@vltpkg/cli-js 1.0.6 → 1.0.7
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-CMN3GDV4.js → access-OKO4MXDT.js} +3 -3
- package/{bugs-MEP373JU.js → bugs-J56QQ3CP.js} +4 -4
- package/{build-TKUT6V2P.js → build-CQ2E2XRO.js} +2 -2
- package/{cache-3VLQ7CWL.js → cache-PPEXAQT7.js} +5 -5
- package/{chunk-O7OUBUZ3.js → chunk-A4EKZ32F.js} +1 -1
- package/{chunk-4LBWNGU6.js → chunk-ADYHZTEI.js} +1 -1
- package/{chunk-LQGUEFV6.js → chunk-CHHGSDAP.js} +1 -1
- package/{chunk-FBHWUWBW.js → chunk-CIKUT62L.js} +1 -1
- package/{chunk-XVA4ZRW5.js → chunk-GVZRKITF.js} +164 -41
- package/{chunk-G7BEW32U.js → chunk-JLKFIX2H.js} +2 -2
- package/{chunk-PND2URIT.js → chunk-JWWDJYSU.js} +16 -7
- package/chunk-NEFV2B5V.js +75 -0
- package/{chunk-AL42Z2D3.js → chunk-OUF2P2OD.js} +2 -2
- package/{chunk-LCDBW6IT.js → chunk-PTR5IGFQ.js} +1 -1
- package/{chunk-EJUKA3HX.js → chunk-RKXQ66T4.js} +1 -1
- package/{chunk-AHTQ5ADD.js → chunk-SVO3HI2G.js} +1 -1
- package/{chunk-WP6CYBPM.js → chunk-XISRK3R5.js} +21 -6
- package/{chunk-FEIPJIEN.js → chunk-YAIKXFLN.js} +1 -1
- package/{ci-ODHEBQNE.js → ci-WDQ4SQN6.js} +3 -3
- package/cli-package.json +1 -1
- package/{config-35TJIXFF.js → config-JMARDHLW.js} +4 -4
- package/{config-5HCRQACM.js → config-XY5CDGTD.js} +5 -3
- package/{create-5BESMSRT.js → create-C24ZGR6S.js} +8 -8
- package/{deprecate-6YTC2E2E.js → deprecate-HYHD5WQC.js} +4 -4
- package/{devtools-OKXASR4F.js → devtools-66MVSNF5.js} +29 -29
- package/{dist-tag-HHCPJPJL.js → dist-tag-RPQ5LZWM.js} +3 -3
- package/{docs-M7KRVAON.js → docs-UKQNAVM3.js} +4 -4
- package/{exec-H664T76F.js → exec-FNZEVDGU.js} +8 -8
- package/{exec-cache-EQUYR4PE.js → exec-cache-GRHS57DV.js} +6 -6
- package/{exec-local-OUOXFTQ6.js → exec-local-AHDW7CKQ.js} +6 -6
- package/{help-F4DM2AQP.js → help-VDBXIWF3.js} +4 -4
- package/{init-7D5MFAP5.js → init-2ICZBLI2.js} +3 -3
- package/{install-OZBDTEAY.js → install-IFSVVRU5.js} +3 -3
- package/{list-DRQS77GZ.js → list-RCAPA3OE.js} +6 -6
- package/{login-JAWRM634.js → login-T42R75OV.js} +21 -5
- package/{logout-3ACX34HP.js → logout-PVR6J2AK.js} +3 -3
- package/{pack-XUEMZORZ.js → pack-HPLDE4RB.js} +3 -3
- package/package.json +1 -1
- package/{ping-FQGTZ5FI.js → ping-N5U4XHUU.js} +3 -3
- package/{pkg-D4OYJPRA.js → pkg-VNKZX5JC.js} +4 -4
- package/{profile-UNVFHARP.js → profile-N7UOXZ2X.js} +3 -3
- package/{publish-FSZSNKBN.js → publish-CRSF7NZP.js} +6 -6
- package/{query-QHCEICAY.js → query-MEAXXYOE.js} +6 -6
- package/{registry-43SSGAPE.js → registry-BMWXMQS4.js} +2 -2
- package/registry-client-package.json +1 -1
- package/registry-client-src-revalidate.js +16 -7
- package/{repo-KHFU55BU.js → repo-IRTGGLIC.js} +4 -4
- package/{reporter-Y3LUXPQS.js → reporter-Y7RMSVN4.js} +75 -75
- package/{run-4GHCV2NW.js → run-I6HWURSB.js} +6 -6
- package/{run-exec-N2B7XW7Y.js → run-exec-BV3RUWQM.js} +6 -6
- package/{setup-3PSRN42W.js → setup-U6DWTZBA.js} +44 -16
- package/{src-D7FPRPSM.js → src-44BBCHST.js} +1 -1
- package/{src-2Q2V6EI2.js → src-SXMLUOLI.js} +7 -7
- package/{token-3RNS2EZO.js → token-CTUMLTQP.js} +3 -3
- package/{uninstall-RBT3ENOD.js → uninstall-UUFXE47B.js} +3 -3
- package/{unpublish-AS7IBBGN.js → unpublish-G4NALOC6.js} +3 -3
- package/{update-6CBZZ5PN.js → update-BGMQQNYE.js} +3 -3
- package/{version-PW4DD2HC.js → version-QVFPFL6M.js} +3 -3
- package/{view-LRZPRP7J.js → view-QFYMJVBE.js} +3 -3
- 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-EASZYMSY.js → whoami-5D4XUOSP.js} +3 -3
- package/chunk-VWCDSE2C.js +0 -75
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
} from "./chunk-5JFRXIK2.js";
|
|
15
15
|
import {
|
|
16
16
|
commandUsage
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-PTR5IGFQ.js";
|
|
18
18
|
import "./chunk-XKVU23NC.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-XISRK3R5.js";
|
|
20
20
|
import {
|
|
21
21
|
RegistryClient
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-JWWDJYSU.js";
|
|
23
23
|
import "./chunk-HAYXR3MW.js";
|
|
24
24
|
import "./chunk-E74WGW5C.js";
|
|
25
25
|
import "./chunk-LPIBYUMT.js";
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
} from "./chunk-CLVRCGOZ.js";
|
|
15
15
|
import {
|
|
16
16
|
createHostContextsMap
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CHHGSDAP.js";
|
|
18
18
|
import {
|
|
19
19
|
PackageInfoClient
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-A4EKZ32F.js";
|
|
21
21
|
import "./chunk-ZWKI5OSF.js";
|
|
22
22
|
import {
|
|
23
23
|
Query,
|
|
@@ -30,11 +30,11 @@ import "./chunk-SVBEF5PK.js";
|
|
|
30
30
|
import "./chunk-3OPNZI6G.js";
|
|
31
31
|
import {
|
|
32
32
|
commandUsage
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-PTR5IGFQ.js";
|
|
34
34
|
import {
|
|
35
35
|
Spec
|
|
36
36
|
} from "./chunk-XKVU23NC.js";
|
|
37
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-XISRK3R5.js";
|
|
38
38
|
import "./chunk-HTOTG4TS.js";
|
|
39
39
|
import {
|
|
40
40
|
urlOpen
|
|
@@ -17,9 +17,9 @@ import "./chunk-SVBEF5PK.js";
|
|
|
17
17
|
import "./chunk-3OPNZI6G.js";
|
|
18
18
|
import {
|
|
19
19
|
commandUsage
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-PTR5IGFQ.js";
|
|
21
21
|
import "./chunk-XKVU23NC.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-XISRK3R5.js";
|
|
23
23
|
import "./chunk-HTOTG4TS.js";
|
|
24
24
|
import "./chunk-E74WGW5C.js";
|
|
25
25
|
import "./chunk-LPIBYUMT.js";
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
stderr,
|
|
17
17
|
stdout
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-OUF2P2OD.js";
|
|
19
|
+
import "./chunk-YAIKXFLN.js";
|
|
20
20
|
import "./chunk-G2YT2GWF.js";
|
|
21
21
|
import "./chunk-GDJ7JT2R.js";
|
|
22
22
|
import "./chunk-5JFRXIK2.js";
|
|
@@ -24,17 +24,17 @@ import "./chunk-WGDTG44V.js";
|
|
|
24
24
|
import "./chunk-3OPNZI6G.js";
|
|
25
25
|
import {
|
|
26
26
|
commandUsage
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-PTR5IGFQ.js";
|
|
28
28
|
import {
|
|
29
29
|
Spec
|
|
30
30
|
} from "./chunk-XKVU23NC.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-XISRK3R5.js";
|
|
32
32
|
import {
|
|
33
33
|
ViewClass
|
|
34
34
|
} from "./chunk-4KCU2KZL.js";
|
|
35
35
|
import {
|
|
36
36
|
CacheEntry
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-JWWDJYSU.js";
|
|
38
38
|
import "./chunk-HAYXR3MW.js";
|
|
39
39
|
import "./chunk-E74WGW5C.js";
|
|
40
40
|
import "./chunk-LPIBYUMT.js";
|
|
@@ -111,7 +111,7 @@ var PackageInfoClient = class {
|
|
|
111
111
|
#tarPoolPromise;
|
|
112
112
|
async getRegistryClient() {
|
|
113
113
|
if (this.#registryClient) return this.#registryClient;
|
|
114
|
-
this.#registryClientPromise ??= import("./src-
|
|
114
|
+
this.#registryClientPromise ??= import("./src-44BBCHST.js").then(({ RegistryClient }) => {
|
|
115
115
|
this.#registryClient = new RegistryClient(this.options);
|
|
116
116
|
return this.#registryClient;
|
|
117
117
|
});
|
|
@@ -11,7 +11,7 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
stderr
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OUF2P2OD.js";
|
|
15
15
|
import {
|
|
16
16
|
mermaidOutput
|
|
17
17
|
} from "./chunk-3NGV7EC6.js";
|
|
@@ -115,7 +115,7 @@ var reloadConfig = async (folder) => {
|
|
|
115
115
|
unload("project");
|
|
116
116
|
} catch {
|
|
117
117
|
}
|
|
118
|
-
const { Config } = await import("./config-
|
|
118
|
+
const { Config } = await import("./config-XY5CDGTD.js");
|
|
119
119
|
return Config.load(folder, process.argv, true);
|
|
120
120
|
};
|
|
121
121
|
|
|
@@ -11,7 +11,7 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
PackageInfoClient
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-A4EKZ32F.js";
|
|
15
15
|
import {
|
|
16
16
|
Monorepo,
|
|
17
17
|
PackageJson,
|
|
@@ -22,11 +22,12 @@ import {
|
|
|
22
22
|
} from "./chunk-3OPNZI6G.js";
|
|
23
23
|
import {
|
|
24
24
|
commands,
|
|
25
|
+
defaultValues,
|
|
25
26
|
definition,
|
|
26
27
|
getCommand,
|
|
27
28
|
isRecordField,
|
|
28
29
|
recordFields
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-XISRK3R5.js";
|
|
30
31
|
import {
|
|
31
32
|
find,
|
|
32
33
|
load,
|
|
@@ -63,6 +64,70 @@ var merge = (base, add) => Object.fromEntries(
|
|
|
63
64
|
)
|
|
64
65
|
);
|
|
65
66
|
|
|
67
|
+
// ../../src/cli-sdk/src/config/merge-layers.ts
|
|
68
|
+
var registrySelectors = [
|
|
69
|
+
"registry",
|
|
70
|
+
"default-registry-alias"
|
|
71
|
+
];
|
|
72
|
+
var registrySelectionFields = [
|
|
73
|
+
"registry",
|
|
74
|
+
"registries",
|
|
75
|
+
"default-registry-alias"
|
|
76
|
+
];
|
|
77
|
+
var isObj = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
78
|
+
var cloneValue = (v) => Array.isArray(v) ? v.map((x) => cloneValue(x)) : isObj(v) ? Object.fromEntries(
|
|
79
|
+
Object.entries(v).map(([k, x]) => [k, cloneValue(x)])
|
|
80
|
+
) : v;
|
|
81
|
+
var cloneLayer = (data) => cloneValue(data);
|
|
82
|
+
var mergeRecord = (base, add) => {
|
|
83
|
+
const result = isObj(base) ? { ...base } : {};
|
|
84
|
+
for (const [k, v] of Object.entries(add)) {
|
|
85
|
+
if (v === null) delete result[k];
|
|
86
|
+
else result[k] = v;
|
|
87
|
+
}
|
|
88
|
+
return Object.keys(result).length ? result : void 0;
|
|
89
|
+
};
|
|
90
|
+
var mergeCommands = (base, add) => {
|
|
91
|
+
const result = isObj(base) ? { ...base } : {};
|
|
92
|
+
for (const [cmd, opts] of Object.entries(add)) {
|
|
93
|
+
if (opts === null) delete result[cmd];
|
|
94
|
+
else if (isObj(opts)) {
|
|
95
|
+
result[cmd] = mergeLayers([
|
|
96
|
+
isObj(result[cmd]) ? result[cmd] : void 0,
|
|
97
|
+
opts
|
|
98
|
+
]);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return Object.keys(result).length ? result : void 0;
|
|
102
|
+
};
|
|
103
|
+
var mergeLayers = (layers) => {
|
|
104
|
+
const result = {};
|
|
105
|
+
for (const layer of layers) {
|
|
106
|
+
if (!isObj(layer)) continue;
|
|
107
|
+
for (const [k, v] of Object.entries(layer)) {
|
|
108
|
+
if (k === "command") {
|
|
109
|
+
const merged = isObj(v) ? mergeCommands(result.command, v) : void 0;
|
|
110
|
+
if (merged) result.command = merged;
|
|
111
|
+
else delete result.command;
|
|
112
|
+
} else if (v === null) {
|
|
113
|
+
delete result[k];
|
|
114
|
+
} else if (isRecordField(k) && isObj(v)) {
|
|
115
|
+
const merged = mergeRecord(result[k], v);
|
|
116
|
+
if (merged) result[k] = merged;
|
|
117
|
+
else delete result[k];
|
|
118
|
+
} else {
|
|
119
|
+
result[k] = v;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (registrySelectionFields.some((f) => f in layer)) {
|
|
123
|
+
for (const f of registrySelectors) {
|
|
124
|
+
if (!(f in layer)) delete result[f];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return result;
|
|
129
|
+
};
|
|
130
|
+
|
|
66
131
|
// ../../src/cli-sdk/src/config/index.ts
|
|
67
132
|
var kCustomInspect = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
68
133
|
var reducePairs = (pairs) => {
|
|
@@ -79,6 +144,18 @@ var reducePairs = (pairs) => {
|
|
|
79
144
|
return record;
|
|
80
145
|
};
|
|
81
146
|
var isRecordFieldValue = (k, v) => Array.isArray(v) && recordFields.includes(k);
|
|
147
|
+
var assertRegistryKeys = (registries, file) => {
|
|
148
|
+
if (!registries || typeof registries !== "object") return;
|
|
149
|
+
const obj = Array.isArray(registries) ? reducePairs(registries) : registries;
|
|
150
|
+
for (const key of Object.keys(obj)) {
|
|
151
|
+
if (key === "" || key.includes("~")) {
|
|
152
|
+
throw error("Reserved character found in registries name", {
|
|
153
|
+
path: file,
|
|
154
|
+
found: key
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
82
159
|
var pairsToRecords = (obj) => {
|
|
83
160
|
return Object.fromEntries(
|
|
84
161
|
Object.entries(obj).map(([k, v]) => [
|
|
@@ -99,7 +176,16 @@ var recordsToPairs = (obj) => {
|
|
|
99
176
|
([k]) => !(k === "scurry" || k === "packageJson" || k === "monorepo" || k === "projectRoot" || k === "packageInfo")
|
|
100
177
|
).map(([k, v]) => [
|
|
101
178
|
k,
|
|
102
|
-
k === "command" && v && typeof v === "object" ?
|
|
179
|
+
k === "command" && v && typeof v === "object" ? (
|
|
180
|
+
// each command's own block gets converted too, mirroring
|
|
181
|
+
// pairsToRecords
|
|
182
|
+
Object.fromEntries(
|
|
183
|
+
Object.entries(v).map(([k2, v2]) => [
|
|
184
|
+
k2,
|
|
185
|
+
recordsToPairs(v2)
|
|
186
|
+
])
|
|
187
|
+
)
|
|
188
|
+
) : !v || typeof v !== "object" || Array.isArray(v) || !isRecordField(k) ? v : Object.entries(v).map(([k2, v2]) => `${k2}=${v2}`)
|
|
103
189
|
])
|
|
104
190
|
);
|
|
105
191
|
};
|
|
@@ -292,7 +378,12 @@ var Config = class _Config {
|
|
|
292
378
|
async addConfigToFile(which, values) {
|
|
293
379
|
return this.writeConfigFile(
|
|
294
380
|
which,
|
|
295
|
-
merge(
|
|
381
|
+
merge(
|
|
382
|
+
pairsToRecords(
|
|
383
|
+
await this.#maybeLoadConfigFile(which) ?? {}
|
|
384
|
+
),
|
|
385
|
+
pairsToRecords(values)
|
|
386
|
+
)
|
|
296
387
|
);
|
|
297
388
|
}
|
|
298
389
|
// called in this weird bound way so that it can be used by the
|
|
@@ -308,53 +399,79 @@ var Config = class _Config {
|
|
|
308
399
|
wanted: "ConfigFileData"
|
|
309
400
|
});
|
|
310
401
|
}
|
|
311
|
-
const { command, ...values } =
|
|
312
|
-
|
|
313
|
-
if (
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
throw error("Reserved character found in registries name", {
|
|
318
|
-
path: file,
|
|
319
|
-
found: key
|
|
320
|
-
});
|
|
402
|
+
const { command, ...values } = c;
|
|
403
|
+
assertRegistryKeys(values.registries, file);
|
|
404
|
+
if (command && typeof command === "object") {
|
|
405
|
+
for (const opts of Object.values(command)) {
|
|
406
|
+
if (opts && typeof opts === "object") {
|
|
407
|
+
assertRegistryKeys(opts.registries, file);
|
|
321
408
|
}
|
|
322
409
|
}
|
|
323
410
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
411
|
+
const layer = cloneLayer(pairsToRecords(c));
|
|
412
|
+
const { command: _cmd, ...single } = mergeLayers([layer]);
|
|
413
|
+
try {
|
|
414
|
+
this.jack.validate(recordsToPairs(single));
|
|
415
|
+
} catch (er) {
|
|
416
|
+
if (er instanceof Error) {
|
|
417
|
+
const cause = typeof er.cause === "object" ? er.cause : {};
|
|
418
|
+
er.cause = { ...cause, path: file };
|
|
419
|
+
}
|
|
420
|
+
throw er;
|
|
421
|
+
}
|
|
422
|
+
this.#layers[file === find("user") ? "user" : "project"] = layer;
|
|
423
|
+
this.#applyLayers();
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* The raw config data from each `vlt.json` file, normalized to record
|
|
427
|
+
* form, before the layers are merged together. `undefined` for a layer
|
|
428
|
+
* with no file, or a file with no `config` field.
|
|
429
|
+
*/
|
|
430
|
+
get layers() {
|
|
431
|
+
return this.#layers;
|
|
432
|
+
}
|
|
433
|
+
#layers = {};
|
|
434
|
+
/**
|
|
435
|
+
* Recompute the jack defaults and {@link Config#commandValues} from
|
|
436
|
+
* {@link Config#layers}.
|
|
437
|
+
*
|
|
438
|
+
* Everything is derived from `#layers`, and every known field is applied,
|
|
439
|
+
* so this is idempotent: re-reading a config file (which
|
|
440
|
+
* `addConfigToFile` and `deleteConfigKeys` both do) can't stack the user
|
|
441
|
+
* layer back on top of the project layer, and a field a layer stopped
|
|
442
|
+
* setting goes back to its definitional default.
|
|
443
|
+
*/
|
|
444
|
+
#applyLayers() {
|
|
445
|
+
const { command, ...values } = mergeLayers([
|
|
446
|
+
this.#layers.user,
|
|
447
|
+
this.#layers.project
|
|
448
|
+
]);
|
|
449
|
+
this.commandValues = {};
|
|
450
|
+
for (const [c, opts] of Object.entries(command ?? {})) {
|
|
451
|
+
const cmd = getCommand(c);
|
|
452
|
+
if (cmd && opts && typeof opts === "object") {
|
|
453
|
+
this.commandValues[cmd] = opts;
|
|
348
454
|
}
|
|
349
455
|
}
|
|
350
|
-
|
|
456
|
+
const pairs = recordsToPairs(values);
|
|
457
|
+
const applied = {};
|
|
458
|
+
for (const [field, dflt] of Object.entries(defaultValues)) {
|
|
459
|
+
applied[field] = field in pairs ? pairs[field] : dflt;
|
|
460
|
+
}
|
|
461
|
+
this.jack.setConfigValues(applied);
|
|
462
|
+
this.#options = void 0;
|
|
351
463
|
}
|
|
352
464
|
/**
|
|
353
465
|
* if the file exists, parse and load it. returns object if data was
|
|
354
466
|
* loaded, or undefined if not.
|
|
355
467
|
*/
|
|
356
468
|
async #maybeLoadConfigFile(whichConfig) {
|
|
357
|
-
|
|
469
|
+
const data = load("config", this.#validator, whichConfig);
|
|
470
|
+
if (data === void 0 && this.#layers[whichConfig] !== void 0) {
|
|
471
|
+
delete this.#layers[whichConfig];
|
|
472
|
+
this.#applyLayers();
|
|
473
|
+
}
|
|
474
|
+
return data;
|
|
358
475
|
}
|
|
359
476
|
/**
|
|
360
477
|
* Deletes the specified config fields from the named file
|
|
@@ -482,10 +599,16 @@ var Config = class _Config {
|
|
|
482
599
|
}
|
|
483
600
|
};
|
|
484
601
|
var isParsed = (c) => !!(c.values && c.positionals && c.command);
|
|
602
|
+
var configWriteTarget = (conf, fallback) => {
|
|
603
|
+
const which = conf.get("config");
|
|
604
|
+
return which === "user" || which === "project" ? which : fallback;
|
|
605
|
+
};
|
|
485
606
|
|
|
486
607
|
export {
|
|
608
|
+
registrySelectionFields,
|
|
487
609
|
kCustomInspect,
|
|
488
610
|
pairsToRecords,
|
|
489
611
|
recordsToPairs,
|
|
490
|
-
Config
|
|
612
|
+
Config,
|
|
613
|
+
configWriteTarget
|
|
491
614
|
};
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
} from "./chunk-RIYFGX27.js";
|
|
15
15
|
import {
|
|
16
16
|
createHostContextsMap
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CHHGSDAP.js";
|
|
18
18
|
import {
|
|
19
19
|
stderr,
|
|
20
20
|
stdout,
|
|
21
21
|
styleTextStdout
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-OUF2P2OD.js";
|
|
23
23
|
import {
|
|
24
24
|
require_emoji_regex
|
|
25
25
|
} from "./chunk-VTEFO2FT.js";
|
|
@@ -27474,13 +27474,24 @@ var RegistryClient = class {
|
|
|
27474
27474
|
await deleteToken(registry, this.identity);
|
|
27475
27475
|
}
|
|
27476
27476
|
/**
|
|
27477
|
-
* Log into the registry specified
|
|
27477
|
+
* Log into the registry specified.
|
|
27478
|
+
*
|
|
27479
|
+
* When a list of registries is provided, the web login flow runs once
|
|
27480
|
+
* against the first of them, and the token it returns is saved for all
|
|
27481
|
+
* of them. This is for registries that share credentials -- like the
|
|
27482
|
+
* ones under a single vlt.io account -- where opening the browser once
|
|
27483
|
+
* per registry would just be asking for the same token again.
|
|
27478
27484
|
*
|
|
27479
27485
|
* Does not return the token or expose it, just saves to the auth keychain
|
|
27480
27486
|
* and returns void if it worked. Otherwise, error is raised.
|
|
27481
27487
|
*/
|
|
27482
27488
|
async login(registry) {
|
|
27483
|
-
const
|
|
27489
|
+
const registries = Array.isArray(registry) ? registry : [registry];
|
|
27490
|
+
const [first] = registries;
|
|
27491
|
+
if (!first) {
|
|
27492
|
+
throw error("No registry provided to log in against");
|
|
27493
|
+
}
|
|
27494
|
+
const webLoginURL = new URL("-/v1/login", registryBase(first));
|
|
27484
27495
|
const response = await this.request(webLoginURL, {
|
|
27485
27496
|
method: "POST",
|
|
27486
27497
|
useCache: false,
|
|
@@ -27494,11 +27505,9 @@ var RegistryClient = class {
|
|
|
27494
27505
|
const challenge = getWebAuthChallenge(response.json());
|
|
27495
27506
|
if (challenge) {
|
|
27496
27507
|
const result = await this.webAuthOpener(challenge);
|
|
27497
|
-
|
|
27498
|
-
|
|
27499
|
-
|
|
27500
|
-
this.identity
|
|
27501
|
-
);
|
|
27508
|
+
for (const reg of registries) {
|
|
27509
|
+
await setToken(reg, `Bearer ${result.token}`, this.identity);
|
|
27510
|
+
}
|
|
27502
27511
|
return;
|
|
27503
27512
|
}
|
|
27504
27513
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var global = globalThis;
|
|
2
|
+
import {Buffer} from "node:buffer";
|
|
3
|
+
import {setTimeout as _vlt_setTimeout,clearTimeout as _vlt_clearTimeout,setImmediate as _vlt_setImmediate,clearImmediate as _vlt_clearImmediate,setInterval as _vlt_setInterval,clearInterval as _vlt_clearInterval} from "node:timers";
|
|
4
|
+
globalThis.setTimeout = _vlt_setTimeout;
|
|
5
|
+
globalThis.clearTimeout = _vlt_clearTimeout;
|
|
6
|
+
globalThis.setImmediate = _vlt_setImmediate;
|
|
7
|
+
globalThis.clearImmediate = _vlt_clearImmediate;
|
|
8
|
+
globalThis.setInterval = _vlt_setInterval;
|
|
9
|
+
globalThis.clearInterval = _vlt_clearInterval;
|
|
10
|
+
import {createRequire as _vlt_createRequire} from "node:module";
|
|
11
|
+
var require = _vlt_createRequire(import.meta.filename);
|
|
12
|
+
import {
|
|
13
|
+
error
|
|
14
|
+
} from "./chunk-WZWDS3W4.js";
|
|
15
|
+
import {
|
|
16
|
+
__glob
|
|
17
|
+
} from "./chunk-PZLD7RTK.js";
|
|
18
|
+
|
|
19
|
+
// import("./commands/**/*.ts") in ../../src/cli-sdk/src/load-command.ts
|
|
20
|
+
var globImport_commands_ts = __glob({
|
|
21
|
+
"./commands/access.ts": () => import("./access-OKO4MXDT.js"),
|
|
22
|
+
"./commands/bugs.ts": () => import("./bugs-J56QQ3CP.js"),
|
|
23
|
+
"./commands/build.ts": () => import("./build-CQ2E2XRO.js"),
|
|
24
|
+
"./commands/cache.ts": () => import("./cache-PPEXAQT7.js"),
|
|
25
|
+
"./commands/ci.ts": () => import("./ci-WDQ4SQN6.js"),
|
|
26
|
+
"./commands/config.ts": () => import("./config-JMARDHLW.js"),
|
|
27
|
+
"./commands/create.ts": () => import("./create-C24ZGR6S.js"),
|
|
28
|
+
"./commands/deprecate.ts": () => import("./deprecate-HYHD5WQC.js"),
|
|
29
|
+
"./commands/dist-tag.ts": () => import("./dist-tag-RPQ5LZWM.js"),
|
|
30
|
+
"./commands/docs.ts": () => import("./docs-UKQNAVM3.js"),
|
|
31
|
+
"./commands/exec-cache.ts": () => import("./exec-cache-GRHS57DV.js"),
|
|
32
|
+
"./commands/exec-local.ts": () => import("./exec-local-AHDW7CKQ.js"),
|
|
33
|
+
"./commands/exec.ts": () => import("./exec-FNZEVDGU.js"),
|
|
34
|
+
"./commands/help.ts": () => import("./help-VDBXIWF3.js"),
|
|
35
|
+
"./commands/init.ts": () => import("./init-2ICZBLI2.js"),
|
|
36
|
+
"./commands/install.ts": () => import("./install-IFSVVRU5.js"),
|
|
37
|
+
"./commands/install/reporter.ts": () => import("./reporter-Y7RMSVN4.js"),
|
|
38
|
+
"./commands/list.ts": () => import("./list-RCAPA3OE.js"),
|
|
39
|
+
"./commands/login.ts": () => import("./login-T42R75OV.js"),
|
|
40
|
+
"./commands/logout.ts": () => import("./logout-PVR6J2AK.js"),
|
|
41
|
+
"./commands/pack.ts": () => import("./pack-HPLDE4RB.js"),
|
|
42
|
+
"./commands/ping.ts": () => import("./ping-N5U4XHUU.js"),
|
|
43
|
+
"./commands/pkg.ts": () => import("./pkg-VNKZX5JC.js"),
|
|
44
|
+
"./commands/profile.ts": () => import("./profile-N7UOXZ2X.js"),
|
|
45
|
+
"./commands/publish.ts": () => import("./publish-CRSF7NZP.js"),
|
|
46
|
+
"./commands/query.ts": () => import("./query-MEAXXYOE.js"),
|
|
47
|
+
"./commands/registry.ts": () => import("./registry-BMWXMQS4.js"),
|
|
48
|
+
"./commands/repo.ts": () => import("./repo-IRTGGLIC.js"),
|
|
49
|
+
"./commands/run-exec.ts": () => import("./run-exec-BV3RUWQM.js"),
|
|
50
|
+
"./commands/run.ts": () => import("./run-I6HWURSB.js"),
|
|
51
|
+
"./commands/setup.ts": () => import("./setup-U6DWTZBA.js"),
|
|
52
|
+
"./commands/token.ts": () => import("./token-CTUMLTQP.js"),
|
|
53
|
+
"./commands/uninstall.ts": () => import("./uninstall-UUFXE47B.js"),
|
|
54
|
+
"./commands/unpublish.ts": () => import("./unpublish-G4NALOC6.js"),
|
|
55
|
+
"./commands/update.ts": () => import("./update-BGMQQNYE.js"),
|
|
56
|
+
"./commands/version.ts": () => import("./version-QVFPFL6M.js"),
|
|
57
|
+
"./commands/view.ts": () => import("./view-QFYMJVBE.js"),
|
|
58
|
+
"./commands/whoami.ts": () => import("./whoami-5D4XUOSP.js")
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// ../../src/cli-sdk/src/load-command.ts
|
|
62
|
+
var loadCommand = async (command) => {
|
|
63
|
+
try {
|
|
64
|
+
return await globImport_commands_ts(`./commands/${command}.ts`);
|
|
65
|
+
} catch (e) {
|
|
66
|
+
throw error("Could not load command", {
|
|
67
|
+
found: command,
|
|
68
|
+
cause: e
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
loadCommand
|
|
75
|
+
};
|
|
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
generateDefaultHelp,
|
|
14
14
|
generateFullHelp
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-YAIKXFLN.js";
|
|
16
16
|
import {
|
|
17
17
|
flush,
|
|
18
18
|
trackCommand,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
} from "./chunk-3OPNZI6G.js";
|
|
34
34
|
import {
|
|
35
35
|
defaultView
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-XISRK3R5.js";
|
|
37
37
|
import {
|
|
38
38
|
isLazyView,
|
|
39
39
|
isViewClass,
|
|
@@ -11,7 +11,7 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
PackageInfoClient
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-A4EKZ32F.js";
|
|
15
15
|
import {
|
|
16
16
|
findCmdShimIfExists,
|
|
17
17
|
install
|
|
@@ -1184,14 +1184,22 @@ j2.description(Object.keys(canonicalCommands).join(", "), {
|
|
|
1184
1184
|
"Run `vlt <cmd> --help` for more information about a specific command"
|
|
1185
1185
|
);
|
|
1186
1186
|
var definition = j2.heading("Configuration").description(
|
|
1187
|
-
`
|
|
1188
|
-
then
|
|
1187
|
+
`The \`vlt.json\` file in the XDG specified config directory is loaded
|
|
1188
|
+
first, and then the \`vlt.json\` file in the root of the current
|
|
1189
|
+
project, if present, is layered on top of it.
|
|
1189
1190
|
|
|
1190
|
-
|
|
1191
|
-
|
|
1191
|
+
Scalar values are overridden by the innermost layer that sets them.
|
|
1192
|
+
Object type values are merged together key by key. Set a field, or a
|
|
1193
|
+
key within an object field, to \`null\` in the JSON configuration to
|
|
1194
|
+
explicitly remove it.
|
|
1192
1195
|
|
|
1193
|
-
|
|
1194
|
-
|
|
1196
|
+
Registry *selection* is an exception, since \`--registry\` outranks any
|
|
1197
|
+
\`--registries\` alias. A layer that sets any of \`registry\`,
|
|
1198
|
+
\`registries\`, or \`default-registry-alias\` owns selection: the
|
|
1199
|
+
\`registry\` and \`default-registry-alias\` it does *not* set are
|
|
1200
|
+
dropped, rather than inherited from an outer layer. So a project that
|
|
1201
|
+
configures its own registry is never sent to the user-level one, while
|
|
1202
|
+
the aliases in the user config stay addressable by name.
|
|
1195
1203
|
|
|
1196
1204
|
Command-specific fields may be set in a nested \`command\` object that
|
|
1197
1205
|
overrides any options defined at the top level.
|
|
@@ -1776,6 +1784,12 @@ var definition = j2.heading("Configuration").description(
|
|
|
1776
1784
|
description: "Show all commands, bins, and flags"
|
|
1777
1785
|
}
|
|
1778
1786
|
});
|
|
1787
|
+
var defaultValues = Object.fromEntries(
|
|
1788
|
+
Object.entries(definition.toJSON()).map(([field, def]) => [
|
|
1789
|
+
field,
|
|
1790
|
+
def.default
|
|
1791
|
+
])
|
|
1792
|
+
);
|
|
1779
1793
|
var getSortedCliOptions = () => {
|
|
1780
1794
|
const defs = definition.toJSON();
|
|
1781
1795
|
return getSortedKeys().map((k2) => {
|
|
@@ -1796,6 +1810,7 @@ export {
|
|
|
1796
1810
|
recordFields,
|
|
1797
1811
|
isRecordField,
|
|
1798
1812
|
definition,
|
|
1813
|
+
defaultValues,
|
|
1799
1814
|
getSortedCliOptions,
|
|
1800
1815
|
getSortedKeys
|
|
1801
1816
|
};
|