vlt 0.0.0-3 → 0.0.0-4
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/README.md +2 -1
- package/package.json +17 -10
- package/postinstall.cjs +56 -0
- package/vlix +25 -0
- package/vlr +25 -0
- package/vlrx +25 -0
- package/vlt +25 -0
- package/vlx +25 -0
- package/cache-unzip-src-unzip.js +0 -7896
- package/cache-unzip-src-unzip.js.map +0 -7
- package/chunk-227OF2U2.js +0 -1183
- package/chunk-227OF2U2.js.map +0 -7
- package/chunk-3HXIYJS2.js +0 -54
- package/chunk-3HXIYJS2.js.map +0 -7
- package/chunk-AA6MVXJX.js +0 -19823
- package/chunk-AA6MVXJX.js.map +0 -7
- package/chunk-BCK4ZGNG.js +0 -41
- package/chunk-BCK4ZGNG.js.map +0 -7
- package/chunk-DH36SF3E.js +0 -35
- package/chunk-DH36SF3E.js.map +0 -7
- package/chunk-FNKWJ7AZ.js +0 -1379
- package/chunk-FNKWJ7AZ.js.map +0 -7
- package/chunk-H77UDCL3.js +0 -9820
- package/chunk-H77UDCL3.js.map +0 -7
- package/chunk-HL76E44L.js +0 -73
- package/chunk-HL76E44L.js.map +0 -7
- package/chunk-IN7DEH7F.js +0 -44
- package/chunk-IN7DEH7F.js.map +0 -7
- package/chunk-JLP2QDXQ.js +0 -1137
- package/chunk-JLP2QDXQ.js.map +0 -7
- package/chunk-JMGSFQ32.js +0 -969
- package/chunk-JMGSFQ32.js.map +0 -7
- package/chunk-JQRUGUZ3.js +0 -512
- package/chunk-JQRUGUZ3.js.map +0 -7
- package/chunk-K2BYYPM7.js +0 -8656
- package/chunk-K2BYYPM7.js.map +0 -7
- package/chunk-LNUDEBGP.js +0 -2071
- package/chunk-LNUDEBGP.js.map +0 -7
- package/chunk-MV5ZQ3LW.js +0 -1105
- package/chunk-MV5ZQ3LW.js.map +0 -7
- package/chunk-O7CDQZDW.js +0 -5234
- package/chunk-O7CDQZDW.js.map +0 -7
- package/chunk-OFW7MWFP.js +0 -82
- package/chunk-OFW7MWFP.js.map +0 -7
- package/chunk-PGDJ2ZZ6.js +0 -4810
- package/chunk-PGDJ2ZZ6.js.map +0 -7
- package/chunk-POVPHE2F.js +0 -1864
- package/chunk-POVPHE2F.js.map +0 -7
- package/chunk-PTVPYZHU.js +0 -72
- package/chunk-PTVPYZHU.js.map +0 -7
- package/chunk-SXBMMXTY.js +0 -11837
- package/chunk-SXBMMXTY.js.map +0 -7
- package/chunk-UZZ72UON.js +0 -152
- package/chunk-UZZ72UON.js.map +0 -7
- package/chunk-V7KRP7IO.js +0 -481
- package/chunk-V7KRP7IO.js.map +0 -7
- package/chunk-WVNUD273.js +0 -83
- package/chunk-WVNUD273.js.map +0 -7
- package/chunk-WYPE3MV4.js +0 -62
- package/chunk-WYPE3MV4.js.map +0 -7
- package/chunk-ZRNJWPYC.js +0 -37
- package/chunk-ZRNJWPYC.js.map +0 -7
- package/cli-package.json +0 -107
- package/config-3QQHUYLI.js +0 -179
- package/config-3QQHUYLI.js.map +0 -7
- package/devtools-5BBQJTDW.js +0 -16682
- package/devtools-5BBQJTDW.js.map +0 -7
- package/exec-C6GK336U.js +0 -50
- package/exec-C6GK336U.js.map +0 -7
- package/gui-IQ4M4K5X.js +0 -46
- package/gui-IQ4M4K5X.js.map +0 -7
- package/gui-assets/favicon.ico +0 -0
- package/gui-assets/fonts/geist-mono.ttf +0 -0
- package/gui-assets/fonts/inter.ttf +0 -0
- package/gui-assets/images/folder.png +0 -0
- package/gui-assets/index.html +0 -34
- package/gui-assets/index.js +0 -1549
- package/gui-assets/index.js.map +0 -7
- package/gui-assets/main.css +0 -1
- package/help-R6TSKVEA.js +0 -25
- package/help-R6TSKVEA.js.map +0 -7
- package/init-UTJGYULC.js +0 -25
- package/init-UTJGYULC.js.map +0 -7
- package/install-5XDTGLAU.js +0 -56
- package/install-5XDTGLAU.js.map +0 -7
- package/install-exec-VMPN3JE7.js +0 -28
- package/install-exec-VMPN3JE7.js.map +0 -7
- package/list-Q7IANZ3I.js +0 -129
- package/list-Q7IANZ3I.js.map +0 -7
- package/login-VHJEIRVU.js +0 -36
- package/login-VHJEIRVU.js.map +0 -7
- package/logout-5KMCSSR4.js +0 -36
- package/logout-5KMCSSR4.js.map +0 -7
- package/pkg-WYFDWETL.js +0 -364
- package/pkg-WYFDWETL.js.map +0 -7
- package/query-KP4F5D2Y.js +0 -117
- package/query-KP4F5D2Y.js.map +0 -7
- package/registry-client-package.json +0 -85
- package/reporter-LFGXWL6N.js +0 -18
- package/reporter-LFGXWL6N.js.map +0 -7
- package/rollback-remove-src-remove.js +0 -7398
- package/rollback-remove-src-remove.js.map +0 -7
- package/run-XNDZH72D.js +0 -68
- package/run-XNDZH72D.js.map +0 -7
- package/run-exec-NXA33NXJ.js +0 -41
- package/run-exec-NXA33NXJ.js.map +0 -7
- package/source-JWPG6PR3.js +0 -33
- package/source-JWPG6PR3.js.map +0 -7
- package/token-6IJNGEMI.js +0 -86
- package/token-6IJNGEMI.js.map +0 -7
- package/uninstall-MI7NFD27.js +0 -45
- package/uninstall-MI7NFD27.js.map +0 -7
- package/vlix.js +0 -25
- package/vlix.js.map +0 -7
- package/vlr.js +0 -25
- package/vlr.js.map +0 -7
- package/vlrx.js +0 -25
- package/vlrx.js.map +0 -7
- package/vlt.js +0 -24
- package/vlt.js.map +0 -7
- package/vlx.js +0 -25
- package/vlx.js.map +0 -7
- package/whoami-3IEXJF3U.js +0 -46
- package/whoami-3IEXJF3U.js.map +0 -7
- package/yoga.wasm +0 -0
package/chunk-227OF2U2.js
DELETED
|
@@ -1,1183 +0,0 @@
|
|
|
1
|
-
var global = globalThis;
|
|
2
|
-
import {Buffer} from "node:buffer";
|
|
3
|
-
import {setImmediate, clearImmediate} from "node:timers";
|
|
4
|
-
import {createRequire as _vlt_createRequire} from 'node:module';
|
|
5
|
-
var require = _vlt_createRequire(import.meta.filename);
|
|
6
|
-
import {
|
|
7
|
-
promiseSpawn
|
|
8
|
-
} from "./chunk-OFW7MWFP.js";
|
|
9
|
-
import {
|
|
10
|
-
Range,
|
|
11
|
-
Spec2 as Spec,
|
|
12
|
-
Version,
|
|
13
|
-
parse2 as parse,
|
|
14
|
-
satisfies
|
|
15
|
-
} from "./chunk-POVPHE2F.js";
|
|
16
|
-
import {
|
|
17
|
-
LRUCache
|
|
18
|
-
} from "./chunk-FNKWJ7AZ.js";
|
|
19
|
-
import {
|
|
20
|
-
error
|
|
21
|
-
} from "./chunk-ZRNJWPYC.js";
|
|
22
|
-
import {
|
|
23
|
-
__commonJS,
|
|
24
|
-
__export,
|
|
25
|
-
__toESM
|
|
26
|
-
} from "./chunk-3HXIYJS2.js";
|
|
27
|
-
|
|
28
|
-
// ../../node_modules/.pnpm/err-code@2.0.3/node_modules/err-code/index.js
|
|
29
|
-
var require_err_code = __commonJS({
|
|
30
|
-
"../../node_modules/.pnpm/err-code@2.0.3/node_modules/err-code/index.js"(exports, module) {
|
|
31
|
-
"use strict";
|
|
32
|
-
function assign(obj, props) {
|
|
33
|
-
for (const key in props) {
|
|
34
|
-
Object.defineProperty(obj, key, {
|
|
35
|
-
value: props[key],
|
|
36
|
-
enumerable: true,
|
|
37
|
-
configurable: true
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return obj;
|
|
41
|
-
}
|
|
42
|
-
function createError(err, code, props) {
|
|
43
|
-
if (!err || typeof err === "string") {
|
|
44
|
-
throw new TypeError("Please pass an Error to err-code");
|
|
45
|
-
}
|
|
46
|
-
if (!props) {
|
|
47
|
-
props = {};
|
|
48
|
-
}
|
|
49
|
-
if (typeof code === "object") {
|
|
50
|
-
props = code;
|
|
51
|
-
code = void 0;
|
|
52
|
-
}
|
|
53
|
-
if (code != null) {
|
|
54
|
-
props.code = code;
|
|
55
|
-
}
|
|
56
|
-
try {
|
|
57
|
-
return assign(err, props);
|
|
58
|
-
} catch (_) {
|
|
59
|
-
props.message = err.message;
|
|
60
|
-
props.stack = err.stack;
|
|
61
|
-
const ErrClass = function() {
|
|
62
|
-
};
|
|
63
|
-
ErrClass.prototype = Object.create(Object.getPrototypeOf(err));
|
|
64
|
-
return assign(new ErrClass(), props);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
module.exports = createError;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// ../../node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry_operation.js
|
|
72
|
-
var require_retry_operation = __commonJS({
|
|
73
|
-
"../../node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry_operation.js"(exports, module) {
|
|
74
|
-
function RetryOperation(timeouts, options) {
|
|
75
|
-
if (typeof options === "boolean") {
|
|
76
|
-
options = { forever: options };
|
|
77
|
-
}
|
|
78
|
-
this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
|
|
79
|
-
this._timeouts = timeouts;
|
|
80
|
-
this._options = options || {};
|
|
81
|
-
this._maxRetryTime = options && options.maxRetryTime || Infinity;
|
|
82
|
-
this._fn = null;
|
|
83
|
-
this._errors = [];
|
|
84
|
-
this._attempts = 1;
|
|
85
|
-
this._operationTimeout = null;
|
|
86
|
-
this._operationTimeoutCb = null;
|
|
87
|
-
this._timeout = null;
|
|
88
|
-
this._operationStart = null;
|
|
89
|
-
if (this._options.forever) {
|
|
90
|
-
this._cachedTimeouts = this._timeouts.slice(0);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
module.exports = RetryOperation;
|
|
94
|
-
RetryOperation.prototype.reset = function() {
|
|
95
|
-
this._attempts = 1;
|
|
96
|
-
this._timeouts = this._originalTimeouts;
|
|
97
|
-
};
|
|
98
|
-
RetryOperation.prototype.stop = function() {
|
|
99
|
-
if (this._timeout) {
|
|
100
|
-
clearTimeout(this._timeout);
|
|
101
|
-
}
|
|
102
|
-
this._timeouts = [];
|
|
103
|
-
this._cachedTimeouts = null;
|
|
104
|
-
};
|
|
105
|
-
RetryOperation.prototype.retry = function(err) {
|
|
106
|
-
if (this._timeout) {
|
|
107
|
-
clearTimeout(this._timeout);
|
|
108
|
-
}
|
|
109
|
-
if (!err) {
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
var currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
113
|
-
if (err && currentTime - this._operationStart >= this._maxRetryTime) {
|
|
114
|
-
this._errors.unshift(new Error("RetryOperation timeout occurred"));
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
this._errors.push(err);
|
|
118
|
-
var timeout = this._timeouts.shift();
|
|
119
|
-
if (timeout === void 0) {
|
|
120
|
-
if (this._cachedTimeouts) {
|
|
121
|
-
this._errors.splice(this._errors.length - 1, this._errors.length);
|
|
122
|
-
this._timeouts = this._cachedTimeouts.slice(0);
|
|
123
|
-
timeout = this._timeouts.shift();
|
|
124
|
-
} else {
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
var self = this;
|
|
129
|
-
var timer = setTimeout(function() {
|
|
130
|
-
self._attempts++;
|
|
131
|
-
if (self._operationTimeoutCb) {
|
|
132
|
-
self._timeout = setTimeout(function() {
|
|
133
|
-
self._operationTimeoutCb(self._attempts);
|
|
134
|
-
}, self._operationTimeout);
|
|
135
|
-
if (self._options.unref) {
|
|
136
|
-
self._timeout.unref();
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
self._fn(self._attempts);
|
|
140
|
-
}, timeout);
|
|
141
|
-
if (this._options.unref) {
|
|
142
|
-
timer.unref();
|
|
143
|
-
}
|
|
144
|
-
return true;
|
|
145
|
-
};
|
|
146
|
-
RetryOperation.prototype.attempt = function(fn, timeoutOps) {
|
|
147
|
-
this._fn = fn;
|
|
148
|
-
if (timeoutOps) {
|
|
149
|
-
if (timeoutOps.timeout) {
|
|
150
|
-
this._operationTimeout = timeoutOps.timeout;
|
|
151
|
-
}
|
|
152
|
-
if (timeoutOps.cb) {
|
|
153
|
-
this._operationTimeoutCb = timeoutOps.cb;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
var self = this;
|
|
157
|
-
if (this._operationTimeoutCb) {
|
|
158
|
-
this._timeout = setTimeout(function() {
|
|
159
|
-
self._operationTimeoutCb();
|
|
160
|
-
}, self._operationTimeout);
|
|
161
|
-
}
|
|
162
|
-
this._operationStart = (/* @__PURE__ */ new Date()).getTime();
|
|
163
|
-
this._fn(this._attempts);
|
|
164
|
-
};
|
|
165
|
-
RetryOperation.prototype.try = function(fn) {
|
|
166
|
-
console.log("Using RetryOperation.try() is deprecated");
|
|
167
|
-
this.attempt(fn);
|
|
168
|
-
};
|
|
169
|
-
RetryOperation.prototype.start = function(fn) {
|
|
170
|
-
console.log("Using RetryOperation.start() is deprecated");
|
|
171
|
-
this.attempt(fn);
|
|
172
|
-
};
|
|
173
|
-
RetryOperation.prototype.start = RetryOperation.prototype.try;
|
|
174
|
-
RetryOperation.prototype.errors = function() {
|
|
175
|
-
return this._errors;
|
|
176
|
-
};
|
|
177
|
-
RetryOperation.prototype.attempts = function() {
|
|
178
|
-
return this._attempts;
|
|
179
|
-
};
|
|
180
|
-
RetryOperation.prototype.mainError = function() {
|
|
181
|
-
if (this._errors.length === 0) {
|
|
182
|
-
return null;
|
|
183
|
-
}
|
|
184
|
-
var counts = {};
|
|
185
|
-
var mainError = null;
|
|
186
|
-
var mainErrorCount = 0;
|
|
187
|
-
for (var i = 0; i < this._errors.length; i++) {
|
|
188
|
-
var error2 = this._errors[i];
|
|
189
|
-
var message = error2.message;
|
|
190
|
-
var count = (counts[message] || 0) + 1;
|
|
191
|
-
counts[message] = count;
|
|
192
|
-
if (count >= mainErrorCount) {
|
|
193
|
-
mainError = error2;
|
|
194
|
-
mainErrorCount = count;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
return mainError;
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
// ../../node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry.js
|
|
203
|
-
var require_retry = __commonJS({
|
|
204
|
-
"../../node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry.js"(exports) {
|
|
205
|
-
var RetryOperation = require_retry_operation();
|
|
206
|
-
exports.operation = function(options) {
|
|
207
|
-
var timeouts = exports.timeouts(options);
|
|
208
|
-
return new RetryOperation(timeouts, {
|
|
209
|
-
forever: options && options.forever,
|
|
210
|
-
unref: options && options.unref,
|
|
211
|
-
maxRetryTime: options && options.maxRetryTime
|
|
212
|
-
});
|
|
213
|
-
};
|
|
214
|
-
exports.timeouts = function(options) {
|
|
215
|
-
if (options instanceof Array) {
|
|
216
|
-
return [].concat(options);
|
|
217
|
-
}
|
|
218
|
-
var opts2 = {
|
|
219
|
-
retries: 10,
|
|
220
|
-
factor: 2,
|
|
221
|
-
minTimeout: 1 * 1e3,
|
|
222
|
-
maxTimeout: Infinity,
|
|
223
|
-
randomize: false
|
|
224
|
-
};
|
|
225
|
-
for (var key in options) {
|
|
226
|
-
opts2[key] = options[key];
|
|
227
|
-
}
|
|
228
|
-
if (opts2.minTimeout > opts2.maxTimeout) {
|
|
229
|
-
throw new Error("minTimeout is greater than maxTimeout");
|
|
230
|
-
}
|
|
231
|
-
var timeouts = [];
|
|
232
|
-
for (var i = 0; i < opts2.retries; i++) {
|
|
233
|
-
timeouts.push(this.createTimeout(i, opts2));
|
|
234
|
-
}
|
|
235
|
-
if (options && options.forever && !timeouts.length) {
|
|
236
|
-
timeouts.push(this.createTimeout(i, opts2));
|
|
237
|
-
}
|
|
238
|
-
timeouts.sort(function(a, b) {
|
|
239
|
-
return a - b;
|
|
240
|
-
});
|
|
241
|
-
return timeouts;
|
|
242
|
-
};
|
|
243
|
-
exports.createTimeout = function(attempt, opts2) {
|
|
244
|
-
var random = opts2.randomize ? Math.random() + 1 : 1;
|
|
245
|
-
var timeout = Math.round(random * opts2.minTimeout * Math.pow(opts2.factor, attempt));
|
|
246
|
-
timeout = Math.min(timeout, opts2.maxTimeout);
|
|
247
|
-
return timeout;
|
|
248
|
-
};
|
|
249
|
-
exports.wrap = function(obj, options, methods) {
|
|
250
|
-
if (options instanceof Array) {
|
|
251
|
-
methods = options;
|
|
252
|
-
options = null;
|
|
253
|
-
}
|
|
254
|
-
if (!methods) {
|
|
255
|
-
methods = [];
|
|
256
|
-
for (var key in obj) {
|
|
257
|
-
if (typeof obj[key] === "function") {
|
|
258
|
-
methods.push(key);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
for (var i = 0; i < methods.length; i++) {
|
|
263
|
-
var method = methods[i];
|
|
264
|
-
var original = obj[method];
|
|
265
|
-
obj[method] = function retryWrapper(original2) {
|
|
266
|
-
var op = exports.operation(options);
|
|
267
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
268
|
-
var callback = args.pop();
|
|
269
|
-
args.push(function(err) {
|
|
270
|
-
if (op.retry(err)) {
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
if (err) {
|
|
274
|
-
arguments[0] = op.mainError();
|
|
275
|
-
}
|
|
276
|
-
callback.apply(this, arguments);
|
|
277
|
-
});
|
|
278
|
-
op.attempt(function() {
|
|
279
|
-
original2.apply(obj, args);
|
|
280
|
-
});
|
|
281
|
-
}.bind(obj, original);
|
|
282
|
-
obj[method].options = options;
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
|
|
288
|
-
// ../../node_modules/.pnpm/retry@0.12.0/node_modules/retry/index.js
|
|
289
|
-
var require_retry2 = __commonJS({
|
|
290
|
-
"../../node_modules/.pnpm/retry@0.12.0/node_modules/retry/index.js"(exports, module) {
|
|
291
|
-
module.exports = require_retry();
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
|
|
295
|
-
// ../../node_modules/.pnpm/promise-retry@2.0.1/node_modules/promise-retry/index.js
|
|
296
|
-
var require_promise_retry = __commonJS({
|
|
297
|
-
"../../node_modules/.pnpm/promise-retry@2.0.1/node_modules/promise-retry/index.js"(exports, module) {
|
|
298
|
-
"use strict";
|
|
299
|
-
var errcode = require_err_code();
|
|
300
|
-
var retry = require_retry2();
|
|
301
|
-
var hasOwn = Object.prototype.hasOwnProperty;
|
|
302
|
-
function isRetryError(err) {
|
|
303
|
-
return err && err.code === "EPROMISERETRY" && hasOwn.call(err, "retried");
|
|
304
|
-
}
|
|
305
|
-
function promiseRetry2(fn, options) {
|
|
306
|
-
var temp;
|
|
307
|
-
var operation;
|
|
308
|
-
if (typeof fn === "object" && typeof options === "function") {
|
|
309
|
-
temp = options;
|
|
310
|
-
options = fn;
|
|
311
|
-
fn = temp;
|
|
312
|
-
}
|
|
313
|
-
operation = retry.operation(options);
|
|
314
|
-
return new Promise(function(resolve3, reject) {
|
|
315
|
-
operation.attempt(function(number) {
|
|
316
|
-
Promise.resolve().then(function() {
|
|
317
|
-
return fn(function(err) {
|
|
318
|
-
if (isRetryError(err)) {
|
|
319
|
-
err = err.retried;
|
|
320
|
-
}
|
|
321
|
-
throw errcode(new Error("Retrying"), "EPROMISERETRY", { retried: err });
|
|
322
|
-
}, number);
|
|
323
|
-
}).then(resolve3, function(err) {
|
|
324
|
-
if (isRetryError(err)) {
|
|
325
|
-
err = err.retried;
|
|
326
|
-
if (operation.retry(err || new Error())) {
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
reject(err);
|
|
331
|
-
});
|
|
332
|
-
});
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
module.exports = promiseRetry2;
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
// ../../src/git/src/spawn.ts
|
|
340
|
-
var import_promise_retry = __toESM(require_promise_retry(), 1);
|
|
341
|
-
|
|
342
|
-
// ../../src/git/src/make-error.ts
|
|
343
|
-
var connectionErrorRe = new RegExp(
|
|
344
|
-
[
|
|
345
|
-
"remote error: Internal Server Error",
|
|
346
|
-
"The remote end hung up unexpectedly",
|
|
347
|
-
"Connection timed out",
|
|
348
|
-
"Operation timed out",
|
|
349
|
-
"Failed to connect to .* Timed out",
|
|
350
|
-
"Connection reset by peer",
|
|
351
|
-
"SSL_ERROR_SYSCALL",
|
|
352
|
-
"The requested URL returned error: 503"
|
|
353
|
-
].join("|")
|
|
354
|
-
);
|
|
355
|
-
var missingPathspecRe = /pathspec .* did not match any file\(s\) known to git/;
|
|
356
|
-
var makeError = (result) => connectionErrorRe.test(result.stderr) ? Object.assign(error("A git connection error occurred", result), {
|
|
357
|
-
shouldRetry: (n) => n < 3
|
|
358
|
-
}) : Object.assign(
|
|
359
|
-
missingPathspecRe.test(result.stderr) ? error("The git reference could not be found", result) : error("An unknown git error occurred", result),
|
|
360
|
-
{
|
|
361
|
-
shouldRetry: () => false
|
|
362
|
-
}
|
|
363
|
-
);
|
|
364
|
-
|
|
365
|
-
// ../../src/git/src/opts.ts
|
|
366
|
-
var gitEnv = {
|
|
367
|
-
GIT_ASKPASS: "echo",
|
|
368
|
-
GIT_SSH_COMMAND: "ssh -oStrictHostKeyChecking=accept-new"
|
|
369
|
-
};
|
|
370
|
-
var opts = (opts2 = {}) => ({
|
|
371
|
-
acceptFail: true,
|
|
372
|
-
...opts2,
|
|
373
|
-
env: opts2.env ?? { ...gitEnv, ...process.env },
|
|
374
|
-
stdio: "pipe",
|
|
375
|
-
stdioString: true,
|
|
376
|
-
shell: false
|
|
377
|
-
});
|
|
378
|
-
|
|
379
|
-
// ../../node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/mjs/posix.js
|
|
380
|
-
var posix_exports = {};
|
|
381
|
-
__export(posix_exports, {
|
|
382
|
-
isexe: () => isexe,
|
|
383
|
-
sync: () => sync
|
|
384
|
-
});
|
|
385
|
-
import { statSync } from "node:fs";
|
|
386
|
-
import { stat } from "node:fs/promises";
|
|
387
|
-
var isexe = async (path, options = {}) => {
|
|
388
|
-
const { ignoreErrors = false } = options;
|
|
389
|
-
try {
|
|
390
|
-
return checkStat(await stat(path), options);
|
|
391
|
-
} catch (e) {
|
|
392
|
-
const er = e;
|
|
393
|
-
if (ignoreErrors || er.code === "EACCES")
|
|
394
|
-
return false;
|
|
395
|
-
throw er;
|
|
396
|
-
}
|
|
397
|
-
};
|
|
398
|
-
var sync = (path, options = {}) => {
|
|
399
|
-
const { ignoreErrors = false } = options;
|
|
400
|
-
try {
|
|
401
|
-
return checkStat(statSync(path), options);
|
|
402
|
-
} catch (e) {
|
|
403
|
-
const er = e;
|
|
404
|
-
if (ignoreErrors || er.code === "EACCES")
|
|
405
|
-
return false;
|
|
406
|
-
throw er;
|
|
407
|
-
}
|
|
408
|
-
};
|
|
409
|
-
var checkStat = (stat5, options) => stat5.isFile() && checkMode(stat5, options);
|
|
410
|
-
var checkMode = (stat5, options) => {
|
|
411
|
-
const myUid = options.uid ?? process.getuid?.();
|
|
412
|
-
const myGroups = options.groups ?? process.getgroups?.() ?? [];
|
|
413
|
-
const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];
|
|
414
|
-
if (myUid === void 0 || myGid === void 0) {
|
|
415
|
-
throw new Error("cannot get uid or gid");
|
|
416
|
-
}
|
|
417
|
-
const groups = /* @__PURE__ */ new Set([myGid, ...myGroups]);
|
|
418
|
-
const mod = stat5.mode;
|
|
419
|
-
const uid = stat5.uid;
|
|
420
|
-
const gid = stat5.gid;
|
|
421
|
-
const u = parseInt("100", 8);
|
|
422
|
-
const g = parseInt("010", 8);
|
|
423
|
-
const o = parseInt("001", 8);
|
|
424
|
-
const ug = u | g;
|
|
425
|
-
return !!(mod & o || mod & g && groups.has(gid) || mod & u && uid === myUid || mod & ug && myUid === 0);
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
// ../../node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/mjs/win32.js
|
|
429
|
-
var win32_exports = {};
|
|
430
|
-
__export(win32_exports, {
|
|
431
|
-
isexe: () => isexe2,
|
|
432
|
-
sync: () => sync2
|
|
433
|
-
});
|
|
434
|
-
import { statSync as statSync2 } from "node:fs";
|
|
435
|
-
import { stat as stat2 } from "node:fs/promises";
|
|
436
|
-
var isexe2 = async (path, options = {}) => {
|
|
437
|
-
const { ignoreErrors = false } = options;
|
|
438
|
-
try {
|
|
439
|
-
return checkStat2(await stat2(path), path, options);
|
|
440
|
-
} catch (e) {
|
|
441
|
-
const er = e;
|
|
442
|
-
if (ignoreErrors || er.code === "EACCES")
|
|
443
|
-
return false;
|
|
444
|
-
throw er;
|
|
445
|
-
}
|
|
446
|
-
};
|
|
447
|
-
var sync2 = (path, options = {}) => {
|
|
448
|
-
const { ignoreErrors = false } = options;
|
|
449
|
-
try {
|
|
450
|
-
return checkStat2(statSync2(path), path, options);
|
|
451
|
-
} catch (e) {
|
|
452
|
-
const er = e;
|
|
453
|
-
if (ignoreErrors || er.code === "EACCES")
|
|
454
|
-
return false;
|
|
455
|
-
throw er;
|
|
456
|
-
}
|
|
457
|
-
};
|
|
458
|
-
var checkPathExt = (path, options) => {
|
|
459
|
-
const { pathExt = process.env.PATHEXT || "" } = options;
|
|
460
|
-
const peSplit = pathExt.split(";");
|
|
461
|
-
if (peSplit.indexOf("") !== -1) {
|
|
462
|
-
return true;
|
|
463
|
-
}
|
|
464
|
-
for (let i = 0; i < peSplit.length; i++) {
|
|
465
|
-
const p = peSplit[i].toLowerCase();
|
|
466
|
-
const ext = path.substring(path.length - p.length).toLowerCase();
|
|
467
|
-
if (p && ext === p) {
|
|
468
|
-
return true;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
return false;
|
|
472
|
-
};
|
|
473
|
-
var checkStat2 = (stat5, path, options) => stat5.isFile() && checkPathExt(path, options);
|
|
474
|
-
|
|
475
|
-
// ../../node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/mjs/index.js
|
|
476
|
-
var platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform;
|
|
477
|
-
var impl = platform === "win32" ? win32_exports : posix_exports;
|
|
478
|
-
var isexe3 = impl.isexe;
|
|
479
|
-
var sync3 = impl.sync;
|
|
480
|
-
|
|
481
|
-
// ../../src/which/src/index.ts
|
|
482
|
-
import { delimiter, join, sep } from "node:path";
|
|
483
|
-
var isWindows = process.platform === "win32";
|
|
484
|
-
var rSlash = sep === "/" ? /\// : /[\\/]/;
|
|
485
|
-
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
486
|
-
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
487
|
-
var getPathInfo = (cmd, {
|
|
488
|
-
path: optPath = process.env.PATH,
|
|
489
|
-
pathExt: optPathExt = process.env.PATHEXT,
|
|
490
|
-
delimiter: optDelimiter = delimiter
|
|
491
|
-
}) => {
|
|
492
|
-
const pathEnv = cmd.match(rSlash) ? [""] : [
|
|
493
|
-
// windows always checks the cwd first
|
|
494
|
-
/* c8 ignore next - platform-specific */
|
|
495
|
-
...isWindows ? [process.cwd()] : [],
|
|
496
|
-
...(optPath ?? /* c8 ignore next - very unusual */
|
|
497
|
-
"").split(
|
|
498
|
-
optDelimiter
|
|
499
|
-
)
|
|
500
|
-
];
|
|
501
|
-
if (isWindows) {
|
|
502
|
-
const pathExtExe = optPathExt || [".EXE", ".CMD", ".BAT", ".COM"].join(optDelimiter);
|
|
503
|
-
const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]);
|
|
504
|
-
if (cmd.includes(".") && pathExt[0] !== "") {
|
|
505
|
-
pathExt.unshift("");
|
|
506
|
-
}
|
|
507
|
-
return { pathEnv, pathExt, pathExtExe };
|
|
508
|
-
}
|
|
509
|
-
return { pathEnv, pathExt: [""] };
|
|
510
|
-
};
|
|
511
|
-
var getPathPart = (raw, cmd) => {
|
|
512
|
-
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
513
|
-
const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
|
|
514
|
-
return prefix + join(pathPart, cmd);
|
|
515
|
-
};
|
|
516
|
-
function whichSync(cmd, opt = {}) {
|
|
517
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
518
|
-
const found = [];
|
|
519
|
-
for (const pathEnvPart of pathEnv) {
|
|
520
|
-
const p = getPathPart(pathEnvPart, cmd);
|
|
521
|
-
for (const ext of pathExt) {
|
|
522
|
-
const withExt = p + ext;
|
|
523
|
-
const is2 = sync3(withExt, {
|
|
524
|
-
pathExt: pathExtExe,
|
|
525
|
-
ignoreErrors: true
|
|
526
|
-
});
|
|
527
|
-
if (is2) {
|
|
528
|
-
if (!opt.all) {
|
|
529
|
-
return withExt;
|
|
530
|
-
}
|
|
531
|
-
found.push(withExt);
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
if (opt.all && found.length) {
|
|
536
|
-
return found;
|
|
537
|
-
}
|
|
538
|
-
if (opt.nothrow) {
|
|
539
|
-
return null;
|
|
540
|
-
}
|
|
541
|
-
throw getNotFoundError(cmd);
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
// ../../src/git/src/which.ts
|
|
545
|
-
var gitPath = void 0;
|
|
546
|
-
var which = (opts2 = {}) => {
|
|
547
|
-
if (opts2.git) {
|
|
548
|
-
return opts2.git;
|
|
549
|
-
}
|
|
550
|
-
let whichError = void 0;
|
|
551
|
-
if (opts2.git !== false) {
|
|
552
|
-
if (!gitPath) {
|
|
553
|
-
try {
|
|
554
|
-
gitPath = whichSync("git");
|
|
555
|
-
} catch (er) {
|
|
556
|
-
whichError = er;
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
if (!gitPath || opts2.git === false) {
|
|
561
|
-
return error(
|
|
562
|
-
"No git binary found in $PATH",
|
|
563
|
-
{
|
|
564
|
-
code: "ENOGIT",
|
|
565
|
-
cause: whichError
|
|
566
|
-
},
|
|
567
|
-
which
|
|
568
|
-
);
|
|
569
|
-
}
|
|
570
|
-
return gitPath;
|
|
571
|
-
};
|
|
572
|
-
|
|
573
|
-
// ../../src/git/src/spawn.ts
|
|
574
|
-
var spawn = async (gitArgs, opts2 = {}) => {
|
|
575
|
-
const gitPath2 = which(opts2);
|
|
576
|
-
if (gitPath2 instanceof Error) {
|
|
577
|
-
throw gitPath2;
|
|
578
|
-
}
|
|
579
|
-
const args = opts2.allowReplace || gitArgs[0] === "--no-replace-objects" ? gitArgs : ["--no-replace-objects", ...gitArgs];
|
|
580
|
-
const retryOpts = {
|
|
581
|
-
retries: opts2["fetch-retries"] || 3,
|
|
582
|
-
factor: opts2["fetch-retry-factor"] || 2,
|
|
583
|
-
maxTimeout: opts2["fetch-retry-maxtimeout"] || 6e4,
|
|
584
|
-
minTimeout: opts2["fetch-retry-mintimeout"] || 1e3
|
|
585
|
-
};
|
|
586
|
-
return (0, import_promise_retry.default)(async (retryFn, num) => {
|
|
587
|
-
const result = await promiseSpawn(gitPath2, args, opts(opts2));
|
|
588
|
-
if (result.status || result.signal) {
|
|
589
|
-
const gitError = makeError(result);
|
|
590
|
-
if (!gitError.shouldRetry(num)) {
|
|
591
|
-
throw gitError;
|
|
592
|
-
}
|
|
593
|
-
retryFn(gitError);
|
|
594
|
-
}
|
|
595
|
-
return result;
|
|
596
|
-
}, retryOpts);
|
|
597
|
-
};
|
|
598
|
-
|
|
599
|
-
// ../../src/git/src/user.ts
|
|
600
|
-
var getUser = async (opts2 = {}) => {
|
|
601
|
-
let name = "";
|
|
602
|
-
let email = "";
|
|
603
|
-
const oldFlagUserNameResult = await spawn(
|
|
604
|
-
["config", "--get", "user.name"],
|
|
605
|
-
opts2
|
|
606
|
-
);
|
|
607
|
-
if (oldFlagUserNameResult.status || oldFlagUserNameResult.signal) {
|
|
608
|
-
const userNameResult = await spawn(
|
|
609
|
-
["config", "get", "user.name"],
|
|
610
|
-
opts2
|
|
611
|
-
);
|
|
612
|
-
name = userNameResult.status || userNameResult.signal ? "" : userNameResult.stdout.trim();
|
|
613
|
-
} else {
|
|
614
|
-
name = oldFlagUserNameResult.stdout.trim();
|
|
615
|
-
}
|
|
616
|
-
const oldFlagUserEmailResult = await spawn(
|
|
617
|
-
["config", "--get", "user.email"],
|
|
618
|
-
opts2
|
|
619
|
-
);
|
|
620
|
-
if (oldFlagUserEmailResult.status || oldFlagUserEmailResult.signal) {
|
|
621
|
-
const userEmailResult = await spawn(
|
|
622
|
-
["config", "get", "user.email"],
|
|
623
|
-
opts2
|
|
624
|
-
);
|
|
625
|
-
email = userEmailResult.status || userEmailResult.signal ? "" : userEmailResult.stdout.trim();
|
|
626
|
-
} else {
|
|
627
|
-
email = oldFlagUserEmailResult.stdout.trim();
|
|
628
|
-
}
|
|
629
|
-
if (!name && !email) {
|
|
630
|
-
return void 0;
|
|
631
|
-
}
|
|
632
|
-
return {
|
|
633
|
-
name,
|
|
634
|
-
email
|
|
635
|
-
};
|
|
636
|
-
};
|
|
637
|
-
|
|
638
|
-
// ../../src/git-scp-url/src/index.ts
|
|
639
|
-
var knownProtocols = /* @__PURE__ */ new Set([
|
|
640
|
-
"http:",
|
|
641
|
-
"https:",
|
|
642
|
-
"git:",
|
|
643
|
-
"git+ssh:",
|
|
644
|
-
"git+https:",
|
|
645
|
-
"ssh:"
|
|
646
|
-
]);
|
|
647
|
-
var memo = /* @__PURE__ */ new Map();
|
|
648
|
-
var correctProtocol = (arg) => {
|
|
649
|
-
const firstColon = arg.indexOf(":");
|
|
650
|
-
const proto = arg.slice(0, firstColon + 1);
|
|
651
|
-
const doubleSlash = arg.indexOf("//");
|
|
652
|
-
if (knownProtocols.has(proto)) {
|
|
653
|
-
if (doubleSlash === firstColon + 1) {
|
|
654
|
-
return arg;
|
|
655
|
-
}
|
|
656
|
-
return proto + "//" + arg.slice(firstColon + 1);
|
|
657
|
-
}
|
|
658
|
-
const firstAt = arg.indexOf("@");
|
|
659
|
-
if (firstAt > -1) {
|
|
660
|
-
if (firstAt > firstColon) {
|
|
661
|
-
return `git+ssh://${arg}`;
|
|
662
|
-
} else {
|
|
663
|
-
return arg;
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
return proto + "//" + arg.slice(firstColon + 1);
|
|
667
|
-
};
|
|
668
|
-
var correctUrl = (url) => {
|
|
669
|
-
const firstAt = url.indexOf("@");
|
|
670
|
-
const lastHash = url.lastIndexOf("#");
|
|
671
|
-
let firstColon = url.indexOf(":");
|
|
672
|
-
let lastColon = url.lastIndexOf(
|
|
673
|
-
":",
|
|
674
|
-
lastHash > -1 ? lastHash : Infinity
|
|
675
|
-
);
|
|
676
|
-
let corrected = url;
|
|
677
|
-
if (lastColon > firstAt) {
|
|
678
|
-
corrected = url.slice(0, lastColon) + "/" + url.slice(lastColon + 1);
|
|
679
|
-
firstColon = corrected.indexOf(":");
|
|
680
|
-
lastColon = corrected.lastIndexOf(":");
|
|
681
|
-
}
|
|
682
|
-
if (firstColon === -1 && !url.includes("//")) {
|
|
683
|
-
corrected = `git+ssh://${corrected}`;
|
|
684
|
-
}
|
|
685
|
-
return corrected;
|
|
686
|
-
};
|
|
687
|
-
var gitScpURL = (url) => {
|
|
688
|
-
const memoized = memo.get(url);
|
|
689
|
-
if (memoized) return memoized;
|
|
690
|
-
try {
|
|
691
|
-
const result = new URL(url);
|
|
692
|
-
if (result.hostname) {
|
|
693
|
-
memo.set(url, result);
|
|
694
|
-
return result;
|
|
695
|
-
}
|
|
696
|
-
} catch {
|
|
697
|
-
}
|
|
698
|
-
try {
|
|
699
|
-
const result = new URL(correctUrl(correctProtocol(url)));
|
|
700
|
-
if (result.hostname) {
|
|
701
|
-
memo.set(url, result);
|
|
702
|
-
return result;
|
|
703
|
-
}
|
|
704
|
-
} catch {
|
|
705
|
-
}
|
|
706
|
-
return void 0;
|
|
707
|
-
};
|
|
708
|
-
|
|
709
|
-
// ../../src/git/src/clone.ts
|
|
710
|
-
import { mkdir, stat as stat3 } from "node:fs/promises";
|
|
711
|
-
import { basename, resolve as resolve2 } from "node:path";
|
|
712
|
-
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
713
|
-
|
|
714
|
-
// ../../src/git/src/is-windows.ts
|
|
715
|
-
var isWindows2 = (opts2) => (opts2.fakePlatform || process.platform) === "win32";
|
|
716
|
-
|
|
717
|
-
// ../../src/pick-manifest/src/index.ts
|
|
718
|
-
var parsedNodeVersion = Version.parse(process.version);
|
|
719
|
-
var isBefore = (version, before, verTimes) => {
|
|
720
|
-
if (!verTimes || !version || !before) return true;
|
|
721
|
-
const time = version && verTimes[version];
|
|
722
|
-
return !!time && Date.parse(time) <= before;
|
|
723
|
-
};
|
|
724
|
-
var checkList = (value, list) => {
|
|
725
|
-
if (typeof list === "string") {
|
|
726
|
-
list = [list];
|
|
727
|
-
}
|
|
728
|
-
if (!Array.isArray(list)) return true;
|
|
729
|
-
if (list.length === 1 && list[0] === "any") {
|
|
730
|
-
return true;
|
|
731
|
-
}
|
|
732
|
-
let negated = 0;
|
|
733
|
-
let match = false;
|
|
734
|
-
for (const entry of list) {
|
|
735
|
-
const negate = entry.startsWith("!");
|
|
736
|
-
const test = negate ? entry.slice(1) : entry;
|
|
737
|
-
if (negate) {
|
|
738
|
-
negated++;
|
|
739
|
-
if (value === test) {
|
|
740
|
-
return false;
|
|
741
|
-
}
|
|
742
|
-
} else {
|
|
743
|
-
match = match || value === test;
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
return match || negated === list.length;
|
|
747
|
-
};
|
|
748
|
-
var platformCheck = (mani, nodeVersion, wantOs, wantArch) => {
|
|
749
|
-
const { engines, os, cpu } = mani;
|
|
750
|
-
if (engines) {
|
|
751
|
-
const { node } = engines;
|
|
752
|
-
if (node && !satisfies(nodeVersion, node, true)) {
|
|
753
|
-
return false;
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
if (wantOs && !checkList(wantOs, os)) return false;
|
|
757
|
-
if (wantArch && !checkList(wantArch, cpu)) return false;
|
|
758
|
-
return true;
|
|
759
|
-
};
|
|
760
|
-
var versionOk = (packument, version, nodeVersion, os, arch, before) => {
|
|
761
|
-
const mani = packument.versions[version];
|
|
762
|
-
if (!mani) return false;
|
|
763
|
-
const { time } = packument;
|
|
764
|
-
return isBefore(version, before, time) && platformCheck(mani, nodeVersion, os, arch);
|
|
765
|
-
};
|
|
766
|
-
function pickManifest(packument, wanted, opts2 = {}) {
|
|
767
|
-
const {
|
|
768
|
-
tag = "latest",
|
|
769
|
-
before,
|
|
770
|
-
"node-version": nodeVersion,
|
|
771
|
-
os = process.platform,
|
|
772
|
-
arch = process.arch
|
|
773
|
-
} = opts2;
|
|
774
|
-
const nv = !nodeVersion ? parsedNodeVersion : Version.parse(nodeVersion);
|
|
775
|
-
const {
|
|
776
|
-
name,
|
|
777
|
-
time: verTimes,
|
|
778
|
-
versions: versions2 = {},
|
|
779
|
-
"dist-tags": distTags2 = {}
|
|
780
|
-
} = packument;
|
|
781
|
-
const time = before && verTimes ? +new Date(before) : Infinity;
|
|
782
|
-
let range = void 0;
|
|
783
|
-
let spec = void 0;
|
|
784
|
-
if (typeof wanted === "object") {
|
|
785
|
-
if (wanted instanceof Spec) {
|
|
786
|
-
const f = wanted.final;
|
|
787
|
-
range = f.range;
|
|
788
|
-
spec = f;
|
|
789
|
-
} else {
|
|
790
|
-
range = wanted;
|
|
791
|
-
}
|
|
792
|
-
} else {
|
|
793
|
-
spec = Spec.parse(`${name}@${wanted}`).final;
|
|
794
|
-
range = spec.range;
|
|
795
|
-
}
|
|
796
|
-
if (!range) {
|
|
797
|
-
if (!spec?.distTag) {
|
|
798
|
-
throw error(
|
|
799
|
-
"Only dist-tag or semver range specs are supported",
|
|
800
|
-
{ spec }
|
|
801
|
-
);
|
|
802
|
-
}
|
|
803
|
-
const ver = distTags2[spec.distTag];
|
|
804
|
-
if (!ver) return void 0;
|
|
805
|
-
const mani = versions2[ver];
|
|
806
|
-
if (mani && versionOk(packument, ver, nv, os, arch, time)) {
|
|
807
|
-
return mani;
|
|
808
|
-
} else {
|
|
809
|
-
range = new Range(`<=${ver}`);
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
if (range.isAny) range = new Range("*", true);
|
|
813
|
-
const defaultVer = distTags2[tag];
|
|
814
|
-
const defTagVersion = defaultVer ? Version.parse(defaultVer) : void 0;
|
|
815
|
-
if (defaultVer && (range.isAny || defTagVersion?.satisfies(range)) && versionOk(packument, defaultVer, nv, os, arch, time)) {
|
|
816
|
-
return versions2[defaultVer];
|
|
817
|
-
}
|
|
818
|
-
const entries = Object.entries(versions2);
|
|
819
|
-
if (!entries.length) {
|
|
820
|
-
return void 0;
|
|
821
|
-
}
|
|
822
|
-
let found = void 0;
|
|
823
|
-
let foundIsDefTag = false;
|
|
824
|
-
for (const [ver, mani] of entries) {
|
|
825
|
-
if (time && verTimes && !isBefore(ver, time, verTimes)) {
|
|
826
|
-
continue;
|
|
827
|
-
}
|
|
828
|
-
const version = parse(ver);
|
|
829
|
-
if (!version?.satisfies(range)) {
|
|
830
|
-
continue;
|
|
831
|
-
}
|
|
832
|
-
const mc = {
|
|
833
|
-
version,
|
|
834
|
-
deprecated: !!mani.deprecated,
|
|
835
|
-
platform: platformCheck(mani, nv, os, arch),
|
|
836
|
-
prerelease: !!version.prerelease?.length,
|
|
837
|
-
mani
|
|
838
|
-
};
|
|
839
|
-
if (!found) {
|
|
840
|
-
found = mc;
|
|
841
|
-
if (defTagVersion?.equals(found.version)) {
|
|
842
|
-
foundIsDefTag = true;
|
|
843
|
-
}
|
|
844
|
-
continue;
|
|
845
|
-
}
|
|
846
|
-
const mok = !mc.deprecated && mc.platform;
|
|
847
|
-
const fok = !found.deprecated && found.platform;
|
|
848
|
-
if (mok !== fok) {
|
|
849
|
-
if (mok) {
|
|
850
|
-
found = mc;
|
|
851
|
-
foundIsDefTag = !!defTagVersion?.equals(mc.version);
|
|
852
|
-
}
|
|
853
|
-
} else if (mc.platform !== found.platform) {
|
|
854
|
-
if (mc.platform) {
|
|
855
|
-
found = mc;
|
|
856
|
-
foundIsDefTag = !!defTagVersion?.equals(mc.version);
|
|
857
|
-
}
|
|
858
|
-
} else if (mc.deprecated !== found.deprecated) {
|
|
859
|
-
if (!mc.deprecated) {
|
|
860
|
-
found = mc;
|
|
861
|
-
foundIsDefTag = !!defTagVersion?.equals(mc.version);
|
|
862
|
-
}
|
|
863
|
-
} else if (found.prerelease !== mc.prerelease) {
|
|
864
|
-
if (!mc.prerelease) {
|
|
865
|
-
found = mc;
|
|
866
|
-
foundIsDefTag = !!defTagVersion?.equals(mc.version);
|
|
867
|
-
}
|
|
868
|
-
} else if (defTagVersion?.equals(mc.version)) {
|
|
869
|
-
found = mc;
|
|
870
|
-
foundIsDefTag = true;
|
|
871
|
-
} else if (mc.version.greaterThan(found.version) && !foundIsDefTag) {
|
|
872
|
-
found = mc;
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
return found?.mani;
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
// ../../src/git/src/revs.ts
|
|
879
|
-
import { fileURLToPath } from "node:url";
|
|
880
|
-
|
|
881
|
-
// ../../src/git/src/lines-to-revs.ts
|
|
882
|
-
var linesToRevs = (lines) => finish(
|
|
883
|
-
lines.reduce(linesToRevsReducer, {
|
|
884
|
-
name: "",
|
|
885
|
-
versions: {},
|
|
886
|
-
"dist-tags": {},
|
|
887
|
-
refs: {},
|
|
888
|
-
shas: {}
|
|
889
|
-
})
|
|
890
|
-
);
|
|
891
|
-
var finish = (revs2) => distTags(versions(shaList(peelTags(revs2))));
|
|
892
|
-
var versions = (revs2) => {
|
|
893
|
-
for (const [version, entry] of Object.entries(revs2.versions)) {
|
|
894
|
-
entry.version = version;
|
|
895
|
-
}
|
|
896
|
-
return revs2;
|
|
897
|
-
};
|
|
898
|
-
var shaList = (revs2) => {
|
|
899
|
-
Object.entries(revs2.refs).forEach(([ref, doc]) => {
|
|
900
|
-
const shas = revs2.shas[doc.sha];
|
|
901
|
-
if (!shas) {
|
|
902
|
-
revs2.shas[doc.sha] = [ref];
|
|
903
|
-
} else {
|
|
904
|
-
shas.push(ref);
|
|
905
|
-
}
|
|
906
|
-
});
|
|
907
|
-
return revs2;
|
|
908
|
-
};
|
|
909
|
-
var peelTags = (revs2) => {
|
|
910
|
-
Object.entries(revs2.refs).filter(([ref]) => ref.endsWith("^{}")).forEach(([ref, peeled]) => {
|
|
911
|
-
const unpeeled = revs2.refs[ref.replace(/\^\{\}$/, "")];
|
|
912
|
-
if (unpeeled) {
|
|
913
|
-
unpeeled.sha = peeled.sha;
|
|
914
|
-
delete revs2.refs[ref];
|
|
915
|
-
}
|
|
916
|
-
});
|
|
917
|
-
return revs2;
|
|
918
|
-
};
|
|
919
|
-
var distTags = (revs2) => {
|
|
920
|
-
const HEAD = revs2.refs.HEAD ?? {
|
|
921
|
-
sha: void 0
|
|
922
|
-
};
|
|
923
|
-
for (const [v, ver] of Object.entries(revs2.versions)) {
|
|
924
|
-
if (revs2.refs.latest && ver.sha === revs2.refs.latest.sha) {
|
|
925
|
-
revs2["dist-tags"].latest = v;
|
|
926
|
-
} else if (ver.sha === HEAD.sha) {
|
|
927
|
-
revs2["dist-tags"].HEAD = v;
|
|
928
|
-
if (!revs2.refs.latest) {
|
|
929
|
-
revs2["dist-tags"].latest = v;
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
return revs2;
|
|
934
|
-
};
|
|
935
|
-
var refType = (ref) => {
|
|
936
|
-
if (ref.startsWith("refs/tags/")) {
|
|
937
|
-
return "tag";
|
|
938
|
-
}
|
|
939
|
-
if (ref.startsWith("refs/heads/")) {
|
|
940
|
-
return "branch";
|
|
941
|
-
}
|
|
942
|
-
if (ref.startsWith("refs/pull/")) {
|
|
943
|
-
return "pull";
|
|
944
|
-
}
|
|
945
|
-
if (ref === "HEAD") {
|
|
946
|
-
return "head";
|
|
947
|
-
}
|
|
948
|
-
return "other";
|
|
949
|
-
};
|
|
950
|
-
var lineToRevDoc = (line) => {
|
|
951
|
-
let [sha, rawRef] = line.trim().split(/\s+/, 2);
|
|
952
|
-
if (sha === void 0 || rawRef === void 0) return void 0;
|
|
953
|
-
sha = sha.trim();
|
|
954
|
-
rawRef = rawRef.trim();
|
|
955
|
-
const type = refType(rawRef);
|
|
956
|
-
switch (type) {
|
|
957
|
-
case "tag": {
|
|
958
|
-
const ref = rawRef.slice("refs/tags/".length);
|
|
959
|
-
return { name: "", version: "", sha, ref, rawRef, type };
|
|
960
|
-
}
|
|
961
|
-
case "branch": {
|
|
962
|
-
const ref = rawRef.slice("refs/heads/".length);
|
|
963
|
-
return { name: "", version: "", sha, ref, rawRef, type };
|
|
964
|
-
}
|
|
965
|
-
case "pull": {
|
|
966
|
-
const ref = rawRef.slice("refs/".length).replace(/\/head$/, "");
|
|
967
|
-
return { name: "", version: "", sha, ref, rawRef, type };
|
|
968
|
-
}
|
|
969
|
-
case "head": {
|
|
970
|
-
const ref = "HEAD";
|
|
971
|
-
return { name: "", version: "", sha, ref, rawRef, type };
|
|
972
|
-
}
|
|
973
|
-
default:
|
|
974
|
-
return { name: "", version: "", sha, ref: rawRef, rawRef, type };
|
|
975
|
-
}
|
|
976
|
-
};
|
|
977
|
-
var linesToRevsReducer = (revs2, line) => {
|
|
978
|
-
const doc = lineToRevDoc(line);
|
|
979
|
-
if (!doc) {
|
|
980
|
-
return revs2;
|
|
981
|
-
}
|
|
982
|
-
revs2.refs[doc.ref] = doc;
|
|
983
|
-
revs2.refs[doc.rawRef] = doc;
|
|
984
|
-
if (doc.type === "tag") {
|
|
985
|
-
const match = doc.ref.endsWith("^{}") ? null : /v?(\d+\.\d+\.\d+(?:[-+].+)?)$/.exec(doc.ref);
|
|
986
|
-
if (match) {
|
|
987
|
-
if (!match[1])
|
|
988
|
-
throw error(`invalid semver tag`, { found: doc.ref });
|
|
989
|
-
const v = parse(match[1]);
|
|
990
|
-
if (v) revs2.versions[String(v)] = doc;
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
return revs2;
|
|
994
|
-
};
|
|
995
|
-
|
|
996
|
-
// ../../src/git/src/revs.ts
|
|
997
|
-
var fetchMethod = async (repo, _, options) => {
|
|
998
|
-
const result = await spawn(["ls-remote", repo], options.context);
|
|
999
|
-
const revsDoc = linesToRevs(result.stdout.split("\n"));
|
|
1000
|
-
return revsDoc;
|
|
1001
|
-
};
|
|
1002
|
-
var revsCache = new LRUCache({
|
|
1003
|
-
max: 100,
|
|
1004
|
-
ttl: 5 * 60 * 1e3,
|
|
1005
|
-
allowStaleOnFetchAbort: true,
|
|
1006
|
-
allowStaleOnFetchRejection: true,
|
|
1007
|
-
fetchMethod
|
|
1008
|
-
});
|
|
1009
|
-
var revs = async (repo, opts2 = {}) => {
|
|
1010
|
-
repo = String(gitScpURL(repo) ?? repo).replace(/^git\+/, "");
|
|
1011
|
-
if (repo.startsWith("file://")) repo = fileURLToPath(repo);
|
|
1012
|
-
if (opts2.noGitRevCache) {
|
|
1013
|
-
const result = await fetchMethod(repo, void 0, {
|
|
1014
|
-
context: opts2
|
|
1015
|
-
});
|
|
1016
|
-
revsCache.set(repo, result);
|
|
1017
|
-
return result;
|
|
1018
|
-
}
|
|
1019
|
-
return await revsCache.fetch(repo, { context: opts2 });
|
|
1020
|
-
};
|
|
1021
|
-
|
|
1022
|
-
// ../../src/git/src/resolve.ts
|
|
1023
|
-
var resolve = async (repo, ref = "HEAD", opts2 = {}) => {
|
|
1024
|
-
const revDoc = await revs(repo, opts2);
|
|
1025
|
-
if (!revDoc) return void 0;
|
|
1026
|
-
return resolveRef(revDoc, ref, opts2);
|
|
1027
|
-
};
|
|
1028
|
-
var resolveRef = (revDoc, ref = "HEAD", opts2 = {}) => {
|
|
1029
|
-
const { spec } = opts2;
|
|
1030
|
-
ref = spec?.gitCommittish || ref;
|
|
1031
|
-
if (spec?.range) {
|
|
1032
|
-
return pickManifest(revDoc, spec.range, opts2);
|
|
1033
|
-
}
|
|
1034
|
-
if (!ref) {
|
|
1035
|
-
return revDoc.refs.HEAD;
|
|
1036
|
-
}
|
|
1037
|
-
if (revDoc.refs[ref]) {
|
|
1038
|
-
return revDoc.refs[ref];
|
|
1039
|
-
}
|
|
1040
|
-
const sha = revDoc.shas[ref]?.[0];
|
|
1041
|
-
if (sha) {
|
|
1042
|
-
return revDoc.refs[sha];
|
|
1043
|
-
}
|
|
1044
|
-
return void 0;
|
|
1045
|
-
};
|
|
1046
|
-
|
|
1047
|
-
// ../../src/git/src/clone.ts
|
|
1048
|
-
var shallowHosts = /* @__PURE__ */ new Set([
|
|
1049
|
-
"github.com",
|
|
1050
|
-
"gist.github.com",
|
|
1051
|
-
"gitlab.com",
|
|
1052
|
-
"bitbucket.com",
|
|
1053
|
-
"bitbucket.org"
|
|
1054
|
-
]);
|
|
1055
|
-
var clone = async (repo, ref = "HEAD", target = void 0, opts2 = {}) => {
|
|
1056
|
-
repo = String(gitScpURL(repo) ?? repo).replace(/^git\+/, "");
|
|
1057
|
-
if (repo.startsWith("file://")) repo = fileURLToPath2(repo);
|
|
1058
|
-
const revs2 = await revs(repo, opts2);
|
|
1059
|
-
return await clone_(
|
|
1060
|
-
repo,
|
|
1061
|
-
revs2,
|
|
1062
|
-
ref,
|
|
1063
|
-
revs2 && resolveRef(revs2, ref, opts2),
|
|
1064
|
-
target || defaultTarget(repo, opts2.cwd),
|
|
1065
|
-
opts2
|
|
1066
|
-
);
|
|
1067
|
-
};
|
|
1068
|
-
var maybeShallow = (repo, opts2) => {
|
|
1069
|
-
if (opts2["git-shallow"] === false || opts2["git-shallow"]) {
|
|
1070
|
-
return opts2["git-shallow"];
|
|
1071
|
-
}
|
|
1072
|
-
const host = gitScpURL(repo)?.host ?? "";
|
|
1073
|
-
return shallowHosts.has(host);
|
|
1074
|
-
};
|
|
1075
|
-
var defaultTarget = (repo, cwd = process.cwd()) => resolve2(cwd, basename(repo.replace(/[/\\]?\.git$/, "")));
|
|
1076
|
-
var clone_ = (repo, revs2, ref, revDoc, target, opts2) => {
|
|
1077
|
-
if (!revDoc || !revs2) {
|
|
1078
|
-
return unresolved(repo, ref, target, opts2);
|
|
1079
|
-
}
|
|
1080
|
-
if (revDoc.sha === revs2.refs.HEAD?.sha) {
|
|
1081
|
-
return plain(repo, revDoc, target, opts2);
|
|
1082
|
-
}
|
|
1083
|
-
if (revDoc.type === "tag" || revDoc.type === "branch") {
|
|
1084
|
-
return branch(repo, revDoc, target, opts2);
|
|
1085
|
-
}
|
|
1086
|
-
return other(repo, revDoc, target, opts2);
|
|
1087
|
-
};
|
|
1088
|
-
var other = async (repo, revDoc, target, opts2) => {
|
|
1089
|
-
const shallow = maybeShallow(repo, opts2);
|
|
1090
|
-
const fetchOrigin = ["fetch", "origin", revDoc.rawRef].concat(
|
|
1091
|
-
shallow ? ["--depth=1"] : []
|
|
1092
|
-
);
|
|
1093
|
-
const git = (args) => spawn(args, { ...opts2, cwd: target });
|
|
1094
|
-
await mkdir(target, { recursive: true });
|
|
1095
|
-
await git(["init"]);
|
|
1096
|
-
if (isWindows2(opts2)) {
|
|
1097
|
-
await git([
|
|
1098
|
-
"config",
|
|
1099
|
-
"--local",
|
|
1100
|
-
"--add",
|
|
1101
|
-
"core.longpaths",
|
|
1102
|
-
"true"
|
|
1103
|
-
]);
|
|
1104
|
-
}
|
|
1105
|
-
await git(["remote", "add", "origin", repo]);
|
|
1106
|
-
await git(fetchOrigin);
|
|
1107
|
-
await git(["checkout", revDoc.sha]);
|
|
1108
|
-
await updateSubmodules(target, opts2);
|
|
1109
|
-
return revDoc.sha;
|
|
1110
|
-
};
|
|
1111
|
-
var branch = async (repo, revDoc, target, opts2) => {
|
|
1112
|
-
const args = [
|
|
1113
|
-
"clone",
|
|
1114
|
-
"-b",
|
|
1115
|
-
revDoc.ref,
|
|
1116
|
-
repo,
|
|
1117
|
-
target,
|
|
1118
|
-
"--recurse-submodules"
|
|
1119
|
-
];
|
|
1120
|
-
if (maybeShallow(repo, opts2)) {
|
|
1121
|
-
args.push("--depth=1");
|
|
1122
|
-
}
|
|
1123
|
-
if (isWindows2(opts2)) {
|
|
1124
|
-
args.push("--config", "core.longpaths=true");
|
|
1125
|
-
}
|
|
1126
|
-
await spawn(args, opts2);
|
|
1127
|
-
return revDoc.sha;
|
|
1128
|
-
};
|
|
1129
|
-
var plain = async (repo, revDoc, target, opts2) => {
|
|
1130
|
-
const args = ["clone", repo, target, "--recurse-submodules"];
|
|
1131
|
-
if (maybeShallow(repo, opts2)) {
|
|
1132
|
-
args.push("--depth=1");
|
|
1133
|
-
}
|
|
1134
|
-
if (isWindows2(opts2)) {
|
|
1135
|
-
args.push("--config", "core.longpaths=true");
|
|
1136
|
-
}
|
|
1137
|
-
await spawn(args, opts2);
|
|
1138
|
-
return revDoc.sha;
|
|
1139
|
-
};
|
|
1140
|
-
var updateSubmodules = async (target, opts2) => {
|
|
1141
|
-
const hasSubmodules = await stat3(`${target}/.gitmodules`).then(() => true).catch(() => false);
|
|
1142
|
-
if (!hasSubmodules) {
|
|
1143
|
-
return;
|
|
1144
|
-
}
|
|
1145
|
-
await spawn(
|
|
1146
|
-
["submodule", "update", "-q", "--init", "--recursive"],
|
|
1147
|
-
{ ...opts2, cwd: target }
|
|
1148
|
-
);
|
|
1149
|
-
};
|
|
1150
|
-
var unresolved = async (repo, ref, target, opts2) => {
|
|
1151
|
-
const lp = isWindows2(opts2) ? ["--config", "core.longpaths=true"] : [];
|
|
1152
|
-
const cloneArgs = [
|
|
1153
|
-
"clone",
|
|
1154
|
-
"--mirror",
|
|
1155
|
-
"-q",
|
|
1156
|
-
repo,
|
|
1157
|
-
target + "/.git"
|
|
1158
|
-
];
|
|
1159
|
-
const git = (args) => spawn(args, { ...opts2, cwd: target });
|
|
1160
|
-
await mkdir(target, { recursive: true });
|
|
1161
|
-
await git(cloneArgs.concat(lp));
|
|
1162
|
-
await git(["init"]);
|
|
1163
|
-
await git(["checkout", ref]);
|
|
1164
|
-
await updateSubmodules(target, opts2);
|
|
1165
|
-
const result = await git(["rev-parse", "--revs-only", "HEAD"]);
|
|
1166
|
-
return result.stdout;
|
|
1167
|
-
};
|
|
1168
|
-
|
|
1169
|
-
// ../../src/git/src/find.ts
|
|
1170
|
-
import { dirname } from "node:path";
|
|
1171
|
-
|
|
1172
|
-
// ../../src/git/src/is.ts
|
|
1173
|
-
import { stat as stat4 } from "node:fs/promises";
|
|
1174
|
-
|
|
1175
|
-
export {
|
|
1176
|
-
platformCheck,
|
|
1177
|
-
pickManifest,
|
|
1178
|
-
revs,
|
|
1179
|
-
resolve,
|
|
1180
|
-
clone,
|
|
1181
|
-
getUser
|
|
1182
|
-
};
|
|
1183
|
-
//# sourceMappingURL=chunk-227OF2U2.js.map
|