@vltpkg/cli-sdk 0.0.0-9 → 1.0.0-rc.10
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/bugs.d.ts +18 -0
- package/dist/esm/commands/bugs.d.ts.map +1 -0
- package/dist/esm/commands/bugs.js +164 -0
- package/dist/esm/commands/bugs.js.map +1 -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 +18 -0
- package/dist/esm/commands/cache.d.ts.map +1 -1
- package/dist/esm/commands/cache.js +48 -2
- package/dist/esm/commands/cache.js.map +1 -1
- 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 +1 -0
- package/dist/esm/commands/exec-local.d.ts.map +1 -1
- package/dist/esm/commands/exec-local.js +2 -0
- package/dist/esm/commands/exec-local.js.map +1 -1
- package/dist/esm/commands/exec.d.ts +6 -1
- package/dist/esm/commands/exec.d.ts.map +1 -1
- package/dist/esm/commands/exec.js +79 -5
- 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 +3 -3
- 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 +42 -15
- package/dist/esm/commands/install/reporter.js.map +1 -1
- package/dist/esm/commands/install.d.ts +21 -3
- package/dist/esm/commands/install.d.ts.map +1 -1
- package/dist/esm/commands/install.js +29 -4
- 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 +1 -2
- 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 -3
- package/dist/esm/commands/query.d.ts.map +1 -1
- package/dist/esm/commands/query.js +132 -38
- 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 +8 -2
- package/dist/esm/commands/uninstall.d.ts.map +1 -1
- package/dist/esm/commands/uninstall.js +10 -5
- 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/config/definition.d.ts +119 -15
- package/dist/esm/config/definition.d.ts.map +1 -1
- package/dist/esm/config/definition.js +186 -37
- package/dist/esm/config/definition.js.map +1 -1
- package/dist/esm/config/index.d.ts +41 -37
- package/dist/esm/config/index.d.ts.map +1 -1
- package/dist/esm/config/index.js +109 -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/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 +213 -64
- 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 +45 -19
- 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 -11
- package/dist/esm/output.d.ts.map +1 -1
- package/dist/esm/output.js +64 -27
- 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 +9 -2
- package/dist/esm/parse-add-remove-args.d.ts.map +1 -1
- package/dist/esm/parse-add-remove-args.js +43 -10
- package/dist/esm/parse-add-remove-args.js.map +1 -1
- package/dist/esm/print-err.d.ts +9 -2
- package/dist/esm/print-err.d.ts.map +1 -1
- package/dist/esm/print-err.js +130 -46
- 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 +28 -8
- 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 +55 -41
- 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/start-gui.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import LZString from 'lz-string';
|
|
1
3
|
import { createServer } from '@vltpkg/server';
|
|
2
4
|
import { urlOpen } from '@vltpkg/url-open';
|
|
3
5
|
import { stdout } from "./output.js";
|
|
4
|
-
import { resolve } from 'node:path';
|
|
5
6
|
export const getDefaultStartingRoute = async (options) => {
|
|
6
|
-
const { startingRoute, projectRoot, scurry } = options;
|
|
7
|
+
const { queryString = ':root', startingRoute, projectRoot, scurry, } = options;
|
|
7
8
|
if (startingRoute)
|
|
8
9
|
return startingRoute;
|
|
9
10
|
const stat = await scurry.lstat(`${projectRoot}/package.json`);
|
|
10
|
-
|
|
11
|
-
`/explore
|
|
12
|
-
: '/';
|
|
11
|
+
const res = stat?.isFile() && !stat.isSymbolicLink() ?
|
|
12
|
+
`/explore/${LZString.compressToEncodedURIComponent(queryString)}/overview`
|
|
13
|
+
: '/dashboard';
|
|
14
|
+
return res;
|
|
13
15
|
};
|
|
14
16
|
const getAssetsDir = () => {
|
|
15
17
|
/* c8 ignore start */
|
|
@@ -19,18 +21,36 @@ const getAssetsDir = () => {
|
|
|
19
21
|
/* c8 ignore stop */
|
|
20
22
|
};
|
|
21
23
|
export const startGUI = async (conf, startingRoute) => {
|
|
24
|
+
/* c8 ignore start */
|
|
25
|
+
const allowScripts = conf.get('allow-scripts') ?
|
|
26
|
+
String(conf.get('allow-scripts'))
|
|
27
|
+
: ':not(*)';
|
|
28
|
+
/* c8 ignore stop */
|
|
22
29
|
const server = createServer({
|
|
23
30
|
...conf.options,
|
|
24
31
|
assetsDir: getAssetsDir(),
|
|
32
|
+
loadedConfig: conf,
|
|
33
|
+
allowScripts,
|
|
25
34
|
});
|
|
26
|
-
server.on('needConfigUpdate', dir => {
|
|
35
|
+
server.on('needConfigUpdate', async (dir) => {
|
|
27
36
|
conf.resetOptions(dir);
|
|
28
|
-
server
|
|
37
|
+
const listeningServer = server;
|
|
38
|
+
listeningServer.updateOptions({ ...conf.options, allowScripts });
|
|
39
|
+
await conf
|
|
40
|
+
.reloadFromDisk()
|
|
41
|
+
.then(() => {
|
|
42
|
+
listeningServer.updateOptions({
|
|
43
|
+
...conf.options,
|
|
44
|
+
allowScripts,
|
|
45
|
+
});
|
|
46
|
+
})
|
|
47
|
+
.catch(() => { });
|
|
29
48
|
});
|
|
30
49
|
const { projectRoot, scurry } = conf.options;
|
|
31
50
|
await server.start();
|
|
32
|
-
stdout(`⚡️ vlt
|
|
51
|
+
stdout(`⚡️ vlt UI running at ${server.address()}`);
|
|
33
52
|
void urlOpen(server.address(await getDefaultStartingRoute({
|
|
53
|
+
queryString: conf.values.target,
|
|
34
54
|
startingRoute,
|
|
35
55
|
projectRoot,
|
|
36
56
|
scurry,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-gui.js","sourceRoot":"","sources":["../../src/start-gui.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start-gui.js","sourceRoot":"","sources":["../../src/start-gui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,QAAQ,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAKpC,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAAE,OAK7C,EAAE,EAAE;IACH,MAAM,EACJ,WAAW,GAAG,OAAO,EACrB,aAAa,EACb,WAAW,EACX,MAAM,GACP,GAAG,OAAO,CAAA;IACX,IAAI,aAAa;QAAE,OAAO,aAAa,CAAA;IACvC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,WAAW,eAAe,CAAC,CAAA;IAC9D,MAAM,GAAG,GACP,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QACxC,YAAY,QAAQ,CAAC,6BAA6B,CAAC,WAAW,CAAC,WAAW;QAC5E,CAAC,CAAC,YAAY,CAAA;IAChB,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,qBAAqB;IACrB,IAAI,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,CAAC;QAC9C,OAAO,OAAO,CACZ,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAC1C,CAAA;IACH,CAAC;IACD,oBAAoB;AACtB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAC3B,IAAkB,EAClB,aAAsB,EACtB,EAAE;IACF,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,MAAM,GAAG,YAAY,CAAC;QAC1B,GAAG,IAAI,CAAC,OAAO;QACf,SAAS,EAAE,YAAY,EAAE;QACzB,YAAY,EAAE,IAAI;QAClB,YAAY;KACb,CAAC,CAAA;IACF,MAAM,CAAC,EAAE,CAAC,kBAAkB,EAAE,KAAK,EAAC,GAAG,EAAC,EAAE;QACxC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;QACtB,MAAM,eAAe,GAAG,MAA4B,CAAA;QACpD,eAAe,CAAC,aAAa,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC,CAAA;QAChE,MAAM,IAAI;aACP,cAAc,EAAE;aAChB,IAAI,CAAC,GAAG,EAAE;YACT,eAAe,CAAC,aAAa,CAAC;gBAC5B,GAAG,IAAI,CAAC,OAAO;gBACf,YAAY;aACb,CAAC,CAAA;QACJ,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;IACpB,CAAC,CAAC,CAAA;IACF,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;IAC5C,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;IACpB,MAAM,CAAC,wBAAwB,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;IAClD,KAAK,OAAO,CACV,MAAM,CAAC,OAAO,CACZ,MAAM,uBAAuB,CAAC;QAC5B,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;QAC/B,aAAa;QACb,WAAW;QACX,MAAM;KACP,CAAC,CACH,CACF,CAAA;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA","sourcesContent":["import { resolve } from 'node:path'\nimport LZString from 'lz-string'\nimport { createServer } from '@vltpkg/server'\nimport { urlOpen } from '@vltpkg/url-open'\nimport { stdout } from './output.ts'\nimport type { PathScurry } from 'path-scurry'\nimport type { LoadedConfig } from './config/index.ts'\nimport type { VltServerListening } from '@vltpkg/server'\n\nexport const getDefaultStartingRoute = async (options: {\n queryString?: string\n startingRoute?: string\n projectRoot: string\n scurry: PathScurry\n}) => {\n const {\n queryString = ':root',\n startingRoute,\n projectRoot,\n scurry,\n } = options\n if (startingRoute) return startingRoute\n const stat = await scurry.lstat(`${projectRoot}/package.json`)\n const res =\n stat?.isFile() && !stat.isSymbolicLink() ?\n `/explore/${LZString.compressToEncodedURIComponent(queryString)}/overview`\n : '/dashboard'\n return res\n}\n\nconst getAssetsDir = () => {\n /* c8 ignore start */\n if (process.env.__VLT_INTERNAL_GUI_ASSETS_DIR) {\n return resolve(\n import.meta.dirname,\n process.env.__VLT_INTERNAL_GUI_ASSETS_DIR,\n )\n }\n /* c8 ignore stop */\n}\n\nexport const startGUI = async (\n conf: LoadedConfig,\n startingRoute?: string,\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 server = createServer({\n ...conf.options,\n assetsDir: getAssetsDir(),\n loadedConfig: conf,\n allowScripts,\n })\n server.on('needConfigUpdate', async dir => {\n conf.resetOptions(dir)\n const listeningServer = server as VltServerListening\n listeningServer.updateOptions({ ...conf.options, allowScripts })\n await conf\n .reloadFromDisk()\n .then(() => {\n listeningServer.updateOptions({\n ...conf.options,\n allowScripts,\n })\n })\n .catch(() => {})\n })\n const { projectRoot, scurry } = conf.options\n await server.start()\n stdout(`⚡️ vlt UI running at ${server.address()}`)\n void urlOpen(\n server.address(\n await getDefaultStartingRoute({\n queryString: conf.values.target,\n startingRoute,\n projectRoot,\n scurry,\n }),\n ),\n )\n return server\n}\n"]}
|
package/dist/esm/view.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ChalkInstance } from 'chalk';
|
|
2
1
|
import type { LoadedConfig } from './config/index.ts';
|
|
3
2
|
export type ViewOptions = {
|
|
4
|
-
colors?:
|
|
3
|
+
colors?: boolean;
|
|
5
4
|
};
|
|
6
5
|
/**
|
|
7
6
|
* The base class for all View classes
|
|
@@ -21,7 +20,7 @@ export declare class ViewClass<T = unknown> {
|
|
|
21
20
|
start(): void;
|
|
22
21
|
done(_result: T, _opts: {
|
|
23
22
|
time: number;
|
|
24
|
-
}): unknown
|
|
23
|
+
}): Promise<unknown>;
|
|
25
24
|
error(_err: unknown): void;
|
|
26
25
|
}
|
|
27
26
|
export type ViewFn<T = unknown> = (result: T, options: ViewOptions, conf: LoadedConfig) => unknown;
|
package/dist/esm/view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,MAAM,MAAM,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAE9C;;;;;;;;;;GAUG;AACH,qBAAa,SAAS,CAAC,CAAC,GAAG,OAAO;IAChC,OAAO,EAAE,WAAW,CAAA;IACpB,MAAM,EAAE,YAAY,CAAA;gBAER,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY;IAQtD,KAAK;IACC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAGjE,KAAK,CAAC,IAAI,EAAE,OAAO;CACpB;AAED,MAAM,MAAM,MAAM,CAAC,CAAC,GAAG,OAAO,IAAI,CAChC,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,YAAY,KACf,OAAO,CAAA;AAEZ,MAAM,MAAM,IAAI,CAAC,CAAC,GAAG,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,SAAS,CAAC,CAAC,CAAC,CAAA;AAE/D,eAAO,MAAM,WAAW,GAAI,CAAC,kBACrB,IAAI,CAAC,CAAC,CAAC,KACZ,IAAI,IAAI,OAAO,SAAS,CAAC,CAAC,CAGQ,CAAA;AAErC,MAAM,MAAM,KAAK,CAAC,CAAC,GAAG,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA"}
|
package/dist/esm/view.js
CHANGED
|
@@ -20,7 +20,7 @@ export class ViewClass {
|
|
|
20
20
|
// run the command", for example to have the gui just open a web browser
|
|
21
21
|
// to the page relevant to a given thing, rather than computing it twice
|
|
22
22
|
start() { }
|
|
23
|
-
done(_result, _opts) {
|
|
23
|
+
async done(_result, _opts) {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
error(_err) { }
|
package/dist/esm/view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../src/view.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../src/view.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,MAAM,OAAO,SAAS;IACpB,OAAO,CAAa;IACpB,MAAM,CAAc;IAEpB,YAAY,OAAoB,EAAE,MAAoB;QACpD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,oEAAoE;IACpE,wEAAwE;IACxE,wEAAwE;IACxE,KAAK,KAAI,CAAC;IACV,KAAK,CAAC,IAAI,CAAC,OAAU,EAAE,KAAuB;QAC5C,OAAM;IACR,CAAC;IACD,KAAK,CAAC,IAAa,IAAG,CAAC;CACxB;AAUD,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,IAAa,EACgB,EAAE,CAC/B,OAAO,IAAI,KAAK,UAAU;IAC1B,WAAW,IAAI,IAAI;IACnB,IAAI,CAAC,SAAS,YAAY,SAAS,CAAA","sourcesContent":["import type { LoadedConfig } from './config/index.ts'\n\nexport type ViewOptions = { colors?: boolean }\n\n/**\n * The base class for all View classes\n *\n * Do not override the constructor, just provide start/done/error methods.\n *\n * These classes should be used as one or more of the exported views for\n * commands that need to know when the processing starts, handle errors in\n * various ways, etc. Fancy stuff.\n *\n * For simple use cases, usually better to create a {@link ViewFn} instead.\n */\nexport class ViewClass<T = unknown> {\n options: ViewOptions\n config: LoadedConfig\n\n constructor(options: ViewOptions, config: LoadedConfig) {\n this.options = options\n this.config = config\n }\n\n // TODO: maybe have start() return a flag to say \"i got this, do not\n // run the command\", for example to have the gui just open a web browser\n // to the page relevant to a given thing, rather than computing it twice\n start() {}\n async done(_result: T, _opts: { time: number }): Promise<unknown> {\n return\n }\n error(_err: unknown) {}\n}\n\nexport type ViewFn<T = unknown> = (\n result: T,\n options: ViewOptions,\n conf: LoadedConfig,\n) => unknown\n\nexport type View<T = unknown> = ViewFn<T> | typeof ViewClass<T>\n\nexport const isViewClass = <T = unknown>(\n view: View<T>,\n): view is typeof ViewClass<T> =>\n typeof view === 'function' &&\n 'prototype' in view &&\n view.prototype instanceof ViewClass\n\nexport type Views<T = unknown> = View<T> | Record<string, View<T>>\n"]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/cli-sdk",
|
|
3
3
|
"description": "The source for the vlt CLI",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "1.0.0-rc.10",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
8
8
|
"directory": "src/cli-sdk"
|
|
9
9
|
},
|
|
10
|
+
"author": "vlt technology inc. <support@vlt.sh> (http://vlt.sh)",
|
|
10
11
|
"tshy": {
|
|
11
12
|
"selfLink": false,
|
|
12
13
|
"liveDev": true,
|
|
@@ -22,55 +23,67 @@
|
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"ansi-to-pre": "^1.0.
|
|
26
|
-
"chalk": "^5.
|
|
27
|
-
"
|
|
26
|
+
"ansi-to-pre": "^1.0.6",
|
|
27
|
+
"chalk": "^5.6.2",
|
|
28
|
+
"graph-run": "^1.1.0",
|
|
29
|
+
"hosted-git-info": "^9.0.2",
|
|
30
|
+
"ink": "^6.5.1",
|
|
28
31
|
"ink-spinner": "^5.0.0",
|
|
29
|
-
"jackspeak": "^4.
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
+
"jackspeak": "^4.1.1",
|
|
33
|
+
"lz-string": "^1.5.0",
|
|
34
|
+
"minimatch": "^10.1.1",
|
|
35
|
+
"package-json-from-dist": "^1.0.1",
|
|
36
|
+
"path-scurry": "^2.0.1",
|
|
32
37
|
"polite-json": "^5.0.0",
|
|
33
|
-
"pretty-bytes": "^
|
|
34
|
-
"react": "^
|
|
38
|
+
"pretty-bytes": "^7.1.0",
|
|
39
|
+
"react": "^19.2.1",
|
|
35
40
|
"react-devtools-core": "^4.28.5",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"@vltpkg/
|
|
42
|
-
"@vltpkg/
|
|
43
|
-
"@vltpkg/
|
|
44
|
-
"@vltpkg/
|
|
45
|
-
"@vltpkg/
|
|
46
|
-
"@vltpkg/
|
|
47
|
-
"@vltpkg/
|
|
48
|
-
"@vltpkg/
|
|
49
|
-
"@vltpkg/
|
|
50
|
-
"@vltpkg/
|
|
51
|
-
"@vltpkg/
|
|
52
|
-
"@vltpkg/
|
|
53
|
-
"@vltpkg/
|
|
54
|
-
"@vltpkg/
|
|
55
|
-
"@vltpkg/
|
|
56
|
-
"@vltpkg/
|
|
41
|
+
"react-dom": "^19.2.1",
|
|
42
|
+
"signal-exit": "^4.1.0",
|
|
43
|
+
"ssri": "^13.0.0",
|
|
44
|
+
"supports-color": "^10.2.2",
|
|
45
|
+
"tar": "^7.5.2",
|
|
46
|
+
"@vltpkg/config": "1.0.0-rc.10",
|
|
47
|
+
"@vltpkg/dep-id": "1.0.0-rc.10",
|
|
48
|
+
"@vltpkg/error-cause": "1.0.0-rc.10",
|
|
49
|
+
"@vltpkg/dot-prop": "1.0.0-rc.10",
|
|
50
|
+
"@vltpkg/git": "1.0.0-rc.10",
|
|
51
|
+
"@vltpkg/graph": "1.0.0-rc.10",
|
|
52
|
+
"@vltpkg/init": "1.0.0-rc.10",
|
|
53
|
+
"@vltpkg/output": "1.0.0-rc.10",
|
|
54
|
+
"@vltpkg/package-info": "1.0.0-rc.10",
|
|
55
|
+
"@vltpkg/package-json": "1.0.0-rc.10",
|
|
56
|
+
"@vltpkg/promise-spawn": "1.0.0-rc.10",
|
|
57
|
+
"@vltpkg/query": "1.0.0-rc.10",
|
|
58
|
+
"@vltpkg/registry-client": "1.0.0-rc.10",
|
|
59
|
+
"@vltpkg/rollback-remove": "1.0.0-rc.10",
|
|
60
|
+
"@vltpkg/run": "1.0.0-rc.10",
|
|
61
|
+
"@vltpkg/security-archive": "1.0.0-rc.10",
|
|
62
|
+
"@vltpkg/spec": "1.0.0-rc.10",
|
|
63
|
+
"@vltpkg/types": "1.0.0-rc.10",
|
|
64
|
+
"@vltpkg/server": "1.0.0-rc.10",
|
|
65
|
+
"@vltpkg/url-open": "1.0.0-rc.10",
|
|
66
|
+
"@vltpkg/vlt-json": "1.0.0-rc.10",
|
|
67
|
+
"@vltpkg/workspaces": "1.0.0-rc.10",
|
|
68
|
+
"@vltpkg/vlx": "1.0.0-rc.10",
|
|
69
|
+
"@vltpkg/xdg": "1.0.0-rc.10"
|
|
57
70
|
},
|
|
58
71
|
"devDependencies": {
|
|
59
|
-
"@eslint/js": "^9.
|
|
60
|
-
"@types/
|
|
61
|
-
"@types/
|
|
62
|
-
"@types/
|
|
63
|
-
"eslint": "^9.
|
|
64
|
-
"prettier": "^3.4
|
|
65
|
-
"tap": "^21.
|
|
66
|
-
"tshy": "^3.0
|
|
67
|
-
"typedoc": "0.27.
|
|
72
|
+
"@eslint/js": "^9.39.1",
|
|
73
|
+
"@types/node": "^22.19.2",
|
|
74
|
+
"@types/react": "^18.3.27",
|
|
75
|
+
"@types/ssri": "^7.1.5",
|
|
76
|
+
"eslint": "^9.39.1",
|
|
77
|
+
"prettier": "^3.7.4",
|
|
78
|
+
"tap": "^21.5.0",
|
|
79
|
+
"tshy": "^3.1.0",
|
|
80
|
+
"typedoc": "~0.27.9",
|
|
68
81
|
"typescript": "5.7.3",
|
|
69
|
-
"typescript-eslint": "^8.
|
|
82
|
+
"typescript-eslint": "^8.49.0"
|
|
70
83
|
},
|
|
71
84
|
"license": "BSD-2-Clause-Patent",
|
|
72
85
|
"engines": {
|
|
73
|
-
"node": ">=22"
|
|
86
|
+
"node": ">=22.9.0"
|
|
74
87
|
},
|
|
75
88
|
"tap": {
|
|
76
89
|
"extends": "../../tap-config.yaml"
|
|
@@ -119,6 +132,7 @@
|
|
|
119
132
|
"snap": "tap",
|
|
120
133
|
"test": "tap",
|
|
121
134
|
"posttest": "tsc --noEmit",
|
|
135
|
+
"tshy": "tshy",
|
|
122
136
|
"typecheck": "tsc --noEmit"
|
|
123
137
|
}
|
|
124
138
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CommandFn, CommandUsage } from '../index.ts';
|
|
2
|
-
import type { ViewFn } from '../view.ts';
|
|
3
|
-
export declare const views: ViewFn<null>;
|
|
4
|
-
export declare const usage: CommandUsage;
|
|
5
|
-
export declare const command: CommandFn;
|
|
6
|
-
//# sourceMappingURL=gui.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gui.d.ts","sourceRoot":"","sources":["../../../src/commands/gui.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAGxC,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,IAAI,CAE9B,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,YAKhB,CAAA;AAEJ,eAAO,MAAM,OAAO,EAAE,SAA4B,CAAA"}
|
package/dist/esm/commands/gui.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { commandUsage } from "../config/usage.js";
|
|
2
|
-
import { startGUI } from "../start-gui.js";
|
|
3
|
-
// this command is only a view, it doesn't actually do anything at this time
|
|
4
|
-
export const views = async (_, __, conf) => {
|
|
5
|
-
await startGUI(conf);
|
|
6
|
-
};
|
|
7
|
-
export const usage = () => commandUsage({
|
|
8
|
-
command: 'gui',
|
|
9
|
-
usage: '',
|
|
10
|
-
description: 'Launch a graphical user interface in a browser',
|
|
11
|
-
});
|
|
12
|
-
export const command = async () => null;
|
|
13
|
-
//# sourceMappingURL=gui.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gui.js","sourceRoot":"","sources":["../../../src/commands/gui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAG1C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,KAAK,GAAiB,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;IACvD,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAA;AACtB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAiB,GAAG,EAAE,CACtC,YAAY,CAAC;IACX,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,EAAE;IACT,WAAW,EAAE,gDAAgD;CAC9D,CAAC,CAAA;AAEJ,MAAM,CAAC,MAAM,OAAO,GAAc,KAAK,IAAI,EAAE,CAAC,IAAI,CAAA","sourcesContent":["import { commandUsage } from '../config/usage.ts'\nimport type { CommandFn, CommandUsage } from '../index.ts'\nimport { startGUI } from '../start-gui.ts'\nimport type { ViewFn } from '../view.ts'\n\n// this command is only a view, it doesn't actually do anything at this time\nexport const views: ViewFn<null> = async (_, __, conf) => {\n await startGUI(conf)\n}\n\nexport const usage: CommandUsage = () =>\n commandUsage({\n command: 'gui',\n usage: '',\n description: 'Launch a graphical user interface in a browser',\n })\n\nexport const command: CommandFn = async () => null\n"]}
|