@oclif/core 3.18.1 → 3.19.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/config/config.d.ts +1 -1
- package/lib/config/config.js +14 -5
- package/lib/help/command.js +3 -3
- package/lib/interfaces/pjson.d.ts +6 -5
- package/package.json +16 -10
package/lib/config/config.d.ts
CHANGED
package/lib/config/config.js
CHANGED
|
@@ -360,12 +360,21 @@ class Config {
|
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
async loadThemes() {
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
363
|
+
const defaultThemeFile = this.pjson.oclif.theme
|
|
364
|
+
? (0, node_path_1.resolve)(this.root, this.pjson.oclif.theme)
|
|
365
|
+
: this.pjson.oclif.theme;
|
|
366
|
+
const userThemeFile = (0, node_path_1.resolve)(this.configDir, 'theme.json');
|
|
367
|
+
const [defaultTheme, userTheme] = await Promise.all([
|
|
368
|
+
defaultThemeFile ? await (0, fs_1.safeReadJson)(defaultThemeFile) : undefined,
|
|
369
|
+
await (0, fs_1.safeReadJson)(userThemeFile),
|
|
370
|
+
]);
|
|
371
|
+
// Merge the default theme with the user theme, giving the user theme precedence.
|
|
372
|
+
const merged = { ...defaultTheme, ...userTheme };
|
|
366
373
|
return {
|
|
367
|
-
file,
|
|
368
|
-
|
|
374
|
+
// Point to the user file if it exists, otherwise use the default file.
|
|
375
|
+
// This doesn't really serve a purpose to anyone but removing it would be a breaking change.
|
|
376
|
+
file: userTheme ? userThemeFile : defaultThemeFile,
|
|
377
|
+
theme: Object.keys(merged).length > 0 ? (0, theme_1.parseTheme)(merged) : undefined,
|
|
369
378
|
};
|
|
370
379
|
}
|
|
371
380
|
macosCacheDir() {
|
package/lib/help/command.js
CHANGED
|
@@ -150,7 +150,7 @@ class CommandHelp extends formatter_1.HelpFormatter {
|
|
|
150
150
|
labels.push(`--${flag.name.trim()}`);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
label = labels.join((0, theme_1.colorize)(this.config?.theme?.flagSeparator,
|
|
153
|
+
label = labels.join(flag.char ? (0, theme_1.colorize)(this.config?.theme?.flagSeparator, ', ') : ' ');
|
|
154
154
|
}
|
|
155
155
|
if (flag.type === 'option') {
|
|
156
156
|
let value = flag.helpValue || (this.opts.showFlagNameInTitle ? flag.name : '<value>');
|
|
@@ -163,14 +163,14 @@ class CommandHelp extends formatter_1.HelpFormatter {
|
|
|
163
163
|
value = chalk_1.default.underline(value);
|
|
164
164
|
label += `=${value}`;
|
|
165
165
|
}
|
|
166
|
-
return label;
|
|
166
|
+
return (0, theme_1.colorize)(this.config.theme?.flag, label);
|
|
167
167
|
}
|
|
168
168
|
flags(flags) {
|
|
169
169
|
if (flags.length === 0)
|
|
170
170
|
return;
|
|
171
171
|
const noChar = flags.reduce((previous, current) => previous && current.char === undefined, true);
|
|
172
172
|
return flags.map((flag) => {
|
|
173
|
-
let left =
|
|
173
|
+
let left = this.flagHelpLabel(flag);
|
|
174
174
|
if (noChar)
|
|
175
175
|
left = left.replace(' ', '');
|
|
176
176
|
let right = flag.summary || flag.description || '';
|
|
@@ -49,15 +49,11 @@ export declare namespace PJSON {
|
|
|
49
49
|
identifier?: string;
|
|
50
50
|
sign?: string;
|
|
51
51
|
};
|
|
52
|
-
windows?: {
|
|
53
|
-
homepage?: string;
|
|
54
|
-
keypath?: string;
|
|
55
|
-
name?: string;
|
|
56
|
-
};
|
|
57
52
|
plugins?: string[];
|
|
58
53
|
repositoryPrefix?: string;
|
|
59
54
|
schema?: number;
|
|
60
55
|
state?: 'beta' | 'deprecated' | string;
|
|
56
|
+
theme?: string;
|
|
61
57
|
topicSeparator?: ' ' | ':';
|
|
62
58
|
topics?: {
|
|
63
59
|
[k: string]: {
|
|
@@ -78,6 +74,11 @@ export declare namespace PJSON {
|
|
|
78
74
|
};
|
|
79
75
|
s3: S3;
|
|
80
76
|
};
|
|
77
|
+
windows?: {
|
|
78
|
+
homepage?: string;
|
|
79
|
+
keypath?: string;
|
|
80
|
+
name?: string;
|
|
81
|
+
};
|
|
81
82
|
};
|
|
82
83
|
version: string;
|
|
83
84
|
}
|
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.19.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/oclif/core/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -38,20 +38,20 @@
|
|
|
38
38
|
"@oclif/plugin-help": "^6",
|
|
39
39
|
"@oclif/plugin-plugins": "^4",
|
|
40
40
|
"@oclif/prettier-config": "^0.2.1",
|
|
41
|
-
"@oclif/test": "^3.
|
|
41
|
+
"@oclif/test": "^3.1.12",
|
|
42
42
|
"@types/ansi-styles": "^3.2.1",
|
|
43
43
|
"@types/benchmark": "^2.1.5",
|
|
44
44
|
"@types/chai": "^4.3.11",
|
|
45
45
|
"@types/chai-as-promised": "^7.1.8",
|
|
46
46
|
"@types/clean-stack": "^2.1.1",
|
|
47
|
-
"@types/color": "^3.0.
|
|
47
|
+
"@types/color": "^3.0.6",
|
|
48
48
|
"@types/debug": "^4.1.10",
|
|
49
49
|
"@types/ejs": "^3.1.5",
|
|
50
50
|
"@types/indent-string": "^4.0.1",
|
|
51
51
|
"@types/js-yaml": "^3.12.7",
|
|
52
52
|
"@types/mocha": "^10.0.6",
|
|
53
53
|
"@types/node": "^18",
|
|
54
|
-
"@types/node-notifier": "^8.0.
|
|
54
|
+
"@types/node-notifier": "^8.0.5",
|
|
55
55
|
"@types/pnpapi": "^0.0.5",
|
|
56
56
|
"@types/slice-ansi": "^4.0.0",
|
|
57
57
|
"@types/strip-ansi": "^5.2.1",
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
"@types/wordwrap": "^1.0.3",
|
|
60
60
|
"@types/wrap-ansi": "^3.0.0",
|
|
61
61
|
"benchmark": "^2.1.4",
|
|
62
|
-
"chai": "^4.
|
|
62
|
+
"chai": "^4.4.1",
|
|
63
63
|
"chai-as-promised": "^7.1.1",
|
|
64
64
|
"commitlint": "^17.7.2",
|
|
65
65
|
"cross-env": "^7.0.3",
|
|
66
|
-
"eslint": "^8.
|
|
66
|
+
"eslint": "^8.56.0",
|
|
67
67
|
"eslint-config-oclif": "^5.0.0",
|
|
68
68
|
"eslint-config-oclif-typescript": "^3.0.35",
|
|
69
|
-
"eslint-config-prettier": "^9.
|
|
69
|
+
"eslint-config-prettier": "^9.1.0",
|
|
70
70
|
"fancy-test": "^3.0.1",
|
|
71
71
|
"globby": "^11.1.0",
|
|
72
72
|
"husky": "^8",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"prettier": "^3.1.1",
|
|
78
78
|
"shx": "^0.3.4",
|
|
79
79
|
"sinon": "^16.1.3",
|
|
80
|
-
"ts-node": "^10.9.
|
|
81
|
-
"tsd": "^0.
|
|
80
|
+
"ts-node": "^10.9.2",
|
|
81
|
+
"tsd": "^0.30.4",
|
|
82
82
|
"typescript": "^5"
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
@@ -92,7 +92,13 @@
|
|
|
92
92
|
],
|
|
93
93
|
"homepage": "https://github.com/oclif/core",
|
|
94
94
|
"keywords": [
|
|
95
|
-
"oclif"
|
|
95
|
+
"oclif",
|
|
96
|
+
"cli",
|
|
97
|
+
"command",
|
|
98
|
+
"command line",
|
|
99
|
+
"parser",
|
|
100
|
+
"args",
|
|
101
|
+
"argv"
|
|
96
102
|
],
|
|
97
103
|
"license": "MIT",
|
|
98
104
|
"main": "./lib/index.js",
|