@qui-cli/core 6.0.0 → 6.0.2
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 +14 -0
- package/dist/Core.d.ts +9 -0
- package/dist/Core.js +22 -6
- package/dist/Help.js +1 -1
- package/dist/JackSpeak.d.ts +1 -1
- package/dist/Positionals.d.ts +1 -0
- package/dist/Positionals.js +16 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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.2](https://github.com/battis/qui-cli/compare/core/6.0.1...core/6.0.2) (2026-02-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* display positional arg documentation ([c97c454](https://github.com/battis/qui-cli/commit/c97c45477df474880b6ae3071d4e9c2f11b17a97))
|
|
11
|
+
|
|
12
|
+
## [6.0.1](https://github.com/battis/qui-cli/compare/core/6.0.0...core/6.0.1) (2026-02-21)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* display plugin usage information in LIFO registration order ([a79c8ed](https://github.com/battis/qui-cli/commit/a79c8ed0e0f8dc0bb45a035909e82af37b7ba350))
|
|
18
|
+
|
|
5
19
|
## [6.0.0](https://github.com/battis/qui-cli/compare/core/5.0.3...core/6.0.0) (2026-01-29)
|
|
6
20
|
|
|
7
21
|
|
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,9 +1,12 @@
|
|
|
1
1
|
import * as Plugin from '@qui-cli/plugin';
|
|
2
|
+
import * as Help from './Help.js';
|
|
2
3
|
import * as JackSpeak from './JackSpeak.js';
|
|
3
4
|
import * as Positionals from './Positionals.js';
|
|
4
5
|
export * from './Usage.js';
|
|
5
6
|
let initialized = false;
|
|
7
|
+
let lifoUsage = true;
|
|
6
8
|
export async function configure(config = {}) {
|
|
9
|
+
lifoUsage = Plugin.hydrate(config.lifoUsage, lifoUsage);
|
|
7
10
|
const { core = {}, jackspeak: jackOptions, positionals = {} } = config;
|
|
8
11
|
const { requirePositionals, ...deprecated } = core;
|
|
9
12
|
const jackspeak = {
|
|
@@ -16,17 +19,30 @@ export async function configure(config = {}) {
|
|
|
16
19
|
}
|
|
17
20
|
await Plugin.Registrar.configure({ positionals, jackspeak });
|
|
18
21
|
}
|
|
22
|
+
function requireUnusedOptions(plugin) {
|
|
23
|
+
return (!!plugin.options &&
|
|
24
|
+
plugin.name !== Positionals.name &&
|
|
25
|
+
plugin.name !== Help.name);
|
|
26
|
+
}
|
|
19
27
|
export async function init(externalOptions) {
|
|
20
28
|
if (initialized) {
|
|
21
29
|
throw new Error(`Already initialized with user-provided command line arguments.`);
|
|
22
30
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
JackSpeak.args(Help.options());
|
|
32
|
+
JackSpeak.args(Positionals.options());
|
|
33
|
+
const usage = [
|
|
34
|
+
...(await Promise.all(Plugin.Registrar.registered()
|
|
35
|
+
.filter(requireUnusedOptions)
|
|
36
|
+
.map(async (plugin) => await plugin.options())))
|
|
37
|
+
];
|
|
28
38
|
if (externalOptions) {
|
|
29
|
-
|
|
39
|
+
usage.push(Plugin.documentDefaults(externalOptions));
|
|
40
|
+
}
|
|
41
|
+
if (lifoUsage) {
|
|
42
|
+
usage.reverse();
|
|
43
|
+
}
|
|
44
|
+
for (const options of usage) {
|
|
45
|
+
JackSpeak.args(options);
|
|
30
46
|
}
|
|
31
47
|
const args = JackSpeak.parse();
|
|
32
48
|
await Plugin.Registrar.init(args);
|
package/dist/Help.js
CHANGED
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/dist/Positionals.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export declare function maximumUnnamedCount(): number | undefined;
|
|
|
41
41
|
* @param maxUnnamed Number of optional args to allow
|
|
42
42
|
*/
|
|
43
43
|
export declare function requireNoMoreThanUnnamedArgs(maxUnnamed: number): void;
|
|
44
|
+
export declare function options(): Plugin.Options;
|
|
44
45
|
export declare function init(args: Plugin.ExpectedArguments<() => Plugin.Options>): void;
|
|
45
46
|
export declare function usageArgs(): string;
|
|
46
47
|
export declare function usage(usage: string, isMarkdown?: boolean): string;
|
package/dist/Positionals.js
CHANGED
|
@@ -109,6 +109,22 @@ export function requireNoMoreThanUnnamedArgs(maxUnnamed) {
|
|
|
109
109
|
}
|
|
110
110
|
requireNoMoreThan(namedCount() + maxUnnamed);
|
|
111
111
|
}
|
|
112
|
+
export function options() {
|
|
113
|
+
const man = [];
|
|
114
|
+
for (const arg in configSet) {
|
|
115
|
+
man.push({
|
|
116
|
+
level: 2,
|
|
117
|
+
text: `${Colors.positionalArg(arg)}${configSet[arg].hint ? `=<${configSet[arg].hint}>` : ''}`
|
|
118
|
+
});
|
|
119
|
+
if (configSet[arg].description) {
|
|
120
|
+
man.push({ text: configSet[arg].description });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (man.length > 0) {
|
|
124
|
+
man.unshift({ level: 1, text: 'Positional arguments' });
|
|
125
|
+
}
|
|
126
|
+
return { man };
|
|
127
|
+
}
|
|
112
128
|
export function init(args) {
|
|
113
129
|
positionals = [...args.positionals];
|
|
114
130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qui-cli/core",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
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",
|