@memlab/cli 1.0.6 → 1.0.10
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/bin/{memlab → memlab.js} +9 -2
- package/dist/BaseCommand.d.ts +1 -1
- package/dist/BaseCommand.js +1 -1
- package/dist/CommandLoader.d.ts +8 -7
- package/dist/CommandLoader.js +8 -1
- package/dist/Dispatcher.d.ts +8 -3
- package/dist/Dispatcher.js +13 -6
- 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 +2 -1
- package/dist/commands/GetVersionCommand.js +21 -2
- 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 +1 -1
- 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 +1 -1
- package/dist/commands/WarmupAppCommand.d.ts +1 -1
- package/dist/commands/WarmupAppCommand.js +1 -1
- package/dist/commands/heap/CheckLeakCommand.d.ts +1 -1
- package/dist/commands/heap/CheckLeakCommand.js +7 -1
- package/dist/commands/heap/GetRetainerTraceCommand.d.ts +1 -1
- package/dist/commands/heap/GetRetainerTraceCommand.js +1 -1
- 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 +16 -0
- package/dist/commands/heap/interactive/InteractiveCommandLoader.js +33 -0
- package/dist/commands/heap/interactive/InteractiveHeapCommand.d.ts +28 -0
- package/dist/commands/heap/interactive/InteractiveHeapCommand.js +166 -0
- package/dist/commands/heap/interactive/InteractiveHeapExploreCommand.d.ts +26 -0
- package/dist/commands/heap/interactive/InteractiveHeapExploreCommand.js +145 -0
- package/dist/commands/heap/interactive/ui-components/CliScreen.d.ts +38 -0
- package/dist/commands/heap/interactive/ui-components/CliScreen.js +234 -0
- package/dist/commands/heap/interactive/ui-components/HeapViewController.d.ts +58 -0
- package/dist/commands/heap/interactive/ui-components/HeapViewController.js +251 -0
- package/dist/commands/heap/interactive/ui-components/HeapViewUtils.d.ts +29 -0
- package/dist/commands/heap/interactive/ui-components/HeapViewUtils.js +84 -0
- package/dist/commands/heap/interactive/ui-components/ListComponent.d.ts +62 -0
- package/dist/commands/heap/interactive/ui-components/ListComponent.js +220 -0
- package/dist/commands/helper/GenerateCLIDocCommand.d.ts +1 -1
- package/dist/commands/helper/GenerateCLIDocCommand.js +1 -1
- package/dist/commands/helper/HelperCommand.d.ts +1 -1
- package/dist/commands/helper/HelperCommand.js +17 -5
- 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 +1 -1
- 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/AppOption.d.ts +1 -1
- package/dist/options/AppOption.js +1 -1
- package/dist/options/DebugOption.d.ts +1 -1
- package/dist/options/DebugOption.js +1 -1
- package/dist/options/DisableXvfbOption.d.ts +1 -1
- package/dist/options/DisableXvfbOption.js +1 -1
- package/dist/options/FullExecutionOption.d.ts +1 -1
- package/dist/options/FullExecutionOption.js +1 -1
- package/dist/options/HeadfulBrowserOption.d.ts +1 -1
- package/dist/options/HeadfulBrowserOption.js +1 -1
- package/dist/options/HeapNodeIdOption.d.ts +1 -1
- package/dist/options/HeapNodeIdOption.js +1 -1
- package/dist/options/HelperOption.d.ts +1 -1
- package/dist/options/HelperOption.js +1 -1
- package/dist/options/InteractionOption.d.ts +1 -1
- package/dist/options/InteractionOption.js +1 -1
- package/dist/options/MLClusteringLinkageMaxDistanceOption.d.ts +18 -0
- package/dist/options/MLClusteringLinkageMaxDistanceOption.js +47 -0
- package/dist/options/MLClusteringMaxDFOption.d.ts +18 -0
- package/dist/options/MLClusteringMaxDFOption.js +47 -0
- package/dist/options/MLClusteringOption.d.ts +18 -0
- package/dist/options/MLClusteringOption.js +37 -0
- package/dist/options/NumberOfRunsOption.d.ts +1 -1
- package/dist/options/NumberOfRunsOption.js +1 -1
- package/dist/options/RemoteBrowserDebugOption.d.ts +1 -1
- package/dist/options/RemoteBrowserDebugOption.js +1 -1
- package/dist/options/RunningModeOption.d.ts +1 -1
- package/dist/options/RunningModeOption.js +1 -1
- package/dist/options/ScenarioFileOption.d.ts +1 -1
- package/dist/options/ScenarioFileOption.js +1 -1
- package/dist/options/SetContinuousTestOption.d.ts +1 -1
- package/dist/options/SetContinuousTestOption.js +1 -1
- package/dist/options/SetDeviceOption.d.ts +1 -1
- package/dist/options/SetDeviceOption.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/SkipExtraOperationOption.d.ts +1 -1
- package/dist/options/SkipExtraOperationOption.js +1 -1
- package/dist/options/SkipGCOption.d.ts +1 -1
- package/dist/options/SkipGCOption.js +1 -1
- package/dist/options/SkipScreenshotOption.d.ts +1 -1
- package/dist/options/SkipScreenshotOption.js +1 -1
- package/dist/options/SkipScrollOption.d.ts +1 -1
- package/dist/options/SkipScrollOption.js +1 -1
- package/dist/options/SkipSnapshotOption.d.ts +1 -1
- package/dist/options/SkipSnapshotOption.js +1 -1
- package/dist/options/SkipWarmupOption.d.ts +1 -1
- package/dist/options/SkipWarmupOption.js +1 -1
- package/dist/options/VerboseOption.d.ts +1 -1
- package/dist/options/VerboseOption.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/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 +0 -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 +8 -6
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const blessed_1 = __importDefault(require("blessed"));
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const string_width_1 = __importDefault(require("string-width"));
|
|
9
|
+
/**
|
|
10
|
+
* A ListComponent is an UI list component in CLI.
|
|
11
|
+
* It managers all the UI events related to the
|
|
12
|
+
* list component (e.g., scroll up, down, left, right, and other key strokes)
|
|
13
|
+
*/
|
|
14
|
+
class ListComponent {
|
|
15
|
+
constructor(content, callbacks, options) {
|
|
16
|
+
this.listIndex = 0;
|
|
17
|
+
this.content = [];
|
|
18
|
+
this.moreEntryIndex = -1;
|
|
19
|
+
this.id = ListComponent.nextId();
|
|
20
|
+
this.horizonScrollPositionMap = new Map();
|
|
21
|
+
this.callbacks = callbacks;
|
|
22
|
+
// init list element
|
|
23
|
+
this.element = blessed_1.default.list(Object.assign(Object.assign({}, options), { tags: true, scrollable: true, keys: true, border: {
|
|
24
|
+
fg: 'grey',
|
|
25
|
+
type: 'line',
|
|
26
|
+
}, style: {
|
|
27
|
+
item: {
|
|
28
|
+
fg: 'white',
|
|
29
|
+
bg: 'default',
|
|
30
|
+
},
|
|
31
|
+
selected: {
|
|
32
|
+
bg: 'grey',
|
|
33
|
+
bold: true,
|
|
34
|
+
},
|
|
35
|
+
} }));
|
|
36
|
+
this.setContent(content);
|
|
37
|
+
this.registerKeys();
|
|
38
|
+
}
|
|
39
|
+
static nextId() {
|
|
40
|
+
return ListComponent.nextComponentId++;
|
|
41
|
+
}
|
|
42
|
+
// render the whole screen
|
|
43
|
+
render() {
|
|
44
|
+
if (this.callbacks.render) {
|
|
45
|
+
this.callbacks.render();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
static createEntryForMore(more) {
|
|
49
|
+
const key = chalk_1.default.inverse('enter');
|
|
50
|
+
return chalk_1.default.grey(` ${more} more ... (select and ${key} to load)`);
|
|
51
|
+
}
|
|
52
|
+
registerKeys() {
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
54
|
+
const self = this;
|
|
55
|
+
this.element.on('keypress', (char, key) => {
|
|
56
|
+
const content = self.content;
|
|
57
|
+
// if selecting "More"
|
|
58
|
+
if (key.name === 'enter' &&
|
|
59
|
+
content.length > 0 &&
|
|
60
|
+
self.listIndex >= 0 &&
|
|
61
|
+
self.listIndex === self.moreEntryIndex) {
|
|
62
|
+
self.loadMoreContent();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// move selection down
|
|
66
|
+
if (key.name === 'down' && self.listIndex < self.displayedItems - 1) {
|
|
67
|
+
self.element.select(++self.listIndex);
|
|
68
|
+
self.selectUpdate(self.listIndex, content, {
|
|
69
|
+
keyName: key.name,
|
|
70
|
+
});
|
|
71
|
+
// move selection up
|
|
72
|
+
}
|
|
73
|
+
else if (key.name === 'up' && self.listIndex > 0) {
|
|
74
|
+
self.element.select(--self.listIndex);
|
|
75
|
+
self.selectUpdate(self.listIndex, content, {
|
|
76
|
+
keyName: key.name,
|
|
77
|
+
});
|
|
78
|
+
// hit enter to select the current heap object
|
|
79
|
+
}
|
|
80
|
+
else if (key.name === 'enter') {
|
|
81
|
+
self.selectUpdate(self.listIndex, content, {
|
|
82
|
+
keyName: key.name,
|
|
83
|
+
});
|
|
84
|
+
// scroll left
|
|
85
|
+
}
|
|
86
|
+
else if (key.name === 'left') {
|
|
87
|
+
self.scrollLeft();
|
|
88
|
+
// scroll right
|
|
89
|
+
}
|
|
90
|
+
else if (key.name === 'right') {
|
|
91
|
+
self.scrollRight();
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
scrollLeft() {
|
|
96
|
+
var _a;
|
|
97
|
+
const selectedContent = this.content[this.listIndex];
|
|
98
|
+
if (!selectedContent) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
let offset = 0;
|
|
102
|
+
if (this.horizonScrollPositionMap.has(this.listIndex)) {
|
|
103
|
+
offset = (_a = this.horizonScrollPositionMap.get(this.listIndex)) !== null && _a !== void 0 ? _a : 0;
|
|
104
|
+
}
|
|
105
|
+
if (offset === 0) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
this.horizonScrollPositionMap.set(this.listIndex, --offset);
|
|
109
|
+
let newContent = selectedContent.substring(offset);
|
|
110
|
+
if (offset > 0) {
|
|
111
|
+
newContent = chalk_1.default.grey('...') + newContent;
|
|
112
|
+
}
|
|
113
|
+
this.element.spliceItem(this.listIndex, 1, newContent);
|
|
114
|
+
this.element.select(this.listIndex);
|
|
115
|
+
}
|
|
116
|
+
scrollRight() {
|
|
117
|
+
var _a;
|
|
118
|
+
const selectedContent = this.content[this.listIndex];
|
|
119
|
+
if (!selectedContent || (0, string_width_1.default)(selectedContent) <= 5) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
let offset = 0;
|
|
123
|
+
if (this.horizonScrollPositionMap.has(this.listIndex)) {
|
|
124
|
+
offset = (_a = this.horizonScrollPositionMap.get(this.listIndex)) !== null && _a !== void 0 ? _a : 0;
|
|
125
|
+
}
|
|
126
|
+
this.horizonScrollPositionMap.set(this.listIndex, ++offset);
|
|
127
|
+
let newContent = selectedContent.substring(offset);
|
|
128
|
+
if (offset > 0) {
|
|
129
|
+
newContent = chalk_1.default.grey('...') + newContent;
|
|
130
|
+
}
|
|
131
|
+
this.element.spliceItem(this.listIndex, 1, newContent);
|
|
132
|
+
this.element.select(this.listIndex);
|
|
133
|
+
}
|
|
134
|
+
focus() {
|
|
135
|
+
this.element.focus();
|
|
136
|
+
this.element.style.border.fg = 'white';
|
|
137
|
+
this.getFocus();
|
|
138
|
+
}
|
|
139
|
+
loseFocus() {
|
|
140
|
+
this.element.style.border.fg = 'grey';
|
|
141
|
+
}
|
|
142
|
+
selectIndex(index) {
|
|
143
|
+
while (this.displayedItems <= index &&
|
|
144
|
+
this.displayedItems < this.content.length) {
|
|
145
|
+
this.loadMoreContent();
|
|
146
|
+
}
|
|
147
|
+
this.listIndex = index;
|
|
148
|
+
this.element.select(index);
|
|
149
|
+
}
|
|
150
|
+
setContent(content) {
|
|
151
|
+
const oldContent = this.content;
|
|
152
|
+
this.element.clearItems();
|
|
153
|
+
this.displayedItems = 0;
|
|
154
|
+
this.moreEntryIndex = -1;
|
|
155
|
+
this.listIndex = 0;
|
|
156
|
+
// push list items into the list
|
|
157
|
+
for (let i = 0; i < content.length; ++i) {
|
|
158
|
+
if (this.displayedItems >= ListComponent.ListContentLimit) {
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
this.element.pushItem(content[i]);
|
|
162
|
+
++this.displayedItems;
|
|
163
|
+
}
|
|
164
|
+
this.content = content;
|
|
165
|
+
this.horizonScrollPositionMap.clear();
|
|
166
|
+
this.insertDisplayMoreEntry();
|
|
167
|
+
this.updateContent(oldContent, this.content);
|
|
168
|
+
}
|
|
169
|
+
loadMoreContent() {
|
|
170
|
+
if (this.moreEntryIndex < 0) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const curIndex = this.listIndex;
|
|
174
|
+
this.removeDisplayMoreEntry();
|
|
175
|
+
let idx = this.displayedItems;
|
|
176
|
+
const limit = Math.min(this.displayedItems + ListComponent.loadMore, this.content.length);
|
|
177
|
+
while (idx < limit) {
|
|
178
|
+
this.element.pushItem(this.content[idx++]);
|
|
179
|
+
}
|
|
180
|
+
this.displayedItems = limit;
|
|
181
|
+
this.insertDisplayMoreEntry();
|
|
182
|
+
this.selectIndex(curIndex);
|
|
183
|
+
this.render();
|
|
184
|
+
}
|
|
185
|
+
removeDisplayMoreEntry() {
|
|
186
|
+
this.element.spliceItem(this.displayedItems - 1, 1);
|
|
187
|
+
this.moreEntryIndex = -1;
|
|
188
|
+
--this.displayedItems;
|
|
189
|
+
--this.listIndex;
|
|
190
|
+
}
|
|
191
|
+
// insert the display more entry
|
|
192
|
+
insertDisplayMoreEntry() {
|
|
193
|
+
if (this.displayedItems < this.content.length) {
|
|
194
|
+
this.element.pushItem(ListComponent.createEntryForMore(this.content.length - this.displayedItems));
|
|
195
|
+
++this.displayedItems;
|
|
196
|
+
this.moreEntryIndex = this.displayedItems - 1;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
// function to be overridden
|
|
200
|
+
updateContent(oldContent, newContent) {
|
|
201
|
+
if (this.callbacks.updateContent) {
|
|
202
|
+
this.callbacks.updateContent(oldContent, newContent);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// function to be overridden
|
|
206
|
+
getFocus() {
|
|
207
|
+
if (this.callbacks.getFocus) {
|
|
208
|
+
this.callbacks.getFocus();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
selectUpdate(index, content, selectInfo) {
|
|
212
|
+
if (this.callbacks.selectCallback) {
|
|
213
|
+
this.callbacks.selectCallback(this.id, index, content, selectInfo);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
exports.default = ListComponent;
|
|
218
|
+
ListComponent.ListContentLimit = 100;
|
|
219
|
+
ListComponent.loadMore = 20;
|
|
220
|
+
ListComponent.nextComponentId = 0;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
12
|
if (k2 === undefined) k2 = k;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { BaseOption, CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
12
|
if (k2 === undefined) k2 = k;
|
|
@@ -51,6 +51,7 @@ const core_1 = require("@memlab/core");
|
|
|
51
51
|
const CommandOrder_1 = __importDefault(require("./lib/CommandOrder"));
|
|
52
52
|
const BaseCommand_1 = __importStar(require("../../BaseCommand"));
|
|
53
53
|
const UniversalOptions_1 = __importDefault(require("../../options/lib/UniversalOptions"));
|
|
54
|
+
const heap_analysis_1 = require("@memlab/heap-analysis");
|
|
54
55
|
class HelperCommand extends BaseCommand_1.default {
|
|
55
56
|
constructor() {
|
|
56
57
|
super(...arguments);
|
|
@@ -81,7 +82,11 @@ class HelperCommand extends BaseCommand_1.default {
|
|
|
81
82
|
printCommandCategories(options) {
|
|
82
83
|
for (const category in BaseCommand_1.CommandCategory) {
|
|
83
84
|
const item = CommandOrder_1.default.find(item => item.category === category);
|
|
84
|
-
const commandsToPrintFirst =
|
|
85
|
+
const commandsToPrintFirst = heap_analysis_1.heapConfig.isCliInteractiveMode
|
|
86
|
+
? []
|
|
87
|
+
: item
|
|
88
|
+
? item.commands
|
|
89
|
+
: [];
|
|
85
90
|
this.printCategory(category, commandsToPrintFirst, options);
|
|
86
91
|
}
|
|
87
92
|
}
|
|
@@ -93,13 +98,13 @@ class HelperCommand extends BaseCommand_1.default {
|
|
|
93
98
|
core_1.info.topLevel('');
|
|
94
99
|
}
|
|
95
100
|
printCategory(category, commandsToPrintFirst, options) {
|
|
96
|
-
|
|
101
|
+
const commandsToPrint = [];
|
|
97
102
|
for (const command of commandsToPrintFirst) {
|
|
98
103
|
const name = command.getCommandName();
|
|
99
104
|
if (this.printedCommand.has(name)) {
|
|
100
105
|
continue;
|
|
101
106
|
}
|
|
102
|
-
|
|
107
|
+
commandsToPrint.push(command);
|
|
103
108
|
this.printedCommand.add(name);
|
|
104
109
|
}
|
|
105
110
|
// print other commands in this category
|
|
@@ -115,9 +120,16 @@ class HelperCommand extends BaseCommand_1.default {
|
|
|
115
120
|
if (this.printedCommand.has(name)) {
|
|
116
121
|
continue;
|
|
117
122
|
}
|
|
118
|
-
|
|
123
|
+
commandsToPrint.push(command);
|
|
119
124
|
this.printedCommand.add(name);
|
|
120
125
|
}
|
|
126
|
+
if (commandsToPrint.length === 0) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
this.printCategoryHeader(category, options);
|
|
130
|
+
for (const command of commandsToPrint) {
|
|
131
|
+
this.printCommand(command, options.indent);
|
|
132
|
+
}
|
|
121
133
|
core_1.info.topLevel('');
|
|
122
134
|
}
|
|
123
135
|
getCommandOptionsSummary(command, indent = '') {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CommandOrder } from './Types';
|
|
11
11
|
declare const _default: CommandOrder;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import BaseCommand, { CommandCategory } from '../../../BaseCommand';
|
|
11
11
|
export declare type CommandOrderItem = {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand, { CommandCategory } from '../../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
12
|
if (k2 === undefined) k2 = k;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
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); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
export declare function runPageInteractionFromCLI(): Promise<void>;
|
|
11
11
|
//# sourceMappingURL=Snapshot.d.ts.map
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
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); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
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); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
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
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
/** @internal */
|
|
11
11
|
export declare function registerPackage(): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
12
|
if (k2 === undefined) k2 = k;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { ParsedArgs } from 'minimist';
|
|
11
11
|
import type { MemLabConfig } from '@memlab/core';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
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); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { ParsedArgs } from 'minimist';
|
|
11
11
|
import type { MemLabConfig } from '@memlab/core';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
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); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { ParsedArgs } from 'minimist';
|
|
11
11
|
import type { MemLabConfig } from '@memlab/core';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
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); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { ParsedArgs } from 'minimist';
|
|
11
11
|
import type { MemLabConfig } from '@memlab/core';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
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); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { ParsedArgs } from 'minimist';
|
|
11
11
|
import type { MemLabConfig } from '@memlab/core';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
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); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { ParsedArgs } from 'minimist';
|
|
11
11
|
import type { MemLabConfig } from '@memlab/core';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
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); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { ParsedArgs } from 'minimist';
|
|
11
11
|
import type { MemLabConfig } from '@memlab/core';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
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); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { ParsedArgs } from 'minimist';
|
|
11
11
|
import type { MemLabConfig } from '@memlab/core';
|