@vltpkg/cli-sdk 0.0.0-8 → 1.0.0-rc.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/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/docs.d.ts +18 -0
- package/dist/esm/commands/docs.d.ts.map +1 -0
- package/dist/esm/commands/docs.js +154 -0
- package/dist/esm/commands/docs.js.map +1 -0
- 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 +32 -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 +2 -2
- package/dist/esm/commands/list.d.ts.map +1 -1
- package/dist/esm/commands/list.js +149 -49
- 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 +245 -0
- package/dist/esm/commands/publish.js.map +1 -0
- package/dist/esm/commands/query.d.ts +2 -2
- package/dist/esm/commands/query.d.ts.map +1 -1
- package/dist/esm/commands/query.js +170 -39
- 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 +12 -3
- package/dist/esm/commands/uninstall.d.ts.map +1 -1
- package/dist/esm/commands/uninstall.js +8 -3
- 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 +123 -11
- package/dist/esm/config/definition.d.ts.map +1 -1
- package/dist/esm/config/definition.js +197 -34
- package/dist/esm/config/definition.js.map +1 -1
- package/dist/esm/config/index.d.ts +42 -37
- package/dist/esm/config/index.d.ts.map +1 -1
- package/dist/esm/config/index.js +116 -172
- 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/custom-help.d.ts +9 -0
- package/dist/esm/custom-help.d.ts.map +1 -0
- package/dist/esm/custom-help.js +400 -0
- package/dist/esm/custom-help.js.map +1 -0
- 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 +73 -35
- 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 +249 -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 +1 -0
- package/dist/esm/start-gui.d.ts.map +1 -1
- package/dist/esm/start-gui.js +25 -6
- 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 +51 -35
- 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 -13
- 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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CommandFn, CommandUsage } from '../index.ts';
|
|
2
|
+
import { InstallReporter } from './install/reporter.ts';
|
|
3
|
+
import type { InstallResult } from './install.ts';
|
|
4
|
+
export declare const usage: CommandUsage;
|
|
5
|
+
export declare const views: {
|
|
6
|
+
readonly json: (i: InstallResult) => {
|
|
7
|
+
graph: import("@vltpkg/graph").LockfileData;
|
|
8
|
+
buildQueue?: import("@vltpkg/dep-id").DepID[] | undefined;
|
|
9
|
+
message?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
readonly human: typeof InstallReporter;
|
|
12
|
+
};
|
|
13
|
+
export declare const command: CommandFn<InstallResult>;
|
|
14
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/update.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,eAAO,MAAM,KAAK,EAAE,YAMhB,CAAA;AAEJ,eAAO,MAAM,KAAK;;;;;;;CAWuB,CAAA;AAEzC,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,aAAa,CAmB5C,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { update } from '@vltpkg/graph';
|
|
2
|
+
import { error } from '@vltpkg/error-cause';
|
|
3
|
+
import { commandUsage } from "../config/usage.js";
|
|
4
|
+
import { InstallReporter } from "./install/reporter.js";
|
|
5
|
+
export const usage = () => commandUsage({
|
|
6
|
+
command: 'update',
|
|
7
|
+
usage: '',
|
|
8
|
+
description: `Update dependencies to their latest in-range versions.
|
|
9
|
+
Discards the lockfile and resolves dependencies from scratch.`,
|
|
10
|
+
});
|
|
11
|
+
export const views = {
|
|
12
|
+
json: i => ({
|
|
13
|
+
...(i.buildQueue?.length ?
|
|
14
|
+
{
|
|
15
|
+
buildQueue: i.buildQueue,
|
|
16
|
+
message: `${i.buildQueue.length} packages that will need to be built, run "vlt build" to complete the update.`,
|
|
17
|
+
}
|
|
18
|
+
: null),
|
|
19
|
+
graph: i.graph.toJSON(),
|
|
20
|
+
}),
|
|
21
|
+
human: InstallReporter,
|
|
22
|
+
};
|
|
23
|
+
export const command = async (conf) => {
|
|
24
|
+
// Throw error if any arguments are provided
|
|
25
|
+
if (conf.positionals.length > 0) {
|
|
26
|
+
throw error('Arguments are not yet supported for vlt update', {
|
|
27
|
+
code: 'EUSAGE',
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/* c8 ignore start */
|
|
31
|
+
const allowScripts = conf.get('allow-scripts') ?
|
|
32
|
+
String(conf.get('allow-scripts'))
|
|
33
|
+
: ':not(*)';
|
|
34
|
+
/* c8 ignore stop */
|
|
35
|
+
const { buildQueue, graph } = await update({
|
|
36
|
+
...conf.options,
|
|
37
|
+
allowScripts,
|
|
38
|
+
});
|
|
39
|
+
return { buildQueue, graph };
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAIvD,MAAM,CAAC,MAAM,KAAK,GAAiB,GAAG,EAAE,CACtC,YAAY,CAAC;IACX,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,EAAE;IACT,WAAW,EAAE;gFAC+D;CAC7E,CAAC,CAAA;AAEJ,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACV,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YACxB;gBACE,UAAU,EAAE,CAAC,CAAC,UAAU;gBACxB,OAAO,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,MAAM,+EAA+E;aAC/G;YACH,CAAC,CAAC,IAAI,CAAC;QACP,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;KACxB,CAAC;IACF,KAAK,EAAE,eAAe;CACiB,CAAA;AAEzC,MAAM,CAAC,MAAM,OAAO,GAA6B,KAAK,EAAC,IAAI,EAAC,EAAE;IAC5D,4CAA4C;IAC5C,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,MAAM,KAAK,CAAC,gDAAgD,EAAE;YAC5D,IAAI,EAAE,QAAQ;SACf,CAAC,CAAA;IACJ,CAAC;IAED,qBAAqB;IACrB,MAAM,YAAY,GAChB,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC,CAAC,SAAS,CAAA;IACb,oBAAoB;IACpB,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC;QACzC,GAAG,IAAI,CAAC,OAAO;QACf,YAAY;KACb,CAAC,CAAA;IACF,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA;AAC9B,CAAC,CAAA","sourcesContent":["import { update } from '@vltpkg/graph'\nimport { error } from '@vltpkg/error-cause'\nimport { commandUsage } from '../config/usage.ts'\nimport type { CommandFn, CommandUsage } from '../index.ts'\nimport { InstallReporter } from './install/reporter.ts'\nimport type { Views } from '../view.ts'\nimport type { InstallResult } from './install.ts'\n\nexport const usage: CommandUsage = () =>\n commandUsage({\n command: 'update',\n usage: '',\n description: `Update dependencies to their latest in-range versions.\n Discards the lockfile and resolves dependencies from scratch.`,\n })\n\nexport const views = {\n json: i => ({\n ...(i.buildQueue?.length ?\n {\n buildQueue: i.buildQueue,\n message: `${i.buildQueue.length} packages that will need to be built, run \"vlt build\" to complete the update.`,\n }\n : null),\n graph: i.graph.toJSON(),\n }),\n human: InstallReporter,\n} as const satisfies Views<InstallResult>\n\nexport const command: CommandFn<InstallResult> = async conf => {\n // Throw error if any arguments are provided\n if (conf.positionals.length > 0) {\n throw error('Arguments are not yet supported for vlt update', {\n code: 'EUSAGE',\n })\n }\n\n /* c8 ignore start */\n const allowScripts =\n conf.get('allow-scripts') ?\n String(conf.get('allow-scripts'))\n : ':not(*)'\n /* c8 ignore stop */\n const { buildQueue, graph } = await update({\n ...conf.options,\n allowScripts,\n })\n return { buildQueue, graph }\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CommandFn, CommandUsage } from '../index.ts';
|
|
2
|
+
export type VersionOptions = {
|
|
3
|
+
prereleaseId?: string;
|
|
4
|
+
commit?: boolean;
|
|
5
|
+
tag?: boolean;
|
|
6
|
+
message?: string;
|
|
7
|
+
tagMessage?: string;
|
|
8
|
+
includeNameInCommit?: boolean;
|
|
9
|
+
includeNameInTag?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type CommandResultSingle = {
|
|
12
|
+
name: string;
|
|
13
|
+
oldVersion: string;
|
|
14
|
+
newVersion: string;
|
|
15
|
+
dir: string;
|
|
16
|
+
committed?: string[];
|
|
17
|
+
tag?: string;
|
|
18
|
+
};
|
|
19
|
+
export type CommandResult = CommandResultSingle | CommandResultSingle[];
|
|
20
|
+
export declare const usage: CommandUsage;
|
|
21
|
+
export declare const views: {
|
|
22
|
+
readonly json: (result: CommandResult) => CommandResult;
|
|
23
|
+
readonly human: (results: CommandResult) => string;
|
|
24
|
+
};
|
|
25
|
+
export declare const command: CommandFn<CommandResult>;
|
|
26
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/commands/version.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAS1D,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,aAAa,GACrB,mBAAmB,GACnB,mBAAmB,EAAE,CAAA;AA2LzB,eAAO,MAAM,KAAK,EAAE,YAanB,CAAA;AAED,eAAO,MAAM,KAAK;;;CAiBuB,CAAA;AAEzC,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,aAAa,CAkE5C,CAAA"}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { inc, parse as parseVersion, versionIncrements, } from '@vltpkg/semver';
|
|
2
|
+
import { is as isGit, spawn as spawn_, isClean } from '@vltpkg/git';
|
|
3
|
+
import { error } from '@vltpkg/error-cause';
|
|
4
|
+
import { asError } from '@vltpkg/types';
|
|
5
|
+
import { commandUsage } from "../config/usage.js";
|
|
6
|
+
import { dirname, resolve } from 'node:path';
|
|
7
|
+
import assert from 'node:assert';
|
|
8
|
+
import { actual } from '@vltpkg/graph';
|
|
9
|
+
import { Query } from '@vltpkg/query';
|
|
10
|
+
import { createHostContextsMap } from "../query-host-contexts.js";
|
|
11
|
+
const isValidVersionIncrement = (value) => versionIncrements.includes(value);
|
|
12
|
+
const version = async (conf, increment, cwd, {
|
|
13
|
+
// Hardcode happy path options for now.
|
|
14
|
+
// TODO: make these config definitions
|
|
15
|
+
prereleaseId = 'pre', commit = true, tag = true, message = 'v%s', tagMessage = 'v%s', includeNameInCommit = false, includeNameInTag = false, } = {}) => {
|
|
16
|
+
assert(increment, error('Version increment argument is required', {
|
|
17
|
+
code: 'EUSAGE',
|
|
18
|
+
validOptions: versionIncrements,
|
|
19
|
+
}));
|
|
20
|
+
const manifestPath = conf.options.packageJson.find(cwd);
|
|
21
|
+
assert(manifestPath, error('No package.json found', {
|
|
22
|
+
code: 'ENOENT',
|
|
23
|
+
path: cwd,
|
|
24
|
+
}));
|
|
25
|
+
const spawn = (args, opts) => spawn_(args, { cwd: manifestDir, ...opts });
|
|
26
|
+
const manifestDir = dirname(manifestPath);
|
|
27
|
+
const manifest = conf.options.packageJson.read(manifestDir);
|
|
28
|
+
assert(manifest.name, error('No name field found in package.json', {
|
|
29
|
+
path: manifestPath,
|
|
30
|
+
}));
|
|
31
|
+
assert(manifest.version, error('No version field found in package.json', {
|
|
32
|
+
path: manifestPath,
|
|
33
|
+
}));
|
|
34
|
+
const oldVersion = manifest.version;
|
|
35
|
+
let newVersion;
|
|
36
|
+
// Check if increment is a valid semver version string
|
|
37
|
+
const parsedIncrement = parseVersion(increment);
|
|
38
|
+
if (parsedIncrement) {
|
|
39
|
+
newVersion = parsedIncrement.toString();
|
|
40
|
+
}
|
|
41
|
+
else if (isValidVersionIncrement(increment)) {
|
|
42
|
+
// Use semver increment
|
|
43
|
+
const incrementType = increment;
|
|
44
|
+
try {
|
|
45
|
+
const result = inc(oldVersion, incrementType, prereleaseId);
|
|
46
|
+
newVersion = result.toString();
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
throw error(`Failed to increment version from ${oldVersion} with ${increment}`, { version: oldVersion, wanted: increment, cause: err });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
throw error(`Invalid version increment: ${increment}. Must be a valid semver version or one of: major, minor, patch, premajor, preminor, prepatch, prerelease`, {
|
|
54
|
+
found: increment,
|
|
55
|
+
validOptions: versionIncrements,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
// Update the manifest
|
|
59
|
+
manifest.version = newVersion;
|
|
60
|
+
conf.options.packageJson.write(manifestDir, manifest);
|
|
61
|
+
const result = {
|
|
62
|
+
name: manifest.name,
|
|
63
|
+
oldVersion,
|
|
64
|
+
newVersion,
|
|
65
|
+
dir: manifestDir,
|
|
66
|
+
};
|
|
67
|
+
// Handle git operations if we're in a git repository
|
|
68
|
+
if (
|
|
69
|
+
/* c8 ignore next -- commit and tag are always true for now */
|
|
70
|
+
(commit || tag) &&
|
|
71
|
+
(await isGit({ cwd: conf.options.projectRoot }))) {
|
|
72
|
+
// Check for uncommitted changes (excluding package.json since we just modified it)
|
|
73
|
+
if (!(await isClean({ cwd: conf.options.projectRoot }))) {
|
|
74
|
+
try {
|
|
75
|
+
// Check if there are changes other than package.json
|
|
76
|
+
const gitResult = await spawn([
|
|
77
|
+
'diff',
|
|
78
|
+
'--name-only',
|
|
79
|
+
'HEAD',
|
|
80
|
+
'--',
|
|
81
|
+
'.',
|
|
82
|
+
]);
|
|
83
|
+
const changedFiles = gitResult.stdout
|
|
84
|
+
.trim()
|
|
85
|
+
.split('\n')
|
|
86
|
+
.filter(Boolean)
|
|
87
|
+
.map(f => resolve(conf.options.projectRoot, f));
|
|
88
|
+
const nonPackageJsonChanges = changedFiles.filter(file => file !== resolve(manifestDir, 'package.json'));
|
|
89
|
+
assert(nonPackageJsonChanges.length === 0, error('Git working directory not clean. Please commit or stash your changes first.', { found: nonPackageJsonChanges }));
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
throw error('Git working directory not clean. Please commit or stash your changes first.', asError(err));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (commit) {
|
|
96
|
+
try {
|
|
97
|
+
// Stage package.json
|
|
98
|
+
const files = ['package.json'];
|
|
99
|
+
await spawn(['add', ...files]);
|
|
100
|
+
await spawn([
|
|
101
|
+
'commit',
|
|
102
|
+
'-m',
|
|
103
|
+
`${includeNameInCommit ? `${manifest.name}: ` : ''}${message.replace('%s', newVersion)}`,
|
|
104
|
+
]);
|
|
105
|
+
result.committed = files.map(f => resolve(manifestDir, f));
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
throw error('Failed to commit version changes', {
|
|
109
|
+
version: newVersion,
|
|
110
|
+
cause: err,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (tag) {
|
|
115
|
+
try {
|
|
116
|
+
const tagName = (includeNameInTag ?
|
|
117
|
+
`${manifest.name.replace('/', '-').replace('@', '')}-`
|
|
118
|
+
: '') + `v${newVersion}`;
|
|
119
|
+
await spawn([
|
|
120
|
+
'tag',
|
|
121
|
+
tagName,
|
|
122
|
+
'-m',
|
|
123
|
+
(includeNameInTag ? `${manifest.name}: ` : '') +
|
|
124
|
+
tagMessage.replace('%s', newVersion),
|
|
125
|
+
]);
|
|
126
|
+
result.tag = tagName;
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
throw error('Failed to create git tag', {
|
|
130
|
+
version: newVersion,
|
|
131
|
+
cause: err,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return result;
|
|
137
|
+
};
|
|
138
|
+
export const usage = () => {
|
|
139
|
+
return commandUsage({
|
|
140
|
+
command: 'version',
|
|
141
|
+
usage: '[<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]',
|
|
142
|
+
description: `Bump a package's version.
|
|
143
|
+
|
|
144
|
+
Run in a package directory to bump the version and write the new data back to package.json.
|
|
145
|
+
|
|
146
|
+
The \`<newversion>\` argument should be a valid semver string or a valid increment type (one of patch, minor, major, prepatch, preminor, premajor, prerelease).
|
|
147
|
+
|
|
148
|
+
If run in a git repository, it will also create a version commit and tag.`,
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
export const views = {
|
|
152
|
+
json: result => result,
|
|
153
|
+
human: results => {
|
|
154
|
+
const item = (result) => {
|
|
155
|
+
let output = `${result.name}: v${result.newVersion}`;
|
|
156
|
+
if (result.committed) {
|
|
157
|
+
output += ` +commit`;
|
|
158
|
+
}
|
|
159
|
+
if (result.tag) {
|
|
160
|
+
output += ` +tag`;
|
|
161
|
+
}
|
|
162
|
+
return output;
|
|
163
|
+
};
|
|
164
|
+
return Array.isArray(results) ?
|
|
165
|
+
results.map(item).join('\n')
|
|
166
|
+
: item(results);
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
export const command = async (conf) => {
|
|
170
|
+
const { positionals, options, projectRoot } = conf;
|
|
171
|
+
const queryString = conf.get('scope');
|
|
172
|
+
const paths = conf.get('workspace');
|
|
173
|
+
const groups = conf.get('workspace-group');
|
|
174
|
+
const recursive = conf.get('recursive');
|
|
175
|
+
const locations = [];
|
|
176
|
+
if (queryString) {
|
|
177
|
+
const mainManifest = options.packageJson.maybeRead(projectRoot);
|
|
178
|
+
let graph;
|
|
179
|
+
if (mainManifest) {
|
|
180
|
+
graph = actual.load({
|
|
181
|
+
...options,
|
|
182
|
+
mainManifest,
|
|
183
|
+
monorepo: options.monorepo,
|
|
184
|
+
loadManifests: false,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
const hostContexts = await createHostContextsMap(conf);
|
|
188
|
+
const query = new Query({
|
|
189
|
+
/* c8 ignore next */
|
|
190
|
+
nodes: graph ? new Set(graph.nodes.values()) : new Set(),
|
|
191
|
+
edges: graph?.edges ?? new Set(),
|
|
192
|
+
importers: graph?.importers ?? new Set(),
|
|
193
|
+
securityArchive: undefined,
|
|
194
|
+
hostContexts,
|
|
195
|
+
});
|
|
196
|
+
const { nodes } = await query.search(queryString, {
|
|
197
|
+
signal: new AbortController().signal,
|
|
198
|
+
});
|
|
199
|
+
for (const node of nodes) {
|
|
200
|
+
const location = node.location;
|
|
201
|
+
assert(location, error(`node ${node.id} has no location`, {
|
|
202
|
+
found: node,
|
|
203
|
+
}));
|
|
204
|
+
locations.push(resolve(node.projectRoot, location));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
else if (paths?.length || groups?.length || recursive) {
|
|
208
|
+
for (const workspace of options.monorepo ?? []) {
|
|
209
|
+
locations.push(workspace.fullpath);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
const cwd = options.packageJson.find(process.cwd()) ?? projectRoot;
|
|
214
|
+
return version(conf, positionals[0], cwd);
|
|
215
|
+
}
|
|
216
|
+
assert(locations.length > 0, error('No workspaces or query results found'));
|
|
217
|
+
const results = [];
|
|
218
|
+
for (const location of locations) {
|
|
219
|
+
results.push(await version(conf, positionals[0], location, {
|
|
220
|
+
includeNameInCommit: true,
|
|
221
|
+
includeNameInTag: true,
|
|
222
|
+
}));
|
|
223
|
+
}
|
|
224
|
+
return results;
|
|
225
|
+
};
|
|
226
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/commands/version.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,KAAK,IAAI,YAAY,EACrB,iBAAiB,GAClB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,EAAE,IAAI,KAAK,EAAE,KAAK,IAAI,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAEnE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CA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AO,OAAO,CAAA;AAChB,CAAC,CAAA","sourcesContent":["import {\n inc,\n parse as parseVersion,\n versionIncrements,\n} from '@vltpkg/semver'\nimport type { IncrementType } from '@vltpkg/semver'\nimport { is as isGit, spawn as spawn_, isClean } from '@vltpkg/git'\nimport type { GitOptions } from '@vltpkg/git'\nimport { error } from '@vltpkg/error-cause'\nimport { asError } from '@vltpkg/types'\nimport { commandUsage } from '../config/usage.ts'\nimport type { CommandFn, CommandUsage } from '../index.ts'\nimport type { Views } from '../view.ts'\nimport type { ParsedConfig } from '../config/index.ts'\nimport { dirname, resolve } from 'node:path'\nimport assert from 'node:assert'\nimport { actual } from '@vltpkg/graph'\nimport { Query } from '@vltpkg/query'\nimport { createHostContextsMap } from '../query-host-contexts.ts'\n\nexport type VersionOptions = {\n prereleaseId?: string\n commit?: boolean\n tag?: boolean\n message?: string\n tagMessage?: string\n includeNameInCommit?: boolean\n includeNameInTag?: boolean\n}\n\nexport type CommandResultSingle = {\n name: string\n oldVersion: string\n newVersion: string\n dir: string\n committed?: string[]\n tag?: string\n}\n\nexport type CommandResult =\n | CommandResultSingle\n | CommandResultSingle[]\n\nconst isValidVersionIncrement = (\n value: string,\n): value is IncrementType =>\n versionIncrements.includes(value as IncrementType)\n\nconst version = async (\n conf: ParsedConfig,\n increment: string | undefined,\n cwd: string,\n {\n // Hardcode happy path options for now.\n // TODO: make these config definitions\n prereleaseId = 'pre',\n commit = true,\n tag = true,\n message = 'v%s',\n tagMessage = 'v%s',\n includeNameInCommit = false,\n includeNameInTag = false,\n }: VersionOptions = {},\n): Promise<CommandResultSingle> => {\n assert(\n increment,\n error('Version increment argument is required', {\n code: 'EUSAGE',\n validOptions: versionIncrements,\n }),\n )\n\n const manifestPath = conf.options.packageJson.find(cwd)\n assert(\n manifestPath,\n error('No package.json found', {\n code: 'ENOENT',\n path: cwd,\n }),\n )\n\n const spawn = (args: string[], opts?: GitOptions) =>\n spawn_(args, { cwd: manifestDir, ...opts })\n\n const manifestDir = dirname(manifestPath)\n const manifest = conf.options.packageJson.read(manifestDir)\n\n assert(\n manifest.name,\n error('No name field found in package.json', {\n path: manifestPath,\n }),\n )\n assert(\n manifest.version,\n error('No version field found in package.json', {\n path: manifestPath,\n }),\n )\n\n const oldVersion = manifest.version\n let newVersion: string\n\n // Check if increment is a valid semver version string\n const parsedIncrement = parseVersion(increment)\n if (parsedIncrement) {\n newVersion = parsedIncrement.toString()\n } else if (isValidVersionIncrement(increment)) {\n // Use semver increment\n const incrementType = increment\n try {\n const result = inc(oldVersion, incrementType, prereleaseId)\n newVersion = result.toString()\n } catch (err) {\n throw error(\n `Failed to increment version from ${oldVersion} with ${increment}`,\n { version: oldVersion, wanted: increment, cause: err },\n )\n }\n } else {\n throw error(\n `Invalid version increment: ${increment}. Must be a valid semver version or one of: major, minor, patch, premajor, preminor, prepatch, prerelease`,\n {\n found: increment,\n validOptions: versionIncrements,\n },\n )\n }\n\n // Update the manifest\n manifest.version = newVersion\n conf.options.packageJson.write(manifestDir, manifest)\n\n const result: CommandResultSingle = {\n name: manifest.name,\n oldVersion,\n newVersion,\n dir: manifestDir,\n }\n\n // Handle git operations if we're in a git repository\n if (\n /* c8 ignore next -- commit and tag are always true for now */\n (commit || tag) &&\n (await isGit({ cwd: conf.options.projectRoot }))\n ) {\n // Check for uncommitted changes (excluding package.json since we just modified it)\n if (!(await isClean({ cwd: conf.options.projectRoot }))) {\n try {\n // Check if there are changes other than package.json\n const gitResult = await spawn([\n 'diff',\n '--name-only',\n 'HEAD',\n '--',\n '.',\n ])\n const changedFiles = gitResult.stdout\n .trim()\n .split('\\n')\n .filter(Boolean)\n .map(f => resolve(conf.options.projectRoot, f))\n const nonPackageJsonChanges = changedFiles.filter(\n file => file !== resolve(manifestDir, 'package.json'),\n )\n assert(\n nonPackageJsonChanges.length === 0,\n error(\n 'Git working directory not clean. Please commit or stash your changes first.',\n { found: nonPackageJsonChanges },\n ),\n )\n } catch (err) {\n throw error(\n 'Git working directory not clean. Please commit or stash your changes first.',\n asError(err),\n )\n }\n }\n\n if (commit) {\n try {\n // Stage package.json\n const files = ['package.json']\n await spawn(['add', ...files])\n await spawn([\n 'commit',\n '-m',\n `${includeNameInCommit ? `${manifest.name}: ` : ''}${message.replace(\n '%s',\n newVersion,\n )}`,\n ])\n result.committed = files.map(f => resolve(manifestDir, f))\n } catch (err) {\n throw error('Failed to commit version changes', {\n version: newVersion,\n cause: err,\n })\n }\n }\n\n if (tag) {\n try {\n const tagName =\n (includeNameInTag ?\n `${manifest.name.replace('/', '-').replace('@', '')}-`\n : '') + `v${newVersion}`\n await spawn([\n 'tag',\n tagName,\n '-m',\n (includeNameInTag ? `${manifest.name}: ` : '') +\n tagMessage.replace('%s', newVersion),\n ])\n result.tag = tagName\n } catch (err) {\n throw error('Failed to create git tag', {\n version: newVersion,\n cause: err,\n })\n }\n }\n }\n\n return result\n}\n\nexport const usage: CommandUsage = () => {\n return commandUsage({\n command: 'version',\n usage:\n '[<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]',\n description: `Bump a package's version.\n\n Run in a package directory to bump the version and write the new data back to package.json.\n\n The \\`<newversion>\\` argument should be a valid semver string or a valid increment type (one of patch, minor, major, prepatch, preminor, premajor, prerelease).\n\n If run in a git repository, it will also create a version commit and tag.`,\n })\n}\n\nexport const views = {\n json: result => result,\n human: results => {\n const item = (result: CommandResultSingle) => {\n let output = `${result.name}: v${result.newVersion}`\n if (result.committed) {\n output += ` +commit`\n }\n if (result.tag) {\n output += ` +tag`\n }\n return output\n }\n return Array.isArray(results) ?\n results.map(item).join('\\n')\n : item(results)\n },\n} as const satisfies Views<CommandResult>\n\nexport const command: CommandFn<CommandResult> = async conf => {\n const { positionals, options, projectRoot } = conf\n const queryString = conf.get('scope')\n const paths = conf.get('workspace')\n const groups = conf.get('workspace-group')\n const recursive = conf.get('recursive')\n\n const locations: string[] = []\n\n if (queryString) {\n const mainManifest = options.packageJson.maybeRead(projectRoot)\n let graph\n if (mainManifest) {\n graph = actual.load({\n ...options,\n mainManifest,\n monorepo: options.monorepo,\n loadManifests: false,\n })\n }\n const hostContexts = await createHostContextsMap(conf)\n const query = new Query({\n /* c8 ignore next */\n nodes: graph ? new Set(graph.nodes.values()) : new Set(),\n edges: graph?.edges ?? new Set(),\n importers: graph?.importers ?? new Set(),\n securityArchive: undefined,\n hostContexts,\n })\n const { nodes } = await query.search(queryString, {\n signal: new AbortController().signal,\n })\n for (const node of nodes) {\n const location = node.location\n assert(\n location,\n error(`node ${node.id} has no location`, {\n found: node,\n }),\n )\n locations.push(resolve(node.projectRoot, location))\n }\n } else if (paths?.length || groups?.length || recursive) {\n for (const workspace of options.monorepo ?? []) {\n locations.push(workspace.fullpath)\n }\n } else {\n const cwd = options.packageJson.find(process.cwd()) ?? projectRoot\n return version(conf, positionals[0], cwd)\n }\n\n assert(\n locations.length > 0,\n error('No workspaces or query results found'),\n )\n\n const results: CommandResultSingle[] = []\n for (const location of locations) {\n results.push(\n await version(conf, positionals[0], location, {\n includeNameInCommit: true,\n includeNameInTag: true,\n }),\n )\n }\n return results\n}\n"]}
|
|
@@ -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
|
*/
|
|
@@ -6,32 +7,46 @@ export declare const commands: {
|
|
|
6
7
|
readonly i: "install";
|
|
7
8
|
readonly add: "install";
|
|
8
9
|
readonly rm: "uninstall";
|
|
9
|
-
readonly u: "
|
|
10
|
+
readonly u: "update";
|
|
11
|
+
readonly p: "pkg";
|
|
12
|
+
readonly pub: "publish";
|
|
13
|
+
readonly q: "query";
|
|
14
|
+
readonly b: "build";
|
|
10
15
|
readonly r: "run";
|
|
11
16
|
readonly 'run-script': "run";
|
|
12
17
|
readonly rx: "run-exec";
|
|
18
|
+
readonly s: "serve";
|
|
13
19
|
readonly x: "exec";
|
|
20
|
+
readonly xl: "exec-local";
|
|
14
21
|
readonly h: "help";
|
|
15
22
|
readonly '?': "help";
|
|
16
|
-
readonly conf: "config";
|
|
17
|
-
readonly ix: "install-exec";
|
|
18
23
|
readonly ls: "list";
|
|
24
|
+
readonly xc: "exec-cache";
|
|
25
|
+
readonly build: "build";
|
|
26
|
+
readonly cache: "cache";
|
|
27
|
+
readonly ci: "ci";
|
|
19
28
|
readonly config: "config";
|
|
29
|
+
readonly docs: "docs";
|
|
20
30
|
readonly exec: "exec";
|
|
21
|
-
readonly
|
|
31
|
+
readonly 'exec-local': "exec-local";
|
|
22
32
|
readonly help: "help";
|
|
23
33
|
readonly init: "init";
|
|
24
|
-
readonly 'install-exec': "install-exec";
|
|
25
34
|
readonly install: "install";
|
|
26
35
|
readonly login: "login";
|
|
27
36
|
readonly logout: "logout";
|
|
28
37
|
readonly list: "list";
|
|
38
|
+
readonly pack: "pack";
|
|
29
39
|
readonly pkg: "pkg";
|
|
40
|
+
readonly publish: "publish";
|
|
30
41
|
readonly query: "query";
|
|
31
42
|
readonly 'run-exec': "run-exec";
|
|
32
43
|
readonly run: "run";
|
|
44
|
+
readonly serve: "serve";
|
|
33
45
|
readonly token: "token";
|
|
34
46
|
readonly uninstall: "uninstall";
|
|
47
|
+
readonly update: "update";
|
|
48
|
+
readonly 'exec-cache': "exec-cache";
|
|
49
|
+
readonly version: "version";
|
|
35
50
|
readonly whoami: "whoami";
|
|
36
51
|
};
|
|
37
52
|
/**
|
|
@@ -43,7 +58,7 @@ export declare const getCommand: (s?: string) => Commands[keyof Commands] | unde
|
|
|
43
58
|
/**
|
|
44
59
|
* Fields that are parsed as a set of key=value pairs
|
|
45
60
|
*/
|
|
46
|
-
export declare const recordFields: readonly ["git-hosts", "registries", "git-host-archives", "scope-registries"];
|
|
61
|
+
export declare const recordFields: readonly ["git-hosts", "registries", "git-host-archives", "scope-registries", "jsr-registries"];
|
|
47
62
|
export type RecordField = (typeof recordFields)[number];
|
|
48
63
|
export declare const isRecordField: (s: string) => s is RecordField;
|
|
49
64
|
export declare const definition: import("jackspeak").Jack<{
|
|
@@ -75,6 +90,10 @@ export declare const definition: import("jackspeak").Jack<{
|
|
|
75
90
|
hint: string;
|
|
76
91
|
description: string;
|
|
77
92
|
};
|
|
93
|
+
'jsr-registries': {
|
|
94
|
+
hint: string;
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
78
97
|
'git-hosts': {
|
|
79
98
|
hint: string;
|
|
80
99
|
short: string;
|
|
@@ -88,6 +107,7 @@ export declare const definition: import("jackspeak").Jack<{
|
|
|
88
107
|
} & {
|
|
89
108
|
registries: import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
90
109
|
'scope-registries': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
110
|
+
'jsr-registries': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
91
111
|
'git-hosts': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
92
112
|
'git-host-archives': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
93
113
|
} & {
|
|
@@ -185,6 +205,26 @@ export declare const definition: import("jackspeak").Jack<{
|
|
|
185
205
|
} & {
|
|
186
206
|
workspace: import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
187
207
|
'workspace-group': import("jackspeak").ConfigOption<"string", true, readonly string[] | undefined>;
|
|
208
|
+
} & {
|
|
209
|
+
scope: {
|
|
210
|
+
short: string;
|
|
211
|
+
hint: string;
|
|
212
|
+
description: string;
|
|
213
|
+
};
|
|
214
|
+
target: {
|
|
215
|
+
short: string;
|
|
216
|
+
hint: string;
|
|
217
|
+
description: string;
|
|
218
|
+
};
|
|
219
|
+
} & {
|
|
220
|
+
scope: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
221
|
+
target: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
222
|
+
} & {
|
|
223
|
+
'if-present': {
|
|
224
|
+
description: string;
|
|
225
|
+
};
|
|
226
|
+
} & {
|
|
227
|
+
'if-present': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
188
228
|
} & {
|
|
189
229
|
recursive: {
|
|
190
230
|
short: string;
|
|
@@ -207,7 +247,7 @@ export declare const definition: import("jackspeak").Jack<{
|
|
|
207
247
|
config: {
|
|
208
248
|
hint: string;
|
|
209
249
|
description: string;
|
|
210
|
-
validOptions: readonly ["user", "project"];
|
|
250
|
+
validOptions: readonly ["all", "user", "project"];
|
|
211
251
|
default: string;
|
|
212
252
|
};
|
|
213
253
|
editor: {
|
|
@@ -242,7 +282,7 @@ export declare const definition: import("jackspeak").Jack<{
|
|
|
242
282
|
hint: string;
|
|
243
283
|
default: string;
|
|
244
284
|
description: string;
|
|
245
|
-
validOptions: readonly ["human", "json", "mermaid", "gui", "inspect"];
|
|
285
|
+
validOptions: readonly ["human", "json", "mermaid", "gui", "inspect", "silent"];
|
|
246
286
|
};
|
|
247
287
|
} & {
|
|
248
288
|
view: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
@@ -275,18 +315,90 @@ export declare const definition: import("jackspeak").Jack<{
|
|
|
275
315
|
'save-peer': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
276
316
|
'save-prod': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
277
317
|
} & {
|
|
278
|
-
|
|
279
|
-
|
|
318
|
+
'expect-results': {
|
|
319
|
+
hint: string;
|
|
320
|
+
validate: (v: unknown) => boolean;
|
|
280
321
|
description: string;
|
|
281
322
|
};
|
|
282
323
|
} & {
|
|
283
|
-
|
|
324
|
+
'expect-results': import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
325
|
+
} & {
|
|
326
|
+
'dry-run': {
|
|
327
|
+
description: string;
|
|
328
|
+
};
|
|
329
|
+
'expect-lockfile': {
|
|
330
|
+
description: string;
|
|
331
|
+
};
|
|
332
|
+
'frozen-lockfile': {
|
|
333
|
+
description: string;
|
|
334
|
+
};
|
|
335
|
+
'lockfile-only': {
|
|
336
|
+
description: string;
|
|
337
|
+
};
|
|
338
|
+
} & {
|
|
339
|
+
'dry-run': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
340
|
+
'expect-lockfile': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
341
|
+
'frozen-lockfile': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
342
|
+
'lockfile-only': import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
343
|
+
} & {
|
|
344
|
+
'allow-scripts': {
|
|
345
|
+
hint: string;
|
|
346
|
+
description: string;
|
|
347
|
+
};
|
|
348
|
+
} & {
|
|
349
|
+
'allow-scripts': import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
350
|
+
} & {
|
|
351
|
+
access: {
|
|
352
|
+
description: string;
|
|
353
|
+
validOptions: readonly ["public", "restricted"];
|
|
354
|
+
default: string;
|
|
355
|
+
};
|
|
356
|
+
} & {
|
|
357
|
+
access: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
284
358
|
} & {
|
|
359
|
+
otp: {
|
|
360
|
+
description: string;
|
|
361
|
+
};
|
|
362
|
+
'publish-directory': {
|
|
363
|
+
hint: string;
|
|
364
|
+
description: string;
|
|
365
|
+
};
|
|
366
|
+
port: {
|
|
367
|
+
hint: string;
|
|
368
|
+
description: string;
|
|
369
|
+
};
|
|
370
|
+
'registry-port': {
|
|
371
|
+
hint: string;
|
|
372
|
+
description: string;
|
|
373
|
+
};
|
|
374
|
+
} & {
|
|
375
|
+
otp: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
376
|
+
'publish-directory': import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
377
|
+
port: import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
378
|
+
'registry-port': import("jackspeak").ConfigOption<"string", false, readonly string[] | undefined>;
|
|
379
|
+
} & {
|
|
380
|
+
yes: {
|
|
381
|
+
short: string;
|
|
382
|
+
description: string;
|
|
383
|
+
};
|
|
384
|
+
version: {
|
|
385
|
+
short: string;
|
|
386
|
+
description: string;
|
|
387
|
+
};
|
|
285
388
|
help: {
|
|
286
389
|
short: string;
|
|
287
390
|
description: string;
|
|
288
391
|
};
|
|
392
|
+
all: {
|
|
393
|
+
short: string;
|
|
394
|
+
description: string;
|
|
395
|
+
};
|
|
289
396
|
} & {
|
|
397
|
+
yes: import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
398
|
+
version: import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
290
399
|
help: import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
400
|
+
all: import("jackspeak").ConfigOption<"boolean", false, undefined>;
|
|
291
401
|
}>;
|
|
402
|
+
export declare const getSortedCliOptions: () => string[];
|
|
403
|
+
export declare const getSortedKeys: () => string[];
|
|
292
404
|
//# 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;AAqDT;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsFvB,CAAA;AAEJ,eAAO,MAAM,mBAAmB,gBAS/B,CAAA;AAED,eAAO,MAAM,aAAa,gBAC2C,CAAA"}
|