@memlab/cli 1.0.14 → 1.0.17
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/LICENSE +21 -0
- package/README.md +2 -2
- package/bin/memlab.js +2 -2
- package/bin/preinstall +1 -1
- package/dist/BaseCommand.d.ts +1 -1
- package/dist/BaseCommand.js +1 -1
- package/dist/CommandLoader.d.ts +1 -1
- package/dist/CommandLoader.js +2 -2
- package/dist/Dispatcher.d.ts +1 -1
- package/dist/Dispatcher.js +1 -1
- package/dist/TypesThirdParty.d.ts +1 -1
- package/dist/TypesThirdParty.js +1 -1
- package/dist/commands/CleanLoggerDataCommand.d.ts +1 -1
- package/dist/commands/CleanLoggerDataCommand.js +1 -1
- package/dist/commands/CleanRunDataCommand.d.ts +1 -1
- package/dist/commands/CleanRunDataCommand.js +1 -1
- package/dist/commands/GetVersionCommand.d.ts +1 -1
- package/dist/commands/GetVersionCommand.js +1 -1
- package/dist/commands/InitDirectoryCommand.d.ts +1 -1
- package/dist/commands/InitDirectoryCommand.js +1 -1
- package/dist/commands/ListScenariosCommand.d.ts +1 -1
- package/dist/commands/ListScenariosCommand.js +1 -1
- package/dist/commands/MemLabRunCommand.d.ts +1 -1
- package/dist/commands/MemLabRunCommand.js +5 -5
- package/dist/commands/PrintSummaryCommand.d.ts +1 -1
- package/dist/commands/PrintSummaryCommand.js +1 -1
- package/dist/commands/ResetDirectoryCommand.d.ts +1 -1
- package/dist/commands/ResetDirectoryCommand.js +1 -1
- package/dist/commands/RunMeasureCommand.d.ts +1 -1
- package/dist/commands/RunMeasureCommand.js +21 -15
- package/dist/commands/WarmupAppCommand.d.ts +1 -1
- package/dist/commands/WarmupAppCommand.js +16 -10
- package/dist/commands/heap/CheckLeakCommand.d.ts +1 -1
- package/dist/commands/heap/CheckLeakCommand.js +1 -1
- package/dist/commands/heap/GetRetainerTraceCommand.d.ts +1 -1
- package/dist/commands/heap/GetRetainerTraceCommand.js +2 -2
- package/dist/commands/heap/HeapAnalysisCommand.d.ts +1 -1
- package/dist/commands/heap/HeapAnalysisCommand.js +1 -1
- package/dist/commands/heap/HeapAnalysisSubCommandWrapper.d.ts +1 -1
- package/dist/commands/heap/HeapAnalysisSubCommandWrapper.js +1 -1
- package/dist/commands/heap/interactive/InteractiveCommandLoader.d.ts +1 -1
- package/dist/commands/heap/interactive/InteractiveCommandLoader.js +1 -1
- package/dist/commands/heap/interactive/InteractiveHeapCommand.d.ts +1 -1
- package/dist/commands/heap/interactive/InteractiveHeapCommand.js +1 -1
- package/dist/commands/heap/interactive/InteractiveHeapExploreCommand.d.ts +1 -1
- package/dist/commands/heap/interactive/InteractiveHeapExploreCommand.js +2 -2
- package/dist/commands/heap/interactive/ui-components/CliScreen.d.ts +5 -0
- package/dist/commands/heap/interactive/ui-components/CliScreen.js +56 -11
- package/dist/commands/heap/interactive/ui-components/HeapViewController.d.ts +1 -1
- package/dist/commands/heap/interactive/ui-components/HeapViewController.js +19 -0
- package/dist/commands/heap/interactive/ui-components/HeapViewUtils.d.ts +1 -1
- package/dist/commands/heap/interactive/ui-components/ListComponent.d.ts +1 -1
- package/dist/commands/helper/GenerateCLIDocCommand.d.ts +1 -1
- package/dist/commands/helper/GenerateCLIDocCommand.js +1 -1
- package/dist/commands/helper/HelperCommand.d.ts +2 -1
- package/dist/commands/helper/HelperCommand.js +19 -4
- package/dist/commands/helper/lib/CommandOrder.d.ts +1 -1
- package/dist/commands/helper/lib/CommandOrder.js +1 -1
- package/dist/commands/helper/lib/Types.d.ts +1 -1
- package/dist/commands/helper/lib/Types.js +1 -1
- package/dist/commands/query/QueryDefaultWorkDirCommand.d.ts +1 -1
- package/dist/commands/query/QueryDefaultWorkDirCommand.js +1 -1
- package/dist/commands/snapshot/CheckXvfbSupportCommand.d.ts +1 -1
- package/dist/commands/snapshot/CheckXvfbSupportCommand.js +1 -1
- package/dist/commands/snapshot/Snapshot.d.ts +1 -1
- package/dist/commands/snapshot/Snapshot.js +1 -1
- package/dist/commands/snapshot/TakeSnapshotCommand.d.ts +1 -1
- package/dist/commands/snapshot/TakeSnapshotCommand.js +21 -15
- package/dist/commands/snapshot/WarmupAndSnapshotCommand.d.ts +1 -1
- package/dist/commands/snapshot/WarmupAndSnapshotCommand.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/options/DebugOption.d.ts +1 -1
- package/dist/options/DebugOption.js +1 -1
- package/dist/options/HelperOption.d.ts +1 -1
- package/dist/options/HelperOption.js +1 -1
- package/dist/options/MLClusteringLinkageMaxDistanceOption.d.ts +1 -1
- package/dist/options/MLClusteringLinkageMaxDistanceOption.js +1 -1
- package/dist/options/MLClusteringMaxDFOption.d.ts +1 -1
- package/dist/options/MLClusteringMaxDFOption.js +1 -1
- package/dist/options/MLClusteringOption.d.ts +1 -1
- package/dist/options/MLClusteringOption.js +1 -1
- package/dist/options/NumberOfRunsOption.d.ts +1 -1
- package/dist/options/NumberOfRunsOption.js +1 -1
- package/dist/options/SetContinuousTestOption.d.ts +1 -1
- package/dist/options/SetContinuousTestOption.js +1 -1
- package/dist/options/SetWorkingDirectoryOption.d.ts +1 -1
- package/dist/options/SetWorkingDirectoryOption.js +1 -1
- package/dist/options/SilentOption.d.ts +1 -1
- package/dist/options/SilentOption.js +1 -1
- package/dist/options/VerboseOption.d.ts +1 -1
- package/dist/options/VerboseOption.js +1 -1
- package/dist/options/{AppOption.d.ts → e2e/AppOption.d.ts} +1 -1
- package/dist/options/{AppOption.js → e2e/AppOption.js} +1 -1
- package/dist/options/e2e/DisableWebSecurityOption.d.ts +18 -0
- package/dist/options/e2e/DisableWebSecurityOption.js +38 -0
- package/dist/options/{DisableXvfbOption.d.ts → e2e/DisableXvfbOption.d.ts} +1 -1
- package/dist/options/{DisableXvfbOption.js → e2e/DisableXvfbOption.js} +1 -1
- package/dist/options/e2e/EnableJSRewriteOption.d.ts +18 -0
- package/dist/options/e2e/EnableJSRewriteOption.js +37 -0
- package/dist/options/{FullExecutionOption.d.ts → e2e/FullExecutionOption.d.ts} +1 -1
- package/dist/options/{FullExecutionOption.js → e2e/FullExecutionOption.js} +1 -1
- package/dist/options/{HeadfulBrowserOption.d.ts → e2e/HeadfulBrowserOption.d.ts} +1 -1
- package/dist/options/{HeadfulBrowserOption.js → e2e/HeadfulBrowserOption.js} +1 -1
- package/dist/options/{InteractionOption.d.ts → e2e/InteractionOption.d.ts} +1 -1
- package/dist/options/{InteractionOption.js → e2e/InteractionOption.js} +1 -1
- package/dist/options/{RemoteBrowserDebugOption.d.ts → e2e/RemoteBrowserDebugOption.d.ts} +1 -1
- package/dist/options/{RemoteBrowserDebugOption.js → e2e/RemoteBrowserDebugOption.js} +1 -1
- package/dist/options/{RunningModeOption.d.ts → e2e/RunningModeOption.d.ts} +1 -1
- package/dist/options/{RunningModeOption.js → e2e/RunningModeOption.js} +1 -1
- package/dist/options/{ScenarioFileOption.d.ts → e2e/ScenarioFileOption.d.ts} +1 -1
- package/dist/options/{ScenarioFileOption.js → e2e/ScenarioFileOption.js} +1 -1
- package/dist/options/{SetDeviceOption.d.ts → e2e/SetDeviceOption.d.ts} +1 -1
- package/dist/options/{SetDeviceOption.js → e2e/SetDeviceOption.js} +1 -1
- package/dist/options/e2e/SetUserAgentOption.d.ts +19 -0
- package/dist/options/e2e/SetUserAgentOption.js +42 -0
- package/dist/options/{SkipExtraOperationOption.d.ts → e2e/SkipExtraOperationOption.d.ts} +1 -1
- package/dist/options/{SkipExtraOperationOption.js → e2e/SkipExtraOperationOption.js} +1 -1
- package/dist/options/{SkipGCOption.d.ts → e2e/SkipGCOption.d.ts} +1 -1
- package/dist/options/{SkipGCOption.js → e2e/SkipGCOption.js} +1 -1
- package/dist/options/{SkipScreenshotOption.d.ts → e2e/SkipScreenshotOption.d.ts} +1 -1
- package/dist/options/{SkipScreenshotOption.js → e2e/SkipScreenshotOption.js} +1 -1
- package/dist/options/{SkipScrollOption.d.ts → e2e/SkipScrollOption.d.ts} +1 -1
- package/dist/options/{SkipScrollOption.js → e2e/SkipScrollOption.js} +1 -1
- package/dist/options/{SkipSnapshotOption.d.ts → e2e/SkipSnapshotOption.d.ts} +1 -1
- package/dist/options/{SkipSnapshotOption.js → e2e/SkipSnapshotOption.js} +1 -1
- package/dist/options/{SkipWarmupOption.d.ts → e2e/SkipWarmupOption.d.ts} +1 -1
- package/dist/options/{SkipWarmupOption.js → e2e/SkipWarmupOption.js} +1 -1
- package/dist/options/heap/BaselineFileOption.d.ts +1 -1
- package/dist/options/heap/BaselineFileOption.js +1 -1
- package/dist/options/heap/FinalFileOption.d.ts +1 -1
- package/dist/options/heap/FinalFileOption.js +1 -1
- package/dist/options/{HeapNodeIdOption.d.ts → heap/HeapNodeIdOption.d.ts} +1 -1
- package/dist/options/{HeapNodeIdOption.js → heap/HeapNodeIdOption.js} +1 -1
- package/dist/options/heap/JSEngineOption.d.ts +1 -1
- package/dist/options/heap/JSEngineOption.js +1 -1
- package/dist/options/heap/LeakClusterSizeThresholdOption.d.ts +1 -1
- package/dist/options/heap/LeakClusterSizeThresholdOption.js +1 -1
- package/dist/options/heap/LogTraceAsClusterOption.d.ts +1 -1
- package/dist/options/heap/LogTraceAsClusterOption.js +1 -1
- package/dist/options/heap/OversizeThresholdOption.d.ts +1 -1
- package/dist/options/heap/OversizeThresholdOption.js +1 -1
- package/dist/options/heap/SnapshotDirectoryOption.d.ts +1 -1
- package/dist/options/heap/SnapshotDirectoryOption.js +1 -1
- package/dist/options/heap/SnapshotFileOption.d.ts +1 -1
- package/dist/options/heap/SnapshotFileOption.js +1 -1
- package/dist/options/heap/TargetFileOption.d.ts +1 -1
- package/dist/options/heap/TargetFileOption.js +1 -1
- package/dist/options/heap/TraceAllObjectsOption.d.ts +1 -1
- package/dist/options/heap/TraceAllObjectsOption.js +1 -1
- package/dist/options/heap/leak-filter/LeakFilterFileOption.d.ts +1 -1
- package/dist/options/heap/leak-filter/LeakFilterFileOption.js +1 -1
- package/dist/options/heap/leak-filter/examples/FilterLib.d.ts +1 -1
- package/dist/options/heap/leak-filter/examples/FilterLib.js +1 -1
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.d.ts +1 -1
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.js +1 -1
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.d.ts +1 -1
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.js +1 -1
- package/dist/options/heap/leak-filter/examples/large-object-as-leak.example.js +1 -1
- package/dist/options/lib/UniversalOptions.d.ts +1 -1
- package/dist/options/lib/UniversalOptions.js +1 -1
- package/dist/runner.d.ts +1 -1
- package/dist/runner.js +1 -1
- package/package.json +5 -5
|
@@ -8,6 +8,7 @@ export default class CliScreen {
|
|
|
8
8
|
private referenceBox;
|
|
9
9
|
private objectPropertyBox;
|
|
10
10
|
private retainerTraceBox;
|
|
11
|
+
private helperTextElement;
|
|
11
12
|
private currentFocuseKey;
|
|
12
13
|
private keyToComponent;
|
|
13
14
|
private heapController;
|
|
@@ -19,6 +20,7 @@ export default class CliScreen {
|
|
|
19
20
|
private registerEvents;
|
|
20
21
|
private registerScreenResize;
|
|
21
22
|
private updateComponentSize;
|
|
23
|
+
private updateElementSize;
|
|
22
24
|
private registerKeys;
|
|
23
25
|
private addComponentToFocusKeyMap;
|
|
24
26
|
private getNextFocusKey;
|
|
@@ -34,5 +36,8 @@ export default class CliScreen {
|
|
|
34
36
|
private getReferenceBoxSize;
|
|
35
37
|
private initRetainerTraceBox;
|
|
36
38
|
private getRetainerTraceBoxSize;
|
|
39
|
+
private getHelperTextContent;
|
|
40
|
+
private initHelperText;
|
|
41
|
+
private getHelperTextSize;
|
|
37
42
|
}
|
|
38
43
|
//# sourceMappingURL=CliScreen.d.ts.map
|
|
@@ -7,6 +7,7 @@ const HeapViewUtils_1 = require("./HeapViewUtils");
|
|
|
7
7
|
const blessed_1 = __importDefault(require("blessed"));
|
|
8
8
|
const ListComponent_1 = __importDefault(require("./ListComponent"));
|
|
9
9
|
const HeapViewController_1 = __importDefault(require("./HeapViewController"));
|
|
10
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
10
11
|
function positionToNumber(info) {
|
|
11
12
|
return parseInt(`${info}`);
|
|
12
13
|
}
|
|
@@ -54,6 +55,7 @@ class CliScreen {
|
|
|
54
55
|
this.objectPropertyBox = this.initObjectPropertyBox(callbacks);
|
|
55
56
|
this.heapController.setObjectPropertyBox(this.objectPropertyBox);
|
|
56
57
|
this.retainerTraceBox = this.initRetainerTraceBox(callbacks);
|
|
58
|
+
this.helperTextElement = this.initHelperText();
|
|
57
59
|
this.heapController.setRetainerTraceBox(this.retainerTraceBox);
|
|
58
60
|
this.registerEvents();
|
|
59
61
|
this.setFirstObjectAsCurrrent(objectCategory);
|
|
@@ -63,11 +65,16 @@ class CliScreen {
|
|
|
63
65
|
if (keys.length === 0) {
|
|
64
66
|
return;
|
|
65
67
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
let nodes;
|
|
69
|
+
for (const key of keys) {
|
|
70
|
+
nodes = objectCategory.get(key);
|
|
71
|
+
if (nodes && nodes.length > 0) {
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (nodes && nodes.length > 0) {
|
|
76
|
+
this.heapController.setCurrentHeapObject((0, HeapViewUtils_1.getHeapObjectAt)(nodes, 0));
|
|
69
77
|
}
|
|
70
|
-
this.heapController.setCurrentHeapObject((0, HeapViewUtils_1.getHeapObjectAt)(nodes, 0));
|
|
71
78
|
}
|
|
72
79
|
initScreen(title) {
|
|
73
80
|
return blessed_1.default.screen({
|
|
@@ -113,13 +120,17 @@ class CliScreen {
|
|
|
113
120
|
this.updateComponentSize(this.objectPropertyBox, this.getObjectPropertyBoxSize());
|
|
114
121
|
this.updateComponentSize(this.referenceBox, this.getReferenceBoxSize());
|
|
115
122
|
this.updateComponentSize(this.retainerTraceBox, this.getRetainerTraceBoxSize());
|
|
123
|
+
this.updateElementSize(this.helperTextElement, this.getHelperTextSize());
|
|
116
124
|
});
|
|
117
125
|
}
|
|
118
126
|
updateComponentSize(component, size) {
|
|
119
|
-
component.element
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
127
|
+
this.updateElementSize(component.element, size);
|
|
128
|
+
}
|
|
129
|
+
updateElementSize(element, size) {
|
|
130
|
+
element.width = size.width;
|
|
131
|
+
element.height = size.height;
|
|
132
|
+
element.top = size.top;
|
|
133
|
+
element.left = size.left;
|
|
123
134
|
}
|
|
124
135
|
registerKeys() {
|
|
125
136
|
const screen = this.screen;
|
|
@@ -192,7 +203,8 @@ class CliScreen {
|
|
|
192
203
|
return {
|
|
193
204
|
width: Math.floor(positionToNumber(this.screen.width) / 3),
|
|
194
205
|
height: positionToNumber(this.screen.height) -
|
|
195
|
-
Math.floor(positionToNumber(this.screen.height) / 2)
|
|
206
|
+
Math.floor(positionToNumber(this.screen.height) / 2) -
|
|
207
|
+
1,
|
|
196
208
|
top: Math.floor(positionToNumber(this.screen.height) / 2),
|
|
197
209
|
left: 0,
|
|
198
210
|
};
|
|
@@ -209,7 +221,8 @@ class CliScreen {
|
|
|
209
221
|
return {
|
|
210
222
|
width: Math.floor(positionToNumber(this.screen.width) / 3),
|
|
211
223
|
height: positionToNumber(this.screen.height) -
|
|
212
|
-
Math.floor((2 * positionToNumber(this.screen.height)) / 3)
|
|
224
|
+
Math.floor((2 * positionToNumber(this.screen.height)) / 3) -
|
|
225
|
+
1,
|
|
213
226
|
top: Math.floor((2 * positionToNumber(this.screen.height)) / 3),
|
|
214
227
|
left: Math.floor(positionToNumber(this.screen.width) / 3),
|
|
215
228
|
};
|
|
@@ -244,10 +257,42 @@ class CliScreen {
|
|
|
244
257
|
width: positionToNumber(this.screen.width) -
|
|
245
258
|
Math.floor((2 * positionToNumber(this.screen.width)) / 3),
|
|
246
259
|
height: positionToNumber(this.screen.height) -
|
|
247
|
-
Math.floor(positionToNumber(this.screen.height) / 3)
|
|
260
|
+
Math.floor(positionToNumber(this.screen.height) / 3) -
|
|
261
|
+
1,
|
|
248
262
|
top: Math.floor(positionToNumber(this.screen.height) / 3),
|
|
249
263
|
left: Math.floor((2 * positionToNumber(this.screen.width)) / 3),
|
|
250
264
|
};
|
|
251
265
|
}
|
|
266
|
+
getHelperTextContent() {
|
|
267
|
+
const keys = {
|
|
268
|
+
'↑': '',
|
|
269
|
+
'↓': '',
|
|
270
|
+
'←': '',
|
|
271
|
+
'→': '',
|
|
272
|
+
Enter: 'select',
|
|
273
|
+
q: 'quit',
|
|
274
|
+
};
|
|
275
|
+
const keysToFocus = Array.from(this.keyToComponent.keys());
|
|
276
|
+
const descArr = [...Object.keys(keys), ...keysToFocus].map((key) => {
|
|
277
|
+
const description = keys[key];
|
|
278
|
+
return description
|
|
279
|
+
? chalk_1.default.inverse(key) + `(${description})`
|
|
280
|
+
: chalk_1.default.inverse(key);
|
|
281
|
+
});
|
|
282
|
+
return chalk_1.default.grey('Keys: ' + descArr.join(' '));
|
|
283
|
+
}
|
|
284
|
+
initHelperText() {
|
|
285
|
+
const text = blessed_1.default.text(Object.assign(Object.assign({}, this.getHelperTextSize()), { content: this.getHelperTextContent() }));
|
|
286
|
+
this.screen.append(text);
|
|
287
|
+
return text;
|
|
288
|
+
}
|
|
289
|
+
getHelperTextSize() {
|
|
290
|
+
return {
|
|
291
|
+
width: positionToNumber(this.screen.width),
|
|
292
|
+
height: 1,
|
|
293
|
+
top: positionToNumber(this.screen.height) - 1,
|
|
294
|
+
left: 1,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
252
297
|
}
|
|
253
298
|
exports.default = CliScreen;
|
|
@@ -175,6 +175,25 @@ class HeapViewController {
|
|
|
175
175
|
heapObject: node.dominatorNode,
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
+
// if the node has associated location info
|
|
179
|
+
const location = node.location;
|
|
180
|
+
if (location) {
|
|
181
|
+
const url = core_1.utils.getClosureSourceUrl(node);
|
|
182
|
+
if (url) {
|
|
183
|
+
data.items.push({
|
|
184
|
+
stringContent: this.getKeyValuePairString('code link', url),
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
data.items.push({
|
|
188
|
+
stringContent: this.getKeyValuePairString('script id', location.script_id),
|
|
189
|
+
});
|
|
190
|
+
data.items.push({
|
|
191
|
+
stringContent: this.getKeyValuePairString('line', location.line),
|
|
192
|
+
});
|
|
193
|
+
data.items.push({
|
|
194
|
+
stringContent: this.getKeyValuePairString('column', location.column),
|
|
195
|
+
});
|
|
196
|
+
}
|
|
178
197
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
179
198
|
const self = this;
|
|
180
199
|
(_a = options.details) === null || _a === void 0 ? void 0 : _a.forEach((value, key) => data.items.push({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @format
|
|
8
|
-
* @oncall
|
|
8
|
+
* @oncall web_perf_infra
|
|
9
9
|
*/
|
|
10
10
|
import type { BaseOption, CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../../BaseCommand';
|
|
@@ -28,6 +28,7 @@ export default class HelperCommand extends BaseCommand {
|
|
|
28
28
|
private printCategory;
|
|
29
29
|
private getCommandOptionsSummary;
|
|
30
30
|
private printOptions;
|
|
31
|
+
private formatOptionText;
|
|
31
32
|
private printCommand;
|
|
32
33
|
private printHelperTextForCommand;
|
|
33
34
|
private printFullHelperTextForCommand;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
12
|
if (k2 === undefined) k2 = k;
|
|
@@ -171,12 +171,27 @@ class HelperCommand extends BaseCommand_1.default {
|
|
|
171
171
|
}
|
|
172
172
|
const headerLength = optionsText.reduce((acc, cur) => Math.max(acc, cur.header.length), 0);
|
|
173
173
|
for (const optionText of optionsText) {
|
|
174
|
-
const
|
|
175
|
-
const prefix = core_1.utils.repeat(' ', headerLength - optionText.header.length);
|
|
176
|
-
const msg = `${indent}${prefix}${header} ${optionText.desc}`;
|
|
174
|
+
const msg = this.formatOptionText(optionText, indent, headerLength);
|
|
177
175
|
core_1.info.topLevel(`\n${msg}`);
|
|
178
176
|
}
|
|
179
177
|
}
|
|
178
|
+
formatOptionText(optionText, indent, headerLength) {
|
|
179
|
+
const header = chalk_1.default.green(optionText.header);
|
|
180
|
+
const prefix = core_1.utils.repeat(' ', headerLength - optionText.header.length);
|
|
181
|
+
const headerString = `${indent}${prefix}${header} `;
|
|
182
|
+
const headerStringWidth = (0, string_width_1.default)(headerString);
|
|
183
|
+
const maxWidth = Math.min(process.stdout.columns, 150);
|
|
184
|
+
const descMaxWidth = maxWidth - headerStringWidth;
|
|
185
|
+
let descString = optionText.desc.substring(0, descMaxWidth);
|
|
186
|
+
let descStringRemain = optionText.desc.substring(descMaxWidth);
|
|
187
|
+
while (descStringRemain.length > 0) {
|
|
188
|
+
descString += '\n';
|
|
189
|
+
descString += core_1.utils.repeat(' ', headerStringWidth);
|
|
190
|
+
descString += descStringRemain.substring(0, descMaxWidth);
|
|
191
|
+
descStringRemain = descStringRemain.substring(descMaxWidth);
|
|
192
|
+
}
|
|
193
|
+
return `${headerString}${descString}`;
|
|
194
|
+
}
|
|
180
195
|
printCommand(command, extraIndent = '', printOptions = false) {
|
|
181
196
|
const indent = ' ' + extraIndent;
|
|
182
197
|
const name = command.getFullCommand();
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -24,22 +24,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
24
24
|
const BaseCommand_1 = __importDefault(require("../../BaseCommand"));
|
|
25
25
|
const Snapshot_1 = require("./Snapshot");
|
|
26
26
|
const CleanRunDataCommand_1 = __importDefault(require("../CleanRunDataCommand"));
|
|
27
|
-
const FullExecutionOption_1 = __importDefault(require("../../options/FullExecutionOption"));
|
|
28
|
-
const AppOption_1 = __importDefault(require("../../options/AppOption"));
|
|
29
|
-
const InteractionOption_1 = __importDefault(require("../../options/InteractionOption"));
|
|
30
|
-
const SkipSnapshotOption_1 = __importDefault(require("../../options/SkipSnapshotOption"));
|
|
31
|
-
const SkipScreenshotOption_1 = __importDefault(require("../../options/SkipScreenshotOption"));
|
|
32
|
-
const SkipGCOption_1 = __importDefault(require("../../options/SkipGCOption"));
|
|
33
|
-
const SkipScrollOption_1 = __importDefault(require("../../options/SkipScrollOption"));
|
|
34
|
-
const SkipExtraOperationOption_1 = __importDefault(require("../../options/SkipExtraOperationOption"));
|
|
35
|
-
const RunningModeOption_1 = __importDefault(require("../../options/RunningModeOption"));
|
|
36
|
-
const RemoteBrowserDebugOption_1 = __importDefault(require("../../options/RemoteBrowserDebugOption"));
|
|
37
|
-
const ScenarioFileOption_1 = __importDefault(require("../../options/ScenarioFileOption"));
|
|
38
|
-
const SetDeviceOption_1 = __importDefault(require("../../options/SetDeviceOption"));
|
|
39
|
-
const DisableXvfbOption_1 = __importDefault(require("../../options/DisableXvfbOption"));
|
|
27
|
+
const FullExecutionOption_1 = __importDefault(require("../../options/e2e/FullExecutionOption"));
|
|
28
|
+
const AppOption_1 = __importDefault(require("../../options/e2e/AppOption"));
|
|
29
|
+
const InteractionOption_1 = __importDefault(require("../../options/e2e/InteractionOption"));
|
|
30
|
+
const SkipSnapshotOption_1 = __importDefault(require("../../options/e2e/SkipSnapshotOption"));
|
|
31
|
+
const SkipScreenshotOption_1 = __importDefault(require("../../options/e2e/SkipScreenshotOption"));
|
|
32
|
+
const SkipGCOption_1 = __importDefault(require("../../options/e2e/SkipGCOption"));
|
|
33
|
+
const SkipScrollOption_1 = __importDefault(require("../../options/e2e/SkipScrollOption"));
|
|
34
|
+
const SkipExtraOperationOption_1 = __importDefault(require("../../options/e2e/SkipExtraOperationOption"));
|
|
35
|
+
const RunningModeOption_1 = __importDefault(require("../../options/e2e/RunningModeOption"));
|
|
36
|
+
const RemoteBrowserDebugOption_1 = __importDefault(require("../../options/e2e/RemoteBrowserDebugOption"));
|
|
37
|
+
const ScenarioFileOption_1 = __importDefault(require("../../options/e2e/ScenarioFileOption"));
|
|
38
|
+
const SetDeviceOption_1 = __importDefault(require("../../options/e2e/SetDeviceOption"));
|
|
39
|
+
const DisableXvfbOption_1 = __importDefault(require("../../options/e2e/DisableXvfbOption"));
|
|
40
40
|
const InitDirectoryCommand_1 = __importDefault(require("../InitDirectoryCommand"));
|
|
41
41
|
const CheckXvfbSupportCommand_1 = __importDefault(require("./CheckXvfbSupportCommand"));
|
|
42
|
-
const HeadfulBrowserOption_1 = __importDefault(require("../../options/HeadfulBrowserOption"));
|
|
42
|
+
const HeadfulBrowserOption_1 = __importDefault(require("../../options/e2e/HeadfulBrowserOption"));
|
|
43
|
+
const SetUserAgentOption_1 = __importDefault(require("../../options/e2e/SetUserAgentOption"));
|
|
44
|
+
const DisableWebSecurityOption_1 = __importDefault(require("../../options/e2e/DisableWebSecurityOption"));
|
|
45
|
+
const EnableJSRewriteOption_1 = __importDefault(require("../../options/e2e/EnableJSRewriteOption"));
|
|
43
46
|
class TakeSnapshotCommand extends BaseCommand_1.default {
|
|
44
47
|
getCommandName() {
|
|
45
48
|
return 'snapshot';
|
|
@@ -76,7 +79,10 @@ class TakeSnapshotCommand extends BaseCommand_1.default {
|
|
|
76
79
|
new RemoteBrowserDebugOption_1.default(),
|
|
77
80
|
new ScenarioFileOption_1.default(),
|
|
78
81
|
new SetDeviceOption_1.default(),
|
|
82
|
+
new SetUserAgentOption_1.default(),
|
|
79
83
|
new DisableXvfbOption_1.default(),
|
|
84
|
+
new DisableWebSecurityOption_1.default(),
|
|
85
|
+
new EnableJSRewriteOption_1.default(),
|
|
80
86
|
];
|
|
81
87
|
}
|
|
82
88
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall web_perf_infra
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|