@oclif/core 3.23.0 → 3.24.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/lib/cache.js +0 -1
- package/lib/cli-ux/flush.js +1 -1
- package/lib/cli-ux/index.js +1 -1
- package/lib/errors/handle.js +1 -1
- package/lib/help/command.js +4 -2
- package/lib/help/docopts.d.ts +2 -2
- package/lib/help/docopts.js +3 -1
- package/lib/util/find-root.js +1 -1
- package/package.json +4 -4
package/lib/cache.js
CHANGED
package/lib/cli-ux/flush.js
CHANGED
package/lib/cli-ux/index.js
CHANGED
package/lib/errors/handle.js
CHANGED
|
@@ -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
|
};
|
package/lib/help/command.js
CHANGED
|
@@ -58,7 +58,8 @@ class CommandHelp extends formatter_1.HelpFormatter {
|
|
|
58
58
|
if (args.filter((a) => a.description).length === 0)
|
|
59
59
|
return;
|
|
60
60
|
return args.map((a) => {
|
|
61
|
-
|
|
61
|
+
// Add ellipsis to indicate that the argument takes multiple values if strict is false
|
|
62
|
+
const name = this.command.strict === false ? `${a.name.toUpperCase()}...` : a.name.toUpperCase();
|
|
62
63
|
let description = a.description || '';
|
|
63
64
|
if (a.default)
|
|
64
65
|
description = `${(0, theme_1.colorize)(this.config?.theme?.flagDefaultValue, `[default: ${a.default}]`)} ${description}`;
|
|
@@ -295,13 +296,14 @@ class CommandHelp extends formatter_1.HelpFormatter {
|
|
|
295
296
|
usage() {
|
|
296
297
|
const { id, usage } = this.command;
|
|
297
298
|
const standardId = (0, ids_1.toStandardizedId)(id, this.config);
|
|
299
|
+
const configuredId = (0, ids_1.toConfiguredId)(id, this.config);
|
|
298
300
|
const body = (usage ? (0, util_1.castArray)(usage) : [this.defaultUsage()])
|
|
299
301
|
.map((u) => {
|
|
300
302
|
const allowedSpacing = this.opts.maxWidth - this.indentSpacing;
|
|
301
303
|
const dollarSign = (0, theme_1.colorize)(this.config?.theme?.dollarSign, '$');
|
|
302
304
|
const bin = (0, theme_1.colorize)(this.config?.theme?.bin, this.config.bin);
|
|
303
305
|
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());
|
|
306
|
+
const commandDescription = (0, theme_1.colorize)(this.config?.theme?.sectionDescription, u.replace('<%= command.id %>', '').replace(standardId, '').replace(configuredId, '').trim());
|
|
305
307
|
const line = `${dollarSign} ${bin} ${command} ${commandDescription}`.trim();
|
|
306
308
|
if (line.length > allowedSpacing) {
|
|
307
309
|
const splitIndex = line.slice(0, Math.max(0, allowedSpacing)).lastIndexOf(' ');
|
package/lib/help/docopts.d.ts
CHANGED
|
@@ -59,8 +59,8 @@ export declare class DocOpts {
|
|
|
59
59
|
private cmd;
|
|
60
60
|
private flagList;
|
|
61
61
|
private flagMap;
|
|
62
|
-
constructor(cmd: Command.
|
|
63
|
-
static generate(cmd: Command.
|
|
62
|
+
constructor(cmd: Command.Loadable);
|
|
63
|
+
static generate(cmd: Command.Loadable): string;
|
|
64
64
|
toString(): string;
|
|
65
65
|
private combineElementsToFlag;
|
|
66
66
|
private generateElements;
|
package/lib/help/docopts.js
CHANGED
|
@@ -79,7 +79,9 @@ class DocOpts {
|
|
|
79
79
|
toString() {
|
|
80
80
|
const opts = ['<%= command.id %>'];
|
|
81
81
|
if (this.cmd.args) {
|
|
82
|
-
|
|
82
|
+
// If strict is false, add ellipsis to indicate that the argument takes multiple values
|
|
83
|
+
const suffix = this.cmd.strict === false ? '...' : '';
|
|
84
|
+
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}]`) || [];
|
|
83
85
|
opts.push(...a);
|
|
84
86
|
}
|
|
85
87
|
try {
|
package/lib/util/find-root.js
CHANGED
|
@@ -89,7 +89,7 @@ function maybeRequirePnpApi(root) {
|
|
|
89
89
|
if (pnp)
|
|
90
90
|
return pnp;
|
|
91
91
|
try {
|
|
92
|
-
// eslint-disable-next-line
|
|
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.
|
|
4
|
+
"version": "3.24.0",
|
|
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
|
|
69
|
-
"eslint-config-oclif-typescript": "^3.0
|
|
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.
|
|
71
|
+
"fancy-test": "^3.0.12",
|
|
72
72
|
"globby": "^11.1.0",
|
|
73
73
|
"husky": "^8",
|
|
74
74
|
"lint-staged": "^14.0.1",
|