@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
|
@@ -0,0 +1,349 @@
|
|
|
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
|
+
rimraf
|
|
14
|
+
} from "./chunk-PDWPFR5T.js";
|
|
15
|
+
import {
|
|
16
|
+
error
|
|
17
|
+
} from "./chunk-WZWDS3W4.js";
|
|
18
|
+
|
|
19
|
+
// ../../src/rollback-remove/src/index.ts
|
|
20
|
+
import { spawn } from "node:child_process";
|
|
21
|
+
import { rename } from "node:fs/promises";
|
|
22
|
+
import { basename, dirname } from "node:path";
|
|
23
|
+
|
|
24
|
+
// ../../src/rollback-remove/src/remove.ts
|
|
25
|
+
import { resolve } from "node:path";
|
|
26
|
+
var __CODE_SPLIT_SCRIPT_NAME = resolve(import.meta.dirname, "rollback-remove-src-remove.js");
|
|
27
|
+
|
|
28
|
+
// ../../src/rollback-remove/src/index.ts
|
|
29
|
+
var isDeno = globalThis.Deno != void 0;
|
|
30
|
+
var RollbackRemove = class {
|
|
31
|
+
#key = String(Math.random()).substring(2);
|
|
32
|
+
#paths = /* @__PURE__ */ new Map();
|
|
33
|
+
async rm(path) {
|
|
34
|
+
if (this.#paths.has(path)) return;
|
|
35
|
+
const target = `${dirname(path)}/.VLT.DELETE.${this.#key}.${basename(path)}`;
|
|
36
|
+
try {
|
|
37
|
+
await rename(path, target);
|
|
38
|
+
} catch (e) {
|
|
39
|
+
if (e instanceof Error && "code" in e && /* c8 ignore start - very spurious weirdness on Windows */
|
|
40
|
+
(e.code === "ENOENT" || e.code === "EPERM")) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
throw e;
|
|
44
|
+
}
|
|
45
|
+
this.#paths.set(path, target);
|
|
46
|
+
}
|
|
47
|
+
confirm() {
|
|
48
|
+
if (!this.#paths.size) return;
|
|
49
|
+
const env = { ...process.env };
|
|
50
|
+
const args = [];
|
|
51
|
+
const detached = !(isDeno && process.platform === "win32");
|
|
52
|
+
if (isDeno) {
|
|
53
|
+
args.push(
|
|
54
|
+
"--unstable-node-globals",
|
|
55
|
+
"--unstable-bare-node-builtins"
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
args.push(__CODE_SPLIT_SCRIPT_NAME);
|
|
59
|
+
const child = spawn(process.execPath, args, {
|
|
60
|
+
stdio: ["pipe", "ignore", "ignore"],
|
|
61
|
+
detached,
|
|
62
|
+
env
|
|
63
|
+
});
|
|
64
|
+
for (const path of this.#paths.values()) {
|
|
65
|
+
child.stdin.write(`${path}\0`);
|
|
66
|
+
}
|
|
67
|
+
child.stdin.end();
|
|
68
|
+
if (detached) {
|
|
69
|
+
child.unref();
|
|
70
|
+
}
|
|
71
|
+
this.#paths.clear();
|
|
72
|
+
}
|
|
73
|
+
async rollback() {
|
|
74
|
+
const promises = [];
|
|
75
|
+
for (const [original, moved] of this.#paths) {
|
|
76
|
+
promises.push(
|
|
77
|
+
rimraf(original).catch(() => {
|
|
78
|
+
}).then(() => rename(moved, original))
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
await Promise.all(promises);
|
|
82
|
+
this.#paths.clear();
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// ../../src/cmd-shim/src/read.ts
|
|
87
|
+
import { lstat, readFile, readlink } from "node:fs/promises";
|
|
88
|
+
import { dirname as dirname2, resolve as resolve2 } from "node:path";
|
|
89
|
+
|
|
90
|
+
// ../../src/cmd-shim/src/paths.ts
|
|
91
|
+
var paths = process.platform === "win32" ? (path) => [
|
|
92
|
+
path + ".cmd",
|
|
93
|
+
path + ".ps1",
|
|
94
|
+
path,
|
|
95
|
+
path + ".pwsh"
|
|
96
|
+
] : (path) => [path];
|
|
97
|
+
|
|
98
|
+
// ../../src/cmd-shim/src/read.ts
|
|
99
|
+
var extractPath = (path, cmdshimContents) => {
|
|
100
|
+
if (/\.cmd$/i.test(path)) {
|
|
101
|
+
return extractPathFromCmd(cmdshimContents);
|
|
102
|
+
} else if (/\.(ps1|pwsh)$/i.test(path)) {
|
|
103
|
+
return extractPathFromPowershell(cmdshimContents);
|
|
104
|
+
} else {
|
|
105
|
+
return extractPathFromCygwin(cmdshimContents);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
var extractPathFromPowershell = (cmdshimContents) => {
|
|
109
|
+
const matches = /"(?:[$]basedir\/|(?=[a-zA-Z]:[\\/]))([^"]+?)"\s+[$]args/.exec(
|
|
110
|
+
cmdshimContents
|
|
111
|
+
);
|
|
112
|
+
return matches?.[1]?.replace(/\\/g, "/");
|
|
113
|
+
};
|
|
114
|
+
var extractPathFromCmd = (cmdshimContents) => {
|
|
115
|
+
const matches = /"(?:%(?:~dp0|dp0%)\\|(?=[a-zA-Z]:[\\/]))([^"]+?)"\s+%[*]/.exec(
|
|
116
|
+
cmdshimContents
|
|
117
|
+
);
|
|
118
|
+
return matches?.[1]?.replace(/\\/g, "/");
|
|
119
|
+
};
|
|
120
|
+
var extractPathFromCygwin = (cmdshimContents) => {
|
|
121
|
+
const matches = /"(?:[$]basedir\/|(?=[a-zA-Z]:[\\/]))([^"]+?)"\s+"[$]@"/.exec(
|
|
122
|
+
cmdshimContents
|
|
123
|
+
);
|
|
124
|
+
return matches?.[1]?.replace(/\\/g, "/");
|
|
125
|
+
};
|
|
126
|
+
var findCmdShimIfExists = async (path) => {
|
|
127
|
+
path = path.replace(/\.(cmd|pwsh|ps1)$/i, "");
|
|
128
|
+
for (const p of paths(path)) {
|
|
129
|
+
const result = await readCmdShimIfExists(p);
|
|
130
|
+
if (result) return [p, result];
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
var readCmdShimIfExists = async (path) => {
|
|
134
|
+
try {
|
|
135
|
+
const st = await lstat(path);
|
|
136
|
+
if (st.isSymbolicLink()) {
|
|
137
|
+
return resolve2(dirname2(path), await readlink(path));
|
|
138
|
+
}
|
|
139
|
+
const contents = await readFile(path);
|
|
140
|
+
const destination = extractPath(path, contents.toString());
|
|
141
|
+
if (destination) return resolve2(dirname2(path), destination);
|
|
142
|
+
} catch {
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
// ../../src/cmd-shim/src/index.ts
|
|
147
|
+
import {
|
|
148
|
+
chmod,
|
|
149
|
+
mkdir,
|
|
150
|
+
readFile as readFile2,
|
|
151
|
+
stat,
|
|
152
|
+
writeFile
|
|
153
|
+
} from "node:fs/promises";
|
|
154
|
+
import { dirname as dirname3, isAbsolute, relative } from "node:path";
|
|
155
|
+
|
|
156
|
+
// ../../src/cmd-shim/src/to-batch-syntax.ts
|
|
157
|
+
var convertToSetCommand = (key, value) => convertToSetCommand_(key.trim(), value.trim());
|
|
158
|
+
var convertToSetCommand_ = (key, value) => key && value ? `@SET ${key}=${replaceDollarWithPercentPair(value)}\r
|
|
159
|
+
` : "";
|
|
160
|
+
var extractVariableValuePairs = (declarations) => declarations.reduce(
|
|
161
|
+
(pairs, declaration) => {
|
|
162
|
+
const [key = "", val = ""] = declaration.split("=");
|
|
163
|
+
pairs[key] = val;
|
|
164
|
+
return pairs;
|
|
165
|
+
},
|
|
166
|
+
{}
|
|
167
|
+
);
|
|
168
|
+
var convertToSetCommands = (variableString) => Object.entries(extractVariableValuePairs(variableString.split(" "))).map(([key, val]) => convertToSetCommand(key, val)).join("");
|
|
169
|
+
var replaceDollarWithPercentPair = (value) => {
|
|
170
|
+
const dollarExpressions = /\$\{?([^$@#?\- \t{}:]+)\}?/g;
|
|
171
|
+
let result = "";
|
|
172
|
+
let startIndex = 0;
|
|
173
|
+
do {
|
|
174
|
+
const match = dollarExpressions.exec(value);
|
|
175
|
+
if (match) {
|
|
176
|
+
const betweenMatches = value.substring(startIndex, match.index) || "";
|
|
177
|
+
result += betweenMatches + "%" + String(match[1]) + "%";
|
|
178
|
+
startIndex = dollarExpressions.lastIndex;
|
|
179
|
+
}
|
|
180
|
+
} while (dollarExpressions.lastIndex > 0);
|
|
181
|
+
result += value.slice(startIndex);
|
|
182
|
+
return result;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// ../../src/cmd-shim/src/index.ts
|
|
186
|
+
var shebangExpr = /^#!\s*(?:\/usr\/bin\/env\s+(?:-S\s+)?((?:[^ \t=]+=[^ \t=]+\s+)*))?([^ \t]+)(.*)$/;
|
|
187
|
+
var cmdShimIfExists = async (from, to, remover) => {
|
|
188
|
+
try {
|
|
189
|
+
await stat(from);
|
|
190
|
+
} catch {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
await writeShim(from, to, remover);
|
|
194
|
+
};
|
|
195
|
+
var cmdShim = async (from, to, remover) => {
|
|
196
|
+
try {
|
|
197
|
+
await stat(from);
|
|
198
|
+
await writeShim(from, to, remover);
|
|
199
|
+
} catch (er) {
|
|
200
|
+
throw error("Could not shim to executable file", {
|
|
201
|
+
path: from,
|
|
202
|
+
target: to,
|
|
203
|
+
cause: er
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
var writeShim = async (from, to, remover) => {
|
|
208
|
+
await Promise.all([
|
|
209
|
+
remover.rm(to),
|
|
210
|
+
remover.rm(to + ".cmd"),
|
|
211
|
+
remover.rm(to + ".ps1"),
|
|
212
|
+
remover.rm(to + ".pwsh")
|
|
213
|
+
]);
|
|
214
|
+
await mkdir(dirname3(to), { recursive: true });
|
|
215
|
+
const data = await readFile2(from, "utf8").catch(() => "");
|
|
216
|
+
if (!data) {
|
|
217
|
+
return await writeShim_(from, to);
|
|
218
|
+
}
|
|
219
|
+
const firstLine = data.trim().split(/\r*\n/)[0];
|
|
220
|
+
const shebang = firstLine?.match(shebangExpr) ?? void 0;
|
|
221
|
+
return writeShim_(
|
|
222
|
+
from,
|
|
223
|
+
to,
|
|
224
|
+
shebang?.[2],
|
|
225
|
+
shebang?.[3],
|
|
226
|
+
shebang?.[1]
|
|
227
|
+
);
|
|
228
|
+
};
|
|
229
|
+
var writeShim_ = async (from, to, prog, args, variables) => {
|
|
230
|
+
let shTarget = relative(dirname3(to), from);
|
|
231
|
+
const [dp0, basedir] = isAbsolute(shTarget) ? ["", ""] : ["%dp0%\\", "$basedir/"];
|
|
232
|
+
let target = shTarget.split("/").join("\\");
|
|
233
|
+
let longProg;
|
|
234
|
+
let shProg = prog?.split("\\").join("/");
|
|
235
|
+
let shLongProg;
|
|
236
|
+
let pwshProg = shProg && `"${shProg}$exe"`;
|
|
237
|
+
let pwshLongProg;
|
|
238
|
+
shTarget = shTarget.split("\\").join("/");
|
|
239
|
+
args = args || "";
|
|
240
|
+
variables = variables || "";
|
|
241
|
+
if (!prog) {
|
|
242
|
+
prog = `"${dp0}${target}"`;
|
|
243
|
+
shProg = `"${basedir}${shTarget}"`;
|
|
244
|
+
pwshProg = shProg;
|
|
245
|
+
args = "";
|
|
246
|
+
target = "";
|
|
247
|
+
shTarget = "";
|
|
248
|
+
} else {
|
|
249
|
+
longProg = `"%dp0%\\${prog}.exe"`;
|
|
250
|
+
shLongProg = `"$basedir/${prog}"`;
|
|
251
|
+
pwshLongProg = `"$basedir/${prog}$exe"`;
|
|
252
|
+
target = `"${dp0}${target}"`;
|
|
253
|
+
shTarget = `"${basedir}${shTarget}"`;
|
|
254
|
+
}
|
|
255
|
+
const head = "@ECHO off\r\nGOTO start\r\n:find_dp0\r\nSET dp0=%~dp0\r\nEXIT /b\r\n:start\r\nSETLOCAL\r\nCALL :find_dp0\r\n";
|
|
256
|
+
let cmd;
|
|
257
|
+
if (longProg) {
|
|
258
|
+
shLongProg = (shLongProg ?? "").trim();
|
|
259
|
+
args = args.trim();
|
|
260
|
+
const variablesBatch = convertToSetCommands(variables);
|
|
261
|
+
cmd = `${head}${variablesBatch}\r
|
|
262
|
+
IF EXIST ${longProg} (\r
|
|
263
|
+
SET "_prog=${longProg.replace(/(^")|("$)/g, "")}"\r
|
|
264
|
+
) ELSE (\r
|
|
265
|
+
SET "_prog=${prog.replace(/(^")|("$)/g, "")}"\r
|
|
266
|
+
SET PATHEXT=%PATHEXT:;.JS;=;%\r
|
|
267
|
+
)\r
|
|
268
|
+
\r
|
|
269
|
+
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" ${args} ${target} %*\r
|
|
270
|
+
`;
|
|
271
|
+
} else {
|
|
272
|
+
cmd = `${head}${prog} ${args} ${target} %*\r
|
|
273
|
+
`;
|
|
274
|
+
}
|
|
275
|
+
let sh = `#!/bin/sh
|
|
276
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
|
|
277
|
+
|
|
278
|
+
case \`uname\` in
|
|
279
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
280
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
281
|
+
basedir=\`cygpath -w "$basedir"\`
|
|
282
|
+
fi
|
|
283
|
+
;;
|
|
284
|
+
esac
|
|
285
|
+
|
|
286
|
+
`;
|
|
287
|
+
if (shLongProg) {
|
|
288
|
+
sh += `if [ -x ${shLongProg} ]; then
|
|
289
|
+
exec ${variables}${shLongProg} ${args} ${shTarget} "$@"
|
|
290
|
+
else
|
|
291
|
+
exec ${variables}${shProg} ${args} ${shTarget} "$@"
|
|
292
|
+
fi
|
|
293
|
+
`;
|
|
294
|
+
} else {
|
|
295
|
+
sh += `exec ${shProg} ${args} ${shTarget} "$@"
|
|
296
|
+
`;
|
|
297
|
+
}
|
|
298
|
+
let pwsh = '#!/usr/bin/env pwsh\n$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n\n$exe=""\nif ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {\n # Fix case when both the Windows and Linux builds of Node\n # are installed in the same directory\n $exe=".exe"\n}\n';
|
|
299
|
+
if (shLongProg) {
|
|
300
|
+
pwsh += `$ret=0
|
|
301
|
+
if (Test-Path ${pwshLongProg}) {
|
|
302
|
+
# Support pipeline input
|
|
303
|
+
if ($MyInvocation.ExpectingInput) {
|
|
304
|
+
$input | & ${pwshLongProg} ${args} ${shTarget} $args
|
|
305
|
+
} else {
|
|
306
|
+
& ${pwshLongProg} ${args} ${shTarget} $args
|
|
307
|
+
}
|
|
308
|
+
$ret=$LASTEXITCODE
|
|
309
|
+
} else {
|
|
310
|
+
# Support pipeline input
|
|
311
|
+
if ($MyInvocation.ExpectingInput) {
|
|
312
|
+
$input | & ${pwshProg} ${args} ${shTarget} $args
|
|
313
|
+
} else {
|
|
314
|
+
& ${pwshProg} ${args} ${shTarget} $args
|
|
315
|
+
}
|
|
316
|
+
$ret=$LASTEXITCODE
|
|
317
|
+
}
|
|
318
|
+
exit $ret
|
|
319
|
+
`;
|
|
320
|
+
} else {
|
|
321
|
+
pwsh += `# Support pipeline input
|
|
322
|
+
if ($MyInvocation.ExpectingInput) {
|
|
323
|
+
$input | & ${pwshProg} ${args} ${shTarget} $args
|
|
324
|
+
} else {
|
|
325
|
+
& ${pwshProg} ${args} ${shTarget} $args
|
|
326
|
+
}
|
|
327
|
+
exit $LASTEXITCODE
|
|
328
|
+
`;
|
|
329
|
+
}
|
|
330
|
+
await Promise.all([
|
|
331
|
+
writeFile(to + ".cmd", cmd, "utf8"),
|
|
332
|
+
writeFile(to + ".ps1", pwsh, "utf8"),
|
|
333
|
+
writeFile(to, sh, "utf8")
|
|
334
|
+
]);
|
|
335
|
+
await chmodShim(to);
|
|
336
|
+
};
|
|
337
|
+
var chmodShim = async (to) => await Promise.all([
|
|
338
|
+
chmod(to, 493),
|
|
339
|
+
chmod(to + ".cmd", 493),
|
|
340
|
+
chmod(to + ".ps1", 493)
|
|
341
|
+
]);
|
|
342
|
+
|
|
343
|
+
export {
|
|
344
|
+
findCmdShimIfExists,
|
|
345
|
+
readCmdShimIfExists,
|
|
346
|
+
cmdShimIfExists,
|
|
347
|
+
cmdShim,
|
|
348
|
+
RollbackRemove
|
|
349
|
+
};
|
|
@@ -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
|
getId
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CAV7FKWQ.js";
|
|
15
15
|
|
|
16
16
|
// ../../src/cli-sdk/src/stub-node.ts
|
|
17
17
|
var createStubNode = (spec, name, version, options) => ({
|
|
@@ -12,28 +12,34 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
generateDefaultHelp,
|
|
14
14
|
generateFullHelp
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LGQVZTYR.js";
|
|
16
16
|
import {
|
|
17
17
|
parseError
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-EYGOEAJM.js";
|
|
19
19
|
import {
|
|
20
20
|
isLazyView,
|
|
21
21
|
isViewClass,
|
|
22
22
|
loadLazyView
|
|
23
23
|
} from "./chunk-4KCU2KZL.js";
|
|
24
|
+
import {
|
|
25
|
+
sweepPendingRemove
|
|
26
|
+
} from "./chunk-GCTREKA4.js";
|
|
27
|
+
import {
|
|
28
|
+
globalCommands
|
|
29
|
+
} from "./chunk-MCDLJZXT.js";
|
|
24
30
|
import {
|
|
25
31
|
hasConfiguredRegistry,
|
|
26
32
|
hasNpmRegistry,
|
|
27
33
|
missingNpmRegistryError,
|
|
28
34
|
missingRegistryError
|
|
29
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-7M2VTFLP.js";
|
|
30
36
|
import {
|
|
31
37
|
defaultView
|
|
32
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-EFHOWRKU.js";
|
|
33
39
|
import {
|
|
34
40
|
isGraphRunError,
|
|
35
41
|
splitDepID
|
|
36
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-CAV7FKWQ.js";
|
|
37
43
|
import {
|
|
38
44
|
emitter
|
|
39
45
|
} from "./chunk-B6RIGNEO.js";
|
|
@@ -43,7 +49,10 @@ import {
|
|
|
43
49
|
import {
|
|
44
50
|
isErrorWithCause,
|
|
45
51
|
isObject
|
|
46
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-BF5DRGRZ.js";
|
|
53
|
+
import {
|
|
54
|
+
error
|
|
55
|
+
} from "./chunk-WZWDS3W4.js";
|
|
47
56
|
|
|
48
57
|
// ../../src/cli-sdk/src/print-err.ts
|
|
49
58
|
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
@@ -665,6 +674,16 @@ var outputCommand = async (cliCommand, conf, { start, vltVersion } = {
|
|
|
665
674
|
const telemetryEnabled = conf.values.telemetry;
|
|
666
675
|
const commandName = conf.command;
|
|
667
676
|
try {
|
|
677
|
+
if (conf.explicit.global && !conf.globalRoot) {
|
|
678
|
+
throw error(
|
|
679
|
+
`\`vlt ${conf.command}\` does not support --global`,
|
|
680
|
+
{
|
|
681
|
+
code: "EUSAGE",
|
|
682
|
+
found: conf.command,
|
|
683
|
+
validOptions: [...globalCommands]
|
|
684
|
+
}
|
|
685
|
+
);
|
|
686
|
+
}
|
|
668
687
|
if (needsRegistry && !hasConfiguredRegistry(conf)) {
|
|
669
688
|
throw missingRegistryError();
|
|
670
689
|
}
|
|
@@ -673,6 +692,7 @@ var outputCommand = async (cliCommand, conf, { start, vltVersion } = {
|
|
|
673
692
|
conf.options["default-registry-alias"]
|
|
674
693
|
);
|
|
675
694
|
}
|
|
695
|
+
if (conf.globalRoot) await sweepPendingRemove(conf.globalRoot);
|
|
676
696
|
const output = await onDone(await command(conf));
|
|
677
697
|
stopRequestLog();
|
|
678
698
|
const duration_ms = Date.now() - start;
|
|
@@ -17,19 +17,19 @@ import {
|
|
|
17
17
|
pickManifest,
|
|
18
18
|
resolve,
|
|
19
19
|
revs
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-EMTGRCSE.js";
|
|
21
21
|
import {
|
|
22
22
|
Monorepo,
|
|
23
23
|
PackageJson
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-TQQO2F56.js";
|
|
25
25
|
import {
|
|
26
26
|
Spec
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-6D3QAFNZ.js";
|
|
28
28
|
import {
|
|
29
29
|
registryErrorMessage,
|
|
30
30
|
storeRoot,
|
|
31
31
|
tokenRefusalAdvice
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-4GMNWW4C.js";
|
|
33
33
|
import {
|
|
34
34
|
logRequest
|
|
35
35
|
} from "./chunk-B6RIGNEO.js";
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
brotliTarballUrl,
|
|
42
42
|
integrityHex,
|
|
43
43
|
tarballFormat
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-BF5DRGRZ.js";
|
|
45
45
|
import {
|
|
46
46
|
error
|
|
47
47
|
} from "./chunk-WZWDS3W4.js";
|
|
@@ -338,7 +338,7 @@ var PackageInfoClient = class {
|
|
|
338
338
|
}
|
|
339
339
|
async getRegistryClient() {
|
|
340
340
|
if (this.#registryClient) return this.#registryClient;
|
|
341
|
-
this.#registryClientPromise ??= import("./src-
|
|
341
|
+
this.#registryClientPromise ??= import("./src-QO5G2S4O.js").then(({ RegistryClient }) => {
|
|
342
342
|
this.#registryClient = new RegistryClient(this.options);
|
|
343
343
|
return this.#registryClient;
|
|
344
344
|
});
|
|
@@ -377,7 +377,7 @@ var PackageInfoClient = class {
|
|
|
377
377
|
}
|
|
378
378
|
async getTarPool() {
|
|
379
379
|
if (this.#tarPool) return this.#tarPool;
|
|
380
|
-
this.#tarPoolPromise ??= import("./src-
|
|
380
|
+
this.#tarPoolPromise ??= import("./src-W2VQULRG.js").then(
|
|
381
381
|
({ Pool }) => {
|
|
382
382
|
this.#tarPool = new Pool();
|
|
383
383
|
return this.#tarPool;
|
|
@@ -593,7 +593,7 @@ var PackageInfoClient = class {
|
|
|
593
593
|
}
|
|
594
594
|
case "remote": {
|
|
595
595
|
const rc = await this.getRegistryClient();
|
|
596
|
-
const { CacheEntry: Entry, cacheKey } = await import("./src-
|
|
596
|
+
const { CacheEntry: Entry, cacheKey } = await import("./src-QO5G2S4O.js");
|
|
597
597
|
const key = cacheKey("GET", new URL(r.resolved));
|
|
598
598
|
const unzipped = (entry) => {
|
|
599
599
|
try {
|
|
@@ -12,43 +12,12 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
source_default
|
|
14
14
|
} from "./chunk-WGDTG44V.js";
|
|
15
|
+
import {
|
|
16
|
+
loadPackageJson
|
|
17
|
+
} from "./chunk-E74WGW5C.js";
|
|
15
18
|
import {
|
|
16
19
|
commandAliases
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
|
|
19
|
-
// ../../node_modules/.vlt/~npm~package-json-from-dist@1.0.1/node_modules/package-json-from-dist/dist/esm/index.js
|
|
20
|
-
import { readFileSync } from "node:fs";
|
|
21
|
-
import { dirname, resolve, sep } from "node:path";
|
|
22
|
-
import { fileURLToPath } from "node:url";
|
|
23
|
-
var NM = `${sep}node_modules${sep}`;
|
|
24
|
-
var STORE = `.store${sep}`;
|
|
25
|
-
var PKG = `${sep}package${sep}`;
|
|
26
|
-
var DIST = `${sep}dist${sep}`;
|
|
27
|
-
var findPackageJson = (from, pathFromSrc = "../package.json") => {
|
|
28
|
-
const f = typeof from === "object" || from.startsWith("file://") ? fileURLToPath(from) : from;
|
|
29
|
-
const __dirname = dirname(f);
|
|
30
|
-
const nms = __dirname.lastIndexOf(NM);
|
|
31
|
-
if (nms !== -1) {
|
|
32
|
-
const nm = __dirname.substring(0, nms + NM.length);
|
|
33
|
-
const pkgDir = __dirname.substring(nms + NM.length);
|
|
34
|
-
if (pkgDir.startsWith(STORE)) {
|
|
35
|
-
const pkg = pkgDir.indexOf(PKG, STORE.length);
|
|
36
|
-
if (pkg) {
|
|
37
|
-
return resolve(nm, pkgDir.substring(0, pkg + PKG.length), "package.json");
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const pkgName = pkgDir.startsWith("@") ? pkgDir.split(sep, 2).join(sep) : String(pkgDir.split(sep)[0]);
|
|
41
|
-
return resolve(nm, pkgName, "package.json");
|
|
42
|
-
} else {
|
|
43
|
-
const d = __dirname.lastIndexOf(DIST);
|
|
44
|
-
if (d !== -1) {
|
|
45
|
-
return resolve(__dirname.substring(0, d), "package.json");
|
|
46
|
-
} else {
|
|
47
|
-
return resolve(__dirname, pathFromSrc);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
var loadPackageJson = (from, pathFromSrc = "../package.json") => JSON.parse(readFileSync(findPackageJson(from, pathFromSrc), "utf8"));
|
|
20
|
+
} from "./chunk-EFHOWRKU.js";
|
|
52
21
|
|
|
53
22
|
// ../../src/cli-sdk/src/custom-help.ts
|
|
54
23
|
var { version } = loadPackageJson(
|
|
@@ -407,7 +376,6 @@ ${s("dim", `Run \`vlt help <command>\` for detailed information about a specific
|
|
|
407
376
|
};
|
|
408
377
|
|
|
409
378
|
export {
|
|
410
|
-
loadPackageJson,
|
|
411
379
|
generateDefaultHelp,
|
|
412
380
|
generateFullHelp
|
|
413
381
|
};
|