@oclif/core 4.4.0 → 4.5.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.
package/README.md CHANGED
@@ -147,4 +147,4 @@ hello world from oclif
147
147
 
148
148
  🚀 Contributing
149
149
 
150
- See the [contributing guide](./CONRTIBUTING.md).
150
+ See the [contributing guide](./CONTRIBUTING.md).
@@ -102,7 +102,9 @@ class DocOpts {
102
102
  if (this.cmd.args) {
103
103
  // If strict is false, add ellipsis to indicate that the argument takes multiple values
104
104
  const suffix = this.cmd.strict === false ? '...' : '';
105
- const a = Object.values((0, ensure_arg_object_1.ensureArgObject)(this.cmd.args)).map((arg) => arg.required ? `${arg.name.toUpperCase()}${suffix}` : `[${arg.name.toUpperCase()}${suffix}]`) || [];
105
+ const a = Object.values((0, ensure_arg_object_1.ensureArgObject)(this.cmd.args))
106
+ .filter((arg) => !arg.hidden)
107
+ .map((arg) => arg.required ? `${arg.name.toUpperCase()}${suffix}` : `[${arg.name.toUpperCase()}${suffix}]`) || [];
106
108
  opts.push(...a);
107
109
  }
108
110
  try {
@@ -37,6 +37,8 @@ export interface Hooks {
37
37
  options: {
38
38
  argv: string[];
39
39
  id: string;
40
+ Command: Command.Loadable | undefined;
41
+ error: Error | undefined;
40
42
  };
41
43
  return: void;
42
44
  };
package/lib/main.js CHANGED
@@ -59,13 +59,13 @@ async function run(argv, options) {
59
59
  argv = [symbols_1.SINGLE_COMMAND_CLI_SYMBOL, ...argv];
60
60
  }
61
61
  const [id, ...argvSlice] = (0, help_1.normalizeArgv)(config, argv);
62
- const runFinally = async () => {
62
+ const runFinally = async (cmd, error) => {
63
63
  marker?.stop();
64
64
  if (!initMarker?.stopped)
65
65
  initMarker?.stop();
66
66
  await performance_1.Performance.collect();
67
67
  performance_1.Performance.debug();
68
- await config.runHook('finally', { argv: argvSlice, id });
68
+ await config.runHook('finally', { argv: argvSlice, Command: cmd, error, id });
69
69
  };
70
70
  // run init hook
71
71
  await config.runHook('init', { argv: argvSlice, id });
@@ -92,10 +92,14 @@ async function run(argv, options) {
92
92
  }
93
93
  }
94
94
  initMarker?.stop();
95
+ let err;
95
96
  try {
96
97
  return await config.runCommand(id, argvSlice, cmd);
97
98
  }
99
+ catch (error) {
100
+ err = error;
101
+ }
98
102
  finally {
99
- await runFinally();
103
+ await runFinally(cmd, err);
100
104
  }
101
105
  }
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": "4.4.0",
4
+ "version": "4.5.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@commitlint/config-conventional": "^19",
29
- "@eslint/compat": "^1.3.0",
29
+ "@eslint/compat": "^1.3.1",
30
30
  "@oclif/plugin-help": "^6",
31
31
  "@oclif/plugin-plugins": "^5",
32
32
  "@oclif/prettier-config": "^0.2.1",
@@ -58,7 +58,7 @@
58
58
  "madge": "^6.1.0",
59
59
  "mocha": "^10.8.2",
60
60
  "nyc": "^15.1.0",
61
- "prettier": "^3.5.3",
61
+ "prettier": "^3.6.2",
62
62
  "shx": "^0.4.0",
63
63
  "sinon": "^18",
64
64
  "ts-node": "^10.9.2",