@qui-cli/core 5.0.3 → 6.0.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/CHANGELOG.md +19 -0
- package/dist/Core.d.ts +9 -0
- package/dist/Core.js +24 -17
- package/dist/Help.d.ts +0 -1
- package/dist/Help.js +1 -2
- package/dist/JackSpeak.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [6.0.1](https://github.com/battis/qui-cli/compare/core/6.0.0...core/6.0.1) (2026-02-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* display plugin usage information in LIFO registration order ([a79c8ed](https://github.com/battis/qui-cli/commit/a79c8ed0e0f8dc0bb45a035909e82af37b7ba350))
|
|
11
|
+
|
|
12
|
+
## [6.0.0](https://github.com/battis/qui-cli/compare/core/5.0.3...core/6.0.0) (2026-01-29)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### ⚠ BREAKING CHANGES
|
|
16
|
+
|
|
17
|
+
* allow errors to be thrown
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* allow errors to be thrown ([8bf98db](https://github.com/battis/qui-cli/commit/8bf98db45ebe06514cef02572d515379985c7067))
|
|
22
|
+
* preempt all other plugins if --help is set ([db99833](https://github.com/battis/qui-cli/commit/db9983336135080a5fecff6adbf2e2913f55fa8d))
|
|
23
|
+
|
|
5
24
|
## [5.0.3](https://github.com/battis/qui-cli/compare/core/5.0.2...core/5.0.3) (2026-01-18)
|
|
6
25
|
|
|
7
26
|
|
package/dist/Core.d.ts
CHANGED
|
@@ -3,6 +3,15 @@ import * as JackSpeak from './JackSpeak.js';
|
|
|
3
3
|
export { Options } from '@qui-cli/plugin';
|
|
4
4
|
export * from './Usage.js';
|
|
5
5
|
export type Configuration = Plugin.Registrar.Configuration & {
|
|
6
|
+
/**
|
|
7
|
+
* Usage information for plugins is diplayed in LIFO (last-in, first-out)
|
|
8
|
+
* order, putting the plug-in that requires other plug-ins at the top and the
|
|
9
|
+
* plug-ins required by other plug-ins at the bottom.
|
|
10
|
+
*
|
|
11
|
+
* To display plugins in FIFO order (as in qui-cli/core@<6.0.1), set
|
|
12
|
+
* `lifoUsage` to false
|
|
13
|
+
*/
|
|
14
|
+
lifoUsage?: boolean;
|
|
6
15
|
/** @deprecated Use {@link JackSpeak} core plugin */
|
|
7
16
|
core?: JackSpeak.Configuration & {
|
|
8
17
|
/** @deprecated Use {@link Positionals} core plugin */
|
package/dist/Core.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as Colors from '@qui-cli/colors/dist/Colors.js';
|
|
2
1
|
import * as Plugin from '@qui-cli/plugin';
|
|
3
2
|
import * as JackSpeak from './JackSpeak.js';
|
|
4
3
|
import * as Positionals from './Positionals.js';
|
|
5
|
-
import { usage } from './Usage.js';
|
|
6
4
|
export * from './Usage.js';
|
|
7
5
|
let initialized = false;
|
|
6
|
+
let lifoUsage = true;
|
|
8
7
|
export async function configure(config = {}) {
|
|
8
|
+
lifoUsage = Plugin.hydrate(config.lifoUsage, lifoUsage);
|
|
9
9
|
const { core = {}, jackspeak: jackOptions, positionals = {} } = config;
|
|
10
10
|
const { requirePositionals, ...deprecated } = core;
|
|
11
11
|
const jackspeak = {
|
|
@@ -22,13 +22,27 @@ export async function init(externalOptions) {
|
|
|
22
22
|
if (initialized) {
|
|
23
23
|
throw new Error(`Already initialized with user-provided command line arguments.`);
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
if (lifoUsage) {
|
|
26
|
+
// lifo plugin usage order
|
|
27
|
+
if (externalOptions) {
|
|
28
|
+
JackSpeak.args(Plugin.documentDefaults(externalOptions));
|
|
29
|
+
}
|
|
30
|
+
for (const plugin of Plugin.Registrar.registered().toReversed()) {
|
|
31
|
+
if (plugin.options) {
|
|
32
|
+
JackSpeak.args(await plugin.options());
|
|
33
|
+
}
|
|
28
34
|
}
|
|
29
35
|
}
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
else {
|
|
37
|
+
// fifo plugin usage order
|
|
38
|
+
for (const plugin of Plugin.Registrar.registered()) {
|
|
39
|
+
if (plugin.options) {
|
|
40
|
+
JackSpeak.args(await plugin.options());
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (externalOptions) {
|
|
44
|
+
JackSpeak.args(Plugin.documentDefaults(externalOptions));
|
|
45
|
+
}
|
|
32
46
|
}
|
|
33
47
|
const args = JackSpeak.parse();
|
|
34
48
|
await Plugin.Registrar.init(args);
|
|
@@ -36,15 +50,8 @@ export async function init(externalOptions) {
|
|
|
36
50
|
return args;
|
|
37
51
|
}
|
|
38
52
|
export async function run(externalOptions) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
await init(externalOptions);
|
|
42
|
-
}
|
|
43
|
-
return await Plugin.Registrar.run();
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
const error = e;
|
|
47
|
-
console.log(`${Colors.error(error.message)}\n\n${usage()}`);
|
|
48
|
-
process.exit(1);
|
|
53
|
+
if (!initialized) {
|
|
54
|
+
await init(externalOptions);
|
|
49
55
|
}
|
|
56
|
+
return await Plugin.Registrar.run();
|
|
50
57
|
}
|
package/dist/Help.d.ts
CHANGED
|
@@ -7,4 +7,3 @@ export declare const name = "core.help";
|
|
|
7
7
|
export declare function configure(config?: Configuration): void;
|
|
8
8
|
export declare function options(): Plugin.Options;
|
|
9
9
|
export declare function init({ values }: Plugin.ExpectedArguments<typeof options>): void;
|
|
10
|
-
export declare function run(): void;
|
package/dist/Help.js
CHANGED
|
@@ -7,6 +7,7 @@ export function configure(config = {}) {
|
|
|
7
7
|
}
|
|
8
8
|
export function options() {
|
|
9
9
|
return {
|
|
10
|
+
man: [{ level: 1, text: 'Usage information' }],
|
|
10
11
|
flag: {
|
|
11
12
|
help: {
|
|
12
13
|
description: 'Get usage information',
|
|
@@ -17,8 +18,6 @@ export function options() {
|
|
|
17
18
|
}
|
|
18
19
|
export function init({ values }) {
|
|
19
20
|
configure(values);
|
|
20
|
-
}
|
|
21
|
-
export function run() {
|
|
22
21
|
if (help) {
|
|
23
22
|
console.log(Core.usage());
|
|
24
23
|
process.exit(0);
|
package/dist/JackSpeak.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare function toJSON(): {
|
|
|
11
11
|
hint?: string | undefined;
|
|
12
12
|
default?: import("jackspeak").ConfigValue | undefined;
|
|
13
13
|
validOptions?: readonly number[] | readonly string[] | undefined;
|
|
14
|
-
validate?: ((v: unknown) => boolean) | ((v: unknown) => v is import("jackspeak").
|
|
14
|
+
validate?: ((v: unknown) => boolean) | ((v: unknown) => v is import("jackspeak").ConfigValue) | undefined;
|
|
15
15
|
description?: string | undefined;
|
|
16
16
|
short?: string | undefined;
|
|
17
17
|
delim?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qui-cli/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "Core features of @qui-cli/qui-cli",
|
|
5
5
|
"homepage": "https://github.com/battis/qui-cli/tree/main/packages/core#readme",
|
|
6
6
|
"repository": {
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
"main": "./dist/index.js",
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"jackspeak": "^4.
|
|
21
|
-
"wrap-ansi": "^
|
|
20
|
+
"jackspeak": "^4.2.3",
|
|
21
|
+
"wrap-ansi": "^10.0.0",
|
|
22
22
|
"@qui-cli/colors": "3.2.3"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@tsconfig/node24": "^24.0.4",
|
|
26
|
-
"@types/node": "^24.10.
|
|
26
|
+
"@types/node": "^24.10.13",
|
|
27
27
|
"commit-and-tag-version": "^12.6.1",
|
|
28
28
|
"del-cli": "^7.0.0",
|
|
29
29
|
"npm-run-all": "^4.1.5",
|