@memlab/cli 1.0.44 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/MemLabRunCommand.js +2 -2
- package/dist/commands/PrintSummaryCommand.js +1 -1
- package/dist/commands/heap/interactive/worker/LocateClosureSourceWorker.js +1 -1
- package/dist/commands/helper/GenerateCLIDocCommand.js +3 -3
- package/dist/options/e2e/SetDeviceOption.d.ts.map +1 -1
- package/dist/options/e2e/SetDeviceOption.js +2 -1
- package/package.json +9 -9
|
@@ -120,10 +120,10 @@ class MemLabRunCommand extends BaseCommand_1.default {
|
|
|
120
120
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
121
121
|
const outDir = core_1.fileManager.getDataOutDir({ workDir });
|
|
122
122
|
const leakSrcFile = path_1.default.join(outDir, 'leaks.txt');
|
|
123
|
-
const content = fs_1.default.readFileSync(leakSrcFile, '
|
|
123
|
+
const content = fs_1.default.readFileSync(leakSrcFile, { encoding: 'utf8' });
|
|
124
124
|
const curDataDir = core_1.fileManager.getCurDataDir({ workDir });
|
|
125
125
|
const leakDestFile = path_1.default.join(curDataDir, 'leaks.txt');
|
|
126
|
-
fs_1.default.writeFileSync(leakDestFile, content, '
|
|
126
|
+
fs_1.default.writeFileSync(leakDestFile, content, { encoding: 'utf8' });
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -47,7 +47,7 @@ class PrintSummaryCommand extends BaseCommand_1.default {
|
|
|
47
47
|
if (!fs_extra_1.default.existsSync(summaryFile)) {
|
|
48
48
|
core_1.utils.haltOrThrow('No MemLab leak summary found. Please make sure "memlab find-leaks" runs successfully first.');
|
|
49
49
|
}
|
|
50
|
-
const content = fs_extra_1.default.readFileSync(summaryFile, '
|
|
50
|
+
const content = fs_extra_1.default.readFileSync(summaryFile, { encoding: 'utf8' });
|
|
51
51
|
core_2.info.topLevel(content);
|
|
52
52
|
});
|
|
53
53
|
}
|
|
@@ -44,7 +44,7 @@ function displaySourceCode() {
|
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
const file = core_1.fileManager.getDebugSourceFile();
|
|
47
|
-
fs_1.default.writeFileSync(file, code, '
|
|
47
|
+
fs_1.default.writeFileSync(file, code, { encoding: 'utf8' });
|
|
48
48
|
iterateClosures(scope, closureScope => {
|
|
49
49
|
const varSet = new Set(closureScope.variablesDefined);
|
|
50
50
|
const found = closureVars.reduce((acc, v) => varSet.has(v) && acc, true);
|
|
@@ -182,11 +182,11 @@ npm install -g memlab
|
|
|
182
182
|
}
|
|
183
183
|
writeTextWithNewLine(docFile, content) {
|
|
184
184
|
this.touchFile(docFile);
|
|
185
|
-
fs_extra_1.default.appendFileSync(docFile, `${content}\n`, '
|
|
185
|
+
fs_extra_1.default.appendFileSync(docFile, `${content}\n`, { encoding: 'utf8' });
|
|
186
186
|
}
|
|
187
187
|
touchFile(docFile) {
|
|
188
188
|
if (!fs_extra_1.default.existsSync(docFile)) {
|
|
189
|
-
fs_extra_1.default.writeFileSync(docFile, '', '
|
|
189
|
+
fs_extra_1.default.writeFileSync(docFile, '', { encoding: 'utf8' });
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
writeCodeBlock(docFile, code, codeType = '') {
|
|
@@ -195,7 +195,7 @@ npm install -g memlab
|
|
|
195
195
|
normalizedCode = normalizedCode.slice(0, normalizedCode.length - 1);
|
|
196
196
|
}
|
|
197
197
|
this.touchFile(docFile);
|
|
198
|
-
fs_extra_1.default.appendFileSync(docFile, '```' + codeType + '\n' + normalizedCode + '\n```\n', '
|
|
198
|
+
fs_extra_1.default.appendFileSync(docFile, '```' + codeType + '\n' + normalizedCode + '\n```\n', { encoding: 'utf8' });
|
|
199
199
|
}
|
|
200
200
|
writeCommandOptions(docFile, command) {
|
|
201
201
|
const options = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetDeviceOption.d.ts","sourceRoot":"","sources":["../../../src/options/e2e/SetDeviceOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAW,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"SetDeviceOption.d.ts","sourceRoot":"","sources":["../../../src/options/e2e/SetDeviceOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAW,MAAM,cAAc,CAAC;AAWlD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU;IACrD,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAOnE"}
|
|
@@ -26,7 +26,8 @@ const OptionConstant_1 = __importDefault(require("../lib/OptionConstant"));
|
|
|
26
26
|
const devices = core_1.constant.isFRL
|
|
27
27
|
? {}
|
|
28
28
|
: core_1.constant.isFB
|
|
29
|
-
?
|
|
29
|
+
? // eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
30
|
+
require('puppeteer-core').KnownDevices
|
|
30
31
|
: // eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
31
32
|
require('puppeteer').KnownDevices;
|
|
32
33
|
class SetDeviceOption extends core_1.BaseOption {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memlab/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "command line interface for memlab",
|
|
6
6
|
"author": "Liang Gong <lgong@meta.com>",
|
|
@@ -26,18 +26,18 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@memlab/api": "^
|
|
30
|
-
"@memlab/core": "^
|
|
31
|
-
"@memlab/e2e": "^
|
|
32
|
-
"@memlab/heap-analysis": "^
|
|
29
|
+
"@memlab/api": "^2.0.0",
|
|
30
|
+
"@memlab/core": "^2.0.0",
|
|
31
|
+
"@memlab/e2e": "^2.0.0",
|
|
32
|
+
"@memlab/heap-analysis": "^2.0.0",
|
|
33
33
|
"ansi": "^0.3.1",
|
|
34
34
|
"babar": "^0.2.0",
|
|
35
35
|
"blessed": "^0.1.81",
|
|
36
36
|
"chalk": "^4.0.0",
|
|
37
37
|
"fs-extra": "^4.0.2",
|
|
38
38
|
"minimist": "^1.2.8",
|
|
39
|
-
"puppeteer": "^
|
|
40
|
-
"puppeteer-core": "^
|
|
39
|
+
"puppeteer": "^24.2.0",
|
|
40
|
+
"puppeteer-core": "^24.2.0",
|
|
41
41
|
"string-width": "^4.2.0",
|
|
42
42
|
"util.promisify": "^1.1.1",
|
|
43
43
|
"xvfb": "^0.4.0"
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"@types/fs-extra": "^9.0.3",
|
|
48
48
|
"@types/jest": "^27.4.1",
|
|
49
49
|
"@types/minimist": "^1.2.5",
|
|
50
|
-
"@types/node": "^
|
|
50
|
+
"@types/node": "^25.0.0",
|
|
51
51
|
"jest": "^29.6.2",
|
|
52
52
|
"ts-jest": "^29.1.1",
|
|
53
|
-
"typescript": "^5.
|
|
53
|
+
"typescript": "^5.9.3"
|
|
54
54
|
},
|
|
55
55
|
"repository": {
|
|
56
56
|
"type": "git",
|