@memlab/cli 1.0.45 → 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/BaseCommand.js +1 -1
- package/dist/Dispatcher.js +6 -6
- package/dist/commands/CleanLoggerDataCommand.js +1 -1
- package/dist/commands/CleanRunDataCommand.js +1 -1
- package/dist/commands/InitDirectoryCommand.js +1 -1
- package/dist/commands/MemLabRunCommand.js +20 -10
- package/dist/commands/PrintSummaryCommand.js +2 -2
- package/dist/commands/ResetDirectoryCommand.js +1 -1
- package/dist/commands/heap/CheckLeakCommand.js +18 -8
- package/dist/commands/heap/DiffLeakCommand.js +17 -7
- package/dist/commands/heap/GetRetainerTraceCommand.js +18 -8
- package/dist/commands/heap/HeapAnalysisCommand.js +18 -8
- package/dist/commands/heap/HeapAnalysisSubCommandWrapper.js +17 -7
- package/dist/commands/heap/interactive/InteractiveHeapCommand.js +18 -8
- package/dist/commands/heap/interactive/InteractiveHeapExploreCommand.js +18 -8
- package/dist/commands/heap/interactive/ui-components/CliScreen.js +1 -1
- package/dist/commands/heap/interactive/ui-components/HeapViewUtils.js +5 -5
- package/dist/commands/heap/interactive/ui-components/ListComponent.js +1 -1
- package/dist/commands/heap/interactive/worker/LocateClosureSourceWorker.js +1 -1
- package/dist/commands/helper/GenerateCLIDocCommand.js +20 -10
- package/dist/commands/helper/HelperCommand.js +19 -9
- package/dist/commands/query/QueryDefaultWorkDirCommand.js +17 -7
- package/dist/commands/snapshot/Snapshot.js +1 -2
- package/dist/index.js +1 -2
- package/dist/lib/CLIUtils.js +5 -5
- package/dist/options/e2e/SetDeviceOption.d.ts.map +1 -1
- package/dist/options/e2e/SetDeviceOption.js +2 -1
- package/dist/options/experiment/ExperimentOptionUtils.js +1 -2
- package/dist/options/experiment/utils/ExperimentOptionsUtils.js +2 -3
- package/dist/options/heap/leak-filter/examples/FilterLib.js +1 -2
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.js +2 -3
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.d.ts.map +1 -1
- package/dist/runner.js +1 -2
- package/package.json +9 -9
package/dist/BaseCommand.js
CHANGED
|
@@ -24,7 +24,7 @@ var CommandCategory;
|
|
|
24
24
|
CommandCategory["COMMON"] = "COMMON";
|
|
25
25
|
CommandCategory["DEV"] = "DEV";
|
|
26
26
|
CommandCategory["MISC"] = "MISC";
|
|
27
|
-
})(CommandCategory
|
|
27
|
+
})(CommandCategory || (exports.CommandCategory = CommandCategory = {}));
|
|
28
28
|
class Command {
|
|
29
29
|
constructor() {
|
|
30
30
|
// If you are trying to add a new CLI command in MemLab,
|
package/dist/Dispatcher.js
CHANGED
|
@@ -112,9 +112,9 @@ class CommandDispatcher {
|
|
|
112
112
|
}
|
|
113
113
|
return arr1;
|
|
114
114
|
}
|
|
115
|
-
runCommand(
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
runCommand(command_1, args_1) {
|
|
116
|
+
return __awaiter(this, arguments, void 0, function* (command, args, runCmdOpt = { configFromOptions: {} }) {
|
|
117
|
+
var _a;
|
|
118
118
|
const commandName = command.getCommandName();
|
|
119
119
|
// make sure commands on the prerequisite are only executed once
|
|
120
120
|
if (this.executedCommands.has(commandName)) {
|
|
@@ -149,8 +149,8 @@ class CommandDispatcher {
|
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
runSubCommandIfAny(command, args, runCmdOpt) {
|
|
152
|
-
var _a;
|
|
153
152
|
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
var _a;
|
|
154
154
|
const subCommandIndex = (_a = runCmdOpt.commandIndex) !== null && _a !== void 0 ? _a : 0;
|
|
155
155
|
if (args._.length <= subCommandIndex) {
|
|
156
156
|
return;
|
|
@@ -170,8 +170,8 @@ class CommandDispatcher {
|
|
|
170
170
|
yield this.helper(args, command);
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
helper(
|
|
174
|
-
return __awaiter(this,
|
|
173
|
+
helper(cliArgs_1) {
|
|
174
|
+
return __awaiter(this, arguments, void 0, function* (cliArgs, command = null) {
|
|
175
175
|
yield helperCommand.run({
|
|
176
176
|
modules: this.modules,
|
|
177
177
|
command,
|
|
@@ -39,8 +39,8 @@ class CleanTraceDataCommand extends BaseCommand_1.default {
|
|
|
39
39
|
return [new SetWorkingDirectoryOption_1.default()];
|
|
40
40
|
}
|
|
41
41
|
run(options) {
|
|
42
|
-
var _a;
|
|
43
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
var _a;
|
|
44
44
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
45
45
|
core_1.fileManager.emptyTraceLogDataDir({ workDir });
|
|
46
46
|
yield new InitDirectoryCommand_1.default().run(options);
|
|
@@ -38,8 +38,8 @@ class CleanRunDataCommand extends BaseCommand_1.default {
|
|
|
38
38
|
return [new SetWorkingDirectoryOption_1.default()];
|
|
39
39
|
}
|
|
40
40
|
run(options) {
|
|
41
|
-
var _a;
|
|
42
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
var _a;
|
|
43
43
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
44
44
|
core_1.fileManager.clearDataDirs({ workDir });
|
|
45
45
|
});
|
|
@@ -38,8 +38,8 @@ class InitDirectoryCommand extends BaseCommand_1.default {
|
|
|
38
38
|
return [new SetWorkingDirectoryOption_1.default()];
|
|
39
39
|
}
|
|
40
40
|
run(options) {
|
|
41
|
-
var _a;
|
|
42
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
var _a;
|
|
43
43
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
44
44
|
core_1.fileManager.initDirs(core_1.config, { workDir });
|
|
45
45
|
});
|
|
@@ -24,13 +24,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || function (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
34
44
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
35
45
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
36
46
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -104,16 +114,16 @@ class MemLabRunCommand extends BaseCommand_1.default {
|
|
|
104
114
|
return BaseCommand_1.CommandCategory.COMMON;
|
|
105
115
|
}
|
|
106
116
|
run(options) {
|
|
107
|
-
var _a;
|
|
108
117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
var _a;
|
|
109
119
|
// move leaks.txt file
|
|
110
120
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
111
121
|
const outDir = core_1.fileManager.getDataOutDir({ workDir });
|
|
112
122
|
const leakSrcFile = path_1.default.join(outDir, 'leaks.txt');
|
|
113
|
-
const content = fs_1.default.readFileSync(leakSrcFile, '
|
|
123
|
+
const content = fs_1.default.readFileSync(leakSrcFile, { encoding: 'utf8' });
|
|
114
124
|
const curDataDir = core_1.fileManager.getCurDataDir({ workDir });
|
|
115
125
|
const leakDestFile = path_1.default.join(curDataDir, 'leaks.txt');
|
|
116
|
-
fs_1.default.writeFileSync(leakDestFile, content, '
|
|
126
|
+
fs_1.default.writeFileSync(leakDestFile, content, { encoding: 'utf8' });
|
|
117
127
|
});
|
|
118
128
|
}
|
|
119
129
|
}
|
|
@@ -40,14 +40,14 @@ class PrintSummaryCommand extends BaseCommand_1.default {
|
|
|
40
40
|
return [new SetWorkingDirectoryOption_1.default()];
|
|
41
41
|
}
|
|
42
42
|
run(options) {
|
|
43
|
-
var _a;
|
|
44
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
var _a;
|
|
45
45
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
46
46
|
const summaryFile = core_2.fileManager.getLeakSummaryFile({ workDir });
|
|
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
|
}
|
|
@@ -35,8 +35,8 @@ class ResetDirectoryCommand extends BaseCommand_1.default {
|
|
|
35
35
|
return [new SetWorkingDirectoryOption_1.default()];
|
|
36
36
|
}
|
|
37
37
|
run(options) {
|
|
38
|
-
var _a;
|
|
39
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
var _a;
|
|
40
40
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
41
41
|
core_1.fileManager.rmWorkDir({ workDir });
|
|
42
42
|
core_1.fileManager.initDirs(core_1.config, { workDir });
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -153,8 +163,8 @@ or option 2 mentioned above).
|
|
|
153
163
|
];
|
|
154
164
|
}
|
|
155
165
|
run(options) {
|
|
156
|
-
var _a, _b;
|
|
157
166
|
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
var _a, _b;
|
|
158
168
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
159
169
|
core_1.fileManager.initDirs(core_1.config, { workDir });
|
|
160
170
|
const { runMetaInfoManager } = core_1.runInfoUtils;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -24,13 +24,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || function (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
34
44
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
35
45
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
36
46
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -86,8 +96,8 @@ class GetRetainerTraceCommand extends BaseCommand_1.default {
|
|
|
86
96
|
];
|
|
87
97
|
}
|
|
88
98
|
run(options) {
|
|
89
|
-
var _a;
|
|
90
99
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
var _a;
|
|
91
101
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
92
102
|
const reportOutDir = core_2.fileManager.getReportOutDir({ workDir });
|
|
93
103
|
fs_extra_1.default.emptyDirSync(reportOutDir);
|
|
@@ -24,13 +24,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || function (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
34
44
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
35
45
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
36
46
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -102,8 +112,8 @@ class RunHeapAnalysisCommand extends BaseCommand_1.default {
|
|
|
102
112
|
});
|
|
103
113
|
}
|
|
104
114
|
run(options) {
|
|
105
|
-
var _a;
|
|
106
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
+
var _a;
|
|
107
117
|
// process command line arguments and load analysis modules
|
|
108
118
|
const args = options.cliArgs;
|
|
109
119
|
let plugin = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.heapAnalysisPlugin;
|
|
@@ -24,13 +24,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || function (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
34
44
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
35
45
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
36
46
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -24,13 +24,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || function (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
34
44
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
35
45
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
36
46
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -156,8 +166,8 @@ class InteractiveHeapCommand extends BaseCommand_1.default {
|
|
|
156
166
|
rl.prompt();
|
|
157
167
|
}
|
|
158
168
|
run(options) {
|
|
159
|
-
var _a;
|
|
160
169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
var _a;
|
|
161
171
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
162
172
|
const reportOutDir = core_3.fileManager.getReportOutDir({ workDir });
|
|
163
173
|
fs_extra_1.default.emptyDirSync(reportOutDir);
|
|
@@ -24,13 +24,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || function (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
34
44
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
35
45
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
36
46
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -161,8 +171,8 @@ class InteractiveHeapViewCommand extends BaseCommand_1.default {
|
|
|
161
171
|
});
|
|
162
172
|
}
|
|
163
173
|
run(options) {
|
|
164
|
-
var _a;
|
|
165
174
|
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
var _a;
|
|
166
176
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
167
177
|
core_1.fileManager.initDirs(core_1.config, { workDir, errorWhenAbsent: true });
|
|
168
178
|
const reportOutDir = core_1.fileManager.getReportOutDir({ workDir });
|
|
@@ -3,7 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.ComponentData = exports.ComponentDataItem = void 0;
|
|
7
|
+
exports.throwIfNodesEmpty = throwIfNodesEmpty;
|
|
8
|
+
exports.getHeapObjectAt = getHeapObjectAt;
|
|
9
|
+
exports.substringWithColor = substringWithColor;
|
|
10
|
+
exports.debounce = debounce;
|
|
7
11
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
12
|
const core_1 = require("@memlab/core");
|
|
9
13
|
const lessUsefulEdgeTypeForDebugging = new Set([
|
|
@@ -127,7 +131,6 @@ function throwIfNodesEmpty(nodes) {
|
|
|
127
131
|
}
|
|
128
132
|
return true;
|
|
129
133
|
}
|
|
130
|
-
exports.throwIfNodesEmpty = throwIfNodesEmpty;
|
|
131
134
|
function getHeapObjectAt(nodes, index) {
|
|
132
135
|
throwIfNodesEmpty(nodes);
|
|
133
136
|
if (index < 0 || index >= nodes.length) {
|
|
@@ -135,7 +138,6 @@ function getHeapObjectAt(nodes, index) {
|
|
|
135
138
|
}
|
|
136
139
|
return nodes[index].heapObject;
|
|
137
140
|
}
|
|
138
|
-
exports.getHeapObjectAt = getHeapObjectAt;
|
|
139
141
|
// eslint-disable-next-line no-control-regex
|
|
140
142
|
const colorBegin = /^\u001b\[(\d+)m/;
|
|
141
143
|
// eslint-disable-next-line no-control-regex
|
|
@@ -193,7 +195,6 @@ function substringWithColor(input, begin) {
|
|
|
193
195
|
}
|
|
194
196
|
return curStr;
|
|
195
197
|
}
|
|
196
|
-
exports.substringWithColor = substringWithColor;
|
|
197
198
|
function debounce(timeInMs) {
|
|
198
199
|
let id = null;
|
|
199
200
|
return (callback) => {
|
|
@@ -206,4 +207,3 @@ function debounce(timeInMs) {
|
|
|
206
207
|
}, timeInMs);
|
|
207
208
|
};
|
|
208
209
|
}
|
|
209
|
-
exports.debounce = debounce;
|
|
@@ -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);
|
|
@@ -24,13 +24,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || function (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
34
44
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
35
45
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
36
46
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -172,11 +182,11 @@ npm install -g memlab
|
|
|
172
182
|
}
|
|
173
183
|
writeTextWithNewLine(docFile, content) {
|
|
174
184
|
this.touchFile(docFile);
|
|
175
|
-
fs_extra_1.default.appendFileSync(docFile, `${content}\n`, '
|
|
185
|
+
fs_extra_1.default.appendFileSync(docFile, `${content}\n`, { encoding: 'utf8' });
|
|
176
186
|
}
|
|
177
187
|
touchFile(docFile) {
|
|
178
188
|
if (!fs_extra_1.default.existsSync(docFile)) {
|
|
179
|
-
fs_extra_1.default.writeFileSync(docFile, '', '
|
|
189
|
+
fs_extra_1.default.writeFileSync(docFile, '', { encoding: 'utf8' });
|
|
180
190
|
}
|
|
181
191
|
}
|
|
182
192
|
writeCodeBlock(docFile, code, codeType = '') {
|
|
@@ -185,7 +195,7 @@ npm install -g memlab
|
|
|
185
195
|
normalizedCode = normalizedCode.slice(0, normalizedCode.length - 1);
|
|
186
196
|
}
|
|
187
197
|
this.touchFile(docFile);
|
|
188
|
-
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' });
|
|
189
199
|
}
|
|
190
200
|
writeCommandOptions(docFile, command) {
|
|
191
201
|
const options = [
|
|
@@ -24,13 +24,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || function (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
34
44
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
35
45
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
36
46
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -226,8 +236,8 @@ class HelperCommand extends BaseCommand_1.default {
|
|
|
226
236
|
core_1.info.topLevel('');
|
|
227
237
|
}
|
|
228
238
|
printHelperTextForCommand(command, options) {
|
|
229
|
-
var _a;
|
|
230
239
|
return __awaiter(this, void 0, void 0, function* () {
|
|
240
|
+
var _a;
|
|
231
241
|
// print helper text for a specific command
|
|
232
242
|
this.printCommand(command, options.indent, options);
|
|
233
243
|
// print helper text for its subcommands
|
|
@@ -241,8 +251,8 @@ class HelperCommand extends BaseCommand_1.default {
|
|
|
241
251
|
});
|
|
242
252
|
}
|
|
243
253
|
printFullHelperTextForCommand(args, modules) {
|
|
244
|
-
var _a, _b;
|
|
245
254
|
return __awaiter(this, void 0, void 0, function* () {
|
|
255
|
+
var _a, _b;
|
|
246
256
|
// get the command to print
|
|
247
257
|
let map = modules;
|
|
248
258
|
let command;
|
|
@@ -24,13 +24,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || function (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
34
44
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
35
45
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
36
46
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -18,7 +18,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.runPageInteractionFromCLI =
|
|
21
|
+
exports.runPageInteractionFromCLI = runPageInteractionFromCLI;
|
|
22
22
|
const core_1 = require("@memlab/core");
|
|
23
23
|
const api_1 = require("@memlab/api");
|
|
24
24
|
function runPageInteractionFromCLI() {
|
|
@@ -44,4 +44,3 @@ function runPageInteractionFromCLI() {
|
|
|
44
44
|
core_1.info.topLevel(`total time: ${core_1.utils.getReadableTime(end - start)}`);
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
exports.runPageInteractionFromCLI = runPageInteractionFromCLI;
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.registerPackage =
|
|
38
|
+
exports.registerPackage = registerPackage;
|
|
39
39
|
const path_1 = __importDefault(require("path"));
|
|
40
40
|
const core_1 = require("@memlab/core");
|
|
41
41
|
/** @internal */
|
|
@@ -44,5 +44,4 @@ function registerPackage() {
|
|
|
44
44
|
return core_1.PackageInfoLoader.registerPackage(path_1.default.join(__dirname, '..'));
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
exports.registerPackage = registerPackage;
|
|
48
47
|
__exportStar(require("./runner"), exports);
|
package/dist/lib/CLIUtils.js
CHANGED
|
@@ -3,7 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.READABLE_TEXT_WIDTH = exports.READABLE_CMD_FLAG_WIDTH = void 0;
|
|
7
|
+
exports.filterAndGetUndefinedArgs = filterAndGetUndefinedArgs;
|
|
8
|
+
exports.argsToString = argsToString;
|
|
9
|
+
exports.getBlankSpaceString = getBlankSpaceString;
|
|
10
|
+
exports.alignTextInBlock = alignTextInBlock;
|
|
7
11
|
const string_width_1 = __importDefault(require("string-width"));
|
|
8
12
|
const core_1 = require("@memlab/core");
|
|
9
13
|
const OptionConstant_1 = __importDefault(require("../options/lib/OptionConstant"));
|
|
@@ -38,7 +42,6 @@ function filterAndGetUndefinedArgs(cliArgs) {
|
|
|
38
42
|
}
|
|
39
43
|
return ret;
|
|
40
44
|
}
|
|
41
|
-
exports.filterAndGetUndefinedArgs = filterAndGetUndefinedArgs;
|
|
42
45
|
function quoteIfNecessary(v) {
|
|
43
46
|
if (typeof v !== 'string') {
|
|
44
47
|
return v;
|
|
@@ -73,7 +76,6 @@ function argsToString(args) {
|
|
|
73
76
|
}
|
|
74
77
|
return ret.trim();
|
|
75
78
|
}
|
|
76
|
-
exports.argsToString = argsToString;
|
|
77
79
|
function getBlankSpaceString(length) {
|
|
78
80
|
let ret = '';
|
|
79
81
|
for (let i = 0; i < length; ++i) {
|
|
@@ -81,7 +83,6 @@ function getBlankSpaceString(length) {
|
|
|
81
83
|
}
|
|
82
84
|
return ret;
|
|
83
85
|
}
|
|
84
|
-
exports.getBlankSpaceString = getBlankSpaceString;
|
|
85
86
|
function alignTextInBlock(text, options) {
|
|
86
87
|
var _a, _b;
|
|
87
88
|
const indent = (_a = options.leftIndent) !== null && _a !== void 0 ? _a : 0;
|
|
@@ -108,7 +109,6 @@ function alignTextInBlock(text, options) {
|
|
|
108
109
|
}
|
|
109
110
|
return outputLines.join('\n');
|
|
110
111
|
}
|
|
111
|
-
exports.alignTextInBlock = alignTextInBlock;
|
|
112
112
|
function splitIntoReadableSubstrings(text, intendedSplitPoint) {
|
|
113
113
|
if (intendedSplitPoint >= text.length) {
|
|
114
114
|
return [text];
|
|
@@ -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 {
|
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.extractAndCheckWorkDirs =
|
|
15
|
+
exports.extractAndCheckWorkDirs = extractAndCheckWorkDirs;
|
|
16
16
|
const fs_1 = __importDefault(require("fs"));
|
|
17
17
|
const core_1 = require("@memlab/core");
|
|
18
18
|
function extractAndCheckWorkDirs(optionName, args) {
|
|
@@ -36,4 +36,3 @@ function extractAndCheckWorkDirs(optionName, args) {
|
|
|
36
36
|
}
|
|
37
37
|
return dirs;
|
|
38
38
|
}
|
|
39
|
-
exports.extractAndCheckWorkDirs = extractAndCheckWorkDirs;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.validateHeapSnapshotFileOrThrow = validateHeapSnapshotFileOrThrow;
|
|
4
|
+
exports.createTransientWorkDirFromSingleHeapSnapshot = createTransientWorkDirFromSingleHeapSnapshot;
|
|
4
5
|
/**
|
|
5
6
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
7
|
*
|
|
@@ -24,10 +25,8 @@ function validateHeapSnapshotFileOrThrow(file) {
|
|
|
24
25
|
}
|
|
25
26
|
return file;
|
|
26
27
|
}
|
|
27
|
-
exports.validateHeapSnapshotFileOrThrow = validateHeapSnapshotFileOrThrow;
|
|
28
28
|
function createTransientWorkDirFromSingleHeapSnapshot(file) {
|
|
29
29
|
const config = core_1.MemLabConfig.resetConfigWithTransientDir();
|
|
30
30
|
core_1.fileManager.createOrOverrideVisitOrderMetaFileForExternalSnapshot(file);
|
|
31
31
|
return config.workDir;
|
|
32
32
|
}
|
|
33
|
-
exports.createTransientWorkDirFromSingleHeapSnapshot = createTransientWorkDirFromSingleHeapSnapshot;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.initMap =
|
|
12
|
+
exports.initMap = initMap;
|
|
13
13
|
const core_1 = require("@memlab/core");
|
|
14
14
|
function initMap(snapshot) {
|
|
15
15
|
const map = Object.create(null);
|
|
@@ -27,4 +27,3 @@ function initMap(snapshot) {
|
|
|
27
27
|
});
|
|
28
28
|
return map;
|
|
29
29
|
}
|
|
30
|
-
exports.initMap = initMap;
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.beforeLeakFilter = beforeLeakFilter;
|
|
13
|
+
exports.leakFilter = leakFilter;
|
|
13
14
|
const core_1 = require("@memlab/core");
|
|
14
15
|
const FilterLib_1 = require("./FilterLib");
|
|
15
16
|
let map = Object.create(null);
|
|
@@ -18,7 +19,6 @@ function beforeLeakFilter(snapshot,
|
|
|
18
19
|
_leakedNodeIds) {
|
|
19
20
|
map = (0, FilterLib_1.initMap)(snapshot);
|
|
20
21
|
}
|
|
21
|
-
exports.beforeLeakFilter = beforeLeakFilter;
|
|
22
22
|
// duplicated string with size > 1KB as memory leak
|
|
23
23
|
function leakFilter(node) {
|
|
24
24
|
if (node.type !== 'string' || node.retainedSize < 1000) {
|
|
@@ -27,4 +27,3 @@ function leakFilter(node) {
|
|
|
27
27
|
const str = core_1.utils.getStringNodeValue(node);
|
|
28
28
|
return map[str] > 1;
|
|
29
29
|
}
|
|
30
|
-
exports.leakFilter = leakFilter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dup-string-as-leak.example-2.d.ts","sourceRoot":"","sources":["../../../../../src/options/heap/leak-filter/examples/dup-string-as-leak.example-2.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,SAAS,EAAE,aAAa,EAAE,aAAa,EAAQ,MAAM,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"dup-string-as-leak.example-2.d.ts","sourceRoot":"","sources":["../../../../../src/options/heap/leak-filter/examples/dup-string-as-leak.example-2.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,SAAS,EAAE,aAAa,EAAE,aAAa,EAAQ,MAAM,cAAc,CAAC;;iCAMhE,aAAa,kBAEP,aAAa,KAC5B,IAAI;uBAKmB,SAAS,KAAG,OAAO;;AAQ7C,wBAA8C"}
|
package/dist/runner.js
CHANGED
|
@@ -21,7 +21,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
21
21
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.run =
|
|
24
|
+
exports.run = run;
|
|
25
25
|
const minimist_1 = __importDefault(require("minimist"));
|
|
26
26
|
const core_1 = require("@memlab/core");
|
|
27
27
|
const Dispatcher_1 = __importDefault(require("./Dispatcher"));
|
|
@@ -31,7 +31,6 @@ function run() {
|
|
|
31
31
|
Dispatcher_1.default.dispatch(argv);
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
exports.run = run;
|
|
35
34
|
if (require.main === module) {
|
|
36
35
|
// called from command line
|
|
37
36
|
core_1.utils.callAsync(run);
|
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",
|