@vltpkg/cli-js 1.0.10 → 1.1.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-4RPC3X5N.js → access-GLWBGQLN.js} +41 -10
- package/{bugs-K6QLQLL4.js → bugs-OCQYFWFE.js} +18 -18
- package/{build-VD4L5IED.js → build-CPWGNTCM.js} +7 -8
- package/{cache-Q6FUUEQF.js → cache-SL7DQMY2.js} +20 -14
- package/chunk-2IMBYPYC.js +190 -0
- package/{chunk-5JFRXIK2.js → chunk-2PWSMJD7.js} +20 -1
- package/{chunk-FUCQ7ARR.js → chunk-47M7IZ5P.js} +26 -22
- package/{chunk-WAYVHANF.js → chunk-6LEMBT22.js} +30 -5
- package/chunk-A75UYRJC.js +75 -0
- package/{chunk-HAYXR3MW.js → chunk-APMYKJI2.js} +1 -1
- package/{chunk-B5IILBX7.js → chunk-BUXPKRYB.js} +4 -4
- package/{chunk-5HPGL5WS.js → chunk-CBASIDQH.js} +1 -1
- package/{chunk-MNK55XSE.js → chunk-CEHPRPGQ.js} +21 -0
- package/{chunk-BSPUKIWY.js → chunk-CF5EGH4W.js} +12 -2
- package/{chunk-P5S2TFCF.js → chunk-CTQSUNNE.js} +14 -10
- package/{chunk-NWLS3VOQ.js → chunk-GJGQTRAT.js} +154 -26
- package/{chunk-5HBKYSTX.js → chunk-HYCYL4RX.js} +1 -1
- package/{chunk-NA732FNL.js → chunk-J2XWQVDK.js} +98 -6
- package/{chunk-DAS7TVRN.js → chunk-JSQUYHU7.js} +5 -5
- package/{chunk-XUP35M5Q.js → chunk-S6Y57MUS.js} +4 -4
- package/chunk-SNOBGFNM.js +129 -0
- package/{chunk-VL7RJVNN.js → chunk-TNEMFBP5.js} +20 -11
- package/{chunk-3564IL5W.js → chunk-TUXWDPCQ.js} +1 -1
- package/{chunk-ZNCVQQDT.js → chunk-TXTK2PKN.js} +2 -2
- package/{chunk-LPIBYUMT.js → chunk-U7TEQCBN.js} +27 -1
- package/{chunk-XFI4THXZ.js → chunk-WE2TQN32.js} +1 -1
- package/{chunk-USTJECVS.js → chunk-X2AWQGYG.js} +1 -1
- package/{chunk-TYRKIWGF.js → chunk-YKCGWKUE.js} +3 -3
- package/{chunk-2YJ5MESP.js → chunk-ZDQJWRCU.js} +1 -1
- package/{ci-G4PJWJQE.js → ci-O2RSLTBX.js} +9 -10
- package/cli-package.json +1 -1
- package/{config-WTIWWXRD.js → config-ZBIF32GS.js} +11 -11
- package/{config-66ARNESN.js → config-ZPH7V77F.js} +8 -6
- package/{create-DF6RQTHC.js → create-2JX4RV5U.js} +17 -17
- package/{deprecate-2KTC2HKH.js → deprecate-XJLP2TUW.js} +21 -18
- package/{dist-tag-QKJQIOGN.js → dist-tag-F6ZFWGQU.js} +23 -25
- package/{docs-YSWJTGYX.js → docs-IJCZZ4V6.js} +18 -18
- package/{exec-5XIMPSBI.js → exec-IWSS2LUA.js} +17 -17
- package/{exec-cache-OGX7WR5P.js → exec-cache-AG77OOEE.js} +15 -15
- package/{exec-local-SB7EPYED.js → exec-local-QXPWC4QG.js} +13 -14
- package/{help-GMCQHGVN.js → help-TGNDNWLP.js} +4 -4
- package/{init-KXIIWHBA.js → init-WU7BRPKR.js} +7 -8
- package/{install-ODTEMAMS.js → install-74XKB5N7.js} +37 -14
- package/{list-QS4FLJSU.js → list-TOEC6Q3A.js} +41 -29
- package/{login-6TGYRY43.js → login-WJYMAFSL.js} +11 -11
- package/{logout-GOAB7KHJ.js → logout-MTRQWI3L.js} +7 -7
- package/{pack-PJDH6PKP.js → pack-FFWGLSNC.js} +11 -12
- package/package.json +1 -1
- package/{ping-ANBW2IRW.js → ping-DWUVTCJB.js} +7 -7
- package/{pkg-GZWUXU65.js → pkg-KNZW5FIA.js} +10 -11
- package/{profile-BLY74CMB.js → profile-6W2ABNXL.js} +20 -7
- package/{publish-W2KOTNMB.js → publish-HGNUONU3.js} +33 -75
- package/{query-3PUMU5ON.js → query-FSCYPETX.js} +35 -23
- package/{registry-ONSDWNPV.js → registry-YTJZ3AQD.js} +3 -3
- package/registry-client-package.json +6 -1
- package/registry-client-src-revalidate.js +230 -39
- package/{repo-LZ6STH4C.js → repo-OVIKYYWA.js} +18 -18
- package/{reporter-SDMDYYMJ.js → reporter-ZW7OMRZT.js} +23 -1
- package/{run-JMIBADHE.js → run-UPV3RPQJ.js} +13 -14
- package/{run-exec-JEKM2O53.js → run-exec-YJSMWMMP.js} +13 -14
- package/{setup-BTBU3NAI.js → setup-7DPMAPUY.js} +20 -19
- package/{src-23VBKASP.js → src-BNCFK4FH.js} +15 -15
- package/{src-J4BAYOBO.js → src-XJT4IJSV.js} +11 -4
- package/{token-PUJ7QN6D.js → token-GA73ER5V.js} +8 -8
- package/{uninstall-OTISP2T7.js → uninstall-E3VKSC3B.js} +11 -11
- package/{unpublish-X75EEQAN.js → unpublish-Q6MQHBPQ.js} +43 -40
- package/{update-CKXX5POE.js → update-4CC44TR5.js} +34 -12
- package/{version-24B2X7M7.js → version-CRZBXNDG.js} +9 -10
- package/{view-Q7MAQ6R3.js → view-ILUULGSO.js} +9 -9
- 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-S6CQZFE3.js → whoami-Z4TSLYTR.js} +28 -12
- package/chunk-UBLFPJHV.js +0 -40
- package/chunk-Y3QEV76Q.js +0 -75
|
@@ -11,12 +11,12 @@ 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-CTQSUNNE.js";
|
|
15
15
|
import {
|
|
16
16
|
Monorepo,
|
|
17
17
|
PackageJson,
|
|
18
18
|
PathScurry
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-X2AWQGYG.js";
|
|
20
20
|
import {
|
|
21
21
|
resetCaches
|
|
22
22
|
} from "./chunk-YOE3VZFX.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
getCommand,
|
|
28
28
|
isRecordField,
|
|
29
29
|
recordFields
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-CEHPRPGQ.js";
|
|
31
31
|
import {
|
|
32
32
|
find,
|
|
33
33
|
load,
|
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
assertRecordStringString,
|
|
39
39
|
assertRecordStringT,
|
|
40
40
|
getOptions,
|
|
41
|
+
isObject,
|
|
41
42
|
isRecordStringString
|
|
42
43
|
} from "./chunk-VFBCWAOC.js";
|
|
43
44
|
import {
|
|
@@ -150,6 +151,7 @@ var assertRegistryKeys = (registries, file) => {
|
|
|
150
151
|
for (const key of Object.keys(obj)) {
|
|
151
152
|
if (key === "" || key.includes("~")) {
|
|
152
153
|
throw error("Reserved character found in registries name", {
|
|
154
|
+
code: "ECONFIG",
|
|
153
155
|
path: file,
|
|
154
156
|
found: key
|
|
155
157
|
});
|
|
@@ -190,6 +192,26 @@ var recordsToPairs = (obj) => {
|
|
|
190
192
|
);
|
|
191
193
|
};
|
|
192
194
|
var kRecord = /* @__PURE__ */ Symbol("parsed key=value record");
|
|
195
|
+
var envKey = (k) => `VLT_${k.replace(/[^a-zA-Z0-9]+/g, "_").toUpperCase()}`;
|
|
196
|
+
var kParentEnv = "__VLT_INTERNAL_EXPLICIT";
|
|
197
|
+
var parentEnv = () => {
|
|
198
|
+
try {
|
|
199
|
+
const p = JSON.parse(process.env[kParentEnv] ?? "");
|
|
200
|
+
return isObject(p) && isObject(p.explicit) && Object.entries(p.explicit).every(
|
|
201
|
+
([k, v]) => isRecordField(k) ? Array.isArray(v) && v.every((x) => typeof x === "string") : !isObject(v)
|
|
202
|
+
) && isRecordStringString(p.env) ? p : void 0;
|
|
203
|
+
} catch {
|
|
204
|
+
return void 0;
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
var dedupePairs = (pairs) => [
|
|
208
|
+
...new Map(
|
|
209
|
+
pairs.map((p) => {
|
|
210
|
+
const eq = p.indexOf("=");
|
|
211
|
+
return [eq === -1 ? p : p.substring(0, eq), p];
|
|
212
|
+
})
|
|
213
|
+
).values()
|
|
214
|
+
];
|
|
193
215
|
var Config = class _Config {
|
|
194
216
|
/**
|
|
195
217
|
* The {@link https://npmjs.com/jackspeak | JackSpeak} object
|
|
@@ -308,17 +330,56 @@ var Config = class _Config {
|
|
|
308
330
|
parse(args = process.argv) {
|
|
309
331
|
if (isParsed(this)) return this;
|
|
310
332
|
this.#originalArgs = [...args];
|
|
333
|
+
const envKeys = Object.keys(defaultValues).filter(
|
|
334
|
+
(k) => process.env[envKey(k)] !== void 0
|
|
335
|
+
);
|
|
336
|
+
const parent = parentEnv();
|
|
337
|
+
const fileValues = this.#defaults();
|
|
311
338
|
this.jack.loadEnvDefaults();
|
|
339
|
+
const envValues = this.#defaults();
|
|
312
340
|
const p = this.jack.parseRaw(args);
|
|
341
|
+
const cliKeys = Object.keys(p.values);
|
|
313
342
|
const fallback = getCommand(p.values["fallback-command"]);
|
|
314
343
|
this.command = getCommand(p.positionals[0]);
|
|
315
344
|
const cmdOrFallback = this.command ?? fallback;
|
|
316
345
|
const cmdSpecific = cmdOrFallback && this.commandValues[cmdOrFallback];
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
346
|
+
const cmdPairs = cmdSpecific ? recordsToPairs(cmdSpecific) : {};
|
|
347
|
+
if (cmdSpecific) this.jack.setConfigValues(cmdPairs);
|
|
320
348
|
this.jack.applyDefaults(p);
|
|
349
|
+
const values = p.values;
|
|
350
|
+
const explicit = {};
|
|
351
|
+
for (const k of /* @__PURE__ */ new Set([...envKeys, ...cliKeys])) {
|
|
352
|
+
const cli = cliKeys.includes(k) ? values[k] : void 0;
|
|
353
|
+
const env = this.#explicitEnv(k, envValues[k], parent);
|
|
354
|
+
if (isRecordField(k)) {
|
|
355
|
+
const pairs = [
|
|
356
|
+
...env ?? [],
|
|
357
|
+
...cli ?? []
|
|
358
|
+
];
|
|
359
|
+
if (pairs.length) explicit[k] = dedupePairs(pairs);
|
|
360
|
+
} else if (cli !== void 0) explicit[k] = cli;
|
|
361
|
+
else if (env !== void 0 && !(k in cmdPairs))
|
|
362
|
+
explicit[k] = env;
|
|
363
|
+
}
|
|
364
|
+
this.explicit = explicit;
|
|
365
|
+
for (const k of recordFields) {
|
|
366
|
+
const env = envKeys.includes(k) ? envValues[k] : [];
|
|
367
|
+
const cli = cliKeys.includes(k) ? values[k] : [];
|
|
368
|
+
const pairs = [...env, ...cli];
|
|
369
|
+
if (!pairs.length) continue;
|
|
370
|
+
const base = (k in cmdPairs ? cmdPairs[k] : fileValues[k]) ?? [];
|
|
371
|
+
values[k] = dedupePairs([...base, ...pairs]);
|
|
372
|
+
}
|
|
321
373
|
this.jack.writeEnv(p);
|
|
374
|
+
process.env[kParentEnv] = JSON.stringify({
|
|
375
|
+
explicit,
|
|
376
|
+
env: Object.fromEntries(
|
|
377
|
+
Object.keys(defaultValues).flatMap((k) => {
|
|
378
|
+
const v = process.env[envKey(k)];
|
|
379
|
+
return v === void 0 ? [] : [[envKey(k), v]];
|
|
380
|
+
})
|
|
381
|
+
)
|
|
382
|
+
});
|
|
322
383
|
if (this.command) p.positionals.shift();
|
|
323
384
|
else this.command = getCommand(p.values["fallback-command"]);
|
|
324
385
|
Object.assign(this, p);
|
|
@@ -328,6 +389,35 @@ var Config = class _Config {
|
|
|
328
389
|
if (!isParsed(this)) throw error("failed to parse config");
|
|
329
390
|
return this;
|
|
330
391
|
}
|
|
392
|
+
/**
|
|
393
|
+
* Values set on the command line or via `VLT_*` env for this run.
|
|
394
|
+
* Record fields hold only those `key=value` pairs, not the ones from
|
|
395
|
+
* config files.
|
|
396
|
+
*
|
|
397
|
+
* `VLT_*` env left as a parent vlt process wrote it only counts for
|
|
398
|
+
* what was explicit in that parent.
|
|
399
|
+
*/
|
|
400
|
+
explicit = {};
|
|
401
|
+
// a field's explicit env value: all of it at the top level, the new
|
|
402
|
+
// pairs (or changed scalar) when inherited from a parent vlt. once a
|
|
403
|
+
// script changes a record var, the parent's explicit pairs are dropped.
|
|
404
|
+
#explicitEnv(k, value, parent) {
|
|
405
|
+
const cur = process.env[envKey(k)];
|
|
406
|
+
if (cur === void 0) return void 0;
|
|
407
|
+
const written = parent?.env[envKey(k)];
|
|
408
|
+
if (cur === written) return parent?.explicit[k];
|
|
409
|
+
if (!isRecordField(k) || written === void 0) return value;
|
|
410
|
+
const old = new Set(written.split("\n"));
|
|
411
|
+
return value.filter((p) => !old.has(p));
|
|
412
|
+
}
|
|
413
|
+
// the current jack defaults, ie config file (+ env, once loaded) values
|
|
414
|
+
#defaults() {
|
|
415
|
+
const d = { values: {}, positionals: [] };
|
|
416
|
+
this.jack.applyDefaults(
|
|
417
|
+
d
|
|
418
|
+
);
|
|
419
|
+
return d.values;
|
|
420
|
+
}
|
|
331
421
|
/**
|
|
332
422
|
* Get a `key=value` list option value as an object.
|
|
333
423
|
*
|
|
@@ -605,8 +695,10 @@ var configWriteTarget = (conf, fallback) => {
|
|
|
605
695
|
};
|
|
606
696
|
|
|
607
697
|
export {
|
|
698
|
+
registrySelectors,
|
|
608
699
|
registrySelectionFields,
|
|
609
700
|
kCustomInspect,
|
|
701
|
+
assertRegistryKeys,
|
|
610
702
|
pairsToRecords,
|
|
611
703
|
recordsToPairs,
|
|
612
704
|
Config,
|
|
@@ -12,15 +12,15 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
init,
|
|
14
14
|
install
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-47M7IZ5P.js";
|
|
16
|
+
import {
|
|
17
|
+
commandUsage
|
|
18
|
+
} from "./chunk-CBASIDQH.js";
|
|
16
19
|
import {
|
|
17
20
|
asWSConfig,
|
|
18
21
|
assertWSConfig,
|
|
19
22
|
minimatch
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import {
|
|
22
|
-
commandUsage
|
|
23
|
-
} from "./chunk-5HPGL5WS.js";
|
|
23
|
+
} from "./chunk-X2AWQGYG.js";
|
|
24
24
|
import {
|
|
25
25
|
load,
|
|
26
26
|
save
|
|
@@ -11,19 +11,19 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
openUrl
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TXTK2PKN.js";
|
|
15
15
|
import {
|
|
16
16
|
stderr
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TNEMFBP5.js";
|
|
18
18
|
import {
|
|
19
19
|
mermaidOutput
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-47M7IZ5P.js";
|
|
21
21
|
import {
|
|
22
22
|
ViewClass
|
|
23
23
|
} from "./chunk-4KCU2KZL.js";
|
|
24
24
|
import {
|
|
25
25
|
getTokenByURL
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-GJGQTRAT.js";
|
|
27
27
|
|
|
28
28
|
// ../../src/cli-sdk/src/query-auth.ts
|
|
29
29
|
var createGetAuthHeader = (conf) => async (url) => getTokenByURL(url, conf.options.identity);
|
|
@@ -0,0 +1,129 @@
|
|
|
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
|
+
asError,
|
|
14
|
+
isObject
|
|
15
|
+
} from "./chunk-VFBCWAOC.js";
|
|
16
|
+
import {
|
|
17
|
+
error
|
|
18
|
+
} from "./chunk-WZWDS3W4.js";
|
|
19
|
+
|
|
20
|
+
// ../../src/registry-client/src/registry-error.ts
|
|
21
|
+
import { STATUS_CODES } from "node:http";
|
|
22
|
+
var MAX_DETAIL_LENGTH = 512;
|
|
23
|
+
var truncate = (s) => s.length <= MAX_DETAIL_LENGTH ? s : `${s.slice(0, MAX_DETAIL_LENGTH - 1)}\u2026`;
|
|
24
|
+
var isHTML = (s) => /^\s*(<!doctype\s+html|<html\b)/i.test(s);
|
|
25
|
+
var stripTags = (s) => s.replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi, " ").replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
26
|
+
var detailFromJSON = (text) => {
|
|
27
|
+
let body;
|
|
28
|
+
try {
|
|
29
|
+
body = JSON.parse(text);
|
|
30
|
+
} catch {
|
|
31
|
+
return void 0;
|
|
32
|
+
}
|
|
33
|
+
if (!body || typeof body !== "object") return void 0;
|
|
34
|
+
const rec = body;
|
|
35
|
+
const nested = rec.error;
|
|
36
|
+
for (const v of [rec.error, rec.message, nested?.message]) {
|
|
37
|
+
if (typeof v === "string" && v.trim()) return v.trim();
|
|
38
|
+
}
|
|
39
|
+
return void 0;
|
|
40
|
+
};
|
|
41
|
+
var registryErrorMessage = (response) => {
|
|
42
|
+
const statusMessage = STATUS_CODES[response.statusCode];
|
|
43
|
+
const status = `${response.statusCode}${statusMessage ? ` ${statusMessage}` : ""}`;
|
|
44
|
+
let text;
|
|
45
|
+
try {
|
|
46
|
+
text = response.text?.().trim() ?? "";
|
|
47
|
+
} catch {
|
|
48
|
+
return status;
|
|
49
|
+
}
|
|
50
|
+
if (!text) return status;
|
|
51
|
+
const detail = detailFromJSON(text) ?? (isHTML(text) ? stripTags(text) : text);
|
|
52
|
+
return detail ? `${status} \u2014 ${truncate(detail)}` : status;
|
|
53
|
+
};
|
|
54
|
+
var registryError = (response, { message, url, method = "GET", advice }, from, cause) => {
|
|
55
|
+
const { statusCode } = response;
|
|
56
|
+
const denied = statusCode === 401 || statusCode === 403;
|
|
57
|
+
const extra = advice?.(statusCode);
|
|
58
|
+
const tips = (Array.isArray(extra) ? extra : [extra]).filter(
|
|
59
|
+
(t) => !!t
|
|
60
|
+
);
|
|
61
|
+
const warn = tips.map((t) => `
|
|
62
|
+
\u26A0\uFE0F ${t}`).join("");
|
|
63
|
+
return error(
|
|
64
|
+
`${message}: ${registryErrorMessage(response)}${warn}`,
|
|
65
|
+
{
|
|
66
|
+
code: denied ? "ENEEDAUTH" : "EREQUEST",
|
|
67
|
+
url,
|
|
68
|
+
method,
|
|
69
|
+
status: statusCode,
|
|
70
|
+
response,
|
|
71
|
+
...cause === void 0 ? {} : { cause: asError(cause) }
|
|
72
|
+
},
|
|
73
|
+
from
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
var assertOk = (response, options) => {
|
|
77
|
+
const { statusCode } = response;
|
|
78
|
+
if (!(statusCode < 200 || statusCode >= 300)) return;
|
|
79
|
+
throw registryError(response, options, assertOk);
|
|
80
|
+
};
|
|
81
|
+
var isTextFn = (v) => typeof v === "function";
|
|
82
|
+
var requestError = (err, { message, url, method = "GET", advice }) => {
|
|
83
|
+
const e = asError(err);
|
|
84
|
+
const reason = e.message;
|
|
85
|
+
const bag = isObject(e.cause) ? e.cause : void 0;
|
|
86
|
+
const res = isObject(bag?.response) ? bag.response : void 0;
|
|
87
|
+
const statusCode = typeof bag?.status === "number" ? bag.status : typeof res?.statusCode === "number" ? res.statusCode : void 0;
|
|
88
|
+
if (statusCode !== void 0) {
|
|
89
|
+
let body = "";
|
|
90
|
+
try {
|
|
91
|
+
const text = res?.text;
|
|
92
|
+
if (isTextFn(text)) body = String(text()).trim();
|
|
93
|
+
} catch {
|
|
94
|
+
}
|
|
95
|
+
return registryError(
|
|
96
|
+
{ ...res, statusCode, text: () => body || reason },
|
|
97
|
+
{
|
|
98
|
+
message,
|
|
99
|
+
url,
|
|
100
|
+
method,
|
|
101
|
+
advice: (sc) => [
|
|
102
|
+
// the reason only moves here when the body took its place
|
|
103
|
+
...body ? [reason] : [],
|
|
104
|
+
...[advice?.(sc)].flat()
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
requestError,
|
|
108
|
+
e
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
const inner = bag?.cause === void 0 ? void 0 : asError(bag.cause);
|
|
112
|
+
const detail = inner?.message && inner.message !== reason ? `${reason}: ${inner.message}` : reason;
|
|
113
|
+
return error(
|
|
114
|
+
`${message}: ${detail}`,
|
|
115
|
+
{
|
|
116
|
+
code: "EREQUEST",
|
|
117
|
+
url,
|
|
118
|
+
method,
|
|
119
|
+
cause: inner ?? e
|
|
120
|
+
},
|
|
121
|
+
requestError
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export {
|
|
126
|
+
registryErrorMessage,
|
|
127
|
+
assertOk,
|
|
128
|
+
requestError
|
|
129
|
+
};
|
|
@@ -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-HYCYL4RX.js";
|
|
16
16
|
import {
|
|
17
17
|
flush,
|
|
18
18
|
trackCommand,
|
|
@@ -26,22 +26,22 @@ import {
|
|
|
26
26
|
hasNpmRegistry,
|
|
27
27
|
missingNpmRegistryError,
|
|
28
28
|
missingRegistryError
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-2PWSMJD7.js";
|
|
30
|
+
import {
|
|
31
|
+
isLazyView,
|
|
32
|
+
isViewClass,
|
|
33
|
+
loadLazyView
|
|
34
|
+
} from "./chunk-4KCU2KZL.js";
|
|
30
35
|
import {
|
|
31
36
|
isGraphRunError,
|
|
32
37
|
splitDepID
|
|
33
38
|
} from "./chunk-YOE3VZFX.js";
|
|
34
39
|
import {
|
|
35
40
|
defaultView
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import {
|
|
38
|
-
isLazyView,
|
|
39
|
-
isViewClass,
|
|
40
|
-
loadLazyView
|
|
41
|
-
} from "./chunk-4KCU2KZL.js";
|
|
41
|
+
} from "./chunk-CEHPRPGQ.js";
|
|
42
42
|
import {
|
|
43
43
|
emitter
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-U7TEQCBN.js";
|
|
45
45
|
import {
|
|
46
46
|
isErrorWithCause,
|
|
47
47
|
isObject
|
|
@@ -215,15 +215,21 @@ var printCode = (err, usage, stderr2, format) => {
|
|
|
215
215
|
return { file: true };
|
|
216
216
|
}
|
|
217
217
|
case "ENEEDAUTH": {
|
|
218
|
-
const { url } = err.cause;
|
|
218
|
+
const { url, method, status } = err.cause;
|
|
219
219
|
stderr2(`Authentication Error: ${err.message}`);
|
|
220
220
|
if (url) {
|
|
221
221
|
stderr2(indent(`URL: ${formatURL(url, format)}`));
|
|
222
222
|
}
|
|
223
|
+
if (method) {
|
|
224
|
+
stderr2(indent(`Method: ${format(method)}`));
|
|
225
|
+
}
|
|
226
|
+
if (status) {
|
|
227
|
+
stderr2(indent(`Status: ${format(status)}`));
|
|
228
|
+
}
|
|
223
229
|
return {};
|
|
224
230
|
}
|
|
225
231
|
case "EREQUEST": {
|
|
226
|
-
const { url, method } = err.cause;
|
|
232
|
+
const { url, method, status } = err.cause;
|
|
227
233
|
const { code, syscall } = err.cause.cause ?? {};
|
|
228
234
|
stderr2(`Request Error: ${err.message}`);
|
|
229
235
|
if (code) {
|
|
@@ -238,6 +244,9 @@ var printCode = (err, usage, stderr2, format) => {
|
|
|
238
244
|
if (method) {
|
|
239
245
|
stderr2(indent(`Method: ${format(method)}`));
|
|
240
246
|
}
|
|
247
|
+
if (status) {
|
|
248
|
+
stderr2(indent(`Status: ${format(status)}`));
|
|
249
|
+
}
|
|
241
250
|
return { file: true };
|
|
242
251
|
}
|
|
243
252
|
case "EQUERY": {
|
|
@@ -11,10 +11,10 @@ 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-TNEMFBP5.js";
|
|
15
15
|
import {
|
|
16
16
|
urlOpen
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-APMYKJI2.js";
|
|
18
18
|
|
|
19
19
|
// ../../src/cli-sdk/src/open-url.ts
|
|
20
20
|
var openUrl = async (url) => {
|
|
@@ -13,6 +13,29 @@ import {
|
|
|
13
13
|
error
|
|
14
14
|
} from "./chunk-WZWDS3W4.js";
|
|
15
15
|
|
|
16
|
+
// ../../src/output/src/index.ts
|
|
17
|
+
import EventEmitter from "node:events";
|
|
18
|
+
var OutputEmitter = class {
|
|
19
|
+
emitter = new EventEmitter();
|
|
20
|
+
emit(eventName, payload) {
|
|
21
|
+
this.emitter.emit(eventName, payload);
|
|
22
|
+
}
|
|
23
|
+
on(eventName, handler) {
|
|
24
|
+
this.emitter.on(eventName, handler);
|
|
25
|
+
}
|
|
26
|
+
off(eventName, handler) {
|
|
27
|
+
this.emitter.off(eventName, handler);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var emitter = new OutputEmitter();
|
|
31
|
+
var logRequest = (url, state, details = {}) => {
|
|
32
|
+
emitter.emit("request", { url, state, ...details });
|
|
33
|
+
};
|
|
34
|
+
var graphStep = (step) => {
|
|
35
|
+
emitter.emit("graphStep", { step, state: "start" });
|
|
36
|
+
return () => emitter.emit("graphStep", { step, state: "stop" });
|
|
37
|
+
};
|
|
38
|
+
|
|
16
39
|
// ../../node_modules/.vlt/~npm~lru-cache@11.5.2/node_modules/lru-cache/dist/esm/node/index.min.js
|
|
17
40
|
import { tracingChannel as G, channel as P } from "node:diagnostics_channel";
|
|
18
41
|
var S = P("lru-cache:metrics");
|
|
@@ -850,5 +873,8 @@ export {
|
|
|
850
873
|
I,
|
|
851
874
|
promiseSpawn,
|
|
852
875
|
which,
|
|
853
|
-
whichSync
|
|
876
|
+
whichSync,
|
|
877
|
+
emitter,
|
|
878
|
+
logRequest,
|
|
879
|
+
graphStep
|
|
854
880
|
};
|
|
@@ -11,14 +11,14 @@ 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-CTQSUNNE.js";
|
|
15
15
|
import {
|
|
16
16
|
findCmdShimIfExists,
|
|
17
17
|
install
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-47M7IZ5P.js";
|
|
19
19
|
import {
|
|
20
20
|
PathScurry
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-X2AWQGYG.js";
|
|
22
22
|
import {
|
|
23
23
|
Spec
|
|
24
24
|
} from "./chunk-XKVU23NC.js";
|
|
@@ -11,22 +11,21 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
install
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-USTJECVS.js";
|
|
17
|
-
import "./chunk-YOE3VZFX.js";
|
|
14
|
+
} from "./chunk-47M7IZ5P.js";
|
|
15
|
+
import "./chunk-ZDQJWRCU.js";
|
|
18
16
|
import {
|
|
19
17
|
commandUsage
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-MNK55XSE.js";
|
|
18
|
+
} from "./chunk-CBASIDQH.js";
|
|
19
|
+
import "./chunk-X2AWQGYG.js";
|
|
23
20
|
import {
|
|
24
21
|
lazyView
|
|
25
22
|
} from "./chunk-4KCU2KZL.js";
|
|
23
|
+
import "./chunk-YOE3VZFX.js";
|
|
24
|
+
import "./chunk-XKVU23NC.js";
|
|
25
|
+
import "./chunk-CEHPRPGQ.js";
|
|
26
26
|
import "./chunk-HTOTG4TS.js";
|
|
27
27
|
import "./chunk-E74WGW5C.js";
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-UBLFPJHV.js";
|
|
28
|
+
import "./chunk-U7TEQCBN.js";
|
|
30
29
|
import "./chunk-VFBCWAOC.js";
|
|
31
30
|
import "./chunk-XNLSTHDK.js";
|
|
32
31
|
import "./chunk-BHJT53TP.js";
|
|
@@ -60,7 +59,7 @@ var usage = () => commandUsage({
|
|
|
60
59
|
var views = {
|
|
61
60
|
json: (i) => i.graph.toJSON(),
|
|
62
61
|
human: lazyView(
|
|
63
|
-
async () => (await import("./reporter-
|
|
62
|
+
async () => (await import("./reporter-ZW7OMRZT.js")).InstallReporter
|
|
64
63
|
)
|
|
65
64
|
};
|
|
66
65
|
var command = async (conf) => {
|
package/cli-package.json
CHANGED
|
@@ -13,31 +13,31 @@ import {
|
|
|
13
13
|
get,
|
|
14
14
|
set
|
|
15
15
|
} from "./chunk-DBANBIL2.js";
|
|
16
|
+
import {
|
|
17
|
+
asRootError
|
|
18
|
+
} from "./chunk-GDJ7JT2R.js";
|
|
16
19
|
import {
|
|
17
20
|
pairsToRecords,
|
|
18
21
|
recordsToPairs
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-J2XWQVDK.js";
|
|
23
|
+
import "./chunk-CTQSUNNE.js";
|
|
21
24
|
import "./chunk-ZWKI5OSF.js";
|
|
22
|
-
import {
|
|
23
|
-
asRootError
|
|
24
|
-
} from "./chunk-GDJ7JT2R.js";
|
|
25
|
-
import "./chunk-USTJECVS.js";
|
|
26
|
-
import "./chunk-YOE3VZFX.js";
|
|
27
25
|
import {
|
|
28
26
|
commandUsage
|
|
29
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-CBASIDQH.js";
|
|
28
|
+
import "./chunk-X2AWQGYG.js";
|
|
29
|
+
import "./chunk-YOE3VZFX.js";
|
|
30
30
|
import "./chunk-XKVU23NC.js";
|
|
31
31
|
import {
|
|
32
32
|
getSortedKeys,
|
|
33
33
|
isRecordField
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-CEHPRPGQ.js";
|
|
35
35
|
import {
|
|
36
36
|
find,
|
|
37
37
|
load
|
|
38
38
|
} from "./chunk-HTOTG4TS.js";
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-SNOBGFNM.js";
|
|
40
|
+
import "./chunk-U7TEQCBN.js";
|
|
41
41
|
import {
|
|
42
42
|
isObject
|
|
43
43
|
} from "./chunk-VFBCWAOC.js";
|
|
@@ -11,14 +11,15 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
Config,
|
|
14
|
+
assertRegistryKeys,
|
|
14
15
|
configWriteTarget,
|
|
15
16
|
kCustomInspect,
|
|
16
17
|
pairsToRecords,
|
|
17
18
|
recordsToPairs
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-J2XWQVDK.js";
|
|
20
|
+
import "./chunk-CTQSUNNE.js";
|
|
20
21
|
import "./chunk-ZWKI5OSF.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-X2AWQGYG.js";
|
|
22
23
|
import "./chunk-YOE3VZFX.js";
|
|
23
24
|
import "./chunk-XKVU23NC.js";
|
|
24
25
|
import {
|
|
@@ -26,10 +27,10 @@ import {
|
|
|
26
27
|
definition,
|
|
27
28
|
isRecordField,
|
|
28
29
|
recordFields
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-CEHPRPGQ.js";
|
|
30
31
|
import "./chunk-HTOTG4TS.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-SNOBGFNM.js";
|
|
33
|
+
import "./chunk-U7TEQCBN.js";
|
|
33
34
|
import "./chunk-VFBCWAOC.js";
|
|
34
35
|
import "./chunk-XNLSTHDK.js";
|
|
35
36
|
import "./chunk-VE6CCH33.js";
|
|
@@ -37,6 +38,7 @@ import "./chunk-WZWDS3W4.js";
|
|
|
37
38
|
import "./chunk-PZLD7RTK.js";
|
|
38
39
|
export {
|
|
39
40
|
Config,
|
|
41
|
+
assertRegistryKeys,
|
|
40
42
|
commands,
|
|
41
43
|
configWriteTarget,
|
|
42
44
|
definition,
|