@oclif/core 3.22.0 → 3.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cache.js CHANGED
@@ -22,7 +22,6 @@ class Cache extends Map {
22
22
  }
23
23
  getOclifCoreMeta() {
24
24
  try {
25
- // eslint-disable-next-line node/no-extraneous-require
26
25
  return { name: '@oclif/core', version: require('@oclif/core/package.json').version };
27
26
  }
28
27
  catch {
@@ -5,6 +5,9 @@ export interface ITask {
5
5
  status: string | undefined;
6
6
  }
7
7
  export type ActionType = 'debug' | 'simple' | 'spinner';
8
+ /**
9
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
10
+ */
8
11
  export declare class ActionBase {
9
12
  std: 'stderr' | 'stdout';
10
13
  protected stdmocks?: ['stderr' | 'stdout', string[]][];
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActionBase = void 0;
4
4
  const node_util_1 = require("node:util");
5
5
  const util_1 = require("../../util/util");
6
+ /**
7
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
8
+ */
6
9
  class ActionBase {
7
10
  std = 'stderr';
8
11
  stdmocks;
@@ -5,6 +5,9 @@ export interface ConfigMessage {
5
5
  type: 'config';
6
6
  value: any;
7
7
  }
8
+ /**
9
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
10
+ */
8
11
  export declare class Config {
9
12
  action: ActionBase;
10
13
  errorsHandled: boolean;
@@ -15,5 +18,8 @@ export declare class Config {
15
18
  get debug(): boolean;
16
19
  set debug(v: boolean);
17
20
  }
21
+ /**
22
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
23
+ */
18
24
  export declare const config: Config;
19
25
  export default config;
@@ -15,6 +15,9 @@ const actionType = (Boolean(process.stderr.isTTY) &&
15
15
  'spinner') ||
16
16
  'simple';
17
17
  const Action = actionType === 'spinner' ? spinner_1.default : simple_1.default;
18
+ /**
19
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
20
+ */
18
21
  class Config {
19
22
  action = new Action();
20
23
  errorsHandled = false;
@@ -42,5 +45,8 @@ function fetch() {
42
45
  globals[major] = new Config();
43
46
  return globals[major];
44
47
  }
48
+ /**
49
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
50
+ */
45
51
  exports.config = fetch();
46
52
  exports.default = exports.config;
@@ -21,7 +21,7 @@ async function _flush() {
21
21
  return;
22
22
  return p;
23
23
  }
24
- async function flush(ms = 10000) {
24
+ async function flush(ms = 10_000) {
25
25
  await timeout(_flush(), ms);
26
26
  }
27
27
  exports.flush = flush;
@@ -31,7 +31,99 @@ export declare class ux {
31
31
  }
32
32
  declare const action: ActionBase, annotation: typeof ux.annotation, anykey: typeof uxPrompt.anykey, confirm: typeof uxPrompt.confirm, debug: typeof ux.debug, done: typeof ux.done, flush: typeof ux.flush, info: typeof ux.info, log: typeof ux.log, logToStderr: typeof ux.logToStderr, progress: typeof styled.progress, prompt: typeof uxPrompt.prompt, styledHeader: typeof ux.styledHeader, styledJSON: typeof ux.styledJSON, styledObject: typeof ux.styledObject, table: typeof styled.Table.table, trace: typeof ux.trace, tree: typeof styled.tree, url: typeof ux.url, wait: (ms?: number) => Promise<void>;
33
33
  declare const error: typeof Errors.error, exit: typeof Errors.exit, warn: typeof Errors.warn;
34
- export { action, annotation, anykey, confirm, debug, done, error, exit, flush, info, log, logToStderr, progress, prompt, styledHeader, styledJSON, styledObject, table, trace, tree, url, wait, warn, };
34
+ export {
35
+ /**
36
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
37
+ */
38
+ action,
39
+ /**
40
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
41
+ */
42
+ annotation,
43
+ /**
44
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
45
+ */
46
+ anykey,
47
+ /**
48
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
49
+ */
50
+ confirm,
51
+ /**
52
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
53
+ */
54
+ debug,
55
+ /**
56
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
57
+ */
58
+ done,
59
+ /**
60
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
61
+ */
62
+ error,
63
+ /**
64
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
65
+ */
66
+ exit,
67
+ /**
68
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
69
+ */
70
+ flush,
71
+ /**
72
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
73
+ */
74
+ info,
75
+ /**
76
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
77
+ */
78
+ log,
79
+ /**
80
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
81
+ */
82
+ logToStderr,
83
+ /**
84
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
85
+ */
86
+ progress,
87
+ /**
88
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
89
+ */
90
+ prompt,
91
+ /**
92
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
93
+ */
94
+ styledHeader,
95
+ /**
96
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
97
+ */
98
+ styledJSON,
99
+ /**
100
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
101
+ */
102
+ styledObject,
103
+ /**
104
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
105
+ */
106
+ table,
107
+ /**
108
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
109
+ */
110
+ trace,
111
+ /**
112
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
113
+ */
114
+ tree,
115
+ /**
116
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
117
+ */
118
+ url,
119
+ /**
120
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
121
+ */
122
+ wait,
123
+ /**
124
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
125
+ */
126
+ warn, };
35
127
  export { ActionBase } from './action/base';
36
128
  export { Config, config } from './config';
37
129
  export { ExitError } from './exit';
@@ -69,7 +69,7 @@ class ux {
69
69
  static async done() {
70
70
  config_1.config.action.stop();
71
71
  }
72
- static async flush(ms = 10000) {
72
+ static async flush(ms = 10_000) {
73
73
  await (0, flush_1.flush)(ms);
74
74
  }
75
75
  static info(format, ...args) {
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
3
+ */
1
4
  export interface IPromptOptions {
2
5
  default?: string;
3
6
  prompt?: string;
@@ -37,6 +37,9 @@ const F = __importStar(require("../../flags"));
37
37
  const screen_1 = require("../../screen");
38
38
  const util_1 = require("../../util/util");
39
39
  const write_1 = __importDefault(require("../write"));
40
+ /**
41
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
42
+ */
40
43
  class Table {
41
44
  data;
42
45
  columns;
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
3
+ */
1
4
  declare const _default: {
2
5
  stderr: (msg: string) => void;
3
6
  stdout: (msg: string) => void;
@@ -6,6 +6,9 @@ const stdout = (msg) => {
6
6
  const stderr = (msg) => {
7
7
  process.stderr.write(msg);
8
8
  };
9
+ /**
10
+ * @deprecated `ux` will be removed in the next major. See https://github.com/oclif/core/discussions/999
11
+ */
9
12
  exports.default = {
10
13
  stderr,
11
14
  stdout,
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.handle = exports.Exit = void 0;
7
- /* eslint-disable no-process-exit */
8
7
  const clean_stack_1 = __importDefault(require("clean-stack"));
9
8
  const config_1 = require("./config");
10
9
  const cli_1 = require("./errors/cli");
@@ -17,6 +16,7 @@ const pretty_print_1 = __importDefault(require("./errors/pretty-print"));
17
16
  */
18
17
  exports.Exit = {
19
18
  exit(code = 0) {
19
+ // eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit
20
20
  process.exit(code);
21
21
  },
22
22
  };
@@ -295,13 +295,14 @@ class CommandHelp extends formatter_1.HelpFormatter {
295
295
  usage() {
296
296
  const { id, usage } = this.command;
297
297
  const standardId = (0, ids_1.toStandardizedId)(id, this.config);
298
+ const configuredId = (0, ids_1.toConfiguredId)(id, this.config);
298
299
  const body = (usage ? (0, util_1.castArray)(usage) : [this.defaultUsage()])
299
300
  .map((u) => {
300
301
  const allowedSpacing = this.opts.maxWidth - this.indentSpacing;
301
302
  const dollarSign = (0, theme_1.colorize)(this.config?.theme?.dollarSign, '$');
302
303
  const bin = (0, theme_1.colorize)(this.config?.theme?.bin, this.config.bin);
303
304
  const command = (0, theme_1.colorize)(this.config?.theme?.command, '<%= command.id %>');
304
- const commandDescription = (0, theme_1.colorize)(this.config?.theme?.sectionDescription, u.replace('<%= command.id %>', '').replace(standardId, '').trim());
305
+ const commandDescription = (0, theme_1.colorize)(this.config?.theme?.sectionDescription, u.replace('<%= command.id %>', '').replace(standardId, '').replace(configuredId, '').trim());
305
306
  const line = `${dollarSign} ${bin} ${command} ${commandDescription}`.trim();
306
307
  if (line.length > allowedSpacing) {
307
308
  const splitIndex = line.slice(0, Math.max(0, allowedSpacing)).lastIndexOf(' ');
@@ -89,7 +89,7 @@ function maybeRequirePnpApi(root) {
89
89
  if (pnp)
90
90
  return pnp;
91
91
  try {
92
- // eslint-disable-next-line node/no-missing-require
92
+ // eslint-disable-next-line n/no-missing-require
93
93
  pnp = require(require.resolve('pnpapi', { paths: [root] }));
94
94
  return pnp;
95
95
  }
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.22.0",
4
+ "version": "3.23.1",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {
@@ -65,10 +65,10 @@
65
65
  "commitlint": "^17.8.1",
66
66
  "cross-env": "^7.0.3",
67
67
  "eslint": "^8.57.0",
68
- "eslint-config-oclif": "^5.0.4",
69
- "eslint-config-oclif-typescript": "^3.0.48",
68
+ "eslint-config-oclif": "^5.1.0",
69
+ "eslint-config-oclif-typescript": "^3.1.0",
70
70
  "eslint-config-prettier": "^9.1.0",
71
- "fancy-test": "^3.0.11",
71
+ "fancy-test": "^3.0.12",
72
72
  "globby": "^11.1.0",
73
73
  "husky": "^8",
74
74
  "lint-staged": "^14.0.1",