@vltpkg/cli-js 1.5.0 → 1.6.1
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-YSLEWR2C.js} +8 -8
- package/{bugs-TLOECXEM.js → bugs-S6CRUEA2.js} +23 -19
- package/{build-IQOS3LKO.js → build-SG3KPX3W.js} +49 -14
- package/{cache-O5IBYYSB.js → cache-HA77ROM7.js} +16 -13
- package/cache-unzip-src-unzip.js +23 -4
- package/{chunk-3S3W7QEM.js → chunk-3E3ISOYM.js} +10 -5
- package/{chunk-43EJ4Q42.js → chunk-3JIN46K5.js} +1 -1
- package/{chunk-5KW6AOTT.js → chunk-4GMNWW4C.js} +1 -1
- package/{chunk-6W5XMVIZ.js → chunk-4UAIPIAV.js} +7 -7
- package/{chunk-7UWRR6EE.js → chunk-5Q2HSLVV.js} +1 -1
- package/{chunk-LUVDMEW4.js → chunk-6D3QAFNZ.js} +1 -1
- package/{chunk-LH7J5BDU.js → chunk-6XVW7CWJ.js} +3 -3
- package/{chunk-UZ6ICZE3.js → chunk-7M2VTFLP.js} +12 -1
- package/{chunk-XCQCYB6G.js → chunk-AEVT3CHK.js} +142 -16
- package/{chunk-SMXXFQPI.js → chunk-AHLBPSGQ.js} +3 -3
- package/{chunk-6LZM3I4Q.js → chunk-BF5DRGRZ.js} +25 -4
- package/chunk-BH5CVXNY.js +115 -0
- package/{chunk-CS6AYPY5.js → chunk-BQMHDAYL.js} +6 -13
- package/{chunk-2U4PVHP4.js → chunk-C4RJ4NNS.js} +137 -47
- package/{chunk-F7NPYSI2.js → chunk-CAV7FKWQ.js} +2 -2
- 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-DBANBIL2.js → chunk-FZCPQWCJ.js} +1 -0
- package/chunk-GCTREKA4.js +115 -0
- package/{chunk-CW56EJIL.js → chunk-HT6FS4VB.js} +1 -1
- package/{chunk-VR7NRWAD.js → chunk-IHERL3TA.js} +17 -16
- package/chunk-JV5XR5JQ.js +349 -0
- package/{chunk-T5EP7QEF.js → chunk-JZXNHIQE.js} +28 -28
- package/{chunk-IJUVVD7E.js → chunk-KD5ZK72K.js} +1 -1
- package/{chunk-C6ZVVEFV.js → chunk-KURQHX54.js} +5 -3
- package/{chunk-GUP55DM6.js → chunk-L3ZF7OYM.js} +2 -2
- package/{chunk-X6JKMIOU.js → chunk-LGQVZTYR.js} +4 -36
- package/{chunk-G3FZ2ZJK.js → chunk-M242QVJS.js} +1 -1
- package/chunk-MCDLJZXT.js +82 -0
- package/{chunk-WHWPAYZY.js → chunk-MSWOR3FV.js} +35 -7
- package/chunk-N3V6EK5I.js +77 -0
- package/{chunk-ISAMD2FE.js → chunk-N6HV7JWC.js} +1 -1
- package/{chunk-MYX4JCIJ.js → chunk-NO53Y3QO.js} +1 -1
- package/chunk-O6MQ7NN6.js +1155 -0
- package/{chunk-XCSNI6AO.js → chunk-OWL5G4K4.js} +4 -4
- package/{chunk-35EG6T3J.js → chunk-Q2UEILN6.js} +21 -9
- package/{chunk-Z5D5KODU.js → chunk-VGPLFOJO.js} +4 -2
- package/{chunk-ARE7FKDG.js → chunk-W24SBFY5.js} +5 -5
- package/{chunk-XD5KUDXX.js → chunk-WMMKUVAT.js} +10 -8
- package/{chunk-4UH3KMTD.js → chunk-ZJE3OTP3.js} +258 -451
- package/{ci-ESVUMOZO.js → ci-GVLL72SS.js} +21 -17
- package/cli-package.json +3 -1
- package/{config-ZVVLFKR7.js → config-KH6AEMHI.js} +13 -12
- package/{config-TMB2X6DW.js → config-TIPKOPYS.js} +10 -9
- package/{create-BLTNKSBQ.js → create-SKNEZEZY.js} +28 -24
- package/{deprecate-VA6PGHYL.js → deprecate-RFRLJZVL.js} +12 -12
- package/{dist-tag-OYJREFO2.js → dist-tag-LVYOTJHJ.js} +8 -8
- package/{docs-6OC3OQNM.js → docs-INXRFEGY.js} +23 -19
- package/{exec-AZPGFVRY.js → exec-5MA5XRPZ.js} +28 -24
- package/{exec-cache-D75UY2WI.js → exec-cache-7GS4KLWJ.js} +24 -20
- package/{exec-local-E2JKB4X4.js → exec-local-RE4KVTMN.js} +22 -18
- package/{help-UPW77X5N.js → help-JHLP565L.js} +5 -4
- package/{init-SNO6QL7C.js → init-4UFHO67B.js} +13 -12
- package/{install-TEJM2YVX.js → install-Z33YVCDK.js} +108 -52
- package/{list-NHCC2RNB.js → list-XAMKR6TL.js} +29 -22
- package/{login-XNZXCGFD.js → login-6NXUO5FF.js} +14 -13
- package/{logout-YCM7O36Q.js → logout-6P7LWTAY.js} +8 -8
- package/{outdated-4LA7N63W.js → outdated-YNUSWZJD.js} +18 -17
- package/{pack-RC4CZSWF.js → pack-LMQYH75V.js} +15 -14
- package/package.json +1 -1
- package/{ping-RLVAZGDL.js → ping-VLFZ3WCY.js} +8 -8
- package/{pkg-FED5C6TP.js → pkg-JMPBHKSW.js} +16 -15
- package/{profile-DJZNLQPG.js → profile-PJJAA2YM.js} +8 -8
- package/{publish-54AMVMTQ.js → publish-33RFJ2HJ.js} +24 -20
- package/{query-ZQLMSJ7O.js → query-LUUOK57K.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-VLHLQP2S.js} +23 -19
- package/{reporter-UYVR2WMB.js → reporter-SNSM2TDC.js} +61 -15
- package/{run-TP2HTJRN.js → run-USWK7R3N.js} +22 -18
- package/{run-exec-UGCC53DV.js → run-exec-PHE44AWW.js} +22 -18
- package/security-archive-src-update-expired.js +24 -5
- package/{setup-XPAM5U3Z.js → setup-JMY47ERY.js} +206 -27
- package/{skills-YD2TB2VD.js → skills-7PYMTDER.js} +41 -56
- package/{skills-LR6GXW3X.js → skills-YMMV6TMN.js} +24 -21
- package/{src-34D4DOOH.js → src-2ZS4VHJP.js} +25 -19
- package/{src-H6DFCAPH.js → src-A5ZJNOHN.js} +6 -4
- package/{src-LHDC4NJO.js → src-W2VQULRG.js} +2 -2
- package/{token-OF63PFTQ.js → token-YKHELNVQ.js} +10 -9
- package/{uninstall-B54FQ5KQ.js → uninstall-Q46HWR5S.js} +53 -17
- package/{unpublish-CSHIGMDQ.js → unpublish-LBANPSJ5.js} +8 -8
- package/{update-HS4VJ5ZG.js → update-B2EGLZHI.js} +19 -17
- package/{version-L7S3DHUS.js → version-IEOBL3NN.js} +14 -13
- package/{view-NWKKWFVA.js → view-JCA5VT6F.js} +13 -13
- 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-OWJUPO3X.js} +8 -8
- package/chunk-T2VBCUF5.js +0 -77
|
@@ -12,39 +12,43 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
ExecCommand,
|
|
14
14
|
views
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-4UAIPIAV.js";
|
|
16
|
+
import "./chunk-3JIN46K5.js";
|
|
17
17
|
import "./chunk-RIYFGX27.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-W24SBFY5.js";
|
|
19
19
|
import {
|
|
20
20
|
run,
|
|
21
21
|
runFG
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-ZJE3OTP3.js";
|
|
23
|
+
import "./chunk-C4RJ4NNS.js";
|
|
24
|
+
import "./chunk-AHLBPSGQ.js";
|
|
25
|
+
import "./chunk-MSWOR3FV.js";
|
|
26
|
+
import "./chunk-LGQVZTYR.js";
|
|
27
|
+
import "./chunk-EYGOEAJM.js";
|
|
28
28
|
import {
|
|
29
29
|
commandUsage
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-HT6FS4VB.js";
|
|
31
31
|
import "./chunk-VTEFO2FT.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-JV5XR5JQ.js";
|
|
33
|
+
import "./chunk-EMTGRCSE.js";
|
|
34
|
+
import "./chunk-KURQHX54.js";
|
|
34
35
|
import "./chunk-4KCU2KZL.js";
|
|
35
36
|
import "./chunk-WGDTG44V.js";
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-E74WGW5C.js";
|
|
38
|
+
import "./chunk-GCTREKA4.js";
|
|
39
|
+
import "./chunk-MCDLJZXT.js";
|
|
40
|
+
import "./chunk-7M2VTFLP.js";
|
|
41
|
+
import "./chunk-EFHOWRKU.js";
|
|
42
|
+
import "./chunk-CAV7FKWQ.js";
|
|
43
|
+
import "./chunk-6D3QAFNZ.js";
|
|
40
44
|
import "./chunk-HTOTG4TS.js";
|
|
41
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-M242QVJS.js";
|
|
42
46
|
import "./chunk-SUU2WETN.js";
|
|
43
47
|
import "./chunk-B6RIGNEO.js";
|
|
44
48
|
import "./chunk-XNLSTHDK.js";
|
|
45
49
|
import "./chunk-PDWPFR5T.js";
|
|
46
50
|
import "./chunk-Y5PA7DVK.js";
|
|
47
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-BF5DRGRZ.js";
|
|
48
52
|
import "./chunk-WZWDS3W4.js";
|
|
49
53
|
import "./chunk-PZLD7RTK.js";
|
|
50
54
|
|
|
@@ -12,39 +12,43 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
ExecCommand,
|
|
14
14
|
views
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-4UAIPIAV.js";
|
|
16
|
+
import "./chunk-3JIN46K5.js";
|
|
17
17
|
import "./chunk-RIYFGX27.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-W24SBFY5.js";
|
|
19
19
|
import {
|
|
20
20
|
runExec,
|
|
21
21
|
runExecFG
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-ZJE3OTP3.js";
|
|
23
|
+
import "./chunk-C4RJ4NNS.js";
|
|
24
|
+
import "./chunk-AHLBPSGQ.js";
|
|
25
|
+
import "./chunk-MSWOR3FV.js";
|
|
26
|
+
import "./chunk-LGQVZTYR.js";
|
|
27
|
+
import "./chunk-EYGOEAJM.js";
|
|
28
28
|
import {
|
|
29
29
|
commandUsage
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-HT6FS4VB.js";
|
|
31
31
|
import "./chunk-VTEFO2FT.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-JV5XR5JQ.js";
|
|
33
|
+
import "./chunk-EMTGRCSE.js";
|
|
34
|
+
import "./chunk-KURQHX54.js";
|
|
34
35
|
import "./chunk-4KCU2KZL.js";
|
|
35
36
|
import "./chunk-WGDTG44V.js";
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-E74WGW5C.js";
|
|
38
|
+
import "./chunk-GCTREKA4.js";
|
|
39
|
+
import "./chunk-MCDLJZXT.js";
|
|
40
|
+
import "./chunk-7M2VTFLP.js";
|
|
41
|
+
import "./chunk-EFHOWRKU.js";
|
|
42
|
+
import "./chunk-CAV7FKWQ.js";
|
|
43
|
+
import "./chunk-6D3QAFNZ.js";
|
|
40
44
|
import "./chunk-HTOTG4TS.js";
|
|
41
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-M242QVJS.js";
|
|
42
46
|
import "./chunk-SUU2WETN.js";
|
|
43
47
|
import "./chunk-B6RIGNEO.js";
|
|
44
48
|
import "./chunk-XNLSTHDK.js";
|
|
45
49
|
import "./chunk-PDWPFR5T.js";
|
|
46
50
|
import "./chunk-Y5PA7DVK.js";
|
|
47
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-BF5DRGRZ.js";
|
|
48
52
|
import "./chunk-WZWDS3W4.js";
|
|
49
53
|
import "./chunk-PZLD7RTK.js";
|
|
50
54
|
|
|
@@ -1027,12 +1027,31 @@ var Comparator = class {
|
|
|
1027
1027
|
);
|
|
1028
1028
|
}
|
|
1029
1029
|
#parseCaret(comp) {
|
|
1030
|
-
const
|
|
1031
|
-
if (
|
|
1032
|
-
this.tuples.push(
|
|
1030
|
+
const parsed = this.#parseX(comp);
|
|
1031
|
+
if (isXMajor(parsed)) {
|
|
1032
|
+
this.tuples.push(this.#getComparatorAny());
|
|
1033
1033
|
return;
|
|
1034
1034
|
}
|
|
1035
|
-
const
|
|
1035
|
+
const z = this.includePrerelease ? "0" : void 0;
|
|
1036
|
+
if (isXMinor(parsed)) {
|
|
1037
|
+
const [M2] = parsed;
|
|
1038
|
+
this.tuples.push(
|
|
1039
|
+
[">=", new Version(comp, M2, 0, 0, z, void 0)],
|
|
1040
|
+
["<", new Version(comp, M2 + 1, 0, 0, "0", void 0)]
|
|
1041
|
+
);
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
1044
|
+
if (isXPatch(parsed)) {
|
|
1045
|
+
const [M2, m2] = parsed;
|
|
1046
|
+
this.tuples.push(
|
|
1047
|
+
[">=", new Version(comp, M2, m2, 0, z, void 0)],
|
|
1048
|
+
M2 !== 0 ? ["<", new Version(comp, M2 + 1, 0, 0, "0", void 0)] : ["<", new Version(comp, 0, m2 + 1, 0, "0", void 0)]
|
|
1049
|
+
);
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1052
|
+
const [M, m, p, pr = z, build] = parsed;
|
|
1053
|
+
const minv = new Version(comp, M, m, p, pr, build);
|
|
1054
|
+
const min = [">=", minv];
|
|
1036
1055
|
if (minv.major !== 0) {
|
|
1037
1056
|
this.tuples.push(min, [
|
|
1038
1057
|
"<",
|
|
@@ -2190,7 +2209,7 @@ var baseDepID = (id) => {
|
|
|
2190
2209
|
var package_default = {
|
|
2191
2210
|
name: "@vltpkg/user-agent",
|
|
2192
2211
|
description: "The User-Agent string that vlt sends with every outbound request",
|
|
2193
|
-
version: "1.
|
|
2212
|
+
version: "1.6.1",
|
|
2194
2213
|
repository: {
|
|
2195
2214
|
type: "git",
|
|
2196
2215
|
url: "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -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-MSWOR3FV.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-AEVT3CHK.js";
|
|
24
|
+
import "./chunk-IHERL3TA.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-KURQHX54.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-Q2UEILN6.js";
|
|
42
63
|
import "./chunk-QNHBAGXQ.js";
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
64
|
+
import "./chunk-M242QVJS.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) {
|