@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.
Files changed (157) hide show
  1. package/bin/{memlab → memlab.js} +9 -2
  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 +2 -1
  15. package/dist/commands/GetVersionCommand.js +21 -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 +7 -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 +26 -0
  43. package/dist/commands/heap/interactive/InteractiveHeapExploreCommand.js +145 -0
  44. package/dist/commands/heap/interactive/ui-components/CliScreen.d.ts +38 -0
  45. package/dist/commands/heap/interactive/ui-components/CliScreen.js +234 -0
  46. package/dist/commands/heap/interactive/ui-components/HeapViewController.d.ts +58 -0
  47. package/dist/commands/heap/interactive/ui-components/HeapViewController.js +251 -0
  48. package/dist/commands/heap/interactive/ui-components/HeapViewUtils.d.ts +29 -0
  49. package/dist/commands/heap/interactive/ui-components/HeapViewUtils.js +84 -0
  50. package/dist/commands/heap/interactive/ui-components/ListComponent.d.ts +62 -0
  51. package/dist/commands/heap/interactive/ui-components/ListComponent.js +220 -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 +18 -0
  89. package/dist/options/MLClusteringLinkageMaxDistanceOption.js +47 -0
  90. package/dist/options/MLClusteringMaxDFOption.d.ts +18 -0
  91. package/dist/options/MLClusteringMaxDFOption.js +47 -0
  92. package/dist/options/MLClusteringOption.d.ts +18 -0
  93. package/dist/options/MLClusteringOption.js +37 -0
  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/heap/leak-filter/examples/large-object-as-leak.example.js +0 -1
  153. package/dist/options/lib/UniversalOptions.d.ts +1 -1
  154. package/dist/options/lib/UniversalOptions.js +1 -1
  155. package/dist/runner.d.ts +1 -1
  156. package/dist/runner.js +1 -1
  157. package/package.json +8 -6
@@ -10,5 +10,12 @@
10
10
  * @format
11
11
  */
12
12
 
13
- var cli = require("@memlab/cli");
14
- cli.run();
13
+ // eslint-disable-next-line no-var
14
+ var cli = require('../dist/index');
15
+
16
+ // register the `@memlab/cli` package info
17
+ // so that `memlab version` get use the info
18
+ // eslint-disable-next-line fb-www/promise-termination
19
+ cli.registerPackage().then(() => {
20
+ cli.run();
21
+ });
@@ -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, Nullable } from '@memlab/core';
11
11
  import { BaseOption } 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,19 +4,20 @@
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 from './BaseCommand';
11
11
  export default class CommandLoader {
12
- private isLoaded;
13
- private OSSModules;
14
- private modules;
15
- private modulePaths;
12
+ protected isLoaded: boolean;
13
+ protected OSSModules: Map<string, BaseCommand>;
14
+ protected modules: Map<string, BaseCommand>;
15
+ protected modulePaths: Map<string, string>;
16
16
  getModules(): Map<string, BaseCommand>;
17
17
  getModulePaths(): Map<string, string>;
18
18
  registerCommands(): void;
19
- private registerCommandsFromDir;
20
- private postRegistration;
19
+ protected shouldRegisterCommand(command: BaseCommand): boolean;
20
+ protected registerCommandsFromDir(modulesDir: string): void;
21
+ protected postRegistration(): void;
21
22
  }
22
23
  //# sourceMappingURL=CommandLoader.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 __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -41,6 +41,10 @@ class CommandLoader {
41
41
  this.registerCommandsFromDir(modulesDir);
42
42
  this.postRegistration();
43
43
  }
44
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
45
+ shouldRegisterCommand(command) {
46
+ return true;
47
+ }
44
48
  registerCommandsFromDir(modulesDir) {
45
49
  const moduleFiles = fs_1.default.readdirSync(modulesDir);
46
50
  for (const moduleFile of moduleFiles) {
@@ -61,6 +65,9 @@ class CommandLoader {
61
65
  if (!(moduleInstance instanceof BaseCommand_1.default)) {
62
66
  core_1.utils.haltOrThrow('loading a command that does not extend BaseCommand');
63
67
  }
68
+ if (!this.shouldRegisterCommand(moduleInstance)) {
69
+ continue;
70
+ }
64
71
  const commandName = moduleInstance.getCommandName();
65
72
  const loadingOssCommand = !core_1.fileManager.isWithinInternalDirectory(modulePath);
66
73
  // reigster OSS commands
@@ -4,22 +4,27 @@
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 { AnyRecord, MemLabConfig } from '@memlab/core';
12
12
  import BaseCommand from './BaseCommand';
13
+ import CommandLoader from './CommandLoader';
13
14
  declare type RunCommandOptions = {
14
15
  isPrerequisite?: boolean;
15
16
  commandIndex?: number;
16
17
  configFromOptions: AnyRecord;
17
18
  };
18
- declare class CommandDispatcher {
19
+ declare type CommandDispatcherOptions = {
20
+ commandLoader?: CommandLoader;
21
+ };
22
+ export declare class CommandDispatcher {
19
23
  private modules;
20
24
  private executedCommands;
21
25
  private executingCommandStack;
22
- constructor();
26
+ constructor(options?: CommandDispatcherOptions);
27
+ protected resetData(): void;
23
28
  dispatch(args: ParsedArgs): Promise<void>;
24
29
  parseOptions(command: BaseCommand, config: MemLabConfig, args: ParsedArgs): Promise<AnyRecord>;
25
30
  private runCommand;
@@ -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); }); }
@@ -21,21 +21,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
21
21
  return (mod && mod.__esModule) ? mod : { "default": mod };
22
22
  };
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.CommandDispatcher = void 0;
24
25
  const core_1 = require("@memlab/core");
25
26
  const HelperCommand_1 = __importDefault(require("./commands/helper/HelperCommand"));
26
27
  const UniversalOptions_1 = __importDefault(require("./options/lib/UniversalOptions"));
27
28
  const CommandLoader_1 = __importDefault(require("./CommandLoader"));
28
29
  const helperCommand = new HelperCommand_1.default();
29
30
  class CommandDispatcher {
30
- constructor() {
31
- this.executedCommands = new Set();
32
- this.executingCommandStack = [];
31
+ constructor(options = {}) {
32
+ var _a;
33
+ this.resetData();
33
34
  // auto load all command modules
34
- const commandLoader = new CommandLoader_1.default();
35
+ const commandLoader = (_a = options.commandLoader) !== null && _a !== void 0 ? _a : new CommandLoader_1.default();
35
36
  this.modules = commandLoader.getModules();
36
37
  }
38
+ resetData() {
39
+ this.executedCommands = new Set();
40
+ this.executingCommandStack = [];
41
+ }
37
42
  dispatch(args) {
38
43
  return __awaiter(this, void 0, void 0, function* () {
44
+ this.resetData();
39
45
  // triggered by `memlab` (without specific command)
40
46
  if (!args._ || !(args._.length >= 1)) {
41
47
  core_1.info.error('\n command argument missing');
@@ -121,7 +127,7 @@ class CommandDispatcher {
121
127
  const subCommands = command.getSubCommands();
122
128
  for (const subCommand of subCommands) {
123
129
  if (subCommand.getCommandName() === args._[subCommandIndex]) {
124
- this.runCommand(subCommand, args, runCmdOpt);
130
+ yield this.runCommand(subCommand, args, runCmdOpt);
125
131
  return;
126
132
  }
127
133
  }
@@ -140,4 +146,5 @@ class CommandDispatcher {
140
146
  });
141
147
  }
142
148
  }
149
+ exports.CommandDispatcher = CommandDispatcher;
143
150
  exports.default = new CommandDispatcher();
@@ -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
  /// <reference types="node" />
11
11
  declare module 'html-inline' {
@@ -5,6 +5,6 @@
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
  */
@@ -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); }); }
@@ -4,14 +4,15 @@
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';
12
12
  export default class GetVersionCommand extends BaseCommand {
13
13
  getCommandName(): string;
14
14
  getDescription(): string;
15
+ private loadDepencyPackageInfo;
15
16
  run(options: CLIOptions): Promise<void>;
16
17
  }
17
18
  //# sourceMappingURL=GetVersionCommand.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); }); }
@@ -24,6 +24,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
24
24
  const chalk_1 = __importDefault(require("chalk"));
25
25
  const BaseCommand_1 = __importDefault(require("../BaseCommand"));
26
26
  const core_1 = require("@memlab/core");
27
+ const api_1 = require("@memlab/api");
28
+ const core_2 = require("@memlab/core");
29
+ const heap_analysis_1 = require("@memlab/heap-analysis");
30
+ const e2e_1 = require("@memlab/e2e");
27
31
  class GetVersionCommand extends BaseCommand_1.default {
28
32
  getCommandName() {
29
33
  return 'version';
@@ -31,10 +35,25 @@ class GetVersionCommand extends BaseCommand_1.default {
31
35
  getDescription() {
32
36
  return 'Show the versions of all memlab packages installed';
33
37
  }
38
+ loadDepencyPackageInfo() {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ // require all sub-packages to register package information
41
+ // memlab and cli packages already registered in the bin file
42
+ // the following sub-packages are registered here lazily to
43
+ // avoid too many file operations
44
+ return Promise.all([
45
+ (0, api_1.registerPackage)(),
46
+ (0, core_2.registerPackage)(),
47
+ (0, heap_analysis_1.registerPackage)(),
48
+ (0, e2e_1.registerPackage)(),
49
+ ]);
50
+ });
51
+ }
34
52
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
35
53
  run(options) {
36
54
  return __awaiter(this, void 0, void 0, function* () {
37
- const packages = core_1.config._packageInfo;
55
+ yield this.loadDepencyPackageInfo();
56
+ const packages = [...core_1.config.packageInfo].sort((p1, p2) => p1.name < p2.name ? 1 : -1);
38
57
  core_1.info.topLevel('');
39
58
  for (const pkg of packages) {
40
59
  const version = chalk_1.default.grey(`@${pkg.version}`);
@@ -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); }); }
@@ -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, { 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
  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); }); }
@@ -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 { BaseOption } 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 { 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;
@@ -58,6 +58,9 @@ const LogTraceAsClusterOption_1 = __importDefault(require("../../options/heap/Lo
58
58
  const CleanLoggerDataCommand_1 = __importDefault(require("../CleanLoggerDataCommand"));
59
59
  const LeakFilterFileOption_1 = __importDefault(require("../../options/heap/leak-filter/LeakFilterFileOption"));
60
60
  const LeakClusterSizeThresholdOption_1 = __importDefault(require("../../options/heap/LeakClusterSizeThresholdOption"));
61
+ const MLClusteringOption_1 = __importDefault(require("../../options/MLClusteringOption"));
62
+ const MLClusteringLinkageMaxDistanceOption_1 = __importDefault(require("../../options/MLClusteringLinkageMaxDistanceOption"));
63
+ const MLClusteringMaxDFOption_1 = __importDefault(require("../../options/MLClusteringMaxDFOption"));
61
64
  class CheckLeakCommand extends BaseCommand_1.default {
62
65
  getCommandName() {
63
66
  return 'find-leaks';
@@ -83,6 +86,9 @@ class CheckLeakCommand extends BaseCommand_1.default {
83
86
  new LeakClusterSizeThresholdOption_1.default(),
84
87
  new TraceAllObjectsOption_1.default(),
85
88
  new LogTraceAsClusterOption_1.default(),
89
+ new MLClusteringOption_1.default(),
90
+ new MLClusteringLinkageMaxDistanceOption_1.default(),
91
+ new MLClusteringMaxDFOption_1.default(),
86
92
  ];
87
93
  }
88
94
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -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, { 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, { 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 { BaseOption } 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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
12
  if (k2 === undefined) k2 = k;
@@ -0,0 +1,16 @@
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 BaseCommand from '../../../BaseCommand';
11
+ import CommandLoader from '../../../CommandLoader';
12
+ export default class InteractiveCommandLoader extends CommandLoader {
13
+ protected shouldRegisterCommand(command: BaseCommand): boolean;
14
+ protected postRegistration(): void;
15
+ }
16
+ //# sourceMappingURL=InteractiveCommandLoader.d.ts.map
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @format
9
+ * @oncall ws_labs
10
+ */
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const CommandLoader_1 = __importDefault(require("../../../CommandLoader"));
16
+ const HelperCommand_1 = __importDefault(require("../../helper/HelperCommand"));
17
+ const GetRetainerTraceCommand_1 = __importDefault(require("../GetRetainerTraceCommand"));
18
+ const HeapAnalysisCommand_1 = __importDefault(require("../HeapAnalysisCommand"));
19
+ const commandToInclude = new Set([
20
+ HeapAnalysisCommand_1.default,
21
+ GetRetainerTraceCommand_1.default,
22
+ HelperCommand_1.default,
23
+ ]);
24
+ class InteractiveCommandLoader extends CommandLoader_1.default {
25
+ shouldRegisterCommand(command) {
26
+ const constructor = command.constructor;
27
+ return commandToInclude.has(constructor);
28
+ }
29
+ postRegistration() {
30
+ // do nothing
31
+ }
32
+ }
33
+ exports.default = InteractiveCommandLoader;