@oclif/core 3.0.8 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,38 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
2
28
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const ansi_styles_1 = tslib_1.__importDefault(require("ansi-styles"));
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const strip_ansi_1 = tslib_1.__importDefault(require("strip-ansi"));
7
- const supportsColor = tslib_1.__importStar(require("supports-color"));
29
+ const ansi_styles_1 = __importDefault(require("ansi-styles"));
30
+ const chalk_1 = __importDefault(require("chalk"));
31
+ const strip_ansi_1 = __importDefault(require("strip-ansi"));
32
+ const supportsColor = __importStar(require("supports-color"));
8
33
  const screen_1 = require("../../screen");
9
34
  const base_1 = require("./base");
10
- const spinners_1 = tslib_1.__importDefault(require("./spinners"));
35
+ const spinners_1 = __importDefault(require("./spinners"));
11
36
  const ansiEscapes = require('ansi-escapes');
12
37
  function color(s) {
13
38
  if (!supportsColor)
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.config = exports.Config = void 0;
4
- const tslib_1 = require("tslib");
5
7
  const fs_1 = require("../util/fs");
6
- const simple_1 = tslib_1.__importDefault(require("./action/simple"));
7
- const spinner_1 = tslib_1.__importDefault(require("./action/spinner"));
8
+ const simple_1 = __importDefault(require("./action/simple"));
9
+ const spinner_1 = __importDefault(require("./action/spinner"));
8
10
  const g = global;
9
11
  const globals = g.ux || (g.ux = {});
10
12
  const actionType = (Boolean(process.stderr.isTTY) &&
@@ -1,16 +1,41 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
2
28
  Object.defineProperty(exports, "__esModule", { value: true });
3
29
  exports.Table = exports.ExitError = exports.config = exports.Config = exports.ActionBase = exports.warn = exports.wait = exports.url = exports.tree = exports.trace = exports.table = exports.styledObject = exports.styledJSON = exports.styledHeader = exports.prompt = exports.progress = exports.log = exports.info = exports.flush = exports.exit = exports.error = exports.done = exports.debug = exports.confirm = exports.anykey = exports.annotation = exports.action = exports.ux = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
30
+ const chalk_1 = __importDefault(require("chalk"));
6
31
  const node_util_1 = require("node:util");
7
- const Errors = tslib_1.__importStar(require("../errors"));
32
+ const Errors = __importStar(require("../errors"));
8
33
  const config_1 = require("./config");
9
34
  const flush_1 = require("./flush");
10
- const uxPrompt = tslib_1.__importStar(require("./prompt"));
35
+ const uxPrompt = __importStar(require("./prompt"));
11
36
  const stream_1 = require("./stream");
12
- const styled = tslib_1.__importStar(require("./styled"));
13
- const wait_1 = tslib_1.__importDefault(require("./wait"));
37
+ const styled = __importStar(require("./styled"));
38
+ const wait_1 = __importDefault(require("./wait"));
14
39
  const hyperlinker = require('hyperlinker');
15
40
  class ux {
16
41
  static config = config_1.config;
@@ -1,9 +1,34 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
2
28
  Object.defineProperty(exports, "__esModule", { value: true });
3
29
  exports.anykey = exports.confirm = exports.prompt = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const Errors = tslib_1.__importStar(require("../errors"));
30
+ const chalk_1 = __importDefault(require("chalk"));
31
+ const Errors = __importStar(require("../errors"));
7
32
  const config_1 = require("./config");
8
33
  const stream_1 = require("./stream");
9
34
  function normal(options, retries = 100) {
@@ -1,11 +1,36 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
2
28
  Object.defineProperty(exports, "__esModule", { value: true });
3
29
  exports.tree = exports.Table = exports.progress = exports.styledObject = void 0;
4
- const tslib_1 = require("tslib");
5
30
  var object_1 = require("./object");
6
- Object.defineProperty(exports, "styledObject", { enumerable: true, get: function () { return tslib_1.__importDefault(object_1).default; } });
31
+ Object.defineProperty(exports, "styledObject", { enumerable: true, get: function () { return __importDefault(object_1).default; } });
7
32
  var progress_1 = require("./progress");
8
- Object.defineProperty(exports, "progress", { enumerable: true, get: function () { return tslib_1.__importDefault(progress_1).default; } });
9
- exports.Table = tslib_1.__importStar(require("./table"));
33
+ Object.defineProperty(exports, "progress", { enumerable: true, get: function () { return __importDefault(progress_1).default; } });
34
+ exports.Table = __importStar(require("./table"));
10
35
  var tree_1 = require("./tree");
11
- Object.defineProperty(exports, "tree", { enumerable: true, get: function () { return tslib_1.__importDefault(tree_1).default; } });
36
+ Object.defineProperty(exports, "tree", { enumerable: true, get: function () { return __importDefault(tree_1).default; } });
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ const chalk_1 = __importDefault(require("chalk"));
5
7
  const node_util_1 = require("node:util");
6
8
  function styledObject(obj, keys) {
7
9
  const output = [];
@@ -1,14 +1,39 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
2
28
  Object.defineProperty(exports, "__esModule", { value: true });
3
29
  exports.table = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
30
+ const chalk_1 = __importDefault(require("chalk"));
6
31
  const js_yaml_1 = require("js-yaml");
7
32
  const natural_orderby_1 = require("natural-orderby");
8
33
  const node_util_1 = require("node:util");
9
- const slice_ansi_1 = tslib_1.__importDefault(require("slice-ansi"));
10
- const string_width_1 = tslib_1.__importDefault(require("string-width"));
11
- const F = tslib_1.__importStar(require("../../flags"));
34
+ const slice_ansi_1 = __importDefault(require("slice-ansi"));
35
+ const string_width_1 = __importDefault(require("string-width"));
36
+ const F = __importStar(require("../../flags"));
12
37
  const screen_1 = require("../../screen");
13
38
  const util_1 = require("../../util/util");
14
39
  const stream_1 = require("../stream");
package/lib/command.d.ts CHANGED
@@ -49,6 +49,8 @@ export declare abstract class Command {
49
49
  static help: string | undefined;
50
50
  /** Hide the command from help */
51
51
  static hidden: boolean;
52
+ /** An array of aliases for this command that are hidden from help. */
53
+ static hiddenAliases: string[];
52
54
  /** A command ID, used mostly in error or verbose reporting. */
53
55
  static id: string;
54
56
  static plugin: Plugin | undefined;
@@ -155,6 +157,7 @@ export declare namespace Command {
155
157
  };
156
158
  hasDynamicHelp?: boolean;
157
159
  hidden: boolean;
160
+ hiddenAliases: string[];
158
161
  id: string;
159
162
  isESM?: boolean;
160
163
  permutations?: string[];
package/lib/command.js CHANGED
@@ -1,16 +1,41 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
2
28
  Object.defineProperty(exports, "__esModule", { value: true });
3
29
  exports.Command = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
30
+ const chalk_1 = __importDefault(require("chalk"));
6
31
  const node_url_1 = require("node:url");
7
32
  const node_util_1 = require("node:util");
8
33
  const cli_ux_1 = require("./cli-ux");
9
34
  const stream_1 = require("./cli-ux/stream");
10
35
  const config_1 = require("./config");
11
- const Errors = tslib_1.__importStar(require("./errors"));
36
+ const Errors = __importStar(require("./errors"));
12
37
  const util_1 = require("./help/util");
13
- const Parser = tslib_1.__importStar(require("./parser"));
38
+ const Parser = __importStar(require("./parser"));
14
39
  const aggregate_flags_1 = require("./util/aggregate-flags");
15
40
  const fs_1 = require("./util/fs");
16
41
  const util_2 = require("./util/util");
@@ -69,6 +94,8 @@ class Command {
69
94
  static help;
70
95
  /** Hide the command from help */
71
96
  static hidden;
97
+ /** An array of aliases for this command that are hidden from help. */
98
+ static hiddenAliases = [];
72
99
  /** A command ID, used mostly in error or verbose reporting. */
73
100
  static id;
74
101
  static plugin;
@@ -1,9 +1,34 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
2
28
  Object.defineProperty(exports, "__esModule", { value: true });
3
29
  exports.Config = void 0;
4
- const tslib_1 = require("tslib");
5
- const ejs = tslib_1.__importStar(require("ejs"));
6
- const is_wsl_1 = tslib_1.__importDefault(require("is-wsl"));
30
+ const ejs = __importStar(require("ejs"));
31
+ const is_wsl_1 = __importDefault(require("is-wsl"));
7
32
  const node_os_1 = require("node:os");
8
33
  const node_path_1 = require("node:path");
9
34
  const node_url_1 = require("node:url");
@@ -17,7 +42,7 @@ const settings_1 = require("../settings");
17
42
  const fs_1 = require("../util/fs");
18
43
  const os_1 = require("../util/os");
19
44
  const util_2 = require("../util/util");
20
- const plugin_loader_1 = tslib_1.__importDefault(require("./plugin-loader"));
45
+ const plugin_loader_1 = __importDefault(require("./plugin-loader"));
21
46
  const util_3 = require("./util");
22
47
  // eslint-disable-next-line new-cap
23
48
  const debug = (0, util_3.Debug)();
@@ -679,14 +704,13 @@ class Config {
679
704
  for (const permutation of permutations) {
680
705
  this.commandPermutations.add(permutation, command.id);
681
706
  }
682
- // set command aliases
683
- for (const alias of command.aliases ?? []) {
707
+ const handleAlias = (alias, hidden = false) => {
684
708
  if (this._commands.has(alias)) {
685
709
  const prioritizedCommand = this.determinePriority([this._commands.get(alias), command]);
686
710
  this._commands.set(alias, { ...prioritizedCommand, id: alias });
687
711
  }
688
712
  else {
689
- this._commands.set(alias, { ...command, id: alias });
713
+ this._commands.set(alias, { ...command, hidden, id: alias });
690
714
  }
691
715
  // set every permutation of the aliases
692
716
  // v3 moved command alias permutations to the manifest, but some plugins may not have
@@ -698,6 +722,14 @@ class Config {
698
722
  for (const permutation of aliasPermutations) {
699
723
  this.commandPermutations.add(permutation, command.id);
700
724
  }
725
+ };
726
+ // set command aliases
727
+ for (const alias of command.aliases ?? []) {
728
+ handleAlias(alias);
729
+ }
730
+ // set hidden command aliases
731
+ for (const alias of command.hiddenAliases ?? []) {
732
+ handleAlias(alias, true);
701
733
  }
702
734
  }
703
735
  marker?.addDetails({ commandCount: plugin.commands.length });
@@ -1,11 +1,33 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
26
  const node_path_1 = require("node:path");
5
27
  const performance_1 = require("../performance");
6
28
  const fs_1 = require("../util/fs");
7
29
  const util_1 = require("../util/util");
8
- const Plugin = tslib_1.__importStar(require("./plugin"));
30
+ const Plugin = __importStar(require("./plugin"));
9
31
  const util_2 = require("./util");
10
32
  // eslint-disable-next-line new-cap
11
33
  const debug = (0, util_2.Debug)();
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.CLIError = exports.addOclifExitCode = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const clean_stack_1 = tslib_1.__importDefault(require("clean-stack"));
7
- const indent_string_1 = tslib_1.__importDefault(require("indent-string"));
8
- const wrap_ansi_1 = tslib_1.__importDefault(require("wrap-ansi"));
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const clean_stack_1 = __importDefault(require("clean-stack"));
9
+ const indent_string_1 = __importDefault(require("indent-string"));
10
+ const wrap_ansi_1 = __importDefault(require("wrap-ansi"));
9
11
  const screen_1 = require("../../screen");
10
12
  const config_1 = require("../config");
11
13
  /**
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.applyPrettyPrintOptions = void 0;
4
- const tslib_1 = require("tslib");
5
- const indent_string_1 = tslib_1.__importDefault(require("indent-string"));
6
- const wrap_ansi_1 = tslib_1.__importDefault(require("wrap-ansi"));
7
+ const indent_string_1 = __importDefault(require("indent-string"));
8
+ const wrap_ansi_1 = __importDefault(require("wrap-ansi"));
7
9
  const screen_1 = require("../../screen");
8
10
  const config_1 = require("../config");
9
11
  function applyPrettyPrintOptions(error, options) {
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.handle = exports.Exit = void 0;
4
- const tslib_1 = require("tslib");
5
7
  /* eslint-disable no-process-exit */
6
- const clean_stack_1 = tslib_1.__importDefault(require("clean-stack"));
8
+ const clean_stack_1 = __importDefault(require("clean-stack"));
7
9
  const config_1 = require("./config");
8
10
  const cli_1 = require("./errors/cli");
9
11
  const exit_1 = require("./errors/exit");
10
- const pretty_print_1 = tslib_1.__importDefault(require("./errors/pretty-print"));
12
+ const pretty_print_1 = __importDefault(require("./errors/pretty-print"));
11
13
  /**
12
14
  * This is an odd abstraction for process.exit, but it allows us to stub it in tests.
13
15
  *
@@ -1,11 +1,33 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.Logger = exports.memoizedWarn = exports.warn = exports.error = exports.exit = exports.handle = exports.ModuleLoadError = exports.ExitError = exports.CLIError = exports.config = void 0;
4
- const tslib_1 = require("tslib");
5
27
  const config_1 = require("./config");
6
28
  const cli_1 = require("./errors/cli");
7
29
  const exit_1 = require("./errors/exit");
8
- const pretty_print_1 = tslib_1.__importStar(require("./errors/pretty-print"));
30
+ const pretty_print_1 = __importStar(require("./errors/pretty-print"));
9
31
  var config_2 = require("./config");
10
32
  Object.defineProperty(exports, "config", { enumerable: true, get: function () { return config_2.config; } });
11
33
  var cli_2 = require("./errors/cli");
package/lib/flags.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.option = exports.help = exports.version = exports.string = exports.url = exports.file = exports.directory = exports.integer = exports.boolean = exports.custom = void 0;
4
- /* eslint-disable valid-jsdoc */
5
4
  const node_url_1 = require("node:url");
6
5
  const errors_1 = require("./errors");
7
6
  const help_1 = require("./help");
@@ -98,7 +97,7 @@ const help = (opts = {}) => boolean({
98
97
  ...opts,
99
98
  async parse(_, cmd) {
100
99
  const Help = await (0, help_1.loadHelpClass)(cmd.config);
101
- await new Help(cmd.config, cmd.config.pjson.helpOptions).showHelp(cmd.id ? [cmd.id, ...cmd.argv] : cmd.argv);
100
+ await new Help(cmd.config, cmd.config.pjson.oclif.helpOptions ?? cmd.config.pjson.helpOptions).showHelp(cmd.id ? [cmd.id, ...cmd.argv] : cmd.argv);
102
101
  cmd.exit(0);
103
102
  },
104
103
  });
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.CommandHelp = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const strip_ansi_1 = tslib_1.__importDefault(require("strip-ansi"));
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const strip_ansi_1 = __importDefault(require("strip-ansi"));
7
9
  const ensure_arg_object_1 = require("../util/ensure-arg-object");
8
10
  const util_1 = require("../util/util");
9
11
  const docopts_1 = require("./docopts");
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.HelpFormatter = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const indent_string_1 = tslib_1.__importDefault(require("indent-string"));
7
- const string_width_1 = tslib_1.__importDefault(require("string-width"));
8
- const strip_ansi_1 = tslib_1.__importDefault(require("strip-ansi"));
9
- const widest_line_1 = tslib_1.__importDefault(require("widest-line"));
10
- const wrap_ansi_1 = tslib_1.__importDefault(require("wrap-ansi"));
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const indent_string_1 = __importDefault(require("indent-string"));
9
+ const string_width_1 = __importDefault(require("string-width"));
10
+ const strip_ansi_1 = __importDefault(require("strip-ansi"));
11
+ const widest_line_1 = __importDefault(require("widest-line"));
12
+ const wrap_ansi_1 = __importDefault(require("wrap-ansi"));
11
13
  const screen_1 = require("../screen");
12
14
  const util_1 = require("./util");
13
15
  class HelpFormatter {
package/lib/help/index.js CHANGED
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.loadHelpClass = exports.Help = exports.HelpBase = exports.standardizeIDFromArgv = exports.normalizeArgv = exports.getHelpFlagAdditions = exports.CommandHelp = void 0;
4
- const tslib_1 = require("tslib");
5
7
  const node_util_1 = require("node:util");
6
- const strip_ansi_1 = tslib_1.__importDefault(require("strip-ansi"));
8
+ const strip_ansi_1 = __importDefault(require("strip-ansi"));
7
9
  const stream_1 = require("../cli-ux/stream");
8
10
  const errors_1 = require("../errors");
9
11
  const module_loader_1 = require("../module-loader");
@@ -11,7 +13,7 @@ const cache_default_value_1 = require("../util/cache-default-value");
11
13
  const util_1 = require("../util/util");
12
14
  const command_1 = require("./command");
13
15
  const formatter_1 = require("./formatter");
14
- const root_1 = tslib_1.__importDefault(require("./root"));
16
+ const root_1 = __importDefault(require("./root"));
15
17
  const util_2 = require("./util");
16
18
  var command_2 = require("./command");
17
19
  Object.defineProperty(exports, "CommandHelp", { enumerable: true, get: function () { return command_2.CommandHelp; } });
@@ -80,7 +82,9 @@ class Help extends HelpBase {
80
82
  formatCommands(commands) {
81
83
  if (commands.length === 0)
82
84
  return '';
83
- const body = this.renderList(commands.map((c) => {
85
+ const body = this.renderList(commands
86
+ .filter((c) => (this.opts.hideAliasesFromRoot ? !c.aliases?.includes(c.id) : true))
87
+ .map((c) => {
84
88
  if (this.config.topicSeparator !== ':')
85
89
  c.id = c.id.replaceAll(':', this.config.topicSeparator);
86
90
  return [c.id, this.summary(c)];
package/lib/help/root.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const strip_ansi_1 = tslib_1.__importDefault(require("strip-ansi"));
6
+ const strip_ansi_1 = __importDefault(require("strip-ansi"));
5
7
  const util_1 = require("../util/util");
6
8
  const formatter_1 = require("./formatter");
7
9
  class RootHelp extends formatter_1.HelpFormatter {
package/lib/help/util.js CHANGED
@@ -1,8 +1,30 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.normalizeArgv = exports.formatCommandDeprecationWarning = exports.formatFlagDeprecationWarning = exports.getHelpFlagAdditions = exports.standardizeIDFromArgv = exports.toConfiguredId = exports.toStandardizedId = exports.template = void 0;
4
- const tslib_1 = require("tslib");
5
- const ejs = tslib_1.__importStar(require("ejs"));
27
+ const ejs = __importStar(require("ejs"));
6
28
  const util_1 = require("../config/util");
7
29
  function template(context) {
8
30
  function render(t) {
package/lib/index.js CHANGED
@@ -1,7 +1,29 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.settings = exports.Performance = exports.Parser = exports.run = exports.Interfaces = exports.toStandardizedId = exports.toConfiguredId = exports.loadHelpClass = exports.HelpBase = exports.Help = exports.CommandHelp = exports.Flags = exports.execute = exports.handle = exports.Errors = exports.Plugin = exports.Config = exports.Command = exports.stdout = exports.stderr = exports.flush = exports.ux = exports.Args = void 0;
4
- const tslib_1 = require("tslib");
5
27
  const stream_1 = require("./cli-ux/stream");
6
28
  function checkCWD() {
7
29
  try {
@@ -14,8 +36,8 @@ function checkCWD() {
14
36
  }
15
37
  }
16
38
  checkCWD();
17
- exports.Args = tslib_1.__importStar(require("./args"));
18
- exports.ux = tslib_1.__importStar(require("./cli-ux"));
39
+ exports.Args = __importStar(require("./args"));
40
+ exports.ux = __importStar(require("./cli-ux"));
19
41
  var flush_1 = require("./cli-ux/flush");
20
42
  Object.defineProperty(exports, "flush", { enumerable: true, get: function () { return flush_1.flush; } });
21
43
  var stream_2 = require("./cli-ux/stream");
@@ -26,12 +48,12 @@ Object.defineProperty(exports, "Command", { enumerable: true, get: function () {
26
48
  var config_1 = require("./config");
27
49
  Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return config_1.Config; } });
28
50
  Object.defineProperty(exports, "Plugin", { enumerable: true, get: function () { return config_1.Plugin; } });
29
- exports.Errors = tslib_1.__importStar(require("./errors"));
51
+ exports.Errors = __importStar(require("./errors"));
30
52
  var handle_1 = require("./errors/handle");
31
53
  Object.defineProperty(exports, "handle", { enumerable: true, get: function () { return handle_1.handle; } });
32
54
  var execute_1 = require("./execute");
33
55
  Object.defineProperty(exports, "execute", { enumerable: true, get: function () { return execute_1.execute; } });
34
- exports.Flags = tslib_1.__importStar(require("./flags"));
56
+ exports.Flags = __importStar(require("./flags"));
35
57
  var help_1 = require("./help");
36
58
  Object.defineProperty(exports, "CommandHelp", { enumerable: true, get: function () { return help_1.CommandHelp; } });
37
59
  Object.defineProperty(exports, "Help", { enumerable: true, get: function () { return help_1.Help; } });
@@ -40,10 +62,10 @@ Object.defineProperty(exports, "loadHelpClass", { enumerable: true, get: functio
40
62
  var util_1 = require("./help/util");
41
63
  Object.defineProperty(exports, "toConfiguredId", { enumerable: true, get: function () { return util_1.toConfiguredId; } });
42
64
  Object.defineProperty(exports, "toStandardizedId", { enumerable: true, get: function () { return util_1.toStandardizedId; } });
43
- exports.Interfaces = tslib_1.__importStar(require("./interfaces"));
65
+ exports.Interfaces = __importStar(require("./interfaces"));
44
66
  var main_1 = require("./main");
45
67
  Object.defineProperty(exports, "run", { enumerable: true, get: function () { return main_1.run; } });
46
- exports.Parser = tslib_1.__importStar(require("./parser"));
68
+ exports.Parser = __importStar(require("./parser"));
47
69
  var performance_1 = require("./performance");
48
70
  Object.defineProperty(exports, "Performance", { enumerable: true, get: function () { return performance_1.Performance; } });
49
71
  var settings_1 = require("./settings");
@@ -4,6 +4,10 @@ export interface HelpOptions {
4
4
  * Use docopts as the usage. Defaults to true.
5
5
  */
6
6
  docopts?: boolean;
7
+ /**
8
+ * If true, hide command aliases from the root help output. Defaults to false.
9
+ */
10
+ hideAliasesFromRoot?: boolean;
7
11
  /**
8
12
  * By default, the command summary is show at the top of the help and as the first line in
9
13
  * the command description. Repeating the summary in the command description improves readability
package/lib/main.js CHANGED
@@ -64,7 +64,7 @@ async function run(argv, options) {
64
64
  // display help version if applicable
65
65
  if ((0, exports.helpAddition)(argv, config)) {
66
66
  const Help = await (0, help_1.loadHelpClass)(config);
67
- const help = new Help(config, config.pjson.helpOptions);
67
+ const help = new Help(config, config.pjson.oclif.helpOptions ?? config.pjson.helpOptions);
68
68
  await help.showHelp(argv);
69
69
  await collectPerf();
70
70
  return;
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.FailedFlagValidationError = exports.ArgInvalidOptionError = exports.FlagInvalidOptionError = exports.NonExistentFlagsError = exports.UnexpectedArgsError = exports.RequiredFlagError = exports.RequiredArgsError = exports.InvalidArgsSpecError = exports.CLIParseError = exports.CLIError = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
+ const chalk_1 = __importDefault(require("chalk"));
6
8
  const list_1 = require("../cli-ux/list");
7
9
  const errors_1 = require("../errors");
8
10
  const util_1 = require("../util/util");
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.flagUsages = exports.flagUsage = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
+ const chalk_1 = __importDefault(require("chalk"));
6
8
  const util_1 = require("../util/util");
7
9
  function flagUsage(flag, options = {}) {
8
10
  const label = [];
@@ -75,15 +75,17 @@ async function cacheCommand(uncachedCmd, plugin, respectNoCacheDefault = false)
75
75
  const flags = await cacheFlags((0, aggregate_flags_1.aggregateFlags)(uncachedFlags, uncachedBaseFlags, cmd.enableJsonFlag), respectNoCacheDefault);
76
76
  const args = await cacheArgs((0, ensure_arg_object_1.ensureArgObject)(cmd.args), respectNoCacheDefault);
77
77
  const stdProperties = {
78
- aliases: cmd.aliases || [],
78
+ aliases: cmd.aliases ?? [],
79
79
  args,
80
80
  deprecateAliases: cmd.deprecateAliases,
81
81
  deprecationOptions: cmd.deprecationOptions,
82
82
  description: cmd.description,
83
- examples: cmd.examples || cmd.example,
83
+ // Support both `examples` and `example` for backwards compatibility.
84
+ examples: cmd.examples ?? cmd.example,
84
85
  flags,
85
86
  hasDynamicHelp: Object.values(flags).some((f) => f.hasDynamicHelp),
86
87
  hidden: cmd.hidden,
88
+ hiddenAliases: cmd.hiddenAliases ?? [],
87
89
  id: cmd.id,
88
90
  pluginAlias: plugin && plugin.alias,
89
91
  pluginName: plugin && plugin.name,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/core",
3
3
  "description": "base library for oclif CLIs",
4
- "version": "3.0.8",
4
+ "version": "3.1.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {
@@ -75,7 +75,6 @@
75
75
  "sinon": "^11.1.2",
76
76
  "ts-node": "^10.9.1",
77
77
  "tsd": "^0.29.0",
78
- "tslib": "^2.5.0",
79
78
  "typescript": "^5"
80
79
  },
81
80
  "engines": {