@vltpkg/cli-js 1.5.0 → 1.6.0
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/{access-QPX4QXV4.js → access-AJ654YKY.js} +8 -8
- package/{bugs-TLOECXEM.js → bugs-N73DVYHD.js} +23 -19
- package/{build-IQOS3LKO.js → build-VZ3EZKMM.js} +49 -14
- package/{cache-O5IBYYSB.js → cache-VROEWG2C.js} +16 -13
- package/cache-unzip-src-unzip.js +23 -4
- package/{chunk-7UWRR6EE.js → chunk-22LZBDEC.js} +1 -1
- package/{chunk-4UH3KMTD.js → chunk-36UIE654.js} +252 -448
- package/{chunk-43EJ4Q42.js → chunk-3JIN46K5.js} +1 -1
- package/{chunk-35EG6T3J.js → chunk-44AWMA4F.js} +21 -9
- package/chunk-4E65BBTM.js +77 -0
- package/{chunk-5KW6AOTT.js → chunk-4GMNWW4C.js} +1 -1
- package/{chunk-LUVDMEW4.js → chunk-6D3QAFNZ.js} +1 -1
- package/{chunk-6W5XMVIZ.js → chunk-75HGJVNG.js} +7 -7
- package/{chunk-UZ6ICZE3.js → chunk-7M2VTFLP.js} +12 -1
- package/{chunk-XCSNI6AO.js → chunk-ANW36H4T.js} +4 -4
- package/{chunk-6LZM3I4Q.js → chunk-BF5DRGRZ.js} +25 -4
- package/chunk-BH5CVXNY.js +115 -0
- package/{chunk-F7NPYSI2.js → chunk-CAV7FKWQ.js} +2 -2
- package/{chunk-MYX4JCIJ.js → chunk-CYK6I4M6.js} +1 -1
- package/chunk-DXED4ARV.js +436 -0
- package/chunk-E74WGW5C.js +49 -0
- package/{chunk-CMLDLZZ3.js → chunk-EFHOWRKU.js} +56 -0
- package/{chunk-IFEZ6BFV.js → chunk-EMTGRCSE.js} +2 -2
- package/{chunk-4TSHLSRK.js → chunk-EYGOEAJM.js} +1 -1
- package/{chunk-2U4PVHP4.js → chunk-F5LZMLAQ.js} +123 -40
- package/{chunk-Z5D5KODU.js → chunk-FXD3IV2S.js} +4 -2
- package/chunk-GCTREKA4.js +115 -0
- package/{chunk-G3FZ2ZJK.js → chunk-GEQFMH5M.js} +1 -1
- package/{chunk-CS6AYPY5.js → chunk-GZVI75KX.js} +6 -13
- package/{chunk-CW56EJIL.js → chunk-HT6FS4VB.js} +1 -1
- package/{chunk-LH7J5BDU.js → chunk-IXAMCWIT.js} +3 -3
- package/{chunk-ARE7FKDG.js → chunk-JCNI6ZHH.js} +5 -5
- package/chunk-JV5XR5JQ.js +349 -0
- package/{chunk-IJUVVD7E.js → chunk-KD5ZK72K.js} +1 -1
- package/{chunk-WHWPAYZY.js → chunk-KVWGMSPW.js} +26 -6
- package/{chunk-VR7NRWAD.js → chunk-LCLRP64K.js} +8 -8
- package/{chunk-X6JKMIOU.js → chunk-LGQVZTYR.js} +4 -36
- package/{chunk-XCQCYB6G.js → chunk-LP3ORD3D.js} +142 -16
- package/chunk-MCDLJZXT.js +82 -0
- package/{chunk-ISAMD2FE.js → chunk-N6HV7JWC.js} +1 -1
- package/chunk-O6MQ7NN6.js +1155 -0
- package/{chunk-3S3W7QEM.js → chunk-PC2HOBAQ.js} +3 -3
- package/{chunk-GUP55DM6.js → chunk-RBQO54TG.js} +2 -2
- package/{chunk-C6ZVVEFV.js → chunk-TQQO2F56.js} +4 -3
- package/{chunk-XD5KUDXX.js → chunk-TWDSXQPN.js} +10 -8
- package/{chunk-T5EP7QEF.js → chunk-VLVMLSIF.js} +2 -2
- package/{chunk-SMXXFQPI.js → chunk-YTDABXPD.js} +3 -3
- package/{ci-ESVUMOZO.js → ci-3BVMVQIT.js} +21 -17
- package/cli-package.json +3 -1
- package/{config-ZVVLFKR7.js → config-2KQV7N5A.js} +12 -11
- package/{config-TMB2X6DW.js → config-EKHBW6I5.js} +10 -9
- package/{create-BLTNKSBQ.js → create-QVHNOIV3.js} +28 -24
- package/{deprecate-VA6PGHYL.js → deprecate-E254QBH6.js} +12 -12
- package/{dist-tag-OYJREFO2.js → dist-tag-SITRFD7O.js} +8 -8
- package/{docs-6OC3OQNM.js → docs-IDL2P7CA.js} +23 -19
- package/{exec-AZPGFVRY.js → exec-7BK2W2WL.js} +28 -24
- package/{exec-cache-D75UY2WI.js → exec-cache-VY46L7DR.js} +24 -20
- package/{exec-local-E2JKB4X4.js → exec-local-D7R5T3DF.js} +22 -18
- package/{help-UPW77X5N.js → help-RMRIEJQL.js} +5 -4
- package/{init-SNO6QL7C.js → init-BGW4HJ6V.js} +13 -12
- package/{install-TEJM2YVX.js → install-U5GATZ2N.js} +108 -52
- package/{list-NHCC2RNB.js → list-3VG4M2XL.js} +29 -22
- package/{login-XNZXCGFD.js → login-PHQWI6S6.js} +14 -13
- package/{logout-YCM7O36Q.js → logout-DJCOGRFF.js} +8 -8
- package/{outdated-4LA7N63W.js → outdated-JH3O6R3Y.js} +18 -17
- package/{pack-RC4CZSWF.js → pack-U5W5YWHK.js} +15 -14
- package/package.json +1 -1
- package/{ping-RLVAZGDL.js → ping-EKX43AOW.js} +8 -8
- package/{pkg-FED5C6TP.js → pkg-SW5GMERT.js} +15 -14
- package/{profile-DJZNLQPG.js → profile-UGDRDMQ6.js} +8 -8
- package/{publish-54AMVMTQ.js → publish-HTWKK3NN.js} +24 -20
- package/{query-ZQLMSJ7O.js → query-YE3FUVGG.js} +29 -22
- package/{registry-6HKQYSZX.js → registry-ZGGWVLBM.js} +5 -5
- package/registry-client-src-revalidate.js +41 -11
- package/{repo-ITA4BLZ4.js → repo-WDOCU6SE.js} +23 -19
- package/{reporter-UYVR2WMB.js → reporter-N5PAXB26.js} +61 -15
- package/{run-TP2HTJRN.js → run-IPARVIIQ.js} +22 -18
- package/{run-exec-UGCC53DV.js → run-exec-C4RTREEW.js} +22 -18
- package/security-archive-src-update-expired.js +24 -5
- package/{setup-XPAM5U3Z.js → setup-SYYUEHZL.js} +206 -27
- package/{skills-YD2TB2VD.js → skills-KA2VR5Q5.js} +41 -56
- package/{skills-LR6GXW3X.js → skills-UBBMSBDQ.js} +24 -21
- package/{src-34D4DOOH.js → src-FUSTSM4J.js} +25 -19
- package/{src-H6DFCAPH.js → src-QO5G2S4O.js} +6 -4
- package/{src-LHDC4NJO.js → src-W2VQULRG.js} +2 -2
- package/{token-OF63PFTQ.js → token-UQNABECH.js} +10 -9
- package/{uninstall-B54FQ5KQ.js → uninstall-FHBJ3OUV.js} +53 -17
- package/{unpublish-CSHIGMDQ.js → unpublish-APJTEUBA.js} +8 -8
- package/{update-HS4VJ5ZG.js → update-NWZTL4S7.js} +19 -17
- package/{version-L7S3DHUS.js → version-EMKKTL77.js} +14 -13
- package/{view-NWKKWFVA.js → view-BUUI33RV.js} +12 -12
- package/vlr.js +1 -1
- package/vlrx.js +1 -1
- package/vlt.js +1 -1
- package/vlx.js +1 -1
- package/vlxl.js +1 -1
- package/{whoami-65K35VGW.js → whoami-F6BSXGQ2.js} +8 -8
- package/chunk-T2VBCUF5.js +0 -77
|
@@ -11,37 +11,58 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
stdout
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-KVWGMSPW.js";
|
|
15
|
+
import "./chunk-LGQVZTYR.js";
|
|
16
|
+
import "./chunk-EYGOEAJM.js";
|
|
17
17
|
import {
|
|
18
18
|
commandUsage
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-HT6FS4VB.js";
|
|
20
20
|
import {
|
|
21
21
|
configWriteTarget,
|
|
22
22
|
registrySelectionFields
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-LP3ORD3D.js";
|
|
24
|
+
import "./chunk-LCLRP64K.js";
|
|
25
25
|
import "./chunk-SRWDPPLX.js";
|
|
26
|
-
import
|
|
27
|
-
|
|
26
|
+
import {
|
|
27
|
+
applyPathSetup,
|
|
28
|
+
ask,
|
|
29
|
+
editPathHint,
|
|
30
|
+
pathSetupChanged,
|
|
31
|
+
pathSetupFiles,
|
|
32
|
+
pathSetupLines,
|
|
33
|
+
planPathSetup,
|
|
34
|
+
rcList,
|
|
35
|
+
resolveGlobalBinDir,
|
|
36
|
+
sourceCommand
|
|
37
|
+
} from "./chunk-O6MQ7NN6.js";
|
|
38
|
+
import {
|
|
39
|
+
detectShell,
|
|
40
|
+
prettyPath,
|
|
41
|
+
shellPathCommand
|
|
42
|
+
} from "./chunk-BH5CVXNY.js";
|
|
43
|
+
import "./chunk-JV5XR5JQ.js";
|
|
44
|
+
import "./chunk-EMTGRCSE.js";
|
|
45
|
+
import "./chunk-TQQO2F56.js";
|
|
28
46
|
import "./chunk-4KCU2KZL.js";
|
|
29
47
|
import "./chunk-WGDTG44V.js";
|
|
48
|
+
import "./chunk-E74WGW5C.js";
|
|
49
|
+
import "./chunk-GCTREKA4.js";
|
|
50
|
+
import "./chunk-MCDLJZXT.js";
|
|
30
51
|
import {
|
|
31
52
|
normalizeRegistryURL
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
53
|
+
} from "./chunk-7M2VTFLP.js";
|
|
54
|
+
import "./chunk-EFHOWRKU.js";
|
|
55
|
+
import "./chunk-CAV7FKWQ.js";
|
|
56
|
+
import "./chunk-6D3QAFNZ.js";
|
|
36
57
|
import "./chunk-HTOTG4TS.js";
|
|
37
58
|
import {
|
|
38
59
|
RegistryClient,
|
|
39
60
|
getKC,
|
|
40
61
|
normalizeRegistryKey
|
|
41
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-44AWMA4F.js";
|
|
42
63
|
import "./chunk-QNHBAGXQ.js";
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
64
|
+
import "./chunk-GEQFMH5M.js";
|
|
65
|
+
import "./chunk-4GMNWW4C.js";
|
|
45
66
|
import "./chunk-SUU2WETN.js";
|
|
46
67
|
import "./chunk-B6RIGNEO.js";
|
|
47
68
|
import "./chunk-XNLSTHDK.js";
|
|
@@ -53,7 +74,7 @@ import {
|
|
|
53
74
|
defaultRegistries,
|
|
54
75
|
isErrorWithCause,
|
|
55
76
|
isObject
|
|
56
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-BF5DRGRZ.js";
|
|
57
78
|
import {
|
|
58
79
|
error
|
|
59
80
|
} from "./chunk-WZWDS3W4.js";
|
|
@@ -89,8 +110,43 @@ var accountAuthError = (account, er) => isErrorWithCause(er) && isObject(er.caus
|
|
|
89
110
|
].join("\n"),
|
|
90
111
|
{ code: "ECONFIG", cause: er }
|
|
91
112
|
) : asError(er);
|
|
113
|
+
var pathView = (r, wizard = false) => {
|
|
114
|
+
if (r.status === "failed") {
|
|
115
|
+
return `\u26A0\uFE0F Could not add the global bin folder to your PATH: ${r.message}`;
|
|
116
|
+
}
|
|
117
|
+
const dir = prettyPath(r.dir);
|
|
118
|
+
const rcs = rcList(r.files);
|
|
119
|
+
const keep = process.platform === "win32" ? [` To keep it: ${editPathHint}`] : [];
|
|
120
|
+
switch (r.status) {
|
|
121
|
+
case "added":
|
|
122
|
+
return pathSetupLines(r, r.source).join("\n");
|
|
123
|
+
case "unchanged":
|
|
124
|
+
return [
|
|
125
|
+
`\u2705 ${dir} is already added to your PATH in ${rcs}`,
|
|
126
|
+
` Open a new terminal, or run: ${r.source}`
|
|
127
|
+
].join("\n");
|
|
128
|
+
case "in-path":
|
|
129
|
+
return wizard ? "" : `\u2705 ${dir} is already on your PATH`;
|
|
130
|
+
case "disabled":
|
|
131
|
+
return [
|
|
132
|
+
`\u2139\uFE0F no-modify-path is set, so nothing was changed. To add ${dir} to your PATH, run:`,
|
|
133
|
+
` ${r.command}`,
|
|
134
|
+
...keep
|
|
135
|
+
].join("\n");
|
|
136
|
+
case "cancelled":
|
|
137
|
+
if (wizard) {
|
|
138
|
+
return `\u2139\uFE0F Skipped. Run \`vlt setup --path\` later to add ${dir} to your PATH.`;
|
|
139
|
+
}
|
|
140
|
+
return [
|
|
141
|
+
`Nothing changed. To add ${dir} to your PATH, run:`,
|
|
142
|
+
` ${r.command}`,
|
|
143
|
+
...keep
|
|
144
|
+
].join("\n");
|
|
145
|
+
}
|
|
146
|
+
};
|
|
92
147
|
var views = {
|
|
93
148
|
human: (result) => {
|
|
149
|
+
if (!("account" in result)) return pathView(result.path);
|
|
94
150
|
const lines = [
|
|
95
151
|
`Configured ${Object.keys(result.registries).length} registry ${Object.keys(result.registries).length === 1 ? "alias" : "aliases"} for "${result.account}" in ${result.which} config:`
|
|
96
152
|
];
|
|
@@ -105,6 +161,8 @@ var views = {
|
|
|
105
161
|
"to configure this project instead."
|
|
106
162
|
);
|
|
107
163
|
}
|
|
164
|
+
const path = result.path && pathView(result.path, true);
|
|
165
|
+
if (path) lines.push("", path);
|
|
108
166
|
lines.push(
|
|
109
167
|
"",
|
|
110
168
|
"You can now install packages, e.g.:",
|
|
@@ -115,7 +173,10 @@ var views = {
|
|
|
115
173
|
};
|
|
116
174
|
var usage = () => commandUsage({
|
|
117
175
|
command: "setup",
|
|
118
|
-
usage:
|
|
176
|
+
usage: [
|
|
177
|
+
"[<account>]",
|
|
178
|
+
"--path [--yes] [--global-bin-dir=<path>]"
|
|
179
|
+
],
|
|
119
180
|
description: `Configure the registry aliases for your vlt.io account so
|
|
120
181
|
that \`vlt install\` and \`vlx\` work out of the box.
|
|
121
182
|
|
|
@@ -123,7 +184,19 @@ var usage = () => commandUsage({
|
|
|
123
184
|
authenticates against your account, stores the token
|
|
124
185
|
for both the \`npm\` and \`main\` registries, and writes
|
|
125
186
|
those aliases (and any additional aliases you add) to
|
|
126
|
-
your user \`vlt.json
|
|
187
|
+
your user \`vlt.json\`.
|
|
188
|
+
|
|
189
|
+
In a terminal, if the global bin folder isn't on
|
|
190
|
+
your \`PATH\` or set up yet, it ends by asking
|
|
191
|
+
\`Setup PATH for global installs? (Y/n)\`: yes adds
|
|
192
|
+
it (same as \`--path\`), no skips it. Run
|
|
193
|
+
\`vlt setup --path\` later to do just that step.
|
|
194
|
+
|
|
195
|
+
With \`--path\`, add the global bin folder
|
|
196
|
+
(\`--global-bin-dir\`) to your \`PATH\` instead: writes
|
|
197
|
+
\`<global-dir>/env\` and a marked section that loads
|
|
198
|
+
it into your shell config. On Windows it adds it to
|
|
199
|
+
your user \`Path\` (\`HKCU\\Environment\`).`,
|
|
127
200
|
options: {
|
|
128
201
|
config: {
|
|
129
202
|
value: "<user | project>",
|
|
@@ -134,15 +207,119 @@ var usage = () => commandUsage({
|
|
|
134
207
|
description: "Additional registry aliases to stage non-interactively. Combine with `--yes` to run setup unattended."
|
|
135
208
|
},
|
|
136
209
|
yes: {
|
|
137
|
-
description: "Skip interactive prompts (requires <account> and does not open a browser for authentication)."
|
|
210
|
+
description: "Skip interactive prompts (requires <account> and does not open a browser for authentication). With --path: edit without asking. Without --path: skips the PATH prompt."
|
|
211
|
+
},
|
|
212
|
+
path: {
|
|
213
|
+
description: "Only add the global bin folder to your PATH via your shell config (user Path on Windows)."
|
|
214
|
+
},
|
|
215
|
+
"global-bin-dir": {
|
|
216
|
+
value: "<path>",
|
|
217
|
+
description: "The folder to add to your PATH."
|
|
138
218
|
}
|
|
139
219
|
}
|
|
140
220
|
});
|
|
221
|
+
var runPathSetup = async (o) => {
|
|
222
|
+
const root = o.globalDir;
|
|
223
|
+
const bin = await resolveGlobalBinDir({
|
|
224
|
+
projectRoot: root,
|
|
225
|
+
globalBinDir: o.globalBinDir
|
|
226
|
+
});
|
|
227
|
+
const shell = detectShell();
|
|
228
|
+
const base = {
|
|
229
|
+
dir: bin.dir,
|
|
230
|
+
shell,
|
|
231
|
+
files: [],
|
|
232
|
+
backups: [],
|
|
233
|
+
command: shellPathCommand(shell, bin.dir),
|
|
234
|
+
source: sourceCommand(shell, root, bin.dir)
|
|
235
|
+
};
|
|
236
|
+
if (bin.inPath) {
|
|
237
|
+
return { ...base, status: "in-path" };
|
|
238
|
+
}
|
|
239
|
+
if (o.noModifyPath) {
|
|
240
|
+
return { ...base, status: "disabled" };
|
|
241
|
+
}
|
|
242
|
+
const opts = { globalDir: root, dir: bin.dir, shell };
|
|
243
|
+
let plan = await planPathSetup(opts);
|
|
244
|
+
const files = pathSetupFiles(plan);
|
|
245
|
+
if (!pathSetupChanged(plan)) {
|
|
246
|
+
return { ...base, status: "unchanged", files };
|
|
247
|
+
}
|
|
248
|
+
if (!o.yes) {
|
|
249
|
+
if (!process.stdin.isTTY) {
|
|
250
|
+
throw error(
|
|
251
|
+
"Not a terminal: pass --yes to add it to your PATH",
|
|
252
|
+
{
|
|
253
|
+
code: "EUSAGE"
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
const answer = await (o.ask ?? ask)(
|
|
258
|
+
o.question({ dir: prettyPath(bin.dir), rcs: rcList(files) })
|
|
259
|
+
).catch((er) => {
|
|
260
|
+
if (asError(er).name !== "AbortError") throw er;
|
|
261
|
+
process.stdout.write("\n");
|
|
262
|
+
return "n";
|
|
263
|
+
});
|
|
264
|
+
if (/^n/i.test(answer)) {
|
|
265
|
+
return { ...base, status: "cancelled", files };
|
|
266
|
+
}
|
|
267
|
+
plan = await planPathSetup(opts);
|
|
268
|
+
}
|
|
269
|
+
const r = await applyPathSetup(plan);
|
|
270
|
+
return {
|
|
271
|
+
...base,
|
|
272
|
+
status: "added",
|
|
273
|
+
files: r.files,
|
|
274
|
+
backups: r.backups
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
var setupPath = async (conf, root) => {
|
|
278
|
+
if (conf.positionals.length) {
|
|
279
|
+
throw error("`vlt setup --path` takes no arguments", {
|
|
280
|
+
code: "EUSAGE",
|
|
281
|
+
found: conf.positionals[0]
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
return {
|
|
285
|
+
path: await runPathSetup({
|
|
286
|
+
globalDir: root,
|
|
287
|
+
globalBinDir: conf.globalBinDir,
|
|
288
|
+
yes: !!conf.get("yes"),
|
|
289
|
+
noModifyPath: !!conf.get("no-modify-path"),
|
|
290
|
+
question: ({ dir, rcs }) => `Add ${dir} to your PATH in ${rcs}? (Y/n) `
|
|
291
|
+
})
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
var offerPath = async (conf, yes, ask2) => {
|
|
295
|
+
if (yes || !process.stdin.isTTY || conf.get("no-modify-path")) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
const g = conf.globalProject();
|
|
299
|
+
if (!g) return;
|
|
300
|
+
try {
|
|
301
|
+
return await runPathSetup({
|
|
302
|
+
globalDir: g.root,
|
|
303
|
+
globalBinDir: g.binDir,
|
|
304
|
+
question: () => "Setup PATH for global installs? (Y/n) ",
|
|
305
|
+
ask: ask2
|
|
306
|
+
});
|
|
307
|
+
} catch (er) {
|
|
308
|
+
const e = asError(er);
|
|
309
|
+
const found = isErrorWithCause(e) && isObject(e.cause) && typeof e.cause.found === "string" ? prettyPath(e.cause.found) : void 0;
|
|
310
|
+
return {
|
|
311
|
+
status: "failed",
|
|
312
|
+
message: found && !e.message.includes(found) ? `${e.message}: ${found}` : e.message
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
};
|
|
141
316
|
var command = async (conf) => {
|
|
317
|
+
const root = conf.globalRoot;
|
|
318
|
+
if (root) return setupPath(conf, root);
|
|
142
319
|
const yes = !!conf.get("yes");
|
|
143
320
|
const which = configWriteTarget(conf, "user");
|
|
144
321
|
let rl;
|
|
145
|
-
const
|
|
322
|
+
const ask2 = async (question) => {
|
|
146
323
|
rl ??= createInterface(process.stdin, process.stdout);
|
|
147
324
|
return (await rl.question(question)).trim();
|
|
148
325
|
};
|
|
@@ -158,7 +335,7 @@ var command = async (conf) => {
|
|
|
158
335
|
{ code: "ECONFIG" }
|
|
159
336
|
);
|
|
160
337
|
}
|
|
161
|
-
account = await
|
|
338
|
+
account = await ask2("vlt.io account or organization slug: ");
|
|
162
339
|
if (!account) {
|
|
163
340
|
throw error("No account slug provided.", { code: "ECONFIG" });
|
|
164
341
|
}
|
|
@@ -181,7 +358,7 @@ var command = async (conf) => {
|
|
|
181
358
|
}
|
|
182
359
|
const rc = new RegistryClient(conf.options);
|
|
183
360
|
if (!yes) {
|
|
184
|
-
const doAuth = await
|
|
361
|
+
const doAuth = await ask2(
|
|
185
362
|
"Authenticate with your vlt.io account now? (Y/n) "
|
|
186
363
|
);
|
|
187
364
|
if (!/^n/i.test(doAuth)) {
|
|
@@ -201,9 +378,9 @@ var command = async (conf) => {
|
|
|
201
378
|
}
|
|
202
379
|
}
|
|
203
380
|
for (; ; ) {
|
|
204
|
-
const more = await
|
|
381
|
+
const more = await ask2("Add another registry alias? (y/N) ");
|
|
205
382
|
if (!/^y/i.test(more)) break;
|
|
206
|
-
const name = await
|
|
383
|
+
const name = await ask2(" alias name: ");
|
|
207
384
|
if (!name) {
|
|
208
385
|
stdout(" alias name is required, skipping.");
|
|
209
386
|
continue;
|
|
@@ -212,14 +389,14 @@ var command = async (conf) => {
|
|
|
212
389
|
stdout(` alias "${name}" is already staged, skipping.`);
|
|
213
390
|
continue;
|
|
214
391
|
}
|
|
215
|
-
const url = await
|
|
392
|
+
const url = await ask2(" registry url: ");
|
|
216
393
|
if (!url) {
|
|
217
394
|
stdout(" registry url is required, skipping.");
|
|
218
395
|
continue;
|
|
219
396
|
}
|
|
220
397
|
const normalized = normalizeRegistryURL(url);
|
|
221
398
|
registries[name] = normalized;
|
|
222
|
-
const auth = await
|
|
399
|
+
const auth = await ask2(
|
|
223
400
|
` authenticate against "${name}" now? (y/N) `
|
|
224
401
|
);
|
|
225
402
|
if (/^y/i.test(auth)) {
|
|
@@ -232,11 +409,13 @@ var command = async (conf) => {
|
|
|
232
409
|
const shadowedByProject = which === "user" && registrySelectionFields.some(
|
|
233
410
|
(f) => f in (conf.layers.project ?? {})
|
|
234
411
|
);
|
|
412
|
+
const path = await offerPath(conf, yes, ask2);
|
|
235
413
|
return {
|
|
236
414
|
account,
|
|
237
415
|
which,
|
|
238
416
|
registries,
|
|
239
|
-
...shadowedByProject ? { shadowedByProject } : void 0
|
|
417
|
+
...shadowedByProject ? { shadowedByProject } : void 0,
|
|
418
|
+
...path ? { path } : void 0
|
|
240
419
|
};
|
|
241
420
|
} finally {
|
|
242
421
|
if (rl) {
|
|
@@ -10,6 +10,7 @@ globalThis.clearInterval = _vlt_clearInterval;
|
|
|
10
10
|
import {createRequire as _vlt_createRequire} from "node:module";
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
|
+
editGitignore,
|
|
13
14
|
filterNodesByQueryParts,
|
|
14
15
|
load2 as load,
|
|
15
16
|
lstat,
|
|
@@ -22,21 +23,23 @@ import {
|
|
|
22
23
|
skillsDirs,
|
|
23
24
|
unmountSkill,
|
|
24
25
|
unshare
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import
|
|
26
|
+
} from "./chunk-F5LZMLAQ.js";
|
|
27
|
+
import "./chunk-YTDABXPD.js";
|
|
28
|
+
import {
|
|
29
|
+
Monorepo
|
|
30
|
+
} from "./chunk-TQQO2F56.js";
|
|
28
31
|
import {
|
|
29
32
|
splitDepID
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-CAV7FKWQ.js";
|
|
34
|
+
import "./chunk-6D3QAFNZ.js";
|
|
32
35
|
import "./chunk-HTOTG4TS.js";
|
|
33
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-GEQFMH5M.js";
|
|
34
37
|
import "./chunk-B6RIGNEO.js";
|
|
35
38
|
import "./chunk-XNLSTHDK.js";
|
|
36
39
|
import "./chunk-Y5PA7DVK.js";
|
|
37
40
|
import {
|
|
38
41
|
parse
|
|
39
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-BF5DRGRZ.js";
|
|
40
43
|
import "./chunk-WZWDS3W4.js";
|
|
41
44
|
import "./chunk-PZLD7RTK.js";
|
|
42
45
|
|
|
@@ -144,6 +147,7 @@ var scan = (dir, pkgName) => {
|
|
|
144
147
|
return found;
|
|
145
148
|
};
|
|
146
149
|
var rank = (node) => {
|
|
150
|
+
if (node.importer) return 0;
|
|
147
151
|
let r = 2;
|
|
148
152
|
for (const { from } of node.edgesIn) {
|
|
149
153
|
if (from.mainImporter) return 0;
|
|
@@ -163,7 +167,7 @@ var aliasOf = (node) => {
|
|
|
163
167
|
const n = (edges.find((e) => e.from.mainImporter) ?? edges.find((e) => e.from.importer))?.name;
|
|
164
168
|
return n === node.name ? void 0 : n;
|
|
165
169
|
};
|
|
166
|
-
var scannable = (node) =>
|
|
170
|
+
var scannable = (node) => node.importer ? !node.mainImporter : node.inVltStore() && splitDepID(node.id)[0] !== "file";
|
|
167
171
|
var shipsSkills = (node) => scannable(node) && scan(realOr(resolve(node.projectRoot, node.location)), node.name).length > 0;
|
|
168
172
|
var discoverSkills = (nodes, scurry, mounts = []) => {
|
|
169
173
|
const key = (name, path) => `${lc(name)}\0${norm(path)}`;
|
|
@@ -220,49 +224,6 @@ var discoverSkills = (nodes, scurry, mounts = []) => {
|
|
|
220
224
|
return { skills, scanned };
|
|
221
225
|
};
|
|
222
226
|
|
|
223
|
-
// ../../src/graph/src/skills/gitignore.ts
|
|
224
|
-
import { lstatSync, readFileSync as readFileSync2, writeFileSync } from "node:fs";
|
|
225
|
-
import { join } from "node:path";
|
|
226
|
-
var GITIGNORE_BEGIN = "# >>> vlt agent skills (links into node_modules)";
|
|
227
|
-
var GITIGNORE_END = "# <<< vlt agent skills";
|
|
228
|
-
var sorted = (names) => [...names].sort((a, b) => a.localeCompare(b, "en")).map((n) => `/${n}`);
|
|
229
|
-
var update = (file, { add, remove }) => {
|
|
230
|
-
const st = lstatSync(file, { throwIfNoEntry: false });
|
|
231
|
-
if (st && !st.isFile()) return "refused";
|
|
232
|
-
const text = st ? readFileSync2(file, "utf8") : "";
|
|
233
|
-
const eol = text.includes("\r\n") ? "\r\n" : "\n";
|
|
234
|
-
const lines = text.split(eol);
|
|
235
|
-
const begin = lines.findIndex((l) => l.trim() === GITIGNORE_BEGIN);
|
|
236
|
-
const end = lines.findIndex(
|
|
237
|
-
(l, i) => begin !== -1 && i > begin && l.trim() === GITIGNORE_END
|
|
238
|
-
);
|
|
239
|
-
let out;
|
|
240
|
-
if (end === -1) {
|
|
241
|
-
if (!add.length) return "ok";
|
|
242
|
-
out = (text && !text.endsWith(eol) ? text + eol : text) + [GITIGNORE_BEGIN, ...sorted(add), GITIGNORE_END].join(eol) + eol;
|
|
243
|
-
} else {
|
|
244
|
-
const rm = new Set(sorted(remove));
|
|
245
|
-
const block = lines.slice(begin + 1, end).filter((l) => !rm.has(l.trim()));
|
|
246
|
-
const have = new Set(block.map((l) => l.trim()));
|
|
247
|
-
lines.splice(
|
|
248
|
-
begin + 1,
|
|
249
|
-
end - begin - 1,
|
|
250
|
-
...block,
|
|
251
|
-
...sorted(add).filter((l) => !have.has(l))
|
|
252
|
-
);
|
|
253
|
-
out = lines.join(eol);
|
|
254
|
-
}
|
|
255
|
-
if (out !== text) writeFileSync(file, out);
|
|
256
|
-
return "ok";
|
|
257
|
-
};
|
|
258
|
-
var editGitignore = (dir, edit) => {
|
|
259
|
-
try {
|
|
260
|
-
return update(join(dir, ".gitignore"), edit);
|
|
261
|
-
} catch {
|
|
262
|
-
return "refused";
|
|
263
|
-
}
|
|
264
|
-
};
|
|
265
|
-
|
|
266
227
|
// ../../src/graph/src/skills/mask.ts
|
|
267
228
|
var escape = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
268
229
|
var globRegExp = (pattern) => new RegExp(`^${pattern.split("*").map(escape).join(".*")}$`, "i");
|
|
@@ -316,6 +277,17 @@ var dirsOf = (o, create = false) => skillsDirs({
|
|
|
316
277
|
env: o.env,
|
|
317
278
|
create
|
|
318
279
|
});
|
|
280
|
+
var workspaceDirs = (graph, scurry) => [...graph.importers].filter((n) => !n.mainImporter).map((n) => ({
|
|
281
|
+
id: n.id,
|
|
282
|
+
path: realOr(n.resolvedLocation(scurry))
|
|
283
|
+
}));
|
|
284
|
+
var allWorkspaces = (m) => m ? [
|
|
285
|
+
...Monorepo.load(m.projectRoot, {
|
|
286
|
+
config: m.config,
|
|
287
|
+
scurry: m.scurry,
|
|
288
|
+
packageJson: m.packageJson
|
|
289
|
+
}).values()
|
|
290
|
+
].map((ws) => ({ id: ws.id, path: realOr(ws.fullpath) })) : [];
|
|
319
291
|
var liveOwners = (mounts) => mounts.flatMap(
|
|
320
292
|
(m) => m.owner && existsSync(m.target) ? [m.owner] : []
|
|
321
293
|
);
|
|
@@ -347,7 +319,11 @@ var report = (dropped, unscanned) => unscanned && dropped.length ? {
|
|
|
347
319
|
var listSkills = async (o) => {
|
|
348
320
|
const { graph, nodes, parts, unscanned } = await selectNodes(o);
|
|
349
321
|
const { targets, scan: scan2, skipped } = dirsOf(o);
|
|
350
|
-
const { skills } = discoverSkills(
|
|
322
|
+
const { skills } = discoverSkills(
|
|
323
|
+
nodes,
|
|
324
|
+
o.scurry,
|
|
325
|
+
readMounts(scan2, { workspaces: workspaceDirs(graph, o.scurry) })
|
|
326
|
+
);
|
|
351
327
|
const { picked, dropped } = pick(skills, parts, unscanned);
|
|
352
328
|
return {
|
|
353
329
|
project: graph.mainImporter.name,
|
|
@@ -375,7 +351,8 @@ var linkSkills = async (o) => {
|
|
|
375
351
|
conflicts: [],
|
|
376
352
|
dirs: targets.map((d) => d.dir)
|
|
377
353
|
};
|
|
378
|
-
const
|
|
354
|
+
const workspaces = workspaceDirs(graph, o.scurry);
|
|
355
|
+
const mounts = readMounts(scan2, { workspaces });
|
|
379
356
|
const byName = new Map(
|
|
380
357
|
mounts.map((m) => [`${m.dir.dir}\0${lc2(m.name)}`, m])
|
|
381
358
|
);
|
|
@@ -431,7 +408,9 @@ var linkSkills = async (o) => {
|
|
|
431
408
|
const gone = [];
|
|
432
409
|
const foreign = [];
|
|
433
410
|
const kept = /* @__PURE__ */ new Set();
|
|
411
|
+
const made = /* @__PURE__ */ new Set();
|
|
434
412
|
const where = /* @__PURE__ */ new Map();
|
|
413
|
+
let every;
|
|
435
414
|
for (const { dir, winner, losers, m } of picks) {
|
|
436
415
|
if (winner) {
|
|
437
416
|
if (m && m.name !== winner.skill) {
|
|
@@ -439,10 +418,16 @@ var linkSkills = async (o) => {
|
|
|
439
418
|
gone.push(m);
|
|
440
419
|
}
|
|
441
420
|
const mount = `${dir.dir}/${winner.skill}`;
|
|
442
|
-
const r = mountSkill(winner, dir);
|
|
421
|
+
const r = mountSkill(winner, dir, m?.name === winner.skill);
|
|
422
|
+
if (r === "linked") made.add(mount);
|
|
443
423
|
if (r === "conflict") {
|
|
444
424
|
res.conflicts.push(mount);
|
|
445
|
-
|
|
425
|
+
every ??= allWorkspaces(o.monorepo);
|
|
426
|
+
if (!readMounts([dir], { workspaces: every }).some(
|
|
427
|
+
(l) => l.name === winner.skill
|
|
428
|
+
)) {
|
|
429
|
+
foreign.push({ dir, name: winner.skill });
|
|
430
|
+
}
|
|
446
431
|
} else {
|
|
447
432
|
const k = `${winner.id}\0${winner.skill}`;
|
|
448
433
|
const linked = where.get(k) ?? [];
|
|
@@ -455,7 +440,7 @@ var linkSkills = async (o) => {
|
|
|
455
440
|
for (const s of losers)
|
|
456
441
|
res.conflicts.push(`${dir.dir}/${s.skill} (${label(s)})`);
|
|
457
442
|
}
|
|
458
|
-
const after = readMounts(scan2);
|
|
443
|
+
const after = readMounts(scan2, { workspaces, made });
|
|
459
444
|
const present = [];
|
|
460
445
|
for (const m of after) {
|
|
461
446
|
if (o.apply ? kept.has(m.mount) : !stale(m)) {
|
|
@@ -11,21 +11,21 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
mermaidOutput
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-36UIE654.js";
|
|
15
15
|
import {
|
|
16
16
|
assertQuery,
|
|
17
17
|
linkSkills,
|
|
18
18
|
listSkills
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-F5LZMLAQ.js";
|
|
20
|
+
import "./chunk-YTDABXPD.js";
|
|
21
21
|
import {
|
|
22
22
|
styleTextStdout
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-KVWGMSPW.js";
|
|
24
|
+
import "./chunk-LGQVZTYR.js";
|
|
25
|
+
import "./chunk-EYGOEAJM.js";
|
|
26
26
|
import {
|
|
27
27
|
commandUsage
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-HT6FS4VB.js";
|
|
29
29
|
import {
|
|
30
30
|
configLabel,
|
|
31
31
|
savedLine,
|
|
@@ -35,20 +35,24 @@ import {
|
|
|
35
35
|
} from "./chunk-W4T5CGCO.js";
|
|
36
36
|
import {
|
|
37
37
|
configWriteTarget
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-LP3ORD3D.js";
|
|
39
|
+
import "./chunk-LCLRP64K.js";
|
|
40
40
|
import "./chunk-SRWDPPLX.js";
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-JV5XR5JQ.js";
|
|
42
|
+
import "./chunk-EMTGRCSE.js";
|
|
43
|
+
import "./chunk-TQQO2F56.js";
|
|
43
44
|
import "./chunk-4KCU2KZL.js";
|
|
44
45
|
import "./chunk-WGDTG44V.js";
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
48
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-E74WGW5C.js";
|
|
47
|
+
import "./chunk-GCTREKA4.js";
|
|
48
|
+
import "./chunk-MCDLJZXT.js";
|
|
49
|
+
import "./chunk-7M2VTFLP.js";
|
|
50
|
+
import "./chunk-EFHOWRKU.js";
|
|
51
|
+
import "./chunk-CAV7FKWQ.js";
|
|
52
|
+
import "./chunk-6D3QAFNZ.js";
|
|
49
53
|
import "./chunk-HTOTG4TS.js";
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-GEQFMH5M.js";
|
|
55
|
+
import "./chunk-4GMNWW4C.js";
|
|
52
56
|
import "./chunk-SUU2WETN.js";
|
|
53
57
|
import "./chunk-B6RIGNEO.js";
|
|
54
58
|
import "./chunk-XNLSTHDK.js";
|
|
@@ -57,7 +61,7 @@ import "./chunk-PDWPFR5T.js";
|
|
|
57
61
|
import "./chunk-Y5PA7DVK.js";
|
|
58
62
|
import {
|
|
59
63
|
asError
|
|
60
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-BF5DRGRZ.js";
|
|
61
65
|
import {
|
|
62
66
|
error
|
|
63
67
|
} from "./chunk-WZWDS3W4.js";
|
|
@@ -154,9 +158,8 @@ var usage = () => commandUsage({
|
|
|
154
158
|
\`.agents/skills\`, plus \`<folder>/skills\` for each agent folder
|
|
155
159
|
at the project root (e.g. \`.claude/\`), or the \`skills-dir\`
|
|
156
160
|
config. When packages ship skills with the same name, one is
|
|
157
|
-
linked and the others are reported. Only links made by vlt
|
|
158
|
-
|
|
159
|
-
removed; anything else in the way is skipped.
|
|
161
|
+
linked and the others are reported. Only links made by vlt are
|
|
162
|
+
ever replaced or removed; anything else in the way is skipped.
|
|
160
163
|
|
|
161
164
|
Use --target or a query after the subcommand to select packages
|
|
162
165
|
using DSS query syntax. End a selector with
|