@vuetify/cli 0.1.0 → 0.1.2

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.
@@ -0,0 +1,681 @@
1
+ #!/usr/bin/env node
2
+ import { t as __exportAll } from "./rolldown-runtime-BM60vSjP.mjs";
3
+ import { cwd } from "node:process";
4
+ import c from "node:readline";
5
+ import { existsSync } from "node:fs";
6
+ import { delimiter, dirname, join, normalize, resolve } from "node:path";
7
+ import { readFile } from "node:fs/promises";
8
+ import { createRequire as createRequire$1 } from "module";
9
+ import { PassThrough } from "node:stream";
10
+ import { spawn } from "node:child_process";
11
+
12
+ //#region ../../node_modules/.pnpm/giget@3.1.2/node_modules/giget/dist/_chunks/libs/nypm.mjs
13
+ const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
14
+ function normalizeWindowsPath(e = ``) {
15
+ return e && e.replace(/\\/g, `/`).replace(_DRIVE_LETTER_START_RE, (e) => e.toUpperCase());
16
+ }
17
+ const _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, normalize$1 = function(e) {
18
+ if (e.length === 0) return `.`;
19
+ e = normalizeWindowsPath(e);
20
+ let t = e.match(_UNC_REGEX), n = isAbsolute$1(e), r = e[e.length - 1] === `/`;
21
+ return e = normalizeString(e, !n), e.length === 0 ? n ? `/` : r ? `./` : `.` : (r && (e += `/`), _DRIVE_LETTER_RE.test(e) && (e += `/`), t ? n ? `//${e}` : `//./${e}` : n && !isAbsolute$1(e) ? `/${e}` : e);
22
+ }, join$1 = function(...e) {
23
+ let t = ``;
24
+ for (let n of e) if (n) if (t.length > 0) {
25
+ let e = t[t.length - 1] === `/`, r = n[0] === `/`;
26
+ e && r ? t += n.slice(1) : t += e || r ? n : `/${n}`;
27
+ } else t += n;
28
+ return normalize$1(t);
29
+ };
30
+ function cwd$1() {
31
+ return typeof process < `u` && typeof process.cwd == `function` ? process.cwd().replace(/\\/g, `/`) : `/`;
32
+ }
33
+ const resolve$1 = function(...e) {
34
+ e = e.map((e) => normalizeWindowsPath(e));
35
+ let t = ``, n = !1;
36
+ for (let r = e.length - 1; r >= -1 && !n; r--) {
37
+ let i = r >= 0 ? e[r] : cwd$1();
38
+ !i || i.length === 0 || (t = `${i}/${t}`, n = isAbsolute$1(i));
39
+ }
40
+ return t = normalizeString(t, !n), n && !isAbsolute$1(t) ? `/${t}` : t.length > 0 ? t : `.`;
41
+ };
42
+ function normalizeString(e, t) {
43
+ let n = ``, r = 0, i = -1, a = 0, o = null;
44
+ for (let s = 0; s <= e.length; ++s) {
45
+ if (s < e.length) o = e[s];
46
+ else if (o === `/`) break;
47
+ else o = `/`;
48
+ if (o === `/`) {
49
+ if (!(i === s - 1 || a === 1)) if (a === 2) {
50
+ if (n.length < 2 || r !== 2 || n[n.length - 1] !== `.` || n[n.length - 2] !== `.`) {
51
+ if (n.length > 2) {
52
+ let e = n.lastIndexOf(`/`);
53
+ e === -1 ? (n = ``, r = 0) : (n = n.slice(0, e), r = n.length - 1 - n.lastIndexOf(`/`)), i = s, a = 0;
54
+ continue;
55
+ } else if (n.length > 0) {
56
+ n = ``, r = 0, i = s, a = 0;
57
+ continue;
58
+ }
59
+ }
60
+ t && (n += n.length > 0 ? `/..` : `..`, r = 2);
61
+ } else n.length > 0 ? n += `/${e.slice(i + 1, s)}` : n = e.slice(i + 1, s), r = s - i - 1;
62
+ i = s, a = 0;
63
+ } else o === `.` && a !== -1 ? ++a : a = -1;
64
+ }
65
+ return n;
66
+ }
67
+ const isAbsolute$1 = function(e) {
68
+ return _IS_ABSOLUTE_RE.test(e);
69
+ }, relative = function(e, t) {
70
+ let n = resolve$1(e).replace(_ROOT_FOLDER_RE, `$1`).split(`/`), r = resolve$1(t).replace(_ROOT_FOLDER_RE, `$1`).split(`/`);
71
+ if (r[0][1] === `:` && n[0][1] === `:` && n[0] !== r[0]) return r.join(`/`);
72
+ let i = [...n];
73
+ for (let e of i) {
74
+ if (r[0] !== e) break;
75
+ n.shift(), r.shift();
76
+ }
77
+ return [...n.map(() => `..`), ...r].join(`/`);
78
+ }, dirname$1 = function(e) {
79
+ let t = normalizeWindowsPath(e).replace(/\/$/, ``).split(`/`).slice(0, -1);
80
+ return t.length === 1 && _DRIVE_LETTER_RE.test(t[0]) && (t[0] += `/`), t.join(`/`) || (isAbsolute$1(e) ? `/` : `.`);
81
+ }, basename$1 = function(e, t) {
82
+ let n = normalizeWindowsPath(e).split(`/`), r = ``;
83
+ for (let e = n.length - 1; e >= 0; e--) {
84
+ let t = n[e];
85
+ if (t) {
86
+ r = t;
87
+ break;
88
+ }
89
+ }
90
+ return t && r.endsWith(t) ? r.slice(0, -t.length) : r;
91
+ };
92
+ var l = Object.create, u = Object.defineProperty, d = Object.getOwnPropertyDescriptor, f = Object.getOwnPropertyNames, p = Object.getPrototypeOf, m = Object.prototype.hasOwnProperty, h = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), g = (e, t, n, r) => {
93
+ if (t && typeof t == `object` || typeof t == `function`) for (var i = f(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !m.call(e, s) && s !== n && u(e, s, {
94
+ get: ((e) => t[e]).bind(null, s),
95
+ enumerable: !(r = d(t, s)) || r.enumerable
96
+ });
97
+ return e;
98
+ }, _ = (e, t, n) => (n = e == null ? {} : l(p(e)), g(t || !e || !e.__esModule ? u(n, `default`, {
99
+ value: e,
100
+ enumerable: !0
101
+ }) : n, e)), v = createRequire$1(import.meta.url);
102
+ const y = /^path$/i, b = {
103
+ key: `PATH`,
104
+ value: ``
105
+ };
106
+ function x(e) {
107
+ for (let t in e) {
108
+ if (!Object.prototype.hasOwnProperty.call(e, t) || !y.test(t)) continue;
109
+ let n = e[t];
110
+ return n ? {
111
+ key: t,
112
+ value: n
113
+ } : b;
114
+ }
115
+ return b;
116
+ }
117
+ function S(e, t) {
118
+ let n = t.value.split(delimiter), r = e, i;
119
+ do
120
+ n.push(resolve(r, `node_modules`, `.bin`)), i = r, r = dirname(r);
121
+ while (r !== i);
122
+ return {
123
+ key: t.key,
124
+ value: n.join(delimiter)
125
+ };
126
+ }
127
+ function C(e, t) {
128
+ let n = {
129
+ ...process.env,
130
+ ...t
131
+ }, r = S(e, x(n));
132
+ return n[r.key] = r.value, n;
133
+ }
134
+ const w = (e) => {
135
+ let t = e.length, n = new PassThrough(), i = () => {
136
+ --t === 0 && n.emit(`end`);
137
+ };
138
+ for (let t of e) t.pipe(n, { end: !1 }), t.on(`end`, i);
139
+ return n;
140
+ };
141
+ var T = h((e, t) => {
142
+ t.exports = a, a.sync = o;
143
+ var n = v(`fs`);
144
+ function r(e, t) {
145
+ var n = t.pathExt === void 0 ? process.env.PATHEXT : t.pathExt;
146
+ if (!n || (n = n.split(`;`), n.indexOf(``) !== -1)) return !0;
147
+ for (var r = 0; r < n.length; r++) {
148
+ var i = n[r].toLowerCase();
149
+ if (i && e.substr(-i.length).toLowerCase() === i) return !0;
150
+ }
151
+ return !1;
152
+ }
153
+ function i(e, t, n) {
154
+ return !e.isSymbolicLink() && !e.isFile() ? !1 : r(t, n);
155
+ }
156
+ function a(e, t, r) {
157
+ n.stat(e, function(n, a) {
158
+ r(n, n ? !1 : i(a, e, t));
159
+ });
160
+ }
161
+ function o(e, t) {
162
+ return i(n.statSync(e), e, t);
163
+ }
164
+ }), E = h((e, t) => {
165
+ t.exports = r, r.sync = i;
166
+ var n = v(`fs`);
167
+ function r(e, t, r) {
168
+ n.stat(e, function(e, n) {
169
+ r(e, e ? !1 : a(n, t));
170
+ });
171
+ }
172
+ function i(e, t) {
173
+ return a(n.statSync(e), t);
174
+ }
175
+ function a(e, t) {
176
+ return e.isFile() && o(e, t);
177
+ }
178
+ function o(e, t) {
179
+ var n = e.mode, r = e.uid, i = e.gid, a = t.uid === void 0 ? process.getuid && process.getuid() : t.uid, o = t.gid === void 0 ? process.getgid && process.getgid() : t.gid, s = 64, L = 8, J = 1, Y = s | L;
180
+ return n & J || n & L && i === o || n & s && r === a || n & Y && a === 0;
181
+ }
182
+ }), D = h((e, t) => {
183
+ v(`fs`);
184
+ var n = process.platform === `win32` || global.TESTING_WINDOWS ? T() : E();
185
+ t.exports = r, r.sync = i;
186
+ function r(e, t, i) {
187
+ if (typeof t == `function` && (i = t, t = {}), !i) {
188
+ if (typeof Promise != `function`) throw TypeError(`callback not provided`);
189
+ return new Promise(function(n, i) {
190
+ r(e, t || {}, function(e, t) {
191
+ e ? i(e) : n(t);
192
+ });
193
+ });
194
+ }
195
+ n(e, t || {}, function(e, n) {
196
+ e && (e.code === `EACCES` || t && t.ignoreErrors) && (e = null, n = !1), i(e, n);
197
+ });
198
+ }
199
+ function i(e, t) {
200
+ try {
201
+ return n.sync(e, t || {});
202
+ } catch (e) {
203
+ if (t && t.ignoreErrors || e.code === `EACCES`) return !1;
204
+ throw e;
205
+ }
206
+ }
207
+ }), O = h((e, t) => {
208
+ let n = process.platform === `win32` || process.env.OSTYPE === `cygwin` || process.env.OSTYPE === `msys`, r = v(`path`), i = n ? `;` : `:`, a = D(), o = (e) => Object.assign(Error(`not found: ${e}`), { code: `ENOENT` }), s = (e, t) => {
209
+ let r = t.colon || i, a = e.match(/\//) || n && e.match(/\\/) ? [``] : [...n ? [process.cwd()] : [], ...(t.path || process.env.PATH || ``).split(r)], o = n ? t.pathExt || process.env.PATHEXT || `.EXE;.CMD;.BAT;.COM` : ``, s = n ? o.split(r) : [``];
210
+ return n && e.indexOf(`.`) !== -1 && s[0] !== `` && s.unshift(``), {
211
+ pathEnv: a,
212
+ pathExt: s,
213
+ pathExtExe: o
214
+ };
215
+ }, L = (e, t, n) => {
216
+ typeof t == `function` && (n = t, t = {}), t ||= {};
217
+ let { pathEnv: i, pathExt: L, pathExtExe: J } = s(e, t), Y = [], X = (n) => new Promise((a, s) => {
218
+ if (n === i.length) return t.all && Y.length ? a(Y) : s(o(e));
219
+ let L = i[n], J = /^".*"$/.test(L) ? L.slice(1, -1) : L, X = r.join(J, e);
220
+ a(Z(!J && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + X : X, n, 0));
221
+ }), Z = (e, n, r) => new Promise((i, o) => {
222
+ if (r === L.length) return i(X(n + 1));
223
+ let s = L[r];
224
+ a(e + s, { pathExt: J }, (a, o) => {
225
+ if (!a && o) if (t.all) Y.push(e + s);
226
+ else return i(e + s);
227
+ return i(Z(e, n, r + 1));
228
+ });
229
+ });
230
+ return n ? X(0).then((e) => n(null, e), n) : X(0);
231
+ };
232
+ t.exports = L, L.sync = (e, t) => {
233
+ t ||= {};
234
+ let { pathEnv: n, pathExt: i, pathExtExe: L } = s(e, t), J = [];
235
+ for (let o = 0; o < n.length; o++) {
236
+ let s = n[o], Y = /^".*"$/.test(s) ? s.slice(1, -1) : s, X = r.join(Y, e), Z = !Y && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + X : X;
237
+ for (let e = 0; e < i.length; e++) {
238
+ let n = Z + i[e];
239
+ try {
240
+ if (a.sync(n, { pathExt: L })) if (t.all) J.push(n);
241
+ else return n;
242
+ } catch {}
243
+ }
244
+ }
245
+ if (t.all && J.length) return J;
246
+ if (t.nothrow) return null;
247
+ throw o(e);
248
+ };
249
+ }), k = h((e, t) => {
250
+ let n = (e = {}) => {
251
+ let t = e.env || process.env;
252
+ return (e.platform || process.platform) === `win32` ? Object.keys(t).reverse().find((e) => e.toUpperCase() === `PATH`) || `Path` : `PATH`;
253
+ };
254
+ t.exports = n, t.exports.default = n;
255
+ }), A = h((e, t) => {
256
+ let n = v(`path`), r = O(), i = k();
257
+ function a(e, t) {
258
+ let a = e.options.env || process.env, o = process.cwd(), s = e.options.cwd != null, L = s && process.chdir !== void 0 && !process.chdir.disabled;
259
+ if (L) try {
260
+ process.chdir(e.options.cwd);
261
+ } catch {}
262
+ let J;
263
+ try {
264
+ J = r.sync(e.command, {
265
+ path: a[i({ env: a })],
266
+ pathExt: t ? n.delimiter : void 0
267
+ });
268
+ } catch {} finally {
269
+ L && process.chdir(o);
270
+ }
271
+ return J &&= n.resolve(s ? e.options.cwd : ``, J), J;
272
+ }
273
+ function o(e) {
274
+ return a(e) || a(e, !0);
275
+ }
276
+ t.exports = o;
277
+ }), j = h((e, t) => {
278
+ let n = /([()\][%!^"`<>&|;, *?])/g;
279
+ function r(e) {
280
+ return e = e.replace(n, `^$1`), e;
281
+ }
282
+ function i(e, t) {
283
+ return e = `${e}`, e = e.replace(/(\\*)"/g, `$1$1\\"`), e = e.replace(/(\\*)$/, `$1$1`), e = `"${e}"`, e = e.replace(n, `^$1`), t && (e = e.replace(n, `^$1`)), e;
284
+ }
285
+ t.exports.command = r, t.exports.argument = i;
286
+ }), M = h((e, t) => {
287
+ t.exports = /^#!(.*)/;
288
+ }), N = h((e, t) => {
289
+ let n = M();
290
+ t.exports = (e = ``) => {
291
+ let t = e.match(n);
292
+ if (!t) return null;
293
+ let [r, i] = t[0].replace(/#! ?/, ``).split(` `), a = r.split(`/`).pop();
294
+ return a === `env` ? i : i ? `${a} ${i}` : a;
295
+ };
296
+ }), P$1 = h((e, t) => {
297
+ let n = v(`fs`), r = N();
298
+ function i(e) {
299
+ let t = Buffer.alloc(150), i;
300
+ try {
301
+ i = n.openSync(e, `r`), n.readSync(i, t, 0, 150, 0), n.closeSync(i);
302
+ } catch {}
303
+ return r(t.toString());
304
+ }
305
+ t.exports = i;
306
+ }), F = h((e, t) => {
307
+ let n = v(`path`), r = A(), i = j(), a = P$1(), o = process.platform === `win32`, s = /\.(?:com|exe)$/i, L = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
308
+ function J(e) {
309
+ e.file = r(e);
310
+ let t = e.file && a(e.file);
311
+ return t ? (e.args.unshift(e.file), e.command = t, r(e)) : e.file;
312
+ }
313
+ function Y(e) {
314
+ if (!o) return e;
315
+ let t = J(e), r = !s.test(t);
316
+ if (e.options.forceShell || r) {
317
+ let r = L.test(t);
318
+ e.command = n.normalize(e.command), e.command = i.command(e.command), e.args = e.args.map((e) => i.argument(e, r)), e.args = [
319
+ `/d`,
320
+ `/s`,
321
+ `/c`,
322
+ `"${[e.command].concat(e.args).join(` `)}"`
323
+ ], e.command = process.env.comspec || `cmd.exe`, e.options.windowsVerbatimArguments = !0;
324
+ }
325
+ return e;
326
+ }
327
+ function X(e, t, n) {
328
+ t && !Array.isArray(t) && (n = t, t = null), t = t ? t.slice(0) : [], n = Object.assign({}, n);
329
+ let r = {
330
+ command: e,
331
+ args: t,
332
+ options: n,
333
+ file: void 0,
334
+ original: {
335
+ command: e,
336
+ args: t
337
+ }
338
+ };
339
+ return n.shell ? r : Y(r);
340
+ }
341
+ t.exports = X;
342
+ }), I = h((e, t) => {
343
+ let n = process.platform === `win32`;
344
+ function r(e, t) {
345
+ return Object.assign(Error(`${t} ${e.command} ENOENT`), {
346
+ code: `ENOENT`,
347
+ errno: `ENOENT`,
348
+ syscall: `${t} ${e.command}`,
349
+ path: e.command,
350
+ spawnargs: e.args
351
+ });
352
+ }
353
+ function i(e, t) {
354
+ if (!n) return;
355
+ let r = e.emit;
356
+ e.emit = function(n, i) {
357
+ if (n === `exit`) {
358
+ let n = a(i, t, `spawn`);
359
+ if (n) return r.call(e, `error`, n);
360
+ }
361
+ return r.apply(e, arguments);
362
+ };
363
+ }
364
+ function a(e, t) {
365
+ return n && e === 1 && !t.file ? r(t.original, `spawn`) : null;
366
+ }
367
+ function o(e, t) {
368
+ return n && e === 1 && !t.file ? r(t.original, `spawnSync`) : null;
369
+ }
370
+ t.exports = {
371
+ hookChildProcess: i,
372
+ verifyENOENT: a,
373
+ verifyENOENTSync: o,
374
+ notFoundError: r
375
+ };
376
+ }), R = _(h((e, t) => {
377
+ let n = v(`child_process`), r = F(), i = I();
378
+ function a(e, t, a) {
379
+ let o = r(e, t, a), s = n.spawn(o.command, o.args, o.options);
380
+ return i.hookChildProcess(s, o), s;
381
+ }
382
+ function o(e, t, a) {
383
+ let o = r(e, t, a), s = n.spawnSync(o.command, o.args, o.options);
384
+ return s.error = s.error || i.verifyENOENTSync(s.status, o), s;
385
+ }
386
+ t.exports = a, t.exports.spawn = a, t.exports.sync = o, t.exports._parse = r, t.exports._enoent = i;
387
+ })(), 1), z = class extends Error {
388
+ result;
389
+ output;
390
+ get exitCode() {
391
+ if (this.result.exitCode !== null) return this.result.exitCode;
392
+ }
393
+ constructor(e, t) {
394
+ super(`Process exited with non-zero status (${e.exitCode})`), this.result = e, this.output = t;
395
+ }
396
+ };
397
+ const B = {
398
+ timeout: void 0,
399
+ persist: !1
400
+ }, V = { windowsHide: !0 };
401
+ function H(e, t) {
402
+ return {
403
+ command: normalize(e),
404
+ args: t ?? []
405
+ };
406
+ }
407
+ function U(e) {
408
+ let t = new AbortController();
409
+ for (let n of e) {
410
+ if (n.aborted) return t.abort(), n;
411
+ n.addEventListener(`abort`, () => {
412
+ t.abort(n.reason);
413
+ }, { signal: t.signal });
414
+ }
415
+ return t.signal;
416
+ }
417
+ async function W(e) {
418
+ let t = ``;
419
+ for await (let n of e) t += n.toString();
420
+ return t;
421
+ }
422
+ var G = class {
423
+ _process;
424
+ _aborted = !1;
425
+ _options;
426
+ _command;
427
+ _args;
428
+ _resolveClose;
429
+ _processClosed;
430
+ _thrownError;
431
+ get process() {
432
+ return this._process;
433
+ }
434
+ get pid() {
435
+ return this._process?.pid;
436
+ }
437
+ get exitCode() {
438
+ if (this._process && this._process.exitCode !== null) return this._process.exitCode;
439
+ }
440
+ constructor(e, t, n) {
441
+ this._options = {
442
+ ...B,
443
+ ...n
444
+ }, this._command = e, this._args = t ?? [], this._processClosed = new Promise((e) => {
445
+ this._resolveClose = e;
446
+ });
447
+ }
448
+ kill(e) {
449
+ return this._process?.kill(e) === !0;
450
+ }
451
+ get aborted() {
452
+ return this._aborted;
453
+ }
454
+ get killed() {
455
+ return this._process?.killed === !0;
456
+ }
457
+ pipe(e, t, n) {
458
+ return q(e, t, {
459
+ ...n,
460
+ stdin: this
461
+ });
462
+ }
463
+ async *[Symbol.asyncIterator]() {
464
+ let e = this._process;
465
+ if (!e) return;
466
+ let t = [];
467
+ this._streamErr && t.push(this._streamErr), this._streamOut && t.push(this._streamOut);
468
+ let n = w(t), r = c.createInterface({ input: n });
469
+ for await (let e of r) yield e.toString();
470
+ if (await this._processClosed, e.removeAllListeners(), this._thrownError) throw this._thrownError;
471
+ if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new z(this);
472
+ }
473
+ async _waitForOutput() {
474
+ let e = this._process;
475
+ if (!e) throw Error(`No process was started`);
476
+ let [t, n] = await Promise.all([this._streamOut ? W(this._streamOut) : ``, this._streamErr ? W(this._streamErr) : ``]);
477
+ if (await this._processClosed, this._options?.stdin && await this._options.stdin, e.removeAllListeners(), this._thrownError) throw this._thrownError;
478
+ let r = {
479
+ stderr: n,
480
+ stdout: t,
481
+ exitCode: this.exitCode
482
+ };
483
+ if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new z(this, r);
484
+ return r;
485
+ }
486
+ then(e, t) {
487
+ return this._waitForOutput().then(e, t);
488
+ }
489
+ _streamOut;
490
+ _streamErr;
491
+ spawn() {
492
+ let e = cwd(), t = this._options, n = {
493
+ ...V,
494
+ ...t.nodeOptions
495
+ }, r = [];
496
+ this._resetState(), t.timeout !== void 0 && r.push(AbortSignal.timeout(t.timeout)), t.signal !== void 0 && r.push(t.signal), t.persist === !0 && (n.detached = !0), r.length > 0 && (n.signal = U(r)), n.env = C(e, n.env);
497
+ let { command: a, args: o } = H(this._command, this._args), s = (0, R._parse)(a, o, n), L = spawn(s.command, s.args, s.options);
498
+ if (L.stderr && (this._streamErr = L.stderr), L.stdout && (this._streamOut = L.stdout), this._process = L, L.once(`error`, this._onError), L.once(`close`, this._onClose), t.stdin !== void 0 && L.stdin && t.stdin.process) {
499
+ let { stdout: e } = t.stdin.process;
500
+ e && e.pipe(L.stdin);
501
+ }
502
+ }
503
+ _resetState() {
504
+ this._aborted = !1, this._processClosed = new Promise((e) => {
505
+ this._resolveClose = e;
506
+ }), this._thrownError = void 0;
507
+ }
508
+ _onError = (e) => {
509
+ if (e.name === `AbortError` && (!(e.cause instanceof Error) || e.cause.name !== `TimeoutError`)) {
510
+ this._aborted = !0;
511
+ return;
512
+ }
513
+ this._thrownError = e;
514
+ };
515
+ _onClose = () => {
516
+ this._resolveClose && this._resolveClose();
517
+ };
518
+ };
519
+ const K = (e, t, n) => {
520
+ let r = new G(e, t, n);
521
+ return r.spawn(), r;
522
+ }, q = K;
523
+ var dist_exports = __exportAll({
524
+ detectPackageManager: () => detectPackageManager,
525
+ installDependencies: () => installDependencies,
526
+ packageManagers: () => packageManagers
527
+ });
528
+ async function findup(e, t, n = {}) {
529
+ let r = normalize$1(e).split(`/`);
530
+ for (; r.length > 0;) {
531
+ let e = await t(r.join(`/`) || `/`);
532
+ if (e || !n.includeParentDirs) return e;
533
+ r.pop();
534
+ }
535
+ }
536
+ function cached(e) {
537
+ let t;
538
+ return () => (t === void 0 && (t = e().then((e) => (t = e, t))), t);
539
+ }
540
+ const hasCorepack = cached(async () => {
541
+ if (globalThis.process?.versions?.webcontainer) return !1;
542
+ try {
543
+ let { exitCode: e } = await K(`corepack`, [`--version`]);
544
+ return e === 0;
545
+ } catch {
546
+ return !1;
547
+ }
548
+ });
549
+ async function executeCommand(e, t, n = {}) {
550
+ let r = e !== `npm` && e !== `bun` && e !== `deno` && n.corepack !== !1 && await hasCorepack() ? [`corepack`, [e, ...t]] : [e, t], { exitCode: i, stdout: a, stderr: o } = await K(r[0], r[1], { nodeOptions: {
551
+ cwd: resolve$1(n.cwd || process.cwd()),
552
+ env: n.env,
553
+ stdio: n.silent ? `pipe` : `inherit`
554
+ } });
555
+ if (i !== 0) throw Error(`\`${r.flat().join(` `)}\` failed.${n.silent ? [
556
+ ``,
557
+ a,
558
+ o
559
+ ].join(`
560
+ `) : ``}`);
561
+ }
562
+ async function resolveOperationOptions(e = {}) {
563
+ let t = e.cwd || process.cwd(), n = {
564
+ ...process.env,
565
+ ...e.env
566
+ }, r = (typeof e.packageManager == `string` ? packageManagers.find((t) => t.name === e.packageManager) : e.packageManager) || await detectPackageManager(e.cwd || process.cwd());
567
+ if (!r) throw Error(`No package manager auto-detected.`);
568
+ return {
569
+ cwd: t,
570
+ env: n,
571
+ silent: e.silent ?? !1,
572
+ packageManager: r,
573
+ dev: e.dev ?? !1,
574
+ workspace: e.workspace,
575
+ global: e.global ?? !1,
576
+ dry: e.dry ?? !1,
577
+ corepack: e.corepack ?? !0
578
+ };
579
+ }
580
+ function parsePackageManagerField(e) {
581
+ let [t, n] = (e || ``).split(`@`), [r, i] = n?.split(`+`) || [];
582
+ if (t && t !== `-` && /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(t)) return {
583
+ name: t,
584
+ version: r,
585
+ buildMeta: i
586
+ };
587
+ let a = (t || ``).replace(/\W+/g, ``);
588
+ return {
589
+ name: a,
590
+ version: r,
591
+ buildMeta: i,
592
+ warnings: [`Abnormal characters found in \`packageManager\` field, sanitizing from \`${t}\` to \`${a}\``]
593
+ };
594
+ }
595
+ const packageManagers = [
596
+ {
597
+ name: `npm`,
598
+ command: `npm`,
599
+ lockFile: `package-lock.json`
600
+ },
601
+ {
602
+ name: `pnpm`,
603
+ command: `pnpm`,
604
+ lockFile: `pnpm-lock.yaml`,
605
+ files: [`pnpm-workspace.yaml`]
606
+ },
607
+ {
608
+ name: `bun`,
609
+ command: `bun`,
610
+ lockFile: [`bun.lockb`, `bun.lock`]
611
+ },
612
+ {
613
+ name: `yarn`,
614
+ command: `yarn`,
615
+ lockFile: `yarn.lock`,
616
+ files: [`.yarnrc.yml`]
617
+ },
618
+ {
619
+ name: `deno`,
620
+ command: `deno`,
621
+ lockFile: `deno.lock`,
622
+ files: [`deno.json`]
623
+ }
624
+ ];
625
+ async function detectPackageManager(e, r = {}) {
626
+ let i = await findup(resolve$1(e || `.`), async (e) => {
627
+ if (!r.ignorePackageJSON) {
628
+ let r = join$1(e, `package.json`);
629
+ if (existsSync(r)) {
630
+ let e = JSON.parse(await readFile(r, `utf8`));
631
+ if (e?.packageManager) {
632
+ let { name: t, version: n = `0.0.0`, buildMeta: r, warnings: i } = parsePackageManagerField(e.packageManager);
633
+ if (t) {
634
+ let e = n.split(`.`)[0], a = packageManagers.find((n) => n.name === t && n.majorVersion === e) || packageManagers.find((e) => e.name === t);
635
+ return {
636
+ name: t,
637
+ command: t,
638
+ version: n,
639
+ majorVersion: e,
640
+ buildMeta: r,
641
+ warnings: i,
642
+ files: a?.files,
643
+ lockFile: a?.lockFile
644
+ };
645
+ }
646
+ }
647
+ }
648
+ if (existsSync(join$1(e, `deno.json`))) return packageManagers.find((e) => e.name === `deno`);
649
+ }
650
+ if (!r.ignoreLockFile) {
651
+ for (let t of packageManagers) if ([t.lockFile, t.files].flat().filter(Boolean).some((t) => existsSync(resolve$1(e, t)))) return { ...t };
652
+ }
653
+ }, { includeParentDirs: r.includeParentDirs ?? !0 });
654
+ if (!i && !r.ignoreArgv) {
655
+ let e = process.argv[1];
656
+ if (e) {
657
+ for (let t of packageManagers) if (RegExp(`[/\\\\]\\.?${t.command}`).test(e)) return t;
658
+ }
659
+ }
660
+ return i;
661
+ }
662
+ async function installDependencies(e = {}) {
663
+ let t = await resolveOperationOptions(e), n = e.frozenLockFile ? {
664
+ npm: [`ci`],
665
+ yarn: [`install`, `--immutable`],
666
+ bun: [`install`, `--frozen-lockfile`],
667
+ pnpm: [`install`, `--frozen-lockfile`],
668
+ deno: [`install`, `--frozen`]
669
+ }[t.packageManager.name] : [`install`];
670
+ return e.ignoreWorkspace && t.packageManager.name === `pnpm` && n.push(`--ignore-workspace`), t.dry || await executeCommand(t.packageManager.command, n, {
671
+ cwd: t.cwd,
672
+ silent: t.silent,
673
+ corepack: t.corepack
674
+ }), { exec: {
675
+ command: t.packageManager.command,
676
+ args: n
677
+ } };
678
+ }
679
+
680
+ //#endregion
681
+ export { resolve$1 as i, dirname$1 as n, dist_exports as r, basename$1 as t };
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { i as resolve$1, n as dirname$1, r as dist_exports, t as basename$1 } from "./nypm-Bg2ry-tJ.mjs";
3
+
4
+ export { dist_exports as t };
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ //#region ../../node_modules/.pnpm/giget@3.1.2/node_modules/giget/dist/_chunks/rolldown-runtime.mjs
3
+ var __defProp = Object.defineProperty;
4
+ var __exportAll = (all, symbols) => {
5
+ let target = {};
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ if (symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
11
+ return target;
12
+ };
13
+
14
+ //#endregion
15
+ export { __exportAll as t };