@vltpkg/cli-sdk 1.0.0-rc.18 → 1.0.0-rc.22
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/package.json +52 -49
- package/dist/commands/bugs.d.ts +0 -18
- package/dist/commands/bugs.d.ts.map +0 -1
- package/dist/commands/bugs.js +0 -164
- package/dist/commands/bugs.js.map +0 -1
- package/dist/commands/build.d.ts +0 -25
- package/dist/commands/build.d.ts.map +0 -1
- package/dist/commands/build.js +0 -102
- package/dist/commands/build.js.map +0 -1
- package/dist/commands/cache.d.ts +0 -65
- package/dist/commands/cache.d.ts.map +0 -1
- package/dist/commands/cache.js +0 -257
- package/dist/commands/cache.js.map +0 -1
- package/dist/commands/ci.d.ts +0 -11
- package/dist/commands/ci.d.ts.map +0 -1
- package/dist/commands/ci.js +0 -32
- package/dist/commands/ci.js.map +0 -1
- package/dist/commands/config.d.ts +0 -6
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js +0 -424
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/docs.d.ts +0 -18
- package/dist/commands/docs.d.ts.map +0 -1
- package/dist/commands/docs.js +0 -154
- package/dist/commands/docs.js.map +0 -1
- package/dist/commands/exec-cache.d.ts +0 -49
- package/dist/commands/exec-cache.d.ts.map +0 -1
- package/dist/commands/exec-cache.js +0 -146
- package/dist/commands/exec-cache.js.map +0 -1
- package/dist/commands/exec-local.d.ts +0 -6
- package/dist/commands/exec-local.d.ts.map +0 -1
- package/dist/commands/exec-local.js +0 -24
- package/dist/commands/exec-local.js.map +0 -1
- package/dist/commands/exec.d.ts +0 -9
- package/dist/commands/exec.d.ts.map +0 -1
- package/dist/commands/exec.js +0 -87
- package/dist/commands/exec.js.map +0 -1
- package/dist/commands/help.d.ts +0 -4
- package/dist/commands/help.d.ts.map +0 -1
- package/dist/commands/help.js +0 -39
- package/dist/commands/help.js.map +0 -1
- package/dist/commands/init.d.ts +0 -8
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -111
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/install/reporter.d.ts +0 -11
- package/dist/commands/install/reporter.d.ts.map +0 -1
- package/dist/commands/install/reporter.js +0 -94
- package/dist/commands/install/reporter.js.map +0 -1
- package/dist/commands/install.d.ts +0 -28
- package/dist/commands/install.d.ts.map +0 -1
- package/dist/commands/install.js +0 -46
- package/dist/commands/install.js.map +0 -1
- package/dist/commands/list.d.ts +0 -15
- package/dist/commands/list.d.ts.map +0 -1
- package/dist/commands/list.js +0 -195
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/login.d.ts +0 -4
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/login.js +0 -13
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.d.ts +0 -4
- package/dist/commands/logout.d.ts.map +0 -1
- package/dist/commands/logout.js +0 -13
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/pack.d.ts +0 -32
- package/dist/commands/pack.d.ts.map +0 -1
- package/dist/commands/pack.js +0 -147
- package/dist/commands/pack.js.map +0 -1
- package/dist/commands/pkg.d.ts +0 -7
- package/dist/commands/pkg.d.ts.map +0 -1
- package/dist/commands/pkg.js +0 -206
- package/dist/commands/pkg.js.map +0 -1
- package/dist/commands/publish.d.ts +0 -22
- package/dist/commands/publish.d.ts.map +0 -1
- package/dist/commands/publish.js +0 -245
- package/dist/commands/publish.js.map +0 -1
- package/dist/commands/query.d.ts +0 -16
- package/dist/commands/query.d.ts.map +0 -1
- package/dist/commands/query.js +0 -210
- package/dist/commands/query.js.map +0 -1
- package/dist/commands/run-exec.d.ts +0 -6
- package/dist/commands/run-exec.d.ts.map +0 -1
- package/dist/commands/run-exec.js +0 -14
- package/dist/commands/run-exec.js.map +0 -1
- package/dist/commands/run.d.ts +0 -6
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js +0 -36
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/token.d.ts +0 -4
- package/dist/commands/token.d.ts.map +0 -1
- package/dist/commands/token.js +0 -30
- package/dist/commands/token.js.map +0 -1
- package/dist/commands/uninstall.d.ts +0 -16
- package/dist/commands/uninstall.d.ts.map +0 -1
- package/dist/commands/uninstall.js +0 -26
- package/dist/commands/uninstall.js.map +0 -1
- package/dist/commands/update.d.ts +0 -14
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js +0 -41
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/version.d.ts +0 -26
- package/dist/commands/version.d.ts.map +0 -1
- package/dist/commands/version.js +0 -226
- package/dist/commands/version.js.map +0 -1
- package/dist/commands/whoami.d.ts +0 -13
- package/dist/commands/whoami.d.ts.map +0 -1
- package/dist/commands/whoami.js +0 -19
- package/dist/commands/whoami.js.map +0 -1
- package/dist/config/definition.d.ts +0 -396
- package/dist/config/definition.d.ts.map +0 -1
- package/dist/config/definition.js +0 -651
- package/dist/config/definition.js.map +0 -1
- package/dist/config/index.d.ts +0 -219
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -489
- package/dist/config/index.js.map +0 -1
- package/dist/config/merge.d.ts +0 -4
- package/dist/config/merge.d.ts.map +0 -1
- package/dist/config/merge.js +0 -28
- package/dist/config/merge.js.map +0 -1
- package/dist/config/usage.d.ts +0 -19
- package/dist/config/usage.d.ts.map +0 -1
- package/dist/config/usage.js +0 -40
- package/dist/config/usage.js.map +0 -1
- package/dist/custom-help.d.ts +0 -9
- package/dist/custom-help.d.ts.map +0 -1
- package/dist/custom-help.js +0 -392
- package/dist/custom-help.js.map +0 -1
- package/dist/exec-command.d.ts +0 -53
- package/dist/exec-command.d.ts.map +0 -1
- package/dist/exec-command.js +0 -310
- package/dist/exec-command.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -73
- package/dist/index.js.map +0 -1
- package/dist/load-command.d.ts +0 -16
- package/dist/load-command.d.ts.map +0 -1
- package/dist/load-command.js +0 -21
- package/dist/load-command.js.map +0 -1
- package/dist/output.d.ts +0 -21
- package/dist/output.d.ts.map +0 -1
- package/dist/output.js +0 -126
- package/dist/output.js.map +0 -1
- package/dist/pack-tarball.d.ts +0 -22
- package/dist/pack-tarball.d.ts.map +0 -1
- package/dist/pack-tarball.js +0 -249
- package/dist/pack-tarball.js.map +0 -1
- package/dist/parse-add-remove-args.d.ts +0 -29
- package/dist/parse-add-remove-args.d.ts.map +0 -1
- package/dist/parse-add-remove-args.js +0 -104
- package/dist/parse-add-remove-args.js.map +0 -1
- package/dist/print-err.d.ts +0 -14
- package/dist/print-err.d.ts.map +0 -1
- package/dist/print-err.js +0 -178
- package/dist/print-err.js.map +0 -1
- package/dist/query-host-contexts.d.ts +0 -16
- package/dist/query-host-contexts.d.ts.map +0 -1
- package/dist/query-host-contexts.js +0 -135
- package/dist/query-host-contexts.js.map +0 -1
- package/dist/read-password.d.ts +0 -8
- package/dist/read-password.d.ts.map +0 -1
- package/dist/read-password.js +0 -33
- package/dist/read-password.js.map +0 -1
- package/dist/view.d.ts +0 -30
- package/dist/view.d.ts.map +0 -1
- package/dist/view.js +0 -31
- package/dist/view.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,58 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/cli-sdk",
|
|
3
3
|
"description": "The source for the vlt CLI",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.22",
|
|
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":
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "vlt technology inc.",
|
|
12
|
+
"email": "support@vlt.sh"
|
|
13
|
+
},
|
|
11
14
|
"dependencies": {
|
|
15
|
+
"@resvg/resvg-wasm": "^2.6.2",
|
|
16
|
+
"@vltpkg/config": "1.0.0-rc.22",
|
|
17
|
+
"@vltpkg/dep-id": "1.0.0-rc.22",
|
|
18
|
+
"@vltpkg/dot-prop": "1.0.0-rc.22",
|
|
19
|
+
"@vltpkg/error-cause": "1.0.0-rc.22",
|
|
20
|
+
"@vltpkg/git": "1.0.0-rc.22",
|
|
21
|
+
"@vltpkg/graph": "1.0.0-rc.22",
|
|
22
|
+
"@vltpkg/graph-run": "1.0.0-rc.22",
|
|
23
|
+
"@vltpkg/init": "1.0.0-rc.22",
|
|
24
|
+
"@vltpkg/output": "1.0.0-rc.22",
|
|
25
|
+
"@vltpkg/package-info": "1.0.0-rc.22",
|
|
26
|
+
"@vltpkg/package-json": "1.0.0-rc.22",
|
|
27
|
+
"@vltpkg/promise-spawn": "1.0.0-rc.22",
|
|
28
|
+
"@vltpkg/query": "1.0.0-rc.22",
|
|
29
|
+
"@vltpkg/registry-client": "1.0.0-rc.22",
|
|
30
|
+
"@vltpkg/rollback-remove": "1.0.0-rc.22",
|
|
31
|
+
"@vltpkg/run": "1.0.0-rc.22",
|
|
32
|
+
"@vltpkg/security-archive": "1.0.0-rc.22",
|
|
33
|
+
"@vltpkg/spec": "1.0.0-rc.22",
|
|
34
|
+
"@vltpkg/types": "1.0.0-rc.22",
|
|
35
|
+
"@vltpkg/url-open": "1.0.0-rc.22",
|
|
36
|
+
"@vltpkg/vlt-json": "1.0.0-rc.22",
|
|
37
|
+
"@vltpkg/vlx": "1.0.0-rc.22",
|
|
38
|
+
"@vltpkg/workspaces": "1.0.0-rc.22",
|
|
39
|
+
"@vltpkg/xdg": "1.0.0-rc.22",
|
|
12
40
|
"ansi-to-pre": "^1.0.6",
|
|
41
|
+
"beautiful-mermaid": "^1.1.3",
|
|
13
42
|
"chalk": "^5.6.2",
|
|
14
43
|
"hosted-git-info": "^9.0.2",
|
|
15
44
|
"ink": "^6.5.1",
|
|
16
45
|
"ink-spinner": "^5.0.0",
|
|
17
46
|
"jackspeak": "^4.1.1",
|
|
18
|
-
"lz-string": "^1.5.0",
|
|
19
47
|
"minimatch": "^10.1.1",
|
|
20
48
|
"package-json-from-dist": "^1.0.1",
|
|
21
49
|
"path-scurry": "^2.0.1",
|
|
22
50
|
"polite-json": "^5.0.0",
|
|
23
51
|
"pretty-bytes": "^7.1.0",
|
|
52
|
+
"promise-call-limit": "^3.0.2",
|
|
24
53
|
"react": "^19.2.1",
|
|
25
54
|
"react-devtools-core": "^4.28.5",
|
|
26
|
-
"react-dom": "^19.2.1",
|
|
27
|
-
"signal-exit": "^4.1.0",
|
|
28
55
|
"ssri": "^13.0.0",
|
|
29
56
|
"supports-color": "^10.2.2",
|
|
30
|
-
"tar": "^7.5.2"
|
|
31
|
-
"@vltpkg/config": "1.0.0-rc.18",
|
|
32
|
-
"@vltpkg/dep-id": "1.0.0-rc.18",
|
|
33
|
-
"@vltpkg/dot-prop": "1.0.0-rc.18",
|
|
34
|
-
"@vltpkg/git": "1.0.0-rc.18",
|
|
35
|
-
"@vltpkg/graph": "1.0.0-rc.18",
|
|
36
|
-
"@vltpkg/graph-run": "1.0.0-rc.18",
|
|
37
|
-
"@vltpkg/error-cause": "1.0.0-rc.18",
|
|
38
|
-
"@vltpkg/init": "1.0.0-rc.18",
|
|
39
|
-
"@vltpkg/output": "1.0.0-rc.18",
|
|
40
|
-
"@vltpkg/package-info": "1.0.0-rc.18",
|
|
41
|
-
"@vltpkg/package-json": "1.0.0-rc.18",
|
|
42
|
-
"@vltpkg/promise-spawn": "1.0.0-rc.18",
|
|
43
|
-
"@vltpkg/query": "1.0.0-rc.18",
|
|
44
|
-
"@vltpkg/registry-client": "1.0.0-rc.18",
|
|
45
|
-
"@vltpkg/rollback-remove": "1.0.0-rc.18",
|
|
46
|
-
"@vltpkg/run": "1.0.0-rc.18",
|
|
47
|
-
"@vltpkg/security-archive": "1.0.0-rc.18",
|
|
48
|
-
"@vltpkg/server": "1.0.0-rc.18",
|
|
49
|
-
"@vltpkg/spec": "1.0.0-rc.18",
|
|
50
|
-
"@vltpkg/types": "1.0.0-rc.18",
|
|
51
|
-
"@vltpkg/url-open": "1.0.0-rc.18",
|
|
52
|
-
"@vltpkg/vlt-json": "1.0.0-rc.18",
|
|
53
|
-
"@vltpkg/vlx": "1.0.0-rc.18",
|
|
54
|
-
"@vltpkg/workspaces": "1.0.0-rc.18",
|
|
55
|
-
"@vltpkg/xdg": "1.0.0-rc.18"
|
|
57
|
+
"tar": "^7.5.2"
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
58
60
|
"@eslint/js": "^9.39.1",
|
|
@@ -68,34 +70,45 @@
|
|
|
68
70
|
},
|
|
69
71
|
"license": "BSD-2-Clause-Patent",
|
|
70
72
|
"engines": {
|
|
71
|
-
"node": ">=22.
|
|
73
|
+
"node": ">=22.22.0"
|
|
74
|
+
},
|
|
75
|
+
"scripts": {
|
|
76
|
+
"format": "prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache",
|
|
77
|
+
"format:check": "prettier --check . --ignore-path ../../.prettierignore --cache",
|
|
78
|
+
"lint": "eslint . --fix",
|
|
79
|
+
"lint:check": "eslint .",
|
|
80
|
+
"prepack": "tsc -p tsconfig.publish.json && ../../scripts/update-dist-exports.ts",
|
|
81
|
+
"snap": "tap",
|
|
82
|
+
"test": "tap",
|
|
83
|
+
"posttest": "tsc --noEmit",
|
|
84
|
+
"typecheck": "tsc --noEmit"
|
|
72
85
|
},
|
|
73
86
|
"tap": {
|
|
74
87
|
"extends": "../../tap-config.yaml"
|
|
75
88
|
},
|
|
76
89
|
"prettier": "../../.prettierrc.js",
|
|
77
|
-
"module": "./
|
|
90
|
+
"module": "./src/index.ts",
|
|
78
91
|
"type": "module",
|
|
79
92
|
"exports": {
|
|
80
93
|
"./package.json": "./package.json",
|
|
81
94
|
".": {
|
|
82
95
|
"import": {
|
|
83
|
-
"default": "./
|
|
96
|
+
"default": "./src/index.ts"
|
|
84
97
|
}
|
|
85
98
|
},
|
|
86
99
|
"./config": {
|
|
87
100
|
"import": {
|
|
88
|
-
"default": "./
|
|
101
|
+
"default": "./src/config/index.ts"
|
|
89
102
|
}
|
|
90
103
|
},
|
|
91
104
|
"./definition": {
|
|
92
105
|
"import": {
|
|
93
|
-
"default": "./
|
|
106
|
+
"default": "./src/config/definition.ts"
|
|
94
107
|
}
|
|
95
108
|
},
|
|
96
109
|
"./view": {
|
|
97
110
|
"import": {
|
|
98
|
-
"default": "./
|
|
111
|
+
"default": "./src/view.ts"
|
|
99
112
|
}
|
|
100
113
|
}
|
|
101
114
|
},
|
|
@@ -104,15 +117,5 @@
|
|
|
104
117
|
],
|
|
105
118
|
"keywords": [
|
|
106
119
|
"vltpkg"
|
|
107
|
-
]
|
|
108
|
-
|
|
109
|
-
"format": "prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache",
|
|
110
|
-
"format:check": "prettier --check . --ignore-path ../../.prettierignore --cache",
|
|
111
|
-
"lint": "eslint . --fix",
|
|
112
|
-
"lint:check": "eslint .",
|
|
113
|
-
"snap": "tap",
|
|
114
|
-
"test": "tap",
|
|
115
|
-
"posttest": "tsc --noEmit",
|
|
116
|
-
"typecheck": "tsc --noEmit"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
120
|
+
]
|
|
121
|
+
}
|
package/dist/commands/bugs.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { CommandFn, CommandUsage } from '../index.ts';
|
|
2
|
-
export declare const usage: CommandUsage;
|
|
3
|
-
type CommandResultSingle = {
|
|
4
|
-
url: string;
|
|
5
|
-
name: string;
|
|
6
|
-
};
|
|
7
|
-
type CommandResultMultiple = {
|
|
8
|
-
url: string;
|
|
9
|
-
name: string;
|
|
10
|
-
}[];
|
|
11
|
-
export type CommandResult = CommandResultSingle | CommandResultMultiple;
|
|
12
|
-
export declare const views: {
|
|
13
|
-
readonly human: (r: CommandResult) => string;
|
|
14
|
-
readonly json: (r: CommandResult) => CommandResult;
|
|
15
|
-
};
|
|
16
|
-
export declare const command: CommandFn<CommandResult>;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=bugs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bugs.d.ts","sourceRoot":"","sources":["../../src/commands/bugs.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAQ1D,eAAO,MAAM,KAAK,EAAE,YA2BhB,CAAA;AAEJ,KAAK,mBAAmB,GAAG;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,KAAK,qBAAqB,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;CACb,EAAE,CAAA;AAEH,MAAM,MAAM,aAAa,GACrB,mBAAmB,GACnB,qBAAqB,CAAA;AAEzB,eAAO,MAAM,KAAK;;;CAUuB,CAAA;AAkDzC,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,aAAa,CA4F5C,CAAA"}
|
package/dist/commands/bugs.js
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { error } from '@vltpkg/error-cause';
|
|
2
|
-
import { PackageInfoClient } from '@vltpkg/package-info';
|
|
3
|
-
import { Spec } from '@vltpkg/spec';
|
|
4
|
-
import { urlOpen } from '@vltpkg/url-open';
|
|
5
|
-
import { actual } from '@vltpkg/graph';
|
|
6
|
-
import { Query } from '@vltpkg/query';
|
|
7
|
-
import { SecurityArchive } from '@vltpkg/security-archive';
|
|
8
|
-
import { createHostContextsMap } from "../query-host-contexts.js";
|
|
9
|
-
import { commandUsage } from "../config/usage.js";
|
|
10
|
-
import hostedGitInfo from 'hosted-git-info';
|
|
11
|
-
const { fromUrl: hostedGitInfoFromUrl } = hostedGitInfo;
|
|
12
|
-
export const usage = () => commandUsage({
|
|
13
|
-
command: 'bugs',
|
|
14
|
-
usage: ['[<spec>]', '[--target=<query>]'],
|
|
15
|
-
description: `Open bug tracker for a package in a web browser.
|
|
16
|
-
Reads bug tracker information from package.json or fetches
|
|
17
|
-
manifest data for the specified package.`,
|
|
18
|
-
options: {
|
|
19
|
-
target: {
|
|
20
|
-
value: '<query>',
|
|
21
|
-
description: 'Query selector to filter packages using DSS syntax.',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
examples: {
|
|
25
|
-
'': {
|
|
26
|
-
description: 'Open bugs for the current package (reads local package.json)',
|
|
27
|
-
},
|
|
28
|
-
'abbrev@2.0.0': {
|
|
29
|
-
description: 'Open bugs for a specific package version',
|
|
30
|
-
},
|
|
31
|
-
'--target=":root > *"': {
|
|
32
|
-
description: 'List bug tracker URLs for all direct dependencies',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
export const views = {
|
|
37
|
-
human: r => {
|
|
38
|
-
if (Array.isArray(r)) {
|
|
39
|
-
let msg = 'Multiple package bug trackers found:\n';
|
|
40
|
-
msg += r.map(item => `• ${item.name}: ${item.url}`).join('\n');
|
|
41
|
-
return msg;
|
|
42
|
-
}
|
|
43
|
-
return '';
|
|
44
|
-
},
|
|
45
|
-
json: r => r,
|
|
46
|
-
};
|
|
47
|
-
const getUrlFromManifest = (manifest) => {
|
|
48
|
-
const { name, bugs, repository } = manifest;
|
|
49
|
-
if (!name) {
|
|
50
|
-
throw error('No package name found');
|
|
51
|
-
}
|
|
52
|
-
let url;
|
|
53
|
-
// Check bugs field first
|
|
54
|
-
if (bugs) {
|
|
55
|
-
if (typeof bugs === 'string') {
|
|
56
|
-
url = bugs;
|
|
57
|
-
}
|
|
58
|
-
else if (typeof bugs === 'object') {
|
|
59
|
-
if ('url' in bugs && bugs.url) {
|
|
60
|
-
url = bugs.url;
|
|
61
|
-
}
|
|
62
|
-
else if ('email' in bugs && bugs.email) {
|
|
63
|
-
url = `mailto:${bugs.email}`;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
// Try repository if no bugs field
|
|
68
|
-
if (!url && repository) {
|
|
69
|
-
const repoUrl = typeof repository === 'string' ? repository
|
|
70
|
-
: typeof repository === 'object' && 'url' in repository ?
|
|
71
|
-
repository.url
|
|
72
|
-
: /* c8 ignore next */ undefined;
|
|
73
|
-
if (repoUrl) {
|
|
74
|
-
const info = hostedGitInfoFromUrl(repoUrl.replace(/^git\+/, ''));
|
|
75
|
-
if (info?.bugs && typeof info.bugs === 'function') {
|
|
76
|
-
url = info.bugs();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
// Fallback to vlt.io package page
|
|
81
|
-
if (!url) {
|
|
82
|
-
url = `https://vlt.io/explore/npm/${name}/overview`;
|
|
83
|
-
}
|
|
84
|
-
return url;
|
|
85
|
-
};
|
|
86
|
-
export const command = async (conf) => {
|
|
87
|
-
const { projectRoot, packageJson } = conf.options;
|
|
88
|
-
const targetOption = conf.get('target');
|
|
89
|
-
// Handle --target query
|
|
90
|
-
if (targetOption) {
|
|
91
|
-
const mainManifest = packageJson.maybeRead(projectRoot);
|
|
92
|
-
if (!mainManifest) {
|
|
93
|
-
throw error('No package.json found in project root', {
|
|
94
|
-
path: projectRoot,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
const graph = actual.load({
|
|
98
|
-
...conf.options,
|
|
99
|
-
mainManifest,
|
|
100
|
-
monorepo: conf.options.monorepo,
|
|
101
|
-
loadManifests: true,
|
|
102
|
-
});
|
|
103
|
-
const securityArchive = Query.hasSecuritySelectors(targetOption) ?
|
|
104
|
-
await SecurityArchive.start({
|
|
105
|
-
nodes: [...graph.nodes.values()],
|
|
106
|
-
})
|
|
107
|
-
: undefined;
|
|
108
|
-
const hostContexts = await createHostContextsMap(conf);
|
|
109
|
-
const query = new Query({
|
|
110
|
-
nodes: new Set(graph.nodes.values()),
|
|
111
|
-
edges: graph.edges,
|
|
112
|
-
importers: graph.importers,
|
|
113
|
-
securityArchive,
|
|
114
|
-
hostContexts,
|
|
115
|
-
});
|
|
116
|
-
const { nodes } = await query.search(targetOption, {
|
|
117
|
-
signal: new AbortController().signal,
|
|
118
|
-
});
|
|
119
|
-
const results = [];
|
|
120
|
-
for (const node of nodes) {
|
|
121
|
-
if (!node.manifest)
|
|
122
|
-
continue;
|
|
123
|
-
const url = getUrlFromManifest(node.manifest);
|
|
124
|
-
results.push({
|
|
125
|
-
url,
|
|
126
|
-
name: node.name /* c8 ignore next */ ?? '(unknown)',
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
if (results.length === 0) {
|
|
130
|
-
throw error('No packages found matching target query', {
|
|
131
|
-
found: targetOption,
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
// If single result, open it
|
|
135
|
-
if (results.length === 1) {
|
|
136
|
-
const result = results[0];
|
|
137
|
-
/* c8 ignore next 3 */
|
|
138
|
-
if (!result) {
|
|
139
|
-
throw error('Unexpected empty result');
|
|
140
|
-
}
|
|
141
|
-
await urlOpen(result.url);
|
|
142
|
-
return result;
|
|
143
|
-
}
|
|
144
|
-
// Multiple results, return the list
|
|
145
|
-
return results;
|
|
146
|
-
}
|
|
147
|
-
// read the package spec from a positional argument or local package.json
|
|
148
|
-
const specArg = conf.positionals[0];
|
|
149
|
-
const manifest = conf.positionals.length === 0 ? packageJson.read(projectRoot)
|
|
150
|
-
: specArg ?
|
|
151
|
-
await new PackageInfoClient(conf.options).manifest(Spec.parseArgs(specArg, conf.options))
|
|
152
|
-
: /* c8 ignore next */ packageJson.read(projectRoot);
|
|
153
|
-
const url = getUrlFromManifest(manifest);
|
|
154
|
-
const { name } = manifest;
|
|
155
|
-
/* c8 ignore start - getUrlFromManifest already validates name */
|
|
156
|
-
if (!name) {
|
|
157
|
-
throw error('No package name found');
|
|
158
|
-
}
|
|
159
|
-
/* c8 ignore stop */
|
|
160
|
-
// Open the URL
|
|
161
|
-
await urlOpen(url);
|
|
162
|
-
return { url, name };
|
|
163
|
-
};
|
|
164
|
-
//# sourceMappingURL=bugs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,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C;gBACZ,MAAM,KAAK,CAAC,yBAAyB,CAAC,CAAA;YACxC,CAAC;YACD,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YACzB,OAAO,MAAM,CAAA;QACf,CAAC;QAED,oCAAoC;QACpC,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,yEAAyE;IACzE,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;IACnC,MAAM,QAAQ,GACZ,IAAI,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;QAC7D,CAAC,CAAC,OAAO,CAAC,CAAC;YACT,MAAM,IAAI,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAChD,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CACtC;YACH,CAAC,CAAC,oBAAoB,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;IAEtD,MAAM,GAAG,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IACxC,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAA;IACzB,iEAAiE;IACjE,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,KAAK,CAAC,uBAAuB,CAAC,CAAA;IACtC,CAAC;IACD,oBAAoB;IACpB,eAAe;IACf,MAAM,OAAO,CAAC,GAAG,CAAC,CAAA;IAElB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAA;AACtB,CAAC,CAAA","sourcesContent":["import { error } from '@vltpkg/error-cause'\nimport { PackageInfoClient } from '@vltpkg/package-info'\nimport { Spec } from '@vltpkg/spec'\nimport { urlOpen } from '@vltpkg/url-open'\nimport { actual } from '@vltpkg/graph'\nimport { Query } from '@vltpkg/query'\nimport { SecurityArchive } from '@vltpkg/security-archive'\nimport { createHostContextsMap } from '../query-host-contexts.ts'\nimport { commandUsage } from '../config/usage.ts'\nimport type { CommandFn, CommandUsage } from '../index.ts'\nimport type { Views } from '../view.ts'\nimport type { Manifest, NormalizedManifest } from '@vltpkg/types'\nimport hostedGitInfo from 'hosted-git-info'\nconst { fromUrl: hostedGitInfoFromUrl } = hostedGitInfo as {\n fromUrl: (url: string) => { bugs?: () => string } | null\n}\n\nexport const usage: CommandUsage = () =>\n commandUsage({\n command: 'bugs',\n usage: ['[<spec>]', '[--target=<query>]'],\n description: `Open bug tracker for a package in a web browser.\n Reads bug tracker information from package.json or fetches\n manifest data for the specified package.`,\n options: {\n target: {\n value: '<query>',\n description:\n 'Query selector to filter packages using DSS syntax.',\n },\n },\n examples: {\n '': {\n description:\n 'Open bugs for the current package (reads local package.json)',\n },\n 'abbrev@2.0.0': {\n description: 'Open bugs for a specific package version',\n },\n '--target=\":root > *\"': {\n description:\n 'List bug tracker URLs for all direct dependencies',\n },\n },\n })\n\ntype CommandResultSingle = {\n url: string\n name: string\n}\n\ntype CommandResultMultiple = {\n url: string\n name: string\n}[]\n\nexport type CommandResult =\n | CommandResultSingle\n | CommandResultMultiple\n\nexport const views = {\n human: r => {\n if (Array.isArray(r)) {\n let msg = 'Multiple package bug trackers found:\\n'\n msg += r.map(item => `• ${item.name}: ${item.url}`).join('\\n')\n return msg\n }\n return ''\n },\n json: r => r,\n} as const satisfies Views<CommandResult>\n\nconst getUrlFromManifest = (\n manifest: Manifest | NormalizedManifest,\n): string => {\n const { name, bugs, repository } = manifest\n\n if (!name) {\n throw error('No package name found')\n }\n\n let url: string | undefined\n\n // Check bugs field first\n if (bugs) {\n if (typeof bugs === 'string') {\n url = bugs\n } else if (typeof bugs === 'object') {\n if ('url' in bugs && bugs.url) {\n url = bugs.url\n } else if ('email' in bugs && bugs.email) {\n url = `mailto:${bugs.email}`\n }\n }\n }\n\n // Try repository if no bugs field\n if (!url && repository) {\n const repoUrl =\n typeof repository === 'string' ? repository\n : typeof repository === 'object' && 'url' in repository ?\n repository.url\n : /* c8 ignore next */ undefined\n\n if (repoUrl) {\n const info = hostedGitInfoFromUrl(repoUrl.replace(/^git\\+/, ''))\n if (info?.bugs && typeof info.bugs === 'function') {\n url = info.bugs()\n }\n }\n }\n\n // Fallback to vlt.io package page\n if (!url) {\n url = `https://vlt.io/explore/npm/${name}/overview`\n }\n\n return url\n}\n\nexport const command: CommandFn<CommandResult> = async conf => {\n const { projectRoot, packageJson } = conf.options\n const targetOption = conf.get('target')\n\n // Handle --target query\n if (targetOption) {\n const mainManifest = packageJson.maybeRead(projectRoot)\n if (!mainManifest) {\n throw error('No package.json found in project root', {\n path: projectRoot,\n })\n }\n\n const graph = actual.load({\n ...conf.options,\n mainManifest,\n monorepo: conf.options.monorepo,\n loadManifests: true,\n })\n\n const securityArchive =\n Query.hasSecuritySelectors(targetOption) ?\n await SecurityArchive.start({\n nodes: [...graph.nodes.values()],\n })\n : undefined\n\n const hostContexts = await createHostContextsMap(conf)\n const query = new Query({\n nodes: new Set(graph.nodes.values()),\n edges: graph.edges,\n importers: graph.importers,\n securityArchive,\n hostContexts,\n })\n\n const { nodes } = await query.search(targetOption, {\n signal: new AbortController().signal,\n })\n\n const results: CommandResultMultiple = []\n for (const node of nodes) {\n if (!node.manifest) continue\n const url = getUrlFromManifest(node.manifest)\n results.push({\n url,\n name: node.name /* c8 ignore next */ ?? '(unknown)',\n })\n }\n\n if (results.length === 0) {\n throw error('No packages found matching target query', {\n found: targetOption,\n })\n }\n\n // If single result, open it\n if (results.length === 1) {\n const result = results[0]\n /* c8 ignore next 3 */\n if (!result) {\n throw error('Unexpected empty result')\n }\n await urlOpen(result.url)\n return result\n }\n\n // Multiple results, return the list\n return results\n }\n\n // read the package spec from a positional argument or local package.json\n const specArg = conf.positionals[0]\n const manifest =\n conf.positionals.length === 0 ? packageJson.read(projectRoot)\n : specArg ?\n await new PackageInfoClient(conf.options).manifest(\n Spec.parseArgs(specArg, conf.options),\n )\n : /* c8 ignore next */ packageJson.read(projectRoot)\n\n const url = getUrlFromManifest(manifest)\n const { name } = manifest\n /* c8 ignore start - getUrlFromManifest already validates name */\n if (!name) {\n throw error('No package name found')\n }\n /* c8 ignore stop */\n // Open the URL\n await urlOpen(url)\n\n return { url, name }\n}\n"]}
|
package/dist/commands/build.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { BuildResult } from '@vltpkg/graph';
|
|
2
|
-
import type { CommandFn, CommandUsage } from '../index.ts';
|
|
3
|
-
export declare const views: {
|
|
4
|
-
readonly human: (result: BuildResult) => string;
|
|
5
|
-
readonly json: (result: BuildResult) => {
|
|
6
|
-
success: {
|
|
7
|
-
id: import("@vltpkg/dep-id").DepID;
|
|
8
|
-
name: string;
|
|
9
|
-
version: string | undefined;
|
|
10
|
-
}[];
|
|
11
|
-
failure: {
|
|
12
|
-
id: import("@vltpkg/dep-id").DepID;
|
|
13
|
-
name: string;
|
|
14
|
-
version: string | undefined;
|
|
15
|
-
}[];
|
|
16
|
-
message: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export declare const usage: CommandUsage;
|
|
20
|
-
/**
|
|
21
|
-
* Build command implementation. Runs any required "postinstall"
|
|
22
|
-
* lifecycle scripts and binary linking.
|
|
23
|
-
*/
|
|
24
|
-
export declare const command: CommandFn<BuildResult>;
|
|
25
|
-
//# sourceMappingURL=build.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAQ,MAAM,eAAe,CAAA;AAGtD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI1D,eAAO,MAAM,KAAK;6BACA,WAAW,KAAG,MAAM;4BAqBrB,WAAW;;;;;;;;;;;;;CAqBW,CAAA;AAEvC,eAAO,MAAM,KAAK,EAAE,YAsBhB,CAAA;AAWJ;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,WAAW,CAqC1C,CAAA"}
|
package/dist/commands/build.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { build } from '@vltpkg/graph';
|
|
2
|
-
import { error } from '@vltpkg/error-cause';
|
|
3
|
-
import { commandUsage } from "../config/usage.js";
|
|
4
|
-
import { isErrorWithCause } from '@vltpkg/types';
|
|
5
|
-
export const views = {
|
|
6
|
-
human: (result) => {
|
|
7
|
-
const successCount = result.success.length;
|
|
8
|
-
const failureCount = result.failure.length;
|
|
9
|
-
const messages = [];
|
|
10
|
-
if (successCount > 0) {
|
|
11
|
-
messages.push(`🔨 Built ${successCount} package${successCount === 1 ? '' : 's'} successfully.`);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
messages.push('📦 All packages are already built.');
|
|
15
|
-
}
|
|
16
|
-
if (failureCount > 0) {
|
|
17
|
-
messages.push(`🔎 ${failureCount} optional package${ /* c8 ignore next */failureCount === 1 ? '' : 's'} failed to build.`);
|
|
18
|
-
}
|
|
19
|
-
return messages.join('\n');
|
|
20
|
-
},
|
|
21
|
-
json: (result) => {
|
|
22
|
-
const successList = result.success.map(node => ({
|
|
23
|
-
id: node.id,
|
|
24
|
-
name: node.name,
|
|
25
|
-
version: node.version,
|
|
26
|
-
}));
|
|
27
|
-
const failureList = result.failure.map(node => ({
|
|
28
|
-
id: node.id,
|
|
29
|
-
name: node.name,
|
|
30
|
-
version: node.version,
|
|
31
|
-
}));
|
|
32
|
-
return {
|
|
33
|
-
success: successList,
|
|
34
|
-
failure: failureList,
|
|
35
|
-
message: successList.length > 0 ?
|
|
36
|
-
`Built ${successList.length} package${successList.length === 1 ? '' : 's'}.`
|
|
37
|
-
: 'No packages needed building.',
|
|
38
|
-
};
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
export const usage = () => commandUsage({
|
|
42
|
-
command: 'build',
|
|
43
|
-
usage: ['[query]', '[--target=<query>]'],
|
|
44
|
-
description: `Build the project based on the current dependency graph.
|
|
45
|
-
|
|
46
|
-
This command processes the installed packages in node_modules and runs
|
|
47
|
-
any necessary build steps, such as lifecycle scripts and binary linking.
|
|
48
|
-
|
|
49
|
-
The build process is idempotent and will only perform work that is
|
|
50
|
-
actually needed based on the current state of the dependency graph.
|
|
51
|
-
|
|
52
|
-
Use --target option or provide a query as a positional argument to filter
|
|
53
|
-
packages using DSS query language syntax, otherwise it will target
|
|
54
|
-
all packages with scripts (:scripts) by default.`,
|
|
55
|
-
options: {
|
|
56
|
-
target: {
|
|
57
|
-
value: '<query>',
|
|
58
|
-
description: 'Query selector to filter packages using DSS syntax.',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
const isGraphRunError = (error) => typeof error === 'object' &&
|
|
63
|
-
error !== null &&
|
|
64
|
-
'code' in error &&
|
|
65
|
-
error.code === 'GRAPHRUN_TRAVERSAL' &&
|
|
66
|
-
'node' in error;
|
|
67
|
-
/**
|
|
68
|
-
* Build command implementation. Runs any required "postinstall"
|
|
69
|
-
* lifecycle scripts and binary linking.
|
|
70
|
-
*/
|
|
71
|
-
export const command = async (conf) => {
|
|
72
|
-
const { options, projectRoot } = conf;
|
|
73
|
-
try {
|
|
74
|
-
// Get target from option or first positional, default to all scripts
|
|
75
|
-
const targetOption = conf.get('target');
|
|
76
|
-
const targetPositional = conf.positionals[0];
|
|
77
|
-
const target = targetOption ||
|
|
78
|
-
targetPositional ||
|
|
79
|
-
':scripts:not(:built):not(:malware)';
|
|
80
|
-
// Run the build process using the graph build function
|
|
81
|
-
const result = await build({
|
|
82
|
-
...options,
|
|
83
|
-
projectRoot,
|
|
84
|
-
packageJson: options.packageJson,
|
|
85
|
-
monorepo: options.monorepo,
|
|
86
|
-
scurry: options.scurry,
|
|
87
|
-
target,
|
|
88
|
-
});
|
|
89
|
-
return result;
|
|
90
|
-
}
|
|
91
|
-
catch (cause) {
|
|
92
|
-
const graphRunError = isErrorWithCause(cause) && isGraphRunError(cause.cause) ?
|
|
93
|
-
cause.cause
|
|
94
|
-
: undefined;
|
|
95
|
-
if (graphRunError?.code === 'GRAPHRUN_TRAVERSAL') {
|
|
96
|
-
throw error('Build failed:\n Failed to build package: ' +
|
|
97
|
-
`${graphRunError.node.name}@${graphRunError.node.version}`, { cause });
|
|
98
|
-
}
|
|
99
|
-
throw error('Build failed', { cause });
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
//# sourceMappingURL=build.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAEhD,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,KAAK,EAAE,CAAC,MAAmB,EAAU,EAAE;QACrC,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAA;QAC1C,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAA;QAC1C,MAAM,QAAQ,GAAa,EAAE,CAAA;QAE7B,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;YACrB,QAAQ,CAAC,IAAI,CACX,YAAY,YAAY,WAAW,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,gBAAgB,CACjF,CAAA;QACH,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAA;QACrD,CAAC;QAED,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;YACrB,QAAQ,CAAC,IAAI,CACX,MAAM,YAAY,oBAAoB,CAAA,oBAAqB,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CA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c,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IACxC,CAAC;AACH,CAAC,CAAA","sourcesContent":["import { build } from '@vltpkg/graph'\nimport type { BuildResult, Node } from '@vltpkg/graph'\nimport { error } from '@vltpkg/error-cause'\nimport { commandUsage } from '../config/usage.ts'\nimport type { CommandFn, CommandUsage } from '../index.ts'\nimport type { Views } from '../view.ts'\nimport { isErrorWithCause } from '@vltpkg/types'\n\nexport const views = {\n human: (result: BuildResult): string => {\n const successCount = result.success.length\n const failureCount = result.failure.length\n const messages: string[] = []\n\n if (successCount > 0) {\n messages.push(\n `🔨 Built ${successCount} package${successCount === 1 ? '' : 's'} successfully.`,\n )\n } else {\n messages.push('📦 All packages are already built.')\n }\n\n if (failureCount > 0) {\n messages.push(\n `🔎 ${failureCount} optional package${/* c8 ignore next */ failureCount === 1 ? '' : 's'} failed to build.`,\n )\n }\n\n return messages.join('\\n')\n },\n json: (result: BuildResult) => {\n const successList = result.success.map(node => ({\n id: node.id,\n name: node.name,\n version: node.version,\n }))\n const failureList = result.failure.map(node => ({\n id: node.id,\n name: node.name,\n version: node.version,\n }))\n\n return {\n success: successList,\n failure: failureList,\n message:\n successList.length > 0 ?\n `Built ${successList.length} package${successList.length === 1 ? '' : 's'}.`\n : 'No packages needed building.',\n }\n },\n} as const satisfies Views<BuildResult>\n\nexport const usage: CommandUsage = () =>\n commandUsage({\n command: 'build',\n usage: ['[query]', '[--target=<query>]'],\n description: `Build the project based on the current dependency graph.\n\n This command processes the installed packages in node_modules and runs\n any necessary build steps, such as lifecycle scripts and binary linking.\n \n The build process is idempotent and will only perform work that is\n actually needed based on the current state of the dependency graph.\n \n Use --target option or provide a query as a positional argument to filter\n packages using DSS query language syntax, otherwise it will target\n all packages with scripts (:scripts) by default.`,\n options: {\n target: {\n value: '<query>',\n description:\n 'Query selector to filter packages using DSS syntax.',\n },\n },\n })\n\nconst isGraphRunError = (\n error: unknown,\n): error is Error & { code: string; node: Node } =>\n typeof error === 'object' &&\n error !== null &&\n 'code' in error &&\n error.code === 'GRAPHRUN_TRAVERSAL' &&\n 'node' in error\n\n/**\n * Build command implementation. Runs any required \"postinstall\"\n * lifecycle scripts and binary linking.\n */\nexport const command: CommandFn<BuildResult> = async conf => {\n const { options, projectRoot } = conf\n\n try {\n // Get target from option or first positional, default to all scripts\n const targetOption = conf.get('target')\n const targetPositional = conf.positionals[0]\n const target =\n targetOption ||\n targetPositional ||\n ':scripts:not(:built):not(:malware)'\n\n // Run the build process using the graph build function\n const result = await build({\n ...options,\n projectRoot,\n packageJson: options.packageJson,\n monorepo: options.monorepo,\n scurry: options.scurry,\n target,\n })\n\n return result\n } catch (cause) {\n const graphRunError =\n isErrorWithCause(cause) && isGraphRunError(cause.cause) ?\n cause.cause\n : undefined\n if (graphRunError?.code === 'GRAPHRUN_TRAVERSAL') {\n throw error(\n 'Build failed:\\n Failed to build package: ' +\n `${graphRunError.node.name}@${graphRunError.node.version}`,\n { cause },\n )\n }\n throw error('Build failed', { cause })\n }\n}\n"]}
|
package/dist/commands/cache.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { CacheEntry } from '@vltpkg/registry-client';
|
|
2
|
-
import type { LoadedConfig } from '../config/index.ts';
|
|
3
|
-
import type { CommandFn, CommandUsage } from '../index.ts';
|
|
4
|
-
import type { ViewOptions, Views } from '../view.ts';
|
|
5
|
-
import { ViewClass } from '../view.ts';
|
|
6
|
-
export type CacheMap = Record<string, ReturnType<CacheEntry['toJSON']>>;
|
|
7
|
-
export type CacheSubcommands = keyof (typeof usageDef)['subcommands'];
|
|
8
|
-
export declare class CacheView extends ViewClass {
|
|
9
|
-
constructor(options: ViewOptions, conf: LoadedConfig);
|
|
10
|
-
stdout(...args: unknown[]): void;
|
|
11
|
-
}
|
|
12
|
-
export declare const views: Views<void | CacheMap>;
|
|
13
|
-
declare const usageDef: {
|
|
14
|
-
readonly command: "cache";
|
|
15
|
-
readonly usage: "<command> [flags]";
|
|
16
|
-
readonly description: "Work with vlt cache folders";
|
|
17
|
-
readonly subcommands: {
|
|
18
|
-
readonly add: {
|
|
19
|
-
readonly usage: "<package-spec> [<package-spec>...]";
|
|
20
|
-
readonly description: "Resolve the referenced package identifiers and ensure they\n are cached.";
|
|
21
|
-
};
|
|
22
|
-
readonly ls: {
|
|
23
|
-
readonly usage: "[<key>...]";
|
|
24
|
-
readonly description: "Show cache entries. If no keys are provided, then a list of\n available keys will be printed. If one or more keys are\n provided, then details will be shown for the specified\n items.";
|
|
25
|
-
};
|
|
26
|
-
readonly info: {
|
|
27
|
-
readonly usage: "<key>";
|
|
28
|
-
readonly description: "Print metadata details for the specified cache key to\n stderr, and the response body to stdout.";
|
|
29
|
-
};
|
|
30
|
-
readonly clean: {
|
|
31
|
-
readonly usage: "[<key>...]";
|
|
32
|
-
readonly description: "Purge expired cache entries. If one or more keys are\n provided, then only those cache entries will be\n considered.";
|
|
33
|
-
};
|
|
34
|
-
readonly delete: {
|
|
35
|
-
readonly usage: "<key> [<key>...]";
|
|
36
|
-
readonly description: "Purge items explicitly, whether expired or not. If one or\n more keys are provided, then only those cache entries will\n be considered.";
|
|
37
|
-
};
|
|
38
|
-
readonly 'delete-before': {
|
|
39
|
-
readonly usage: "<date>";
|
|
40
|
-
readonly description: "Purge all cache items from before a given date. Date can be\n provided in any format that JavaScript can parse.";
|
|
41
|
-
};
|
|
42
|
-
readonly 'delete-all': {
|
|
43
|
-
readonly usage: "";
|
|
44
|
-
readonly description: "Delete the entire cache folder to make vlt slower.";
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
readonly examples: {
|
|
48
|
-
readonly 'vlt cache ls https://registry.npmjs.org/typescript': {
|
|
49
|
-
readonly description: "Show cache metadata for a given registry URL";
|
|
50
|
-
};
|
|
51
|
-
readonly 'vlt cache add eslint@latest': {
|
|
52
|
-
readonly description: "Add a given package specifier to the cache by fetching\n its resolved value.";
|
|
53
|
-
};
|
|
54
|
-
readonly 'vlt cache info https://registry.npmjs.org/eslint/-/eslint-9.25.1.tgz > eslint.tgz': {
|
|
55
|
-
readonly description: "Print the cache metadata to stderr, and write the tarball\n on stdout, redirecting to a file.";
|
|
56
|
-
};
|
|
57
|
-
readonly 'vlt cache delete-before 2025-01-01': {
|
|
58
|
-
readonly description: "Delete all entries created before Jan 1, 2025";
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
export declare const usage: CommandUsage;
|
|
63
|
-
export declare const command: CommandFn<void | CacheMap>;
|
|
64
|
-
export {};
|
|
65
|
-
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/commands/cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAIpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGtD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,MAAM,MAAM,QAAQ,GAAG,MAAM,CAC3B,MAAM,EACN,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CACjC,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAA;AAGrE,qBAAa,SAAU,SAAQ,SAAS;gBAC1B,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY;IAIpD,MAAM,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;CAG1B;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,IAAI,GAAG,QAAQ,CAExC,CAAA;AAED,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoE6B,CAAA;AAE3C,eAAO,MAAM,KAAK,EAAE,YAA2C,CAAA;AAE/D,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,IAAI,GAAG,QAAQ,CAgC9C,CAAA"}
|