@vltpkg/cli-sdk 0.0.0-3 → 0.0.0-31
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/README.md +3 -0
- package/dist/esm/commands/build.d.ts +25 -0
- package/dist/esm/commands/build.d.ts.map +1 -0
- package/dist/esm/commands/build.js +102 -0
- package/dist/esm/commands/build.js.map +1 -0
- package/dist/esm/commands/cache.d.ts +65 -0
- package/dist/esm/commands/cache.d.ts.map +1 -0
- package/dist/esm/commands/cache.js +257 -0
- package/dist/esm/commands/cache.js.map +1 -0
- package/dist/esm/commands/ci.d.ts +11 -0
- package/dist/esm/commands/ci.d.ts.map +1 -0
- package/dist/esm/commands/ci.js +32 -0
- package/dist/esm/commands/ci.js.map +1 -0
- package/dist/esm/commands/config.d.ts +3 -2
- package/dist/esm/commands/config.d.ts.map +1 -1
- package/dist/esm/commands/config.js +372 -101
- package/dist/esm/commands/config.js.map +1 -1
- package/dist/esm/commands/exec-cache.d.ts +49 -0
- package/dist/esm/commands/exec-cache.d.ts.map +1 -0
- package/dist/esm/commands/exec-cache.js +146 -0
- package/dist/esm/commands/exec-cache.js.map +1 -0
- package/dist/esm/commands/exec-local.d.ts +6 -0
- package/dist/esm/commands/exec-local.d.ts.map +1 -0
- package/dist/esm/commands/exec-local.js +24 -0
- package/dist/esm/commands/exec-local.js.map +1 -0
- package/dist/esm/commands/exec.d.ts +4 -0
- package/dist/esm/commands/exec.d.ts.map +1 -1
- package/dist/esm/commands/exec.js +75 -10
- package/dist/esm/commands/exec.js.map +1 -1
- package/dist/esm/commands/help.d.ts +1 -1
- package/dist/esm/commands/help.d.ts.map +1 -1
- package/dist/esm/commands/help.js +25 -3
- package/dist/esm/commands/help.js.map +1 -1
- package/dist/esm/commands/init.d.ts +4 -5
- package/dist/esm/commands/init.d.ts.map +1 -1
- package/dist/esm/commands/init.js +95 -9
- package/dist/esm/commands/init.js.map +1 -1
- package/dist/esm/commands/install/reporter.d.ts +3 -2
- package/dist/esm/commands/install/reporter.d.ts.map +1 -1
- package/dist/esm/commands/install/reporter.js +43 -15
- package/dist/esm/commands/install/reporter.js.map +1 -1
- package/dist/esm/commands/install.d.ts +24 -3
- package/dist/esm/commands/install.d.ts.map +1 -1
- package/dist/esm/commands/install.js +27 -3
- package/dist/esm/commands/install.js.map +1 -1
- package/dist/esm/commands/list.d.ts +1 -1
- package/dist/esm/commands/list.d.ts.map +1 -1
- package/dist/esm/commands/list.js +150 -42
- package/dist/esm/commands/list.js.map +1 -1
- package/dist/esm/commands/pack.d.ts +32 -0
- package/dist/esm/commands/pack.d.ts.map +1 -0
- package/dist/esm/commands/pack.js +147 -0
- package/dist/esm/commands/pack.js.map +1 -0
- package/dist/esm/commands/pkg.d.ts +2 -3
- package/dist/esm/commands/pkg.d.ts.map +1 -1
- package/dist/esm/commands/pkg.js +123 -38
- package/dist/esm/commands/pkg.js.map +1 -1
- package/dist/esm/commands/publish.d.ts +22 -0
- package/dist/esm/commands/publish.d.ts.map +1 -0
- package/dist/esm/commands/publish.js +239 -0
- package/dist/esm/commands/publish.js.map +1 -0
- package/dist/esm/commands/query.d.ts +1 -1
- package/dist/esm/commands/query.d.ts.map +1 -1
- package/dist/esm/commands/query.js +171 -32
- package/dist/esm/commands/query.js.map +1 -1
- package/dist/esm/commands/run-exec.d.ts +1 -0
- package/dist/esm/commands/run-exec.d.ts.map +1 -1
- package/dist/esm/commands/run-exec.js +1 -0
- package/dist/esm/commands/run-exec.js.map +1 -1
- package/dist/esm/commands/run.d.ts +1 -0
- package/dist/esm/commands/run.d.ts.map +1 -1
- package/dist/esm/commands/run.js +13 -16
- package/dist/esm/commands/run.js.map +1 -1
- package/dist/esm/commands/serve.d.ts +14 -0
- package/dist/esm/commands/serve.d.ts.map +1 -0
- package/dist/esm/commands/serve.js +103 -0
- package/dist/esm/commands/serve.js.map +1 -0
- package/dist/esm/commands/uninstall.d.ts +13 -1
- package/dist/esm/commands/uninstall.d.ts.map +1 -1
- package/dist/esm/commands/uninstall.js +12 -1
- package/dist/esm/commands/uninstall.js.map +1 -1
- package/dist/esm/commands/update.d.ts +14 -0
- package/dist/esm/commands/update.d.ts.map +1 -0
- package/dist/esm/commands/update.js +41 -0
- package/dist/esm/commands/update.js.map +1 -0
- package/dist/esm/commands/version.d.ts +26 -0
- package/dist/esm/commands/version.d.ts.map +1 -0
- package/dist/esm/commands/version.js +226 -0
- package/dist/esm/commands/version.js.map +1 -0
- package/dist/esm/commands/whoami.d.ts +4 -2
- package/dist/esm/commands/whoami.d.ts.map +1 -1
- package/dist/esm/commands/whoami.js +1 -1
- package/dist/esm/commands/whoami.js.map +1 -1
- package/dist/esm/config/definition.d.ts +117 -10
- package/dist/esm/config/definition.d.ts.map +1 -1
- package/dist/esm/config/definition.js +203 -31
- package/dist/esm/config/definition.js.map +1 -1
- package/dist/esm/config/index.d.ts +46 -40
- package/dist/esm/config/index.d.ts.map +1 -1
- package/dist/esm/config/index.js +126 -176
- package/dist/esm/config/index.js.map +1 -1
- package/dist/esm/config/merge.d.ts +3 -1
- package/dist/esm/config/merge.d.ts.map +1 -1
- package/dist/esm/config/merge.js +11 -6
- package/dist/esm/config/merge.js.map +1 -1
- package/dist/esm/config/usage.d.ts +3 -2
- package/dist/esm/config/usage.d.ts.map +1 -1
- package/dist/esm/config/usage.js.map +1 -1
- package/dist/esm/exec-command.d.ts +33 -14
- package/dist/esm/exec-command.d.ts.map +1 -1
- package/dist/esm/exec-command.js +214 -65
- package/dist/esm/exec-command.js.map +1 -1
- package/dist/esm/index.d.ts +1 -14
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +46 -20
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/load-command.d.ts +16 -0
- package/dist/esm/load-command.d.ts.map +1 -0
- package/dist/esm/load-command.js +21 -0
- package/dist/esm/load-command.js.map +1 -0
- package/dist/esm/output.d.ts +6 -10
- package/dist/esm/output.d.ts.map +1 -1
- package/dist/esm/output.js +63 -33
- package/dist/esm/output.js.map +1 -1
- package/dist/esm/pack-tarball.d.ts +22 -0
- package/dist/esm/pack-tarball.d.ts.map +1 -0
- package/dist/esm/pack-tarball.js +247 -0
- package/dist/esm/pack-tarball.js.map +1 -0
- package/dist/esm/parse-add-remove-args.d.ts +1 -1
- package/dist/esm/parse-add-remove-args.d.ts.map +1 -1
- package/dist/esm/parse-add-remove-args.js +1 -1
- package/dist/esm/parse-add-remove-args.js.map +1 -1
- package/dist/esm/print-err.d.ts +12 -1
- package/dist/esm/print-err.d.ts.map +1 -1
- package/dist/esm/print-err.js +157 -26
- package/dist/esm/print-err.js.map +1 -1
- package/dist/esm/query-host-contexts.d.ts +16 -0
- package/dist/esm/query-host-contexts.d.ts.map +1 -0
- package/dist/esm/query-host-contexts.js +135 -0
- package/dist/esm/query-host-contexts.js.map +1 -0
- package/dist/esm/start-gui.d.ts +7 -33
- package/dist/esm/start-gui.d.ts.map +1 -1
- package/dist/esm/start-gui.js +51 -349
- package/dist/esm/start-gui.js.map +1 -1
- package/dist/esm/view.d.ts +2 -3
- package/dist/esm/view.d.ts.map +1 -1
- package/dist/esm/view.js +1 -1
- package/dist/esm/view.js.map +1 -1
- package/package.json +73 -45
- package/dist/esm/commands/gui.d.ts +0 -6
- package/dist/esm/commands/gui.d.ts.map +0 -1
- package/dist/esm/commands/gui.js +0 -14
- package/dist/esm/commands/gui.js.map +0 -1
- package/dist/esm/commands/install-exec.d.ts +0 -4
- package/dist/esm/commands/install-exec.d.ts.map +0 -1
- package/dist/esm/commands/install-exec.js +0 -13
- package/dist/esm/commands/install-exec.js.map +0 -1
- package/dist/esm/ignored-homedir-folder-names.d.ts +0 -7
- package/dist/esm/ignored-homedir-folder-names.d.ts.map +0 -1
- package/dist/esm/ignored-homedir-folder-names.js +0 -35
- package/dist/esm/ignored-homedir-folder-names.js.map +0 -1
- package/dist/esm/project-info.d.ts +0 -32
- package/dist/esm/project-info.d.ts.map +0 -1
- package/dist/esm/project-info.js +0 -90
- package/dist/esm/project-info.js.map +0 -1
- package/dist/esm/read-project-folders.d.ts +0 -27
- package/dist/esm/read-project-folders.d.ts.map +0 -1
- package/dist/esm/read-project-folders.js +0 -66
- package/dist/esm/read-project-folders.js.map +0 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { JSONField } from '@vltpkg/types';
|
|
2
2
|
import type { CommandFn, CommandUsage } from '../index.ts';
|
|
3
|
-
import type { Views } from '../view.ts';
|
|
4
3
|
export declare const usage: CommandUsage;
|
|
5
4
|
type CommandResult = {
|
|
6
5
|
username?: JSONField;
|
|
7
6
|
};
|
|
8
|
-
export declare const views:
|
|
7
|
+
export declare const views: {
|
|
8
|
+
readonly human: (r: CommandResult) => JSONField;
|
|
9
|
+
readonly json: (r: CommandResult) => CommandResult;
|
|
10
|
+
};
|
|
9
11
|
export declare const command: CommandFn<CommandResult>;
|
|
10
12
|
export {};
|
|
11
13
|
//# sourceMappingURL=whoami.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whoami.d.ts","sourceRoot":"","sources":["../../../src/commands/whoami.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"whoami.d.ts","sourceRoot":"","sources":["../../../src/commands/whoami.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG1D,eAAO,MAAM,KAAK,EAAE,YAMhB,CAAA;AAEJ,KAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,KAAK;;;CAGuB,CAAA;AAEzC,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,aAAa,CAQ5C,CAAA"}
|
|
@@ -12,7 +12,7 @@ export const views = {
|
|
|
12
12
|
};
|
|
13
13
|
export const command = async (conf) => {
|
|
14
14
|
const rc = new RegistryClient(conf.options);
|
|
15
|
-
const response = await rc.request(new URL('-/whoami', conf.options.registry), {
|
|
15
|
+
const response = await rc.request(new URL('-/whoami', conf.options.registry), { useCache: false });
|
|
16
16
|
const { username } = response.json();
|
|
17
17
|
return { username };
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whoami.js","sourceRoot":"","sources":["../../../src/commands/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAIjD,MAAM,CAAC,MAAM,KAAK,GAAiB,GAAG,EAAE,CACtC,YAAY,CAAC;IACX,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,WAAW,EAAE;+CAC8B;CAC5C,CAAC,CAAA;AAMJ,MAAM,CAAC,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"whoami.js","sourceRoot":"","sources":["../../../src/commands/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAIjD,MAAM,CAAC,MAAM,KAAK,GAAiB,GAAG,EAAE,CACtC,YAAY,CAAC;IACX,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,WAAW,EAAE;+CAC8B;CAC5C,CAAC,CAAA;AAMJ,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;IACtB,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;CAC2B,CAAA;AAEzC,MAAM,CAAC,MAAM,OAAO,GAA6B,KAAK,EAAC,IAAI,EAAC,EAAE;IAC5D,MAAM,EAAE,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,OAAO,CAC/B,IAAI,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAC1C,EAAE,QAAQ,EAAE,KAAK,EAAE,CACpB,CAAA;IACD,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAA;IACpC,OAAO,EAAE,QAAQ,EAAE,CAAA;AACrB,CAAC,CAAA","sourcesContent":["import { RegistryClient } from '@vltpkg/registry-client'\nimport type { JSONField } from '@vltpkg/types'\nimport { commandUsage } from '../config/usage.ts'\nimport type { CommandFn, CommandUsage } from '../index.ts'\nimport type { Views } from '../view.ts'\n\nexport const usage: CommandUsage = () =>\n commandUsage({\n command: 'whoami',\n usage: [''],\n description: `Look up the username for the currently active token,\n when logged into a registry.`,\n })\n\ntype CommandResult = {\n username?: JSONField\n}\n\nexport const views = {\n human: r => r.username,\n json: r => r,\n} as const satisfies Views<CommandResult>\n\nexport const command: CommandFn<CommandResult> = async conf => {\n const rc = new RegistryClient(conf.options)\n const response = await rc.request(\n new URL('-/whoami', conf.options.registry),\n { useCache: false },\n )\n const { username } = response.json()\n return { username }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const defaultView: string;
|
|
2
|
+
export declare const defaultEditor: () => string;
|
|
2
3
|
/**
|
|
3
4
|
* Command aliases mapped to their canonical names
|
|
4
5
|
*/
|
|
@@ -11,27 +12,35 @@ export declare const commands: {
|
|
|
11
12
|
readonly 'run-script': "run";
|
|
12
13
|
readonly rx: "run-exec";
|
|
13
14
|
readonly x: "exec";
|
|
15
|
+
readonly xl: "exec-local";
|
|
14
16
|
readonly h: "help";
|
|
15
17
|
readonly '?': "help";
|
|
16
|
-
readonly conf: "config";
|
|
17
|
-
readonly ix: "install-exec";
|
|
18
18
|
readonly ls: "list";
|
|
19
|
+
readonly xc: "exec-cache";
|
|
20
|
+
readonly build: "build";
|
|
21
|
+
readonly cache: "cache";
|
|
22
|
+
readonly ci: "ci";
|
|
19
23
|
readonly config: "config";
|
|
20
24
|
readonly exec: "exec";
|
|
21
|
-
readonly
|
|
25
|
+
readonly 'exec-local': "exec-local";
|
|
22
26
|
readonly help: "help";
|
|
23
27
|
readonly init: "init";
|
|
24
|
-
readonly 'install-exec': "install-exec";
|
|
25
28
|
readonly install: "install";
|
|
26
29
|
readonly login: "login";
|
|
27
30
|
readonly logout: "logout";
|
|
28
31
|
readonly list: "list";
|
|
32
|
+
readonly pack: "pack";
|
|
29
33
|
readonly pkg: "pkg";
|
|
34
|
+
readonly publish: "publish";
|
|
30
35
|
readonly query: "query";
|
|
31
36
|
readonly 'run-exec': "run-exec";
|
|
32
37
|
readonly run: "run";
|
|
38
|
+
readonly serve: "serve";
|
|
33
39
|
readonly token: "token";
|
|
34
40
|
readonly uninstall: "uninstall";
|
|
41
|
+
readonly update: "update";
|
|
42
|
+
readonly 'exec-cache': "exec-cache";
|
|
43
|
+
readonly version: "version";
|
|
35
44
|
readonly whoami: "whoami";
|
|
36
45
|
};
|
|
37
46
|
/**
|
|
@@ -43,7 +52,7 @@ export declare const getCommand: (s?: string) => Commands[keyof Commands] | unde
|
|
|
43
52
|
/**
|
|
44
53
|
* Fields that are parsed as a set of key=value pairs
|
|
45
54
|
*/
|
|
46
|
-
export declare const recordFields: readonly ["git-hosts", "registries", "git-host-archives", "scope-registries"];
|
|
55
|
+
export declare const recordFields: readonly ["git-hosts", "registries", "git-host-archives", "scope-registries", "jsr-registries"];
|
|
47
56
|
export type RecordField = (typeof recordFields)[number];
|
|
48
57
|
export declare const isRecordField: (s: string) => s is RecordField;
|
|
49
58
|
export declare const definition: import("jackspeak").Jack<{
|
|
@@ -75,6 +84,10 @@ export declare const definition: import("jackspeak").Jack<{
|
|
|
75
84
|
hint: string;
|
|
76
85
|
description: string;
|
|
77
86
|
};
|
|
87
|
+
'jsr-registries': {
|
|
88
|
+
hint: string;
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
78
91
|
'git-hosts': {
|
|
79
92
|
hint: string;
|
|
80
93
|
short: string;
|
|
@@ -88,6 +101,7 @@ export declare const definition: import("jackspeak").Jack<{
|
|
|
88
101
|
} & {
|
|
89
102
|
registries: import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
90
103
|
'scope-registries': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
104
|
+
'jsr-registries': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
91
105
|
'git-hosts': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
92
106
|
'git-host-archives': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
93
107
|
} & {
|
|
@@ -151,11 +165,17 @@ export declare const definition: import("jackspeak").Jack<{
|
|
|
151
165
|
description: string;
|
|
152
166
|
default: number;
|
|
153
167
|
};
|
|
168
|
+
'stale-while-revalidate-factor': {
|
|
169
|
+
hint: string;
|
|
170
|
+
default: number;
|
|
171
|
+
description: string;
|
|
172
|
+
};
|
|
154
173
|
} & {
|
|
155
174
|
'fetch-retries': import("jackspeak").ConfigOption<"number", false, readonly number[] | undefined>;
|
|
156
175
|
'fetch-retry-factor': import("jackspeak").ConfigOption<"number", false, readonly number[] | undefined>;
|
|
157
176
|
'fetch-retry-mintimeout': import("jackspeak").ConfigOption<"number", false, readonly number[] | undefined>;
|
|
158
177
|
'fetch-retry-maxtimeout': import("jackspeak").ConfigOption<"number", false, readonly number[] | undefined>;
|
|
178
|
+
'stale-while-revalidate-factor': import("jackspeak").ConfigOption<"number", false, readonly number[] | undefined>;
|
|
159
179
|
} & {
|
|
160
180
|
identity: {
|
|
161
181
|
short: string;
|
|
@@ -179,6 +199,26 @@ export declare const definition: import("jackspeak").Jack<{
|
|
|
179
199
|
} & {
|
|
180
200
|
workspace: import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
181
201
|
'workspace-group': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
202
|
+
} & {
|
|
203
|
+
scope: {
|
|
204
|
+
short: string;
|
|
205
|
+
hint: string;
|
|
206
|
+
description: string;
|
|
207
|
+
};
|
|
208
|
+
target: {
|
|
209
|
+
short: string;
|
|
210
|
+
hint: string;
|
|
211
|
+
description: string;
|
|
212
|
+
};
|
|
213
|
+
} & {
|
|
214
|
+
scope: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
215
|
+
target: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
216
|
+
} & {
|
|
217
|
+
'if-present': {
|
|
218
|
+
description: string;
|
|
219
|
+
};
|
|
220
|
+
} & {
|
|
221
|
+
'if-present': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
182
222
|
} & {
|
|
183
223
|
recursive: {
|
|
184
224
|
short: string;
|
|
@@ -201,7 +241,7 @@ export declare const definition: import("jackspeak").Jack<{
|
|
|
201
241
|
config: {
|
|
202
242
|
hint: string;
|
|
203
243
|
description: string;
|
|
204
|
-
validOptions: readonly ["user", "project"];
|
|
244
|
+
validOptions: readonly ["all", "user", "project"];
|
|
205
245
|
default: string;
|
|
206
246
|
};
|
|
207
247
|
editor: {
|
|
@@ -236,7 +276,7 @@ export declare const definition: import("jackspeak").Jack<{
|
|
|
236
276
|
hint: string;
|
|
237
277
|
default: string;
|
|
238
278
|
description: string;
|
|
239
|
-
validOptions: readonly ["human", "json", "mermaid", "gui", "inspect"];
|
|
279
|
+
validOptions: readonly ["human", "json", "mermaid", "gui", "inspect", "silent"];
|
|
240
280
|
};
|
|
241
281
|
} & {
|
|
242
282
|
view: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
@@ -269,18 +309,85 @@ export declare const definition: import("jackspeak").Jack<{
|
|
|
269
309
|
'save-peer': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
270
310
|
'save-prod': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
271
311
|
} & {
|
|
272
|
-
|
|
273
|
-
|
|
312
|
+
'expect-results': {
|
|
313
|
+
hint: string;
|
|
314
|
+
validate: (v: unknown) => boolean;
|
|
274
315
|
description: string;
|
|
275
316
|
};
|
|
276
317
|
} & {
|
|
277
|
-
|
|
318
|
+
'expect-results': import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
278
319
|
} & {
|
|
320
|
+
'dry-run': {
|
|
321
|
+
description: string;
|
|
322
|
+
};
|
|
323
|
+
'expect-lockfile': {
|
|
324
|
+
description: string;
|
|
325
|
+
};
|
|
326
|
+
'frozen-lockfile': {
|
|
327
|
+
description: string;
|
|
328
|
+
};
|
|
329
|
+
'lockfile-only': {
|
|
330
|
+
description: string;
|
|
331
|
+
};
|
|
332
|
+
} & {
|
|
333
|
+
'dry-run': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
334
|
+
'expect-lockfile': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
335
|
+
'frozen-lockfile': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
336
|
+
'lockfile-only': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
337
|
+
} & {
|
|
338
|
+
'allow-scripts': {
|
|
339
|
+
hint: string;
|
|
340
|
+
description: string;
|
|
341
|
+
};
|
|
342
|
+
} & {
|
|
343
|
+
'allow-scripts': import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
344
|
+
} & {
|
|
345
|
+
access: {
|
|
346
|
+
description: string;
|
|
347
|
+
validOptions: readonly ["public", "restricted"];
|
|
348
|
+
default: string;
|
|
349
|
+
};
|
|
350
|
+
} & {
|
|
351
|
+
access: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
352
|
+
} & {
|
|
353
|
+
otp: {
|
|
354
|
+
description: string;
|
|
355
|
+
};
|
|
356
|
+
'publish-directory': {
|
|
357
|
+
hint: string;
|
|
358
|
+
description: string;
|
|
359
|
+
};
|
|
360
|
+
port: {
|
|
361
|
+
hint: string;
|
|
362
|
+
description: string;
|
|
363
|
+
};
|
|
364
|
+
'registry-port': {
|
|
365
|
+
hint: string;
|
|
366
|
+
description: string;
|
|
367
|
+
};
|
|
368
|
+
} & {
|
|
369
|
+
otp: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
370
|
+
'publish-directory': import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
371
|
+
port: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
372
|
+
'registry-port': import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
373
|
+
} & {
|
|
374
|
+
yes: {
|
|
375
|
+
short: string;
|
|
376
|
+
description: string;
|
|
377
|
+
};
|
|
378
|
+
version: {
|
|
379
|
+
short: string;
|
|
380
|
+
description: string;
|
|
381
|
+
};
|
|
279
382
|
help: {
|
|
280
383
|
short: string;
|
|
281
384
|
description: string;
|
|
282
385
|
};
|
|
283
386
|
} & {
|
|
387
|
+
yes: import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
388
|
+
version: import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
284
389
|
help: import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
285
390
|
}>;
|
|
391
|
+
export declare const getSortedCliOptions: () => string[];
|
|
392
|
+
export declare const getSortedKeys: () => string[];
|
|
286
393
|
//# sourceMappingURL=definition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../src/config/definition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../src/config/definition.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,QAOd,CAAA;AAEV,eAAO,MAAM,aAAa,cAKjB,CAAA;AA+CT;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGX,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,cAAc,uBAW1B,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAA;AAEtC,eAAO,MAAM,UAAU,OACjB,MAAM,KACT,QAAQ,CAAC,MAAM,QAAQ,CAAC,GAAG,SACkC,CAAA;AAKhE;;GAEG;AACH,eAAO,MAAM,YAAY,iGAMf,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,aAAa,MAAO,MAAM,KAAG,CAAC,IAAI,WACN,CAAA;AAwCzC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA2OH,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAmOP,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkFvB,CAAA;AAEJ,eAAO,MAAM,mBAAmB,gBAS/B,CAAA;AAED,eAAO,MAAM,aAAa,gBAC2C,CAAA"}
|
|
@@ -1,24 +1,45 @@
|
|
|
1
|
+
import { error } from '@vltpkg/error-cause';
|
|
1
2
|
import { XDG } from '@vltpkg/xdg';
|
|
2
3
|
import { jack } from 'jackspeak';
|
|
3
|
-
export const defaultView =
|
|
4
|
+
export const defaultView =
|
|
5
|
+
// If stdout is a TTY, use human output
|
|
6
|
+
process.stdout.isTTY ? 'human'
|
|
7
|
+
// If its not a TTY but is a CI environment, use human output
|
|
8
|
+
// TODO: make a better view option for CI environments
|
|
9
|
+
: process.env.CI ? 'human'
|
|
10
|
+
// Otherwise, use json output
|
|
11
|
+
: 'json';
|
|
12
|
+
export const defaultEditor = () => process.env.EDITOR ||
|
|
13
|
+
process.env.VISUAL ||
|
|
14
|
+
(process.platform === 'win32' ?
|
|
15
|
+
`${process.env.SYSTEMROOT}\\notepad.exe`
|
|
16
|
+
: 'vi');
|
|
4
17
|
const canonicalCommands = {
|
|
18
|
+
build: 'build',
|
|
19
|
+
cache: 'cache',
|
|
20
|
+
ci: 'ci',
|
|
5
21
|
config: 'config',
|
|
6
22
|
exec: 'exec',
|
|
7
|
-
|
|
23
|
+
'exec-local': 'exec-local',
|
|
8
24
|
help: 'help',
|
|
9
25
|
init: 'init',
|
|
10
|
-
'install-exec': 'install-exec',
|
|
11
26
|
install: 'install',
|
|
12
27
|
login: 'login',
|
|
13
28
|
logout: 'logout',
|
|
14
29
|
list: 'list',
|
|
15
30
|
ls: 'ls',
|
|
31
|
+
pack: 'pack',
|
|
16
32
|
pkg: 'pkg',
|
|
33
|
+
publish: 'publish',
|
|
17
34
|
query: 'query',
|
|
18
35
|
'run-exec': 'run-exec',
|
|
19
36
|
run: 'run',
|
|
37
|
+
serve: 'serve',
|
|
20
38
|
token: 'token',
|
|
21
39
|
uninstall: 'uninstall',
|
|
40
|
+
update: 'update',
|
|
41
|
+
'exec-cache': 'exec-cache',
|
|
42
|
+
version: 'version',
|
|
22
43
|
whoami: 'whoami',
|
|
23
44
|
};
|
|
24
45
|
const aliases = {
|
|
@@ -30,11 +51,11 @@ const aliases = {
|
|
|
30
51
|
'run-script': 'run',
|
|
31
52
|
rx: 'run-exec',
|
|
32
53
|
x: 'exec',
|
|
54
|
+
xl: 'exec-local',
|
|
33
55
|
h: 'help',
|
|
34
56
|
'?': 'help',
|
|
35
|
-
conf: 'config',
|
|
36
|
-
ix: 'install-exec',
|
|
37
57
|
ls: 'list',
|
|
58
|
+
xc: 'exec-cache',
|
|
38
59
|
};
|
|
39
60
|
/**
|
|
40
61
|
* Command aliases mapped to their canonical names
|
|
@@ -67,13 +88,14 @@ export const recordFields = [
|
|
|
67
88
|
'registries',
|
|
68
89
|
'git-host-archives',
|
|
69
90
|
'scope-registries',
|
|
91
|
+
'jsr-registries',
|
|
70
92
|
];
|
|
71
93
|
export const isRecordField = (s) => recordFields.includes(s);
|
|
72
94
|
const stopParsingCommands = [
|
|
73
95
|
'run',
|
|
74
96
|
'run-exec',
|
|
97
|
+
'exec-local',
|
|
75
98
|
'exec',
|
|
76
|
-
'install-exec',
|
|
77
99
|
];
|
|
78
100
|
let stopParsing = undefined;
|
|
79
101
|
const j = jack({
|
|
@@ -188,6 +210,24 @@ export const definition = j
|
|
|
188
210
|
However, custom registry aliases are not supported by other
|
|
189
211
|
package managers.`,
|
|
190
212
|
},
|
|
213
|
+
'jsr-registries': {
|
|
214
|
+
hint: 'name=url',
|
|
215
|
+
description: `Map alias names to JSR.io registry urls.
|
|
216
|
+
|
|
217
|
+
For example,
|
|
218
|
+
\`--jsr-registries acme=https://jsr.acme.io/\` would
|
|
219
|
+
tell vlt to fetch any packages with the \`acme:\` registry
|
|
220
|
+
prefix from the \`https://jsr.acme.io/\` registry, using
|
|
221
|
+
the "npm Compatibility" translation. So for example,
|
|
222
|
+
the package \`acme:@foo/bar\` would fetch the
|
|
223
|
+
\`@jsr/foo__bar\` package from the \`jsr.acme.io\`
|
|
224
|
+
registry.
|
|
225
|
+
|
|
226
|
+
By default the \`jsr\` alias is always mapped to
|
|
227
|
+
\`https://npm.jsr.io/\`, so existing \`jsr:\` packages will
|
|
228
|
+
be fetched from the public \`jsr\` registry appropriately.
|
|
229
|
+
`,
|
|
230
|
+
},
|
|
191
231
|
'git-hosts': {
|
|
192
232
|
hint: `name=template`,
|
|
193
233
|
short: 'G',
|
|
@@ -225,7 +265,7 @@ export const definition = j
|
|
|
225
265
|
default: cacheDir,
|
|
226
266
|
},
|
|
227
267
|
tag: {
|
|
228
|
-
description: `Default \`dist-tag\` to install`,
|
|
268
|
+
description: `Default \`dist-tag\` to install or publish`,
|
|
229
269
|
default: 'latest',
|
|
230
270
|
},
|
|
231
271
|
before: {
|
|
@@ -282,6 +322,25 @@ export const definition = j
|
|
|
282
322
|
description: `Maximum number of milliseconds between two retries`,
|
|
283
323
|
default: 30_000,
|
|
284
324
|
},
|
|
325
|
+
'stale-while-revalidate-factor': {
|
|
326
|
+
hint: 'n',
|
|
327
|
+
default: 60,
|
|
328
|
+
description: `If the server does not serve a \`stale-while-revalidate\`
|
|
329
|
+
value in the \`cache-control\` header, then this multiplier
|
|
330
|
+
is applied to the \`max-age\` or \`s-maxage\` values.
|
|
331
|
+
|
|
332
|
+
By default, this is \`60\`, so for example a response that
|
|
333
|
+
is cacheable for 5 minutes will allow a stale response
|
|
334
|
+
while revalidating for up to 5 hours.
|
|
335
|
+
|
|
336
|
+
If the server *does* provide a \`stale-while-revalidate\`
|
|
337
|
+
value, then that is always used.
|
|
338
|
+
|
|
339
|
+
Set to 0 to prevent any \`stale-while-revalidate\` behavior
|
|
340
|
+
unless explicitly allowed by the server's \`cache-control\`
|
|
341
|
+
header.
|
|
342
|
+
`,
|
|
343
|
+
},
|
|
285
344
|
})
|
|
286
345
|
.opt({
|
|
287
346
|
identity: {
|
|
@@ -319,6 +378,31 @@ export const definition = j
|
|
|
319
378
|
description: `Specify named workspace group names to load and operate on
|
|
320
379
|
when doing recursive operations on workspaces.`,
|
|
321
380
|
},
|
|
381
|
+
})
|
|
382
|
+
.opt({
|
|
383
|
+
scope: {
|
|
384
|
+
short: 's',
|
|
385
|
+
hint: 'query',
|
|
386
|
+
description: 'Set to filter the scope of an operation using a DSS Query.',
|
|
387
|
+
},
|
|
388
|
+
target: {
|
|
389
|
+
short: 't',
|
|
390
|
+
hint: 'query',
|
|
391
|
+
description: 'Set to select packages using a DSS Query selector.',
|
|
392
|
+
},
|
|
393
|
+
})
|
|
394
|
+
.flag({
|
|
395
|
+
'if-present': {
|
|
396
|
+
description: `When running scripts across multiple packages,
|
|
397
|
+
only include packages that have the script.
|
|
398
|
+
|
|
399
|
+
If this is not set, then the run will fail if any
|
|
400
|
+
packages do not have the script.
|
|
401
|
+
|
|
402
|
+
This will default to true if --scope, --workspace,
|
|
403
|
+
--workspace-group, or --recursive is set. Otherwise,
|
|
404
|
+
it will default to false.`,
|
|
405
|
+
},
|
|
322
406
|
})
|
|
323
407
|
.flag({
|
|
324
408
|
recursive: {
|
|
@@ -344,11 +428,16 @@ export const definition = j
|
|
|
344
428
|
})
|
|
345
429
|
.opt({
|
|
346
430
|
config: {
|
|
347
|
-
hint: 'user | project',
|
|
348
|
-
description: `Specify
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
431
|
+
hint: 'all | user | project',
|
|
432
|
+
description: `Specify which configuration to show or operate on when running
|
|
433
|
+
\`vlt config\` commands. For read operations (get, pick, list):
|
|
434
|
+
\`all\` shows merged configuration from both user and project
|
|
435
|
+
files (default). For write operations (set, delete, edit):
|
|
436
|
+
defaults to \`project\`. \`user\` shows/modifies only user-level
|
|
437
|
+
configuration, \`project\` shows/modifies only project-level
|
|
438
|
+
configuration.`,
|
|
439
|
+
validOptions: ['all', 'user', 'project'],
|
|
440
|
+
default: 'all',
|
|
352
441
|
},
|
|
353
442
|
editor: {
|
|
354
443
|
hint: 'program',
|
|
@@ -358,23 +447,23 @@ export const definition = j
|
|
|
358
447
|
|
|
359
448
|
Defaults to the \`EDITOR\` or \`VISUAL\` env if set, or
|
|
360
449
|
\`notepad.exe\` on Windows, or \`vi\` elsewhere.`,
|
|
361
|
-
default:
|
|
362
|
-
process.env.VISUAL ||
|
|
363
|
-
(process.platform === 'win32' ?
|
|
364
|
-
`${process.env.SYSTEMROOT}\\notepad.exe`
|
|
365
|
-
: 'vi'),
|
|
450
|
+
default: defaultEditor(),
|
|
366
451
|
},
|
|
367
452
|
'script-shell': {
|
|
368
453
|
hint: 'program',
|
|
369
|
-
description: `The shell to use when executing \`package.json#scripts
|
|
370
|
-
(either as lifecycle scripts or explicitly with
|
|
371
|
-
\`vlt run\`) and \`vlt exec\`.
|
|
454
|
+
description: `The shell to use when executing \`package.json#scripts\`.
|
|
372
455
|
|
|
373
|
-
|
|
374
|
-
|
|
456
|
+
For \`vlt exec\` and \`vlt exec-local\`, this is never set,
|
|
457
|
+
meaning that command arguments are run exactly as provided.
|
|
375
458
|
|
|
376
|
-
|
|
377
|
-
|
|
459
|
+
For \`vlt run\` (and other things that run lifecycle
|
|
460
|
+
scripts in \`package.json#scripts\`), the entire command
|
|
461
|
+
with all arguments is provided as a single string, meaning
|
|
462
|
+
that some value must be provided for shell interpretation,
|
|
463
|
+
and so for these contexts, the \`script-shell\` value will
|
|
464
|
+
default to \`/bin/sh\` on POSIX systems or \`cmd.exe\` on
|
|
465
|
+
Windows.
|
|
466
|
+
`,
|
|
378
467
|
},
|
|
379
468
|
'fallback-command': {
|
|
380
469
|
hint: 'command',
|
|
@@ -392,10 +481,10 @@ export const definition = j
|
|
|
392
481
|
.opt({
|
|
393
482
|
package: {
|
|
394
483
|
hint: 'p',
|
|
395
|
-
description: `When running \`vlt
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
484
|
+
description: `When running \`vlt exec\`, this allows you to explicitly
|
|
485
|
+
set the package to search for bins. If not provided, then
|
|
486
|
+
vlt will interpret the first argument as the package, and
|
|
487
|
+
attempt to run the default executable.`,
|
|
399
488
|
},
|
|
400
489
|
})
|
|
401
490
|
.opt({
|
|
@@ -416,6 +505,7 @@ export const definition = j
|
|
|
416
505
|
commands.)
|
|
417
506
|
- mermaid: Output mermaid diagramming syntax. (Only
|
|
418
507
|
relevant for certain commands.)
|
|
508
|
+
- silent: Suppress all output to stdout.
|
|
419
509
|
|
|
420
510
|
If the requested view format is not supported for the
|
|
421
511
|
current command, or if no option is provided, then it
|
|
@@ -427,13 +517,14 @@ export const definition = j
|
|
|
427
517
|
'mermaid',
|
|
428
518
|
'gui',
|
|
429
519
|
'inspect',
|
|
520
|
+
'silent',
|
|
430
521
|
],
|
|
431
522
|
},
|
|
432
523
|
})
|
|
433
524
|
.optList({
|
|
434
525
|
'dashboard-root': {
|
|
435
526
|
hint: 'path',
|
|
436
|
-
description: `The root directory to use for the dashboard
|
|
527
|
+
description: `The root directory to use for the dashboard browser-based UI.
|
|
437
528
|
If not set, the user home directory is used.`,
|
|
438
529
|
},
|
|
439
530
|
})
|
|
@@ -459,17 +550,98 @@ export const definition = j
|
|
|
459
550
|
devDependencies or optionalDependencies, but you want to
|
|
460
551
|
move it to be a non-optional production dependency.`,
|
|
461
552
|
},
|
|
553
|
+
})
|
|
554
|
+
.opt({
|
|
555
|
+
'expect-results': {
|
|
556
|
+
hint: 'value',
|
|
557
|
+
validate: (v) => typeof v === 'string' && /^([<>]=?)?[0-9]+$/.test(v),
|
|
558
|
+
description: `When running \`vlt query\`, this option allows you to
|
|
559
|
+
set a expected number of resulting items.
|
|
560
|
+
|
|
561
|
+
Accepted values are numbers and strings.
|
|
562
|
+
|
|
563
|
+
Strings starting with \`>\`, \`<\`, \`>=\` or \`<=\`
|
|
564
|
+
followed by a number can be used to check if the result
|
|
565
|
+
is greater than or less than a specific number.`,
|
|
566
|
+
},
|
|
462
567
|
})
|
|
463
568
|
.flag({
|
|
569
|
+
'dry-run': {
|
|
570
|
+
description: 'Run command without making any changes',
|
|
571
|
+
},
|
|
572
|
+
'expect-lockfile': {
|
|
573
|
+
description: 'Fail if lockfile is missing or out of date. Used by ci command to enforce lockfile integrity.',
|
|
574
|
+
},
|
|
575
|
+
'frozen-lockfile': {
|
|
576
|
+
description: 'Fail if lockfile is missing or out of sync with package.json. Prevents any lockfile modifications.',
|
|
577
|
+
},
|
|
578
|
+
'lockfile-only': {
|
|
579
|
+
description: 'Only update the lockfile (vlt-lock.json) and package.json files, skip all node_modules operations including package extraction and filesystem changes.',
|
|
580
|
+
},
|
|
581
|
+
})
|
|
582
|
+
.opt({
|
|
583
|
+
'allow-scripts': {
|
|
584
|
+
hint: 'query',
|
|
585
|
+
description: `Filter which packages are allowed to run lifecycle scripts using DSS query syntax.
|
|
586
|
+
When provided, only packages matching the query will execute their
|
|
587
|
+
install, preinstall, postinstall, prepare, preprepare, and postprepare scripts.
|
|
588
|
+
Defaults to ':not(*)' which means no scripts will be run.
|
|
589
|
+
|
|
590
|
+
Example: --allow-scripts=":root > *, #my-package"
|
|
591
|
+
Runs scripts only for direct dependencies of the current project and any occurrences
|
|
592
|
+
of a specific dependency with the name "my-package" anywhere in the dependency graph.`,
|
|
593
|
+
},
|
|
594
|
+
})
|
|
595
|
+
.opt({
|
|
596
|
+
access: {
|
|
597
|
+
description: 'Set the access level of the package',
|
|
598
|
+
validOptions: ['public', 'restricted'],
|
|
599
|
+
default: 'public',
|
|
600
|
+
},
|
|
601
|
+
})
|
|
602
|
+
.opt({
|
|
603
|
+
otp: {
|
|
604
|
+
description: `Provide an OTP to use when publishing a package.`,
|
|
605
|
+
},
|
|
606
|
+
'publish-directory': {
|
|
607
|
+
hint: 'path',
|
|
608
|
+
description: `Directory to use for pack and publish operations instead of the current directory.
|
|
609
|
+
The directory must exist and nothing will be copied to it.`,
|
|
610
|
+
},
|
|
611
|
+
port: {
|
|
612
|
+
hint: 'number',
|
|
613
|
+
description: `Port for the browser-based UI server when using vlt serve command (default: 8000).`,
|
|
614
|
+
},
|
|
615
|
+
'registry-port': {
|
|
616
|
+
hint: 'number',
|
|
617
|
+
description: `Port for the VSR registry when using vlt serve command (default: 1337).`,
|
|
618
|
+
},
|
|
619
|
+
})
|
|
620
|
+
.flag({
|
|
621
|
+
yes: {
|
|
622
|
+
short: 'y',
|
|
623
|
+
description: `Automatically accept any confirmation prompts`,
|
|
624
|
+
},
|
|
464
625
|
version: {
|
|
465
626
|
short: 'v',
|
|
466
627
|
description: 'Print the version',
|
|
467
628
|
},
|
|
468
|
-
})
|
|
469
|
-
.flag({
|
|
470
629
|
help: {
|
|
471
630
|
short: 'h',
|
|
472
631
|
description: 'Print helpful information',
|
|
473
632
|
},
|
|
474
633
|
});
|
|
634
|
+
export const getSortedCliOptions = () => {
|
|
635
|
+
const defs = definition.toJSON();
|
|
636
|
+
return getSortedKeys().map((k) => {
|
|
637
|
+
const def = defs[k];
|
|
638
|
+
/* c8 ignore next */
|
|
639
|
+
if (!def)
|
|
640
|
+
throw error('invalid key found', { found: k });
|
|
641
|
+
if (def.type === 'boolean')
|
|
642
|
+
return `--${k}`;
|
|
643
|
+
return `--${k}=<${def.hint ?? k}>`;
|
|
644
|
+
});
|
|
645
|
+
};
|
|
646
|
+
export const getSortedKeys = () => Object.keys(definition.toJSON()).sort((a, b) => a.localeCompare(b));
|
|
475
647
|
//# sourceMappingURL=definition.js.map
|