@qui-cli/core 4.1.0 → 5.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 +30 -11
- package/README.md +17 -7
- package/dist/Core.d.ts +2 -3
- package/dist/Core.js +1 -9
- package/dist/Help.d.ts +1 -0
- package/dist/JackSpeak.d.ts +13 -0
- package/dist/JackSpeak.js +3 -0
- package/dist/Positionals.d.ts +5 -0
- package/package.json +6 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,35 +2,54 @@
|
|
|
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
|
-
## [
|
|
5
|
+
## [5.0.1](https://github.com/battis/qui-cli/compare/core/5.0.0...core/5.0.1) (2025-12-19)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* update documentation to reflect current core plugin model ([dbb3f26](https://github.com/battis/qui-cli/commit/dbb3f269d3dc3996c1d7050eb3a1acfdd08ab640))
|
|
11
|
+
|
|
12
|
+
## [5.0.0](https://github.com/battis/qui-cli/compare/core/4.1.0...core/5.0.0) (2025-11-07)
|
|
13
|
+
|
|
14
|
+
### ⚠ BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
- group arguments by plugin in usage
|
|
17
|
+
- **plugin@4.0.0** auto-document default arg values
|
|
6
18
|
|
|
19
|
+
### revert
|
|
20
|
+
|
|
21
|
+
- group arguments by plugin in usage ([ec3d4bf](https://github.com/battis/qui-cli/commit/ec3d4bf6ef9c59a6da3ede8603554d2dcd2581ad))
|
|
22
|
+
- **plugin@4.0.0** auto-document default arg values ([e01e157](https://github.com/battis/qui-cli/commit/e01e157f06a3a801628ca79366e3f0060be2322e))
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
- merge plugin option in Plugin.Registrar, not in Core ([9a7464f](https://github.com/battis/qui-cli/commit/9a7464fab863c7a9005ade54703726cc9679c8c4))
|
|
27
|
+
|
|
28
|
+
## [4.1.0](https://github.com/battis/qui-cli/compare/core/4.0.1...core/4.1.0) (2025-11-04)
|
|
7
29
|
|
|
8
30
|
### Features
|
|
9
31
|
|
|
10
|
-
|
|
32
|
+
- support scripting markdown documentation for commands ([03ee6d5](https://github.com/battis/qui-cli/commit/03ee6d55f86f6d7b45bd205896cb0fb6a21523b5))
|
|
11
33
|
|
|
12
34
|
## [4.0.1](https://github.com/battis/qui-cli/compare/core/4.0.0...core/4.0.1) (2025-08-04)
|
|
13
35
|
|
|
14
|
-
|
|
15
36
|
### Bug Fixes
|
|
16
37
|
|
|
17
|
-
|
|
38
|
+
- update lagging peer dependency specs ([30c0c27](https://github.com/battis/qui-cli/commit/30c0c279d4247a69a30efef8a7426442752cd9c0))
|
|
18
39
|
|
|
19
40
|
## [4.0.0](https://github.com/battis/qui-cli/compare/core/3.1.0...core/4.0.0) (2025-08-02)
|
|
20
41
|
|
|
21
|
-
|
|
22
42
|
### ⚠ BREAKING CHANGES
|
|
23
43
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* rename @battis/qui-cli.core --> @qui-cli/core ([43367e9](https://github.com/battis/qui-cli/commit/43367e9d4316aa22fb28078e9436e6de35564f1f))
|
|
44
|
+
- rename @battis/qui-cli.core --> @qui-cli/core
|
|
27
45
|
|
|
46
|
+
- rename @battis/qui-cli.core --> @qui-cli/core ([43367e9](https://github.com/battis/qui-cli/commit/43367e9d4316aa22fb28078e9436e6de35564f1f))
|
|
28
47
|
|
|
29
48
|
### Bug Fixes
|
|
30
49
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
50
|
+
- update dependencies to renamed @qui-cli/colors ([ff80e86](https://github.com/battis/qui-cli/commit/ff80e8625ef98834afdf04e57bfedb1906834e2b))
|
|
51
|
+
- update dependencies to renamed @qui-cli/log ([1c8f0fb](https://github.com/battis/qui-cli/commit/1c8f0fbd5561b4274032382c5d10d33912956e7f))
|
|
52
|
+
- update dependencies to renamed @qui-cli/plugin ([117ea85](https://github.com/battis/qui-cli/commit/117ea85256ec69c807c5b56293546d9c350fd43f))
|
|
34
53
|
|
|
35
54
|
## [3.1.0](https://github.com/battis/qui-cli/compare/core/3.0.0...core/3.1.0) (2025-08-01)
|
|
36
55
|
|
package/README.md
CHANGED
|
@@ -44,19 +44,29 @@ See [examples](https://github.com/battis/qui-cli/tree/main/examples#readme) for
|
|
|
44
44
|
|
|
45
45
|
Three core plugins are registered automatically to provide consistent functionality.
|
|
46
46
|
|
|
47
|
-
### `
|
|
47
|
+
### `JackSpeak`
|
|
48
48
|
|
|
49
|
-
Manages any custom [jackspeak](https://www.npmjs.com/package/jackspeak#user-content-jackoptions-jackoptions----jack) options. As with any other plugin, it can be configured via `
|
|
49
|
+
Manages any custom [jackspeak](https://www.npmjs.com/package/jackspeak#user-content-jackoptions-jackoptions----jack) options. As with any other plugin, it can be configured via `configure()`:
|
|
50
50
|
|
|
51
51
|
```ts
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
import { Core, JackSpeak } from '@qui-cli/core';
|
|
53
|
+
|
|
54
|
+
await JackSpeak.configure({
|
|
55
|
+
envPrefix: 'MY_APP'
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
await Core.init({
|
|
59
|
+
foo: {
|
|
60
|
+
description: 'bar'
|
|
55
61
|
}
|
|
56
62
|
});
|
|
63
|
+
|
|
64
|
+
await Core.run();
|
|
65
|
+
|
|
66
|
+
console.log(process.env.MY_APP_FOO);
|
|
57
67
|
```
|
|
58
68
|
|
|
59
|
-
### `
|
|
69
|
+
### `Positionals`
|
|
60
70
|
|
|
61
71
|
Provides per-plugin positonal argument management and documentation. Individual plugins can require named positional arguments, which are collected and documented by `usage()` and accessible throgh the `Positionals` plugin.
|
|
62
72
|
|
|
@@ -97,7 +107,7 @@ Positionals.setMinArg(6);
|
|
|
97
107
|
Positionals.setMaxArg(4);
|
|
98
108
|
```
|
|
99
109
|
|
|
100
|
-
### `
|
|
110
|
+
### `Help`
|
|
101
111
|
|
|
102
112
|
Provides consistent `--help` (`-h`) flag for all commands that displays usage. No confiuration.
|
|
103
113
|
|
package/dist/Core.d.ts
CHANGED
|
@@ -3,13 +3,12 @@ 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
|
-
/** @deprecated Use
|
|
6
|
+
/** @deprecated Use {@link JackSpeak} core plugin */
|
|
7
7
|
core?: JackSpeak.Configuration & {
|
|
8
|
-
/** @deprecated Use
|
|
8
|
+
/** @deprecated Use {@link Positionals} core plugin */
|
|
9
9
|
requirePositionals?: boolean | number;
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
export declare function configure(config?: Configuration): Promise<void>;
|
|
13
|
-
export declare function options(externalOptions?: Plugin.Options): Promise<Plugin.Options>;
|
|
14
13
|
export declare function init(externalOptions?: Plugin.Options): Promise<Plugin.Arguments<Plugin.Options>>;
|
|
15
14
|
export declare function run(externalOptions?: Plugin.Options): Promise<Plugin.AccumulatedResults | undefined>;
|
package/dist/Core.js
CHANGED
|
@@ -18,14 +18,6 @@ export async function configure(config = {}) {
|
|
|
18
18
|
}
|
|
19
19
|
await Plugin.Registrar.configure({ positionals, jackspeak });
|
|
20
20
|
}
|
|
21
|
-
export async function options(externalOptions = {}) {
|
|
22
|
-
/*
|
|
23
|
-
* TODO automate default value documentation
|
|
24
|
-
Issue URL: https://github.com/battis/qui-cli/issues/38
|
|
25
|
-
* Including parsing `env` (#34) and `secret` (#33) fields
|
|
26
|
-
*/
|
|
27
|
-
return Plugin.mergeOptions(await Plugin.Registrar.options(), externalOptions);
|
|
28
|
-
}
|
|
29
21
|
export async function init(externalOptions) {
|
|
30
22
|
if (initialized) {
|
|
31
23
|
throw new Error(`Already initialized with user-provided command line arguments.`);
|
|
@@ -36,7 +28,7 @@ export async function init(externalOptions) {
|
|
|
36
28
|
}
|
|
37
29
|
}
|
|
38
30
|
if (externalOptions) {
|
|
39
|
-
JackSpeak.args(externalOptions);
|
|
31
|
+
JackSpeak.args(Plugin.documentDefaults(externalOptions));
|
|
40
32
|
}
|
|
41
33
|
const args = JackSpeak.parse();
|
|
42
34
|
await Plugin.Registrar.init(args);
|
package/dist/Help.d.ts
CHANGED
package/dist/JackSpeak.d.ts
CHANGED
|
@@ -6,5 +6,18 @@ export declare function jack(): Jack<{}>;
|
|
|
6
6
|
export declare function configure(config?: Configuration): void;
|
|
7
7
|
export declare function args(options: Plugin.Options): void;
|
|
8
8
|
export declare function parse(): import("jackspeak").Parsed<{}>;
|
|
9
|
+
export declare function toJSON(): {
|
|
10
|
+
[k: string]: {
|
|
11
|
+
hint?: string | undefined;
|
|
12
|
+
default?: import("jackspeak").ConfigValue | undefined;
|
|
13
|
+
validOptions?: readonly number[] | readonly string[] | undefined;
|
|
14
|
+
validate?: ((v: unknown) => boolean) | ((v: unknown) => v is import("jackspeak").ValidValue<import("jackspeak").ConfigType, boolean>) | undefined;
|
|
15
|
+
description?: string | undefined;
|
|
16
|
+
short?: string | undefined;
|
|
17
|
+
delim?: string | undefined;
|
|
18
|
+
multiple?: boolean | undefined;
|
|
19
|
+
type: import("jackspeak").ConfigType;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
9
22
|
export declare function usage(): string;
|
|
10
23
|
export declare function usageMarkdown(): string;
|
package/dist/JackSpeak.js
CHANGED
package/dist/Positionals.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import * as Plugin from '@qui-cli/plugin';
|
|
2
2
|
type PositionalConfig = {
|
|
3
|
+
/** Description of the purpose of the positional argument */
|
|
3
4
|
description?: string;
|
|
5
|
+
/** Hint about the value of the positional argument */
|
|
4
6
|
hint?: string;
|
|
7
|
+
/** Must return true for the argument to be accepted */
|
|
5
8
|
validate?: (v?: string) => boolean | string;
|
|
6
9
|
};
|
|
7
10
|
type PositionalConfigSet = Record<string, PositionalConfig>;
|
|
8
11
|
export type Configuration = Plugin.Configuration & {
|
|
12
|
+
/** Minimum number of accepted positional arguments */
|
|
9
13
|
min?: number;
|
|
14
|
+
/** Maximum number of accepted positional arguments */
|
|
10
15
|
max?: number;
|
|
11
16
|
};
|
|
12
17
|
export declare const name = "positionals";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qui-cli/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.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": {
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"jackspeak": "^4.1.1",
|
|
21
|
-
"wrap-ansi": "^9.0.2"
|
|
21
|
+
"wrap-ansi": "^9.0.2",
|
|
22
|
+
"@qui-cli/colors": "3.1.1"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@tsconfig/node20": "^20.1.6",
|
|
@@ -26,13 +27,11 @@
|
|
|
26
27
|
"commit-and-tag-version": "^12.6.0",
|
|
27
28
|
"del-cli": "^6.0.0",
|
|
28
29
|
"npm-run-all": "^4.1.5",
|
|
29
|
-
"typescript": "
|
|
30
|
-
"@qui-cli/plugin": "
|
|
31
|
-
"@qui-cli/colors": "3.0.1"
|
|
30
|
+
"typescript": "^5.9.3",
|
|
31
|
+
"@qui-cli/plugin": "4.0.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@qui-cli/
|
|
35
|
-
"@qui-cli/plugin": "3.x"
|
|
34
|
+
"@qui-cli/plugin": "4.x"
|
|
36
35
|
},
|
|
37
36
|
"target": "node",
|
|
38
37
|
"scripts": {
|