@memlab/cli 1.0.7 → 1.0.11

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.
Files changed (156) hide show
  1. package/bin/{memlab → memlab.js} +5 -3
  2. package/dist/BaseCommand.d.ts +1 -1
  3. package/dist/BaseCommand.js +1 -1
  4. package/dist/CommandLoader.d.ts +8 -7
  5. package/dist/CommandLoader.js +8 -1
  6. package/dist/Dispatcher.d.ts +8 -3
  7. package/dist/Dispatcher.js +13 -6
  8. package/dist/TypesThirdParty.d.ts +1 -1
  9. package/dist/TypesThirdParty.js +1 -1
  10. package/dist/commands/CleanLoggerDataCommand.d.ts +1 -1
  11. package/dist/commands/CleanLoggerDataCommand.js +1 -1
  12. package/dist/commands/CleanRunDataCommand.d.ts +1 -1
  13. package/dist/commands/CleanRunDataCommand.js +1 -1
  14. package/dist/commands/GetVersionCommand.d.ts +1 -1
  15. package/dist/commands/GetVersionCommand.js +2 -2
  16. package/dist/commands/InitDirectoryCommand.d.ts +1 -1
  17. package/dist/commands/InitDirectoryCommand.js +1 -1
  18. package/dist/commands/ListScenariosCommand.d.ts +1 -1
  19. package/dist/commands/ListScenariosCommand.js +1 -1
  20. package/dist/commands/MemLabRunCommand.d.ts +1 -1
  21. package/dist/commands/MemLabRunCommand.js +1 -1
  22. package/dist/commands/PrintSummaryCommand.d.ts +1 -1
  23. package/dist/commands/PrintSummaryCommand.js +1 -1
  24. package/dist/commands/ResetDirectoryCommand.d.ts +1 -1
  25. package/dist/commands/ResetDirectoryCommand.js +1 -1
  26. package/dist/commands/RunMeasureCommand.d.ts +1 -1
  27. package/dist/commands/RunMeasureCommand.js +1 -1
  28. package/dist/commands/WarmupAppCommand.d.ts +1 -1
  29. package/dist/commands/WarmupAppCommand.js +1 -1
  30. package/dist/commands/heap/CheckLeakCommand.d.ts +1 -1
  31. package/dist/commands/heap/CheckLeakCommand.js +3 -1
  32. package/dist/commands/heap/GetRetainerTraceCommand.d.ts +1 -1
  33. package/dist/commands/heap/GetRetainerTraceCommand.js +1 -1
  34. package/dist/commands/heap/HeapAnalysisCommand.d.ts +1 -1
  35. package/dist/commands/heap/HeapAnalysisCommand.js +1 -1
  36. package/dist/commands/heap/HeapAnalysisSubCommandWrapper.d.ts +1 -1
  37. package/dist/commands/heap/HeapAnalysisSubCommandWrapper.js +1 -1
  38. package/dist/commands/heap/interactive/InteractiveCommandLoader.d.ts +16 -0
  39. package/dist/commands/heap/interactive/InteractiveCommandLoader.js +33 -0
  40. package/dist/commands/heap/interactive/InteractiveHeapCommand.d.ts +28 -0
  41. package/dist/commands/heap/interactive/InteractiveHeapCommand.js +166 -0
  42. package/dist/commands/heap/interactive/InteractiveHeapExploreCommand.d.ts +25 -0
  43. package/dist/commands/heap/interactive/InteractiveHeapExploreCommand.js +169 -0
  44. package/dist/commands/heap/interactive/ui-components/CliScreen.d.ts +38 -0
  45. package/dist/commands/heap/interactive/ui-components/CliScreen.js +253 -0
  46. package/dist/commands/heap/interactive/ui-components/HeapViewController.d.ts +73 -0
  47. package/dist/commands/heap/interactive/ui-components/HeapViewController.js +358 -0
  48. package/dist/commands/heap/interactive/ui-components/HeapViewUtils.d.ts +32 -0
  49. package/dist/commands/heap/interactive/ui-components/HeapViewUtils.js +205 -0
  50. package/dist/commands/heap/interactive/ui-components/ListComponent.d.ts +65 -0
  51. package/dist/commands/heap/interactive/ui-components/ListComponent.js +237 -0
  52. package/dist/commands/helper/GenerateCLIDocCommand.d.ts +1 -1
  53. package/dist/commands/helper/GenerateCLIDocCommand.js +1 -1
  54. package/dist/commands/helper/HelperCommand.d.ts +1 -1
  55. package/dist/commands/helper/HelperCommand.js +17 -5
  56. package/dist/commands/helper/lib/CommandOrder.d.ts +1 -1
  57. package/dist/commands/helper/lib/CommandOrder.js +1 -1
  58. package/dist/commands/helper/lib/Types.d.ts +1 -1
  59. package/dist/commands/helper/lib/Types.js +1 -1
  60. package/dist/commands/query/QueryDefaultWorkDirCommand.d.ts +1 -1
  61. package/dist/commands/query/QueryDefaultWorkDirCommand.js +1 -1
  62. package/dist/commands/snapshot/CheckXvfbSupportCommand.d.ts +1 -1
  63. package/dist/commands/snapshot/CheckXvfbSupportCommand.js +1 -1
  64. package/dist/commands/snapshot/Snapshot.d.ts +1 -1
  65. package/dist/commands/snapshot/Snapshot.js +1 -1
  66. package/dist/commands/snapshot/TakeSnapshotCommand.d.ts +1 -1
  67. package/dist/commands/snapshot/TakeSnapshotCommand.js +1 -1
  68. package/dist/commands/snapshot/WarmupAndSnapshotCommand.d.ts +1 -1
  69. package/dist/commands/snapshot/WarmupAndSnapshotCommand.js +1 -1
  70. package/dist/index.d.ts +1 -1
  71. package/dist/index.js +1 -1
  72. package/dist/options/AppOption.d.ts +1 -1
  73. package/dist/options/AppOption.js +1 -1
  74. package/dist/options/DebugOption.d.ts +1 -1
  75. package/dist/options/DebugOption.js +1 -1
  76. package/dist/options/DisableXvfbOption.d.ts +1 -1
  77. package/dist/options/DisableXvfbOption.js +1 -1
  78. package/dist/options/FullExecutionOption.d.ts +1 -1
  79. package/dist/options/FullExecutionOption.js +1 -1
  80. package/dist/options/HeadfulBrowserOption.d.ts +1 -1
  81. package/dist/options/HeadfulBrowserOption.js +1 -1
  82. package/dist/options/HeapNodeIdOption.d.ts +1 -1
  83. package/dist/options/HeapNodeIdOption.js +1 -1
  84. package/dist/options/HelperOption.d.ts +1 -1
  85. package/dist/options/HelperOption.js +1 -1
  86. package/dist/options/InteractionOption.d.ts +1 -1
  87. package/dist/options/InteractionOption.js +1 -1
  88. package/dist/options/MLClusteringLinkageMaxDistanceOption.d.ts +1 -1
  89. package/dist/options/MLClusteringLinkageMaxDistanceOption.js +1 -1
  90. package/dist/options/MLClusteringMaxDFOption.d.ts +18 -0
  91. package/dist/options/MLClusteringMaxDFOption.js +47 -0
  92. package/dist/options/MLClusteringOption.d.ts +1 -1
  93. package/dist/options/MLClusteringOption.js +1 -1
  94. package/dist/options/NumberOfRunsOption.d.ts +1 -1
  95. package/dist/options/NumberOfRunsOption.js +1 -1
  96. package/dist/options/RemoteBrowserDebugOption.d.ts +1 -1
  97. package/dist/options/RemoteBrowserDebugOption.js +1 -1
  98. package/dist/options/RunningModeOption.d.ts +1 -1
  99. package/dist/options/RunningModeOption.js +1 -1
  100. package/dist/options/ScenarioFileOption.d.ts +1 -1
  101. package/dist/options/ScenarioFileOption.js +1 -1
  102. package/dist/options/SetContinuousTestOption.d.ts +1 -1
  103. package/dist/options/SetContinuousTestOption.js +1 -1
  104. package/dist/options/SetDeviceOption.d.ts +1 -1
  105. package/dist/options/SetDeviceOption.js +1 -1
  106. package/dist/options/SetWorkingDirectoryOption.d.ts +1 -1
  107. package/dist/options/SetWorkingDirectoryOption.js +1 -1
  108. package/dist/options/SilentOption.d.ts +1 -1
  109. package/dist/options/SilentOption.js +1 -1
  110. package/dist/options/SkipExtraOperationOption.d.ts +1 -1
  111. package/dist/options/SkipExtraOperationOption.js +1 -1
  112. package/dist/options/SkipGCOption.d.ts +1 -1
  113. package/dist/options/SkipGCOption.js +1 -1
  114. package/dist/options/SkipScreenshotOption.d.ts +1 -1
  115. package/dist/options/SkipScreenshotOption.js +1 -1
  116. package/dist/options/SkipScrollOption.d.ts +1 -1
  117. package/dist/options/SkipScrollOption.js +1 -1
  118. package/dist/options/SkipSnapshotOption.d.ts +1 -1
  119. package/dist/options/SkipSnapshotOption.js +1 -1
  120. package/dist/options/SkipWarmupOption.d.ts +1 -1
  121. package/dist/options/SkipWarmupOption.js +1 -1
  122. package/dist/options/VerboseOption.d.ts +1 -1
  123. package/dist/options/VerboseOption.js +1 -1
  124. package/dist/options/heap/BaselineFileOption.d.ts +1 -1
  125. package/dist/options/heap/BaselineFileOption.js +1 -1
  126. package/dist/options/heap/FinalFileOption.d.ts +1 -1
  127. package/dist/options/heap/FinalFileOption.js +1 -1
  128. package/dist/options/heap/JSEngineOption.d.ts +1 -1
  129. package/dist/options/heap/JSEngineOption.js +1 -1
  130. package/dist/options/heap/LeakClusterSizeThresholdOption.d.ts +1 -1
  131. package/dist/options/heap/LeakClusterSizeThresholdOption.js +1 -1
  132. package/dist/options/heap/LogTraceAsClusterOption.d.ts +1 -1
  133. package/dist/options/heap/LogTraceAsClusterOption.js +1 -1
  134. package/dist/options/heap/OversizeThresholdOption.d.ts +1 -1
  135. package/dist/options/heap/OversizeThresholdOption.js +1 -1
  136. package/dist/options/heap/SnapshotDirectoryOption.d.ts +1 -1
  137. package/dist/options/heap/SnapshotDirectoryOption.js +1 -1
  138. package/dist/options/heap/SnapshotFileOption.d.ts +1 -1
  139. package/dist/options/heap/SnapshotFileOption.js +1 -1
  140. package/dist/options/heap/TargetFileOption.d.ts +1 -1
  141. package/dist/options/heap/TargetFileOption.js +1 -1
  142. package/dist/options/heap/TraceAllObjectsOption.d.ts +1 -1
  143. package/dist/options/heap/TraceAllObjectsOption.js +1 -1
  144. package/dist/options/heap/leak-filter/LeakFilterFileOption.d.ts +1 -1
  145. package/dist/options/heap/leak-filter/LeakFilterFileOption.js +1 -1
  146. package/dist/options/heap/leak-filter/examples/FilterLib.d.ts +1 -1
  147. package/dist/options/heap/leak-filter/examples/FilterLib.js +1 -1
  148. package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.d.ts +1 -1
  149. package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.js +1 -1
  150. package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.d.ts +1 -1
  151. package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.js +1 -1
  152. package/dist/options/lib/UniversalOptions.d.ts +1 -1
  153. package/dist/options/lib/UniversalOptions.js +1 -1
  154. package/dist/runner.d.ts +1 -1
  155. package/dist/runner.js +1 -1
  156. package/package.json +8 -6
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ * @oncall ws_labs
9
+ */
10
+ import type { Widgets } from 'blessed';
11
+ export declare type ListComponentOption = {
12
+ width: number;
13
+ height: number;
14
+ left: number;
15
+ top: number;
16
+ label?: string;
17
+ };
18
+ export declare type ListItemSelectInfo = {
19
+ keyName: string;
20
+ };
21
+ export declare type ListCallbacks = {
22
+ selectCallback?: (componentId: number, index: number, content: string[], selectInfo: ListItemSelectInfo) => void;
23
+ updateContent?: (oldContent: string[], newContent: string[]) => void;
24
+ getFocus?: () => void;
25
+ render?: () => void;
26
+ };
27
+ /**
28
+ * A ListComponent is an UI list component in CLI.
29
+ * It managers all the UI events related to the
30
+ * list component (e.g., scroll up, down, left, right, and other key strokes)
31
+ */
32
+ export default class ListComponent {
33
+ element: Widgets.ListElement;
34
+ id: number;
35
+ private listIndex;
36
+ private content;
37
+ private callbacks;
38
+ private horizonScrollPositionMap;
39
+ private displayedItems;
40
+ private moreEntryIndex;
41
+ private focusKey;
42
+ private static readonly ListContentLimit;
43
+ private static readonly loadMore;
44
+ private static nextComponentId;
45
+ private static nextId;
46
+ constructor(content: string[], callbacks: ListCallbacks, options: ListComponentOption);
47
+ private render;
48
+ private static createEntryForMore;
49
+ protected registerKeys(): void;
50
+ private scrollLeft;
51
+ private scrollRight;
52
+ focus(): void;
53
+ loseFocus(): void;
54
+ selectIndex(index: number): void;
55
+ setFocusKey(key: string): void;
56
+ setLabel(label: string): void;
57
+ setContent(content: string[]): void;
58
+ loadMoreContent(): void;
59
+ private removeDisplayMoreEntry;
60
+ private insertDisplayMoreEntry;
61
+ updateContent(oldContent: string[], newContent: string[]): void;
62
+ getFocus(): void;
63
+ selectUpdate(index: number, content: string[], selectInfo: ListItemSelectInfo): void;
64
+ }
65
+ //# sourceMappingURL=ListComponent.d.ts.map
@@ -0,0 +1,237 @@
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
+ const HeapViewUtils_1 = require("./HeapViewUtils");
10
+ /**
11
+ * A ListComponent is an UI list component in CLI.
12
+ * It managers all the UI events related to the
13
+ * list component (e.g., scroll up, down, left, right, and other key strokes)
14
+ */
15
+ class ListComponent {
16
+ constructor(content, callbacks, options) {
17
+ this.listIndex = 0;
18
+ this.content = [];
19
+ this.moreEntryIndex = -1;
20
+ this.focusKey = '';
21
+ this.id = ListComponent.nextId();
22
+ this.horizonScrollPositionMap = new Map();
23
+ this.callbacks = callbacks;
24
+ // init list element
25
+ this.element = blessed_1.default.list(Object.assign(Object.assign({}, options), { tags: false, scrollable: true, keys: true, border: {
26
+ fg: 'grey',
27
+ type: 'line',
28
+ }, style: {
29
+ item: {
30
+ fg: 'white',
31
+ bg: 'default',
32
+ },
33
+ selected: {
34
+ bg: 'grey',
35
+ bold: true,
36
+ },
37
+ } }));
38
+ this.setContent(content);
39
+ this.registerKeys();
40
+ }
41
+ static nextId() {
42
+ return ListComponent.nextComponentId++;
43
+ }
44
+ // render the whole screen
45
+ render() {
46
+ if (this.callbacks.render) {
47
+ this.callbacks.render();
48
+ }
49
+ }
50
+ static createEntryForMore(more) {
51
+ const key = chalk_1.default.inverse('enter');
52
+ return chalk_1.default.grey(` ${more} more ... (select and ${key} to load)`);
53
+ }
54
+ registerKeys() {
55
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
56
+ const self = this;
57
+ this.element.on('keypress', (char, key) => {
58
+ const content = self.content;
59
+ // if selecting "More"
60
+ if (key.name === 'enter' &&
61
+ content.length > 0 &&
62
+ self.listIndex >= 0 &&
63
+ self.listIndex === self.moreEntryIndex) {
64
+ self.loadMoreContent();
65
+ return;
66
+ }
67
+ // move selection down
68
+ if (key.name === 'down' && self.listIndex < self.displayedItems - 1) {
69
+ self.element.select(++self.listIndex);
70
+ self.selectUpdate(self.listIndex, content, {
71
+ keyName: key.name,
72
+ });
73
+ // move selection up
74
+ }
75
+ else if (key.name === 'up' && self.listIndex > 0) {
76
+ self.element.select(--self.listIndex);
77
+ self.selectUpdate(self.listIndex, content, {
78
+ keyName: key.name,
79
+ });
80
+ // hit enter to select the current heap object
81
+ }
82
+ else if (key.name === 'enter') {
83
+ self.selectUpdate(self.listIndex, content, {
84
+ keyName: key.name,
85
+ });
86
+ // scroll left
87
+ }
88
+ else if (key.name === 'left') {
89
+ self.scrollLeft();
90
+ // scroll right
91
+ }
92
+ else if (key.name === 'right') {
93
+ self.scrollRight();
94
+ }
95
+ });
96
+ }
97
+ scrollLeft() {
98
+ var _a;
99
+ const selectedContent = this.content[this.listIndex];
100
+ if (!selectedContent) {
101
+ return;
102
+ }
103
+ let offset = 0;
104
+ if (this.horizonScrollPositionMap.has(this.listIndex)) {
105
+ offset = (_a = this.horizonScrollPositionMap.get(this.listIndex)) !== null && _a !== void 0 ? _a : 0;
106
+ }
107
+ if (offset === 0) {
108
+ return;
109
+ }
110
+ this.horizonScrollPositionMap.set(this.listIndex, --offset);
111
+ let newContent = (0, HeapViewUtils_1.substringWithColor)(selectedContent, offset);
112
+ if (offset > 0) {
113
+ newContent = chalk_1.default.grey('...') + newContent;
114
+ }
115
+ this.element.spliceItem(this.listIndex, 1, newContent);
116
+ this.element.select(this.listIndex);
117
+ }
118
+ scrollRight() {
119
+ var _a;
120
+ const selectedContent = this.content[this.listIndex];
121
+ if (!selectedContent || (0, string_width_1.default)(selectedContent) <= 5) {
122
+ return;
123
+ }
124
+ let offset = 0;
125
+ if (this.horizonScrollPositionMap.has(this.listIndex)) {
126
+ offset = (_a = this.horizonScrollPositionMap.get(this.listIndex)) !== null && _a !== void 0 ? _a : 0;
127
+ }
128
+ this.horizonScrollPositionMap.set(this.listIndex, ++offset);
129
+ let newContent = (0, HeapViewUtils_1.substringWithColor)(selectedContent, offset);
130
+ if (offset > 0) {
131
+ newContent = chalk_1.default.grey('...') + newContent;
132
+ }
133
+ this.element.spliceItem(this.listIndex, 1, newContent);
134
+ this.element.select(this.listIndex);
135
+ }
136
+ focus() {
137
+ this.element.focus();
138
+ this.element.style.border.fg = 'white';
139
+ this.element.style.selected = {
140
+ bg: 'grey',
141
+ bold: true,
142
+ };
143
+ this.getFocus();
144
+ }
145
+ loseFocus() {
146
+ this.element.style.border.fg = 'grey';
147
+ this.element.style.selected = {
148
+ bg: 'black',
149
+ bold: false,
150
+ };
151
+ }
152
+ selectIndex(index) {
153
+ while (this.displayedItems <= index &&
154
+ this.displayedItems < this.content.length) {
155
+ this.loadMoreContent();
156
+ }
157
+ this.listIndex = index;
158
+ this.element.select(index);
159
+ }
160
+ setFocusKey(key) {
161
+ this.focusKey = key;
162
+ }
163
+ setLabel(label) {
164
+ const componentLabel = label + chalk_1.default.grey(` (press ${chalk_1.default.inverse(this.focusKey)} to focus)`);
165
+ this.element.setLabel(componentLabel);
166
+ }
167
+ setContent(content) {
168
+ const oldContent = this.content;
169
+ this.element.clearItems();
170
+ this.displayedItems = 0;
171
+ this.moreEntryIndex = -1;
172
+ this.listIndex = 0;
173
+ // push list items into the list
174
+ for (let i = 0; i < content.length; ++i) {
175
+ if (this.displayedItems >= ListComponent.ListContentLimit) {
176
+ break;
177
+ }
178
+ this.element.pushItem(content[i]);
179
+ ++this.displayedItems;
180
+ }
181
+ this.content = content;
182
+ this.horizonScrollPositionMap.clear();
183
+ this.insertDisplayMoreEntry();
184
+ this.updateContent(oldContent, this.content);
185
+ }
186
+ loadMoreContent() {
187
+ if (this.moreEntryIndex < 0) {
188
+ return;
189
+ }
190
+ const curIndex = this.listIndex;
191
+ this.removeDisplayMoreEntry();
192
+ let idx = this.displayedItems;
193
+ const limit = Math.min(this.displayedItems + ListComponent.loadMore, this.content.length);
194
+ while (idx < limit) {
195
+ this.element.pushItem(this.content[idx++]);
196
+ }
197
+ this.displayedItems = limit;
198
+ this.insertDisplayMoreEntry();
199
+ this.selectIndex(curIndex);
200
+ this.render();
201
+ }
202
+ removeDisplayMoreEntry() {
203
+ this.element.spliceItem(this.displayedItems - 1, 1);
204
+ this.moreEntryIndex = -1;
205
+ --this.displayedItems;
206
+ --this.listIndex;
207
+ }
208
+ // insert the display more entry
209
+ insertDisplayMoreEntry() {
210
+ if (this.displayedItems < this.content.length) {
211
+ this.element.pushItem(ListComponent.createEntryForMore(this.content.length - this.displayedItems));
212
+ ++this.displayedItems;
213
+ this.moreEntryIndex = this.displayedItems - 1;
214
+ }
215
+ }
216
+ // function to be overridden
217
+ updateContent(oldContent, newContent) {
218
+ if (this.callbacks.updateContent) {
219
+ this.callbacks.updateContent(oldContent, newContent);
220
+ }
221
+ }
222
+ // function to be overridden
223
+ getFocus() {
224
+ if (this.callbacks.getFocus) {
225
+ this.callbacks.getFocus();
226
+ }
227
+ }
228
+ selectUpdate(index, content, selectInfo) {
229
+ if (this.callbacks.selectCallback) {
230
+ this.callbacks.selectCallback(this.id, index, content, selectInfo);
231
+ }
232
+ }
233
+ }
234
+ exports.default = ListComponent;
235
+ ListComponent.ListContentLimit = 100;
236
+ ListComponent.loadMore = 100;
237
+ 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 = item ? item.commands : [];
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
- this.printCategoryHeader(category, options);
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
- this.printCommand(command, options.indent);
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
- this.printCommand(command, options.indent);
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 = {
@@ -5,7 +5,7 @@
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
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -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); }); }