Move desktop-related code to "desktop" subfolder (#872)

Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/872
Move all the JS code related to desktop app to "desktop" subfolder.

The structure of "desktop" folder:
- `src` - JS code of Flipper desktop app executing in Electron Renderer (Chrome) process. This folder also contains all the Flipper plugins in subfolder "src/plugins".
- `static` - JS code of Flipper desktop app bootstrapping executing in Electron Main (Node.js) process
- `pkg` - Flipper packaging lib and CLI tool
- `doctor` - Flipper diagnostics lib and CLI tool
- `scripts` - Build scripts for Flipper desktop app
- `headless` - Headless version of Flipper app
- `headless-tests` - Integration tests running agains Flipper headless version

Reviewed By: passy

Differential Revision: D20249304

fbshipit-source-id: 9a51c63b51b92b758a02fc8ebf7d3d116770efe9
This commit is contained in:
Anton Nikolaev
2020-03-14 14:26:07 -07:00
committed by Facebook GitHub Bot
parent a60e6fee87
commit 85c13bb1f3
607 changed files with 103 additions and 142 deletions

View File

@@ -0,0 +1,47 @@
diff --git a/node_modules/adbkit/lib/adb/parser.js b/node_modules/adbkit/lib/adb/parser.js
index 1b66bda..c41037d 100644
--- a/node_modules/adbkit/lib/adb/parser.js
+++ b/node_modules/adbkit/lib/adb/parser.js
@@ -52,7 +52,7 @@ Parser = (function() {
Parser.prototype.readAll = function() {
var all, endListener, errorListener, resolver, tryRead;
- all = new Buffer(0);
+ all = Buffer.alloc(0);
resolver = Promise.defer();
tryRead = (function(_this) {
return function() {
@@ -108,7 +108,7 @@ Parser = (function() {
return resolver.reject(new Parser.PrematureEOFError(howMany));
}
} else {
- return resolver.resolve(new Buffer(0));
+ return resolver.resolve(Buffer.alloc(0));
}
};
})(this);
@@ -196,7 +196,7 @@ Parser = (function() {
Parser.prototype.readUntil = function(code) {
var read, skipped;
- skipped = new Buffer(0);
+ skipped = Buffer.alloc(0);
read = (function(_this) {
return function() {
return _this.readBytes(1).then(function(chunk) {
diff --git a/node_modules/adbkit/lib/adb/protocol.js b/node_modules/adbkit/lib/adb/protocol.js
index d1377d0..2edd7ba 100644
--- a/node_modules/adbkit/lib/adb/protocol.js
+++ b/node_modules/adbkit/lib/adb/protocol.js
@@ -33,9 +33,9 @@ Protocol = (function() {
Protocol.encodeData = function(data) {
if (!Buffer.isBuffer(data)) {
- data = new Buffer(data);
+ data = Buffer.from(data);
}
- return Buffer.concat([new Buffer(Protocol.encodeLength(data.length)), data]);
+ return Buffer.concat([Buffer.from(Protocol.encodeLength(data.length)), data]);
};
return Protocol;

View File

@@ -0,0 +1,13 @@
diff --git a/node_modules/adbkit-logcat/lib/logcat/parser/binary.js b/node_modules/adbkit-logcat/lib/logcat/parser/binary.js
index 12fa8ec..e122933 100644
--- a/node_modules/adbkit-logcat/lib/logcat/parser/binary.js
+++ b/node_modules/adbkit-logcat/lib/logcat/parser/binary.js
@@ -10,7 +10,7 @@ const HEADER_SIZE_MAX = 100
class Binary extends EventEmitter {
constructor(options) {
super(options)
- this.buffer = new Buffer(0)
+ this.buffer = Buffer.alloc(0)
}
parse(chunk) {

View File

@@ -0,0 +1,51 @@
diff --git a/node_modules/jsonparse/jsonparse.js b/node_modules/jsonparse/jsonparse.js
index 3991060..83f1458 100644
--- a/node_modules/jsonparse/jsonparse.js
+++ b/node_modules/jsonparse/jsonparse.js
@@ -56,7 +56,7 @@ function Parser() {
this.value = undefined;
this.string = undefined; // string data
- this.stringBuffer = Buffer.alloc ? Buffer.alloc(STRING_BUFFER_SIZE) : new Buffer(STRING_BUFFER_SIZE);
+ this.stringBuffer = Buffer.alloc(STRING_BUFFER_SIZE);
this.stringBufferOffset = 0;
this.unicode = undefined; // unicode escapes
this.highSurrogate = undefined;
@@ -67,7 +67,7 @@ function Parser() {
this.state = VALUE;
this.bytes_remaining = 0; // number of bytes remaining in multi byte utf8 char to read after split boundary
this.bytes_in_sequence = 0; // bytes in multi byte utf8 char to read
- this.temp_buffs = { "2": new Buffer(2), "3": new Buffer(3), "4": new Buffer(4) }; // for rebuilding chars split before boundary is reached
+ this.temp_buffs = { "2": Buffer.alloc(2), "3": Buffer.alloc(3), "4": Buffer.alloc(4) }; // for rebuilding chars split before boundary is reached
// Stream offset
this.offset = -1;
@@ -125,7 +125,7 @@ proto.appendStringBuf = function (buf, start, end) {
this.stringBufferOffset += size;
};
proto.write = function (buffer) {
- if (typeof buffer === "string") buffer = new Buffer(buffer);
+ if (typeof buffer === "string") buffer = Buffer.from(buffer);
var n;
for (var i = 0, l = buffer.length; i < l; i++) {
if (this.tState === START){
@@ -221,16 +221,16 @@ proto.write = function (buffer) {
var intVal = parseInt(this.unicode, 16);
this.unicode = undefined;
if (this.highSurrogate !== undefined && intVal >= 0xDC00 && intVal < (0xDFFF + 1)) { //<56320,57343> - lowSurrogate
- this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate, intVal)));
+ this.appendStringBuf(Buffer.from(String.fromCharCode(this.highSurrogate, intVal)));
this.highSurrogate = undefined;
} else if (this.highSurrogate === undefined && intVal >= 0xD800 && intVal < (0xDBFF + 1)) { //<55296,56319> - highSurrogate
this.highSurrogate = intVal;
} else {
if (this.highSurrogate !== undefined) {
- this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate)));
+ this.appendStringBuf(Buffer.from(String.fromCharCode(this.highSurrogate)));
this.highSurrogate = undefined;
}
- this.appendStringBuf(new Buffer(String.fromCharCode(intVal)));
+ this.appendStringBuf(Buffer.from(String.fromCharCode(intVal)));
}
this.tState = STRING1;
}