nitro-nightly 3.0.1-20260119-145349-d0c4950f → 3.0.1-20260120-020848-6786d069
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/dist/_build/rolldown.mjs +13 -8
- package/dist/_build/vite.build.mjs +1 -1
- package/dist/_chunks/dev.mjs +5 -3
- package/dist/_chunks/nitro.mjs +24 -1183
- package/dist/_chunks/nitro2.mjs +248 -91
- package/dist/_chunks/nitro3.mjs +2696 -0
- package/dist/_chunks/nitro4.mjs +176 -0
- package/dist/_chunks/nitro5.mjs +733 -0
- package/dist/_chunks/nitro6.mjs +1458 -0
- package/dist/_chunks/nitro7.mjs +7561 -0
- package/dist/_chunks/nitro8.mjs +3524 -0
- package/dist/_chunks/nitro9.mjs +1729 -0
- package/dist/_libs/_.mjs +3 -0
- package/dist/_libs/_2.mjs +3 -0
- package/dist/_libs/_3.mjs +4 -0
- package/dist/_libs/_4.mjs +6 -0
- package/dist/_libs/_5.mjs +3 -0
- package/dist/_libs/_6.mjs +3 -0
- package/dist/_libs/acorn+confbox+js-tokens+magic-string+mlly+pkg-types+sourcemap-codec+strip-literal+unimport.mjs +8900 -0
- package/dist/_libs/{c12.mjs → c12+dotenv+rc9.mjs} +12 -105
- package/dist/_libs/{chokidar.mjs → chokidar+readdirp.mjs} +2 -9
- package/dist/_libs/confbox+exsolve+pkg-types.mjs +1249 -0
- package/dist/_libs/confbox.mjs +70 -2488
- package/dist/_libs/confbox2.mjs +786 -0
- package/dist/_libs/confbox3.mjs +404 -0
- package/dist/_libs/confbox4.mjs +3 -0
- package/dist/_libs/estree-walker+unimport.mjs +378 -0
- package/dist/_libs/fdir+picomatch+tinyglobby.mjs +2471 -0
- package/dist/_libs/gen-mapping+remapping+resolve-uri+trace-mapping+unimport+unplugin+unplugin-utils+webpack-virtual-modules.mjs +2150 -0
- package/dist/_libs/giget+node-fetch-native.mjs +2692 -0
- package/dist/_libs/httpxy.mjs +1 -6
- package/dist/_libs/local-pkg+quansync+unimport.mjs +1526 -0
- package/dist/_libs/nypm+tinyexec.mjs +858 -0
- package/dist/_libs/pathe.mjs +164 -0
- package/dist/_libs/perfect-debounce.mjs +89 -0
- package/dist/_libs/{@rollup/plugin-inject.mjs → plugin-alias+plugin-inject.mjs} +65 -2
- package/dist/_libs/std-env.mjs +158 -0
- package/dist/_libs/unimport.mjs +5 -1781
- package/dist/_libs/vite-plugin-fullstack.mjs +26 -0
- package/dist/_presets.mjs +8 -3
- package/dist/builder.mjs +8 -6
- package/dist/cli/_chunks/build.mjs +1 -1
- package/dist/cli/_chunks/dev.mjs +3 -2
- package/dist/cli/_chunks/list.mjs +1 -1
- package/dist/cli/_chunks/prepare.mjs +1 -1
- package/dist/cli/_chunks/run.mjs +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/types/index.d.mts +2410 -1174
- package/dist/vite.d.mts +13 -13
- package/dist/vite.mjs +640 -16
- package/package.json +9 -9
- package/dist/_build/common.mjs +0 -24931
- package/dist/_build/rollup.mjs +0 -201
- package/dist/_chunks/utils.mjs +0 -254
- package/dist/_common.mjs +0 -45
- package/dist/_libs/@hiogawa/vite-plugin-fullstack.mjs +0 -652
- package/dist/_libs/@jridgewell/gen-mapping.mjs +0 -448
- package/dist/_libs/@jridgewell/remapping.mjs +0 -117
- package/dist/_libs/@rollup/plugin-alias.mjs +0 -64
- package/dist/_libs/@rollup/plugin-commonjs.mjs +0 -1300
- package/dist/_libs/@rollup/plugin-json.mjs +0 -36
- package/dist/_libs/@rollup/plugin-node-resolve.mjs +0 -1972
- package/dist/_libs/escape-string-regexp.mjs +0 -8
- package/dist/_libs/estree-walker.mjs +0 -187
- package/dist/_libs/giget.mjs +0 -3550
- package/dist/_libs/klona.mjs +0 -38
- package/dist/_libs/rou3.mjs +0 -322
- package/dist/_libs/tsconfck.mjs +0 -832
- package/dist/_libs/ultrahtml.mjs +0 -138
- package/dist/cli/_chunks/task.mjs +0 -16
package/dist/_libs/giget.mjs
DELETED
|
@@ -1,3550 +0,0 @@
|
|
|
1
|
-
import { n as __exportAll } from "../_common.mjs";
|
|
2
|
-
import { At as dirname$2, It as resolve$2, Nt as join$2, Pt as normalize$2, kt as basename$2, xt as readPackageJSON } from "../_build/common.mjs";
|
|
3
|
-
import { createRequire } from "node:module";
|
|
4
|
-
import { createWriteStream, existsSync, readdirSync, renameSync } from "node:fs";
|
|
5
|
-
import nativeFs from "fs";
|
|
6
|
-
import path from "path";
|
|
7
|
-
import Ds from "crypto";
|
|
8
|
-
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
9
|
-
import { homedir, tmpdir } from "node:os";
|
|
10
|
-
import { delimiter, dirname as dirname$1, normalize as normalize$1, resolve as resolve$1 } from "node:path";
|
|
11
|
-
import { cwd } from "node:process";
|
|
12
|
-
import { promisify } from "node:util";
|
|
13
|
-
import { defu } from "defu";
|
|
14
|
-
import { createRequire as createRequire$1 } from "module";
|
|
15
|
-
import { PassThrough, pipeline } from "node:stream";
|
|
16
|
-
import { spawn } from "node:child_process";
|
|
17
|
-
import j$1 from "assert";
|
|
18
|
-
import nt from "events";
|
|
19
|
-
import ot from "stream";
|
|
20
|
-
import ht from "string_decoder";
|
|
21
|
-
import P from "buffer";
|
|
22
|
-
import O$2 from "zlib";
|
|
23
|
-
import nt$1 from "process";
|
|
24
|
-
import a$a from "util";
|
|
25
|
-
import c from "node:readline";
|
|
26
|
-
|
|
27
|
-
//#region node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.js
|
|
28
|
-
var l$2 = Object.create;
|
|
29
|
-
var u$5 = Object.defineProperty;
|
|
30
|
-
var d = Object.getOwnPropertyDescriptor;
|
|
31
|
-
var f$4 = Object.getOwnPropertyNames;
|
|
32
|
-
var p$1 = Object.getPrototypeOf;
|
|
33
|
-
var m$3 = Object.prototype.hasOwnProperty;
|
|
34
|
-
var h$1 = (e$7, t$7) => () => (t$7 || e$7((t$7 = { exports: {} }).exports, t$7), t$7.exports);
|
|
35
|
-
var g = (e$7, t$7, n$4, r) => {
|
|
36
|
-
if (t$7 && typeof t$7 === "object" || typeof t$7 === "function") for (var i$8 = f$4(t$7), a$11 = 0, o$6 = i$8.length, s$8; a$11 < o$6; a$11++) {
|
|
37
|
-
s$8 = i$8[a$11];
|
|
38
|
-
if (!m$3.call(e$7, s$8) && s$8 !== n$4) u$5(e$7, s$8, {
|
|
39
|
-
get: ((e$8) => t$7[e$8]).bind(null, s$8),
|
|
40
|
-
enumerable: !(r = d(t$7, s$8)) || r.enumerable
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
return e$7;
|
|
44
|
-
};
|
|
45
|
-
var _$1 = (e$7, t$7, n$4) => (n$4 = e$7 != null ? l$2(p$1(e$7)) : {}, g(t$7 || !e$7 || !e$7.__esModule ? u$5(n$4, "default", {
|
|
46
|
-
value: e$7,
|
|
47
|
-
enumerable: true
|
|
48
|
-
}) : n$4, e$7));
|
|
49
|
-
var v$2 = /* @__PURE__ */ createRequire$1(import.meta.url);
|
|
50
|
-
const y$3 = /^path$/i;
|
|
51
|
-
const b = {
|
|
52
|
-
key: "PATH",
|
|
53
|
-
value: ""
|
|
54
|
-
};
|
|
55
|
-
function x(e$7) {
|
|
56
|
-
for (const t$7 in e$7) {
|
|
57
|
-
if (!Object.prototype.hasOwnProperty.call(e$7, t$7) || !y$3.test(t$7)) continue;
|
|
58
|
-
const n$4 = e$7[t$7];
|
|
59
|
-
if (!n$4) return b;
|
|
60
|
-
return {
|
|
61
|
-
key: t$7,
|
|
62
|
-
value: n$4
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
return b;
|
|
66
|
-
}
|
|
67
|
-
function S$1(e$7, t$7) {
|
|
68
|
-
const i$8 = t$7.value.split(delimiter);
|
|
69
|
-
let o$6 = e$7;
|
|
70
|
-
let s$8;
|
|
71
|
-
do {
|
|
72
|
-
i$8.push(resolve$1(o$6, "node_modules", ".bin"));
|
|
73
|
-
s$8 = o$6;
|
|
74
|
-
o$6 = dirname$1(o$6);
|
|
75
|
-
} while (o$6 !== s$8);
|
|
76
|
-
return {
|
|
77
|
-
key: t$7.key,
|
|
78
|
-
value: i$8.join(delimiter)
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
function C$1(e$7, t$7) {
|
|
82
|
-
const n$4 = {
|
|
83
|
-
...process.env,
|
|
84
|
-
...t$7
|
|
85
|
-
};
|
|
86
|
-
const r = S$1(e$7, x(n$4));
|
|
87
|
-
n$4[r.key] = r.value;
|
|
88
|
-
return n$4;
|
|
89
|
-
}
|
|
90
|
-
const w$2 = (e$7) => {
|
|
91
|
-
let t$7 = e$7.length;
|
|
92
|
-
const n$4 = new PassThrough();
|
|
93
|
-
const r = () => {
|
|
94
|
-
if (--t$7 === 0) n$4.emit("end");
|
|
95
|
-
};
|
|
96
|
-
for (const t$8 of e$7) {
|
|
97
|
-
t$8.pipe(n$4, { end: false });
|
|
98
|
-
t$8.on("end", r);
|
|
99
|
-
}
|
|
100
|
-
return n$4;
|
|
101
|
-
};
|
|
102
|
-
var T$1 = h$1((exports, t$7) => {
|
|
103
|
-
t$7.exports = a$11;
|
|
104
|
-
a$11.sync = o$6;
|
|
105
|
-
var n$4 = v$2("fs");
|
|
106
|
-
function r(e$7, t$8) {
|
|
107
|
-
var n$5 = t$8.pathExt !== void 0 ? t$8.pathExt : process.env.PATHEXT;
|
|
108
|
-
if (!n$5) return true;
|
|
109
|
-
n$5 = n$5.split(";");
|
|
110
|
-
if (n$5.indexOf("") !== -1) return true;
|
|
111
|
-
for (var r$3 = 0; r$3 < n$5.length; r$3++) {
|
|
112
|
-
var i$9 = n$5[r$3].toLowerCase();
|
|
113
|
-
if (i$9 && e$7.substr(-i$9.length).toLowerCase() === i$9) return true;
|
|
114
|
-
}
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
function i$8(e$7, t$8, n$5) {
|
|
118
|
-
if (!e$7.isSymbolicLink() && !e$7.isFile()) return false;
|
|
119
|
-
return r(t$8, n$5);
|
|
120
|
-
}
|
|
121
|
-
function a$11(e$7, t$8, r$3) {
|
|
122
|
-
n$4.stat(e$7, function(n$5, a$12) {
|
|
123
|
-
r$3(n$5, n$5 ? false : i$8(a$12, e$7, t$8));
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
function o$6(e$7, t$8) {
|
|
127
|
-
return i$8(n$4.statSync(e$7), e$7, t$8);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
var E$1 = h$1((exports, t$7) => {
|
|
131
|
-
t$7.exports = r;
|
|
132
|
-
r.sync = i$8;
|
|
133
|
-
var n$4 = v$2("fs");
|
|
134
|
-
function r(e$7, t$8, r$3) {
|
|
135
|
-
n$4.stat(e$7, function(e$8, n$5) {
|
|
136
|
-
r$3(e$8, e$8 ? false : a$11(n$5, t$8));
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
function i$8(e$7, t$8) {
|
|
140
|
-
return a$11(n$4.statSync(e$7), t$8);
|
|
141
|
-
}
|
|
142
|
-
function a$11(e$7, t$8) {
|
|
143
|
-
return e$7.isFile() && o$6(e$7, t$8);
|
|
144
|
-
}
|
|
145
|
-
function o$6(e$7, t$8) {
|
|
146
|
-
var n$5 = e$7.mode;
|
|
147
|
-
var r$3 = e$7.uid;
|
|
148
|
-
var i$9 = e$7.gid;
|
|
149
|
-
var a$12 = t$8.uid !== void 0 ? t$8.uid : process.getuid && process.getuid();
|
|
150
|
-
var o$7 = t$8.gid !== void 0 ? t$8.gid : process.getgid && process.getgid();
|
|
151
|
-
var s$8 = parseInt("100", 8);
|
|
152
|
-
var c$6 = parseInt("010", 8);
|
|
153
|
-
var l$3 = parseInt("001", 8);
|
|
154
|
-
var u$6 = s$8 | c$6;
|
|
155
|
-
return n$5 & l$3 || n$5 & c$6 && i$9 === o$7 || n$5 & s$8 && r$3 === a$12 || n$5 & u$6 && a$12 === 0;
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
var D = h$1((exports, t$7) => {
|
|
159
|
-
v$2("fs");
|
|
160
|
-
var r;
|
|
161
|
-
if (process.platform === "win32" || global.TESTING_WINDOWS) r = T$1();
|
|
162
|
-
else r = E$1();
|
|
163
|
-
t$7.exports = i$8;
|
|
164
|
-
i$8.sync = a$11;
|
|
165
|
-
function i$8(e$7, t$8, n$4) {
|
|
166
|
-
if (typeof t$8 === "function") {
|
|
167
|
-
n$4 = t$8;
|
|
168
|
-
t$8 = {};
|
|
169
|
-
}
|
|
170
|
-
if (!n$4) {
|
|
171
|
-
if (typeof Promise !== "function") throw new TypeError("callback not provided");
|
|
172
|
-
return new Promise(function(n$5, r$3) {
|
|
173
|
-
i$8(e$7, t$8 || {}, function(e$8, t$9) {
|
|
174
|
-
if (e$8) r$3(e$8);
|
|
175
|
-
else n$5(t$9);
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
r(e$7, t$8 || {}, function(e$8, r$3) {
|
|
180
|
-
if (e$8) {
|
|
181
|
-
if (e$8.code === "EACCES" || t$8 && t$8.ignoreErrors) {
|
|
182
|
-
e$8 = null;
|
|
183
|
-
r$3 = false;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
n$4(e$8, r$3);
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
function a$11(e$7, t$8) {
|
|
190
|
-
try {
|
|
191
|
-
return r.sync(e$7, t$8 || {});
|
|
192
|
-
} catch (e$8) {
|
|
193
|
-
if (t$8 && t$8.ignoreErrors || e$8.code === "EACCES") return false;
|
|
194
|
-
else throw e$8;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
var O$3 = h$1((exports, t$7) => {
|
|
199
|
-
const n$4 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
200
|
-
const r = v$2("path");
|
|
201
|
-
const i$8 = n$4 ? ";" : ":";
|
|
202
|
-
const a$11 = D();
|
|
203
|
-
const o$6 = (e$7) => Object.assign(/* @__PURE__ */ new Error(`not found: ${e$7}`), { code: "ENOENT" });
|
|
204
|
-
const s$8 = (e$7, t$8) => {
|
|
205
|
-
const r$3 = t$8.colon || i$8;
|
|
206
|
-
const a$12 = e$7.match(/\//) || n$4 && e$7.match(/\\/) ? [""] : [...n$4 ? [process.cwd()] : [], ...(t$8.path || process.env.PATH || "").split(r$3)];
|
|
207
|
-
const o$7 = n$4 ? t$8.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
208
|
-
const s$9 = n$4 ? o$7.split(r$3) : [""];
|
|
209
|
-
if (n$4) {
|
|
210
|
-
if (e$7.indexOf(".") !== -1 && s$9[0] !== "") s$9.unshift("");
|
|
211
|
-
}
|
|
212
|
-
return {
|
|
213
|
-
pathEnv: a$12,
|
|
214
|
-
pathExt: s$9,
|
|
215
|
-
pathExtExe: o$7
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
const c$6 = (e$7, t$8, n$5) => {
|
|
219
|
-
if (typeof t$8 === "function") {
|
|
220
|
-
n$5 = t$8;
|
|
221
|
-
t$8 = {};
|
|
222
|
-
}
|
|
223
|
-
if (!t$8) t$8 = {};
|
|
224
|
-
const { pathEnv: i$9, pathExt: c$7, pathExtExe: l$4 } = s$8(e$7, t$8);
|
|
225
|
-
const u$6 = [];
|
|
226
|
-
const d$1 = (n$6) => new Promise((a$12, s$9) => {
|
|
227
|
-
if (n$6 === i$9.length) return t$8.all && u$6.length ? a$12(u$6) : s$9(o$6(e$7));
|
|
228
|
-
const c$8 = i$9[n$6];
|
|
229
|
-
const l$5 = /^".*"$/.test(c$8) ? c$8.slice(1, -1) : c$8;
|
|
230
|
-
const d$2 = r.join(l$5, e$7);
|
|
231
|
-
a$12(f$5(!l$5 && /^\.[\\\/]/.test(e$7) ? e$7.slice(0, 2) + d$2 : d$2, n$6, 0));
|
|
232
|
-
});
|
|
233
|
-
const f$5 = (e$8, n$6, r$3) => new Promise((i$10, o$7) => {
|
|
234
|
-
if (r$3 === c$7.length) return i$10(d$1(n$6 + 1));
|
|
235
|
-
const s$9 = c$7[r$3];
|
|
236
|
-
a$11(e$8 + s$9, { pathExt: l$4 }, (a$12, o$8) => {
|
|
237
|
-
if (!a$12 && o$8) if (t$8.all) u$6.push(e$8 + s$9);
|
|
238
|
-
else return i$10(e$8 + s$9);
|
|
239
|
-
return i$10(f$5(e$8, n$6, r$3 + 1));
|
|
240
|
-
});
|
|
241
|
-
});
|
|
242
|
-
return n$5 ? d$1(0).then((e$8) => n$5(null, e$8), n$5) : d$1(0);
|
|
243
|
-
};
|
|
244
|
-
const l$3 = (e$7, t$8) => {
|
|
245
|
-
t$8 = t$8 || {};
|
|
246
|
-
const { pathEnv: n$5, pathExt: i$9, pathExtExe: c$7 } = s$8(e$7, t$8);
|
|
247
|
-
const l$4 = [];
|
|
248
|
-
for (let o$7 = 0; o$7 < n$5.length; o$7++) {
|
|
249
|
-
const s$9 = n$5[o$7];
|
|
250
|
-
const u$6 = /^".*"$/.test(s$9) ? s$9.slice(1, -1) : s$9;
|
|
251
|
-
const d$1 = r.join(u$6, e$7);
|
|
252
|
-
const f$5 = !u$6 && /^\.[\\\/]/.test(e$7) ? e$7.slice(0, 2) + d$1 : d$1;
|
|
253
|
-
for (let e$8 = 0; e$8 < i$9.length; e$8++) {
|
|
254
|
-
const n$6 = f$5 + i$9[e$8];
|
|
255
|
-
try {
|
|
256
|
-
if (a$11.sync(n$6, { pathExt: c$7 })) if (t$8.all) l$4.push(n$6);
|
|
257
|
-
else return n$6;
|
|
258
|
-
} catch (e$9) {}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
if (t$8.all && l$4.length) return l$4;
|
|
262
|
-
if (t$8.nothrow) return null;
|
|
263
|
-
throw o$6(e$7);
|
|
264
|
-
};
|
|
265
|
-
t$7.exports = c$6;
|
|
266
|
-
c$6.sync = l$3;
|
|
267
|
-
});
|
|
268
|
-
var k$1 = h$1((exports, t$7) => {
|
|
269
|
-
const n$4 = (e$7 = {}) => {
|
|
270
|
-
const t$8 = e$7.env || process.env;
|
|
271
|
-
if ((e$7.platform || process.platform) !== "win32") return "PATH";
|
|
272
|
-
return Object.keys(t$8).reverse().find((e$8) => e$8.toUpperCase() === "PATH") || "Path";
|
|
273
|
-
};
|
|
274
|
-
t$7.exports = n$4;
|
|
275
|
-
t$7.exports.default = n$4;
|
|
276
|
-
});
|
|
277
|
-
var A = h$1((exports, t$7) => {
|
|
278
|
-
const n$4 = v$2("path");
|
|
279
|
-
const r = O$3();
|
|
280
|
-
const i$8 = k$1();
|
|
281
|
-
function a$11(e$7, t$8) {
|
|
282
|
-
const a$12 = e$7.options.env || process.env;
|
|
283
|
-
const o$7 = process.cwd();
|
|
284
|
-
const s$8 = e$7.options.cwd != null;
|
|
285
|
-
const c$6 = s$8 && process.chdir !== void 0 && !process.chdir.disabled;
|
|
286
|
-
if (c$6) try {
|
|
287
|
-
process.chdir(e$7.options.cwd);
|
|
288
|
-
} catch (e$8) {}
|
|
289
|
-
let l$3;
|
|
290
|
-
try {
|
|
291
|
-
l$3 = r.sync(e$7.command, {
|
|
292
|
-
path: a$12[i$8({ env: a$12 })],
|
|
293
|
-
pathExt: t$8 ? n$4.delimiter : void 0
|
|
294
|
-
});
|
|
295
|
-
} catch (e$8) {} finally {
|
|
296
|
-
if (c$6) process.chdir(o$7);
|
|
297
|
-
}
|
|
298
|
-
if (l$3) l$3 = n$4.resolve(s$8 ? e$7.options.cwd : "", l$3);
|
|
299
|
-
return l$3;
|
|
300
|
-
}
|
|
301
|
-
function o$6(e$7) {
|
|
302
|
-
return a$11(e$7) || a$11(e$7, true);
|
|
303
|
-
}
|
|
304
|
-
t$7.exports = o$6;
|
|
305
|
-
});
|
|
306
|
-
var j$2 = h$1((exports, t$7) => {
|
|
307
|
-
const n$4 = /([()\][%!^"`<>&|;, *?])/g;
|
|
308
|
-
function r(e$7) {
|
|
309
|
-
e$7 = e$7.replace(n$4, "^$1");
|
|
310
|
-
return e$7;
|
|
311
|
-
}
|
|
312
|
-
function i$8(e$7, t$8) {
|
|
313
|
-
e$7 = `${e$7}`;
|
|
314
|
-
e$7 = e$7.replace(/(\\*)"/g, "$1$1\\\"");
|
|
315
|
-
e$7 = e$7.replace(/(\\*)$/, "$1$1");
|
|
316
|
-
e$7 = `"${e$7}"`;
|
|
317
|
-
e$7 = e$7.replace(n$4, "^$1");
|
|
318
|
-
if (t$8) e$7 = e$7.replace(n$4, "^$1");
|
|
319
|
-
return e$7;
|
|
320
|
-
}
|
|
321
|
-
t$7.exports.command = r;
|
|
322
|
-
t$7.exports.argument = i$8;
|
|
323
|
-
});
|
|
324
|
-
var M = h$1((exports, t$7) => {
|
|
325
|
-
t$7.exports = /^#!(.*)/;
|
|
326
|
-
});
|
|
327
|
-
var N = h$1((exports, t$7) => {
|
|
328
|
-
const n$4 = M();
|
|
329
|
-
t$7.exports = (e$7 = "") => {
|
|
330
|
-
const t$8 = e$7.match(n$4);
|
|
331
|
-
if (!t$8) return null;
|
|
332
|
-
const [r, i$8] = t$8[0].replace(/#! ?/, "").split(" ");
|
|
333
|
-
const a$11 = r.split("/").pop();
|
|
334
|
-
if (a$11 === "env") return i$8;
|
|
335
|
-
return i$8 ? `${a$11} ${i$8}` : a$11;
|
|
336
|
-
};
|
|
337
|
-
});
|
|
338
|
-
var P$1 = h$1((exports, t$7) => {
|
|
339
|
-
const n$4 = v$2("fs");
|
|
340
|
-
const r = N();
|
|
341
|
-
function i$8(e$7) {
|
|
342
|
-
const t$8 = 150;
|
|
343
|
-
const i$9 = Buffer.alloc(t$8);
|
|
344
|
-
let a$11;
|
|
345
|
-
try {
|
|
346
|
-
a$11 = n$4.openSync(e$7, "r");
|
|
347
|
-
n$4.readSync(a$11, i$9, 0, t$8, 0);
|
|
348
|
-
n$4.closeSync(a$11);
|
|
349
|
-
} catch (e$8) {}
|
|
350
|
-
return r(i$9.toString());
|
|
351
|
-
}
|
|
352
|
-
t$7.exports = i$8;
|
|
353
|
-
});
|
|
354
|
-
var F$3 = h$1((exports, t$7) => {
|
|
355
|
-
const n$4 = v$2("path");
|
|
356
|
-
const r = A();
|
|
357
|
-
const i$8 = j$2();
|
|
358
|
-
const a$11 = P$1();
|
|
359
|
-
const o$6 = process.platform === "win32";
|
|
360
|
-
const s$8 = /\.(?:com|exe)$/i;
|
|
361
|
-
const c$6 = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
362
|
-
function l$3(e$7) {
|
|
363
|
-
e$7.file = r(e$7);
|
|
364
|
-
const t$8 = e$7.file && a$11(e$7.file);
|
|
365
|
-
if (t$8) {
|
|
366
|
-
e$7.args.unshift(e$7.file);
|
|
367
|
-
e$7.command = t$8;
|
|
368
|
-
return r(e$7);
|
|
369
|
-
}
|
|
370
|
-
return e$7.file;
|
|
371
|
-
}
|
|
372
|
-
function u$6(e$7) {
|
|
373
|
-
if (!o$6) return e$7;
|
|
374
|
-
const t$8 = l$3(e$7);
|
|
375
|
-
const r$3 = !s$8.test(t$8);
|
|
376
|
-
if (e$7.options.forceShell || r$3) {
|
|
377
|
-
const r$4 = c$6.test(t$8);
|
|
378
|
-
e$7.command = n$4.normalize(e$7.command);
|
|
379
|
-
e$7.command = i$8.command(e$7.command);
|
|
380
|
-
e$7.args = e$7.args.map((e$8) => i$8.argument(e$8, r$4));
|
|
381
|
-
e$7.args = [
|
|
382
|
-
"/d",
|
|
383
|
-
"/s",
|
|
384
|
-
"/c",
|
|
385
|
-
`"${[e$7.command].concat(e$7.args).join(" ")}"`
|
|
386
|
-
];
|
|
387
|
-
e$7.command = process.env.comspec || "cmd.exe";
|
|
388
|
-
e$7.options.windowsVerbatimArguments = true;
|
|
389
|
-
}
|
|
390
|
-
return e$7;
|
|
391
|
-
}
|
|
392
|
-
function d$1(e$7, t$8, n$5) {
|
|
393
|
-
if (t$8 && !Array.isArray(t$8)) {
|
|
394
|
-
n$5 = t$8;
|
|
395
|
-
t$8 = null;
|
|
396
|
-
}
|
|
397
|
-
t$8 = t$8 ? t$8.slice(0) : [];
|
|
398
|
-
n$5 = Object.assign({}, n$5);
|
|
399
|
-
const r$3 = {
|
|
400
|
-
command: e$7,
|
|
401
|
-
args: t$8,
|
|
402
|
-
options: n$5,
|
|
403
|
-
file: void 0,
|
|
404
|
-
original: {
|
|
405
|
-
command: e$7,
|
|
406
|
-
args: t$8
|
|
407
|
-
}
|
|
408
|
-
};
|
|
409
|
-
return n$5.shell ? r$3 : u$6(r$3);
|
|
410
|
-
}
|
|
411
|
-
t$7.exports = d$1;
|
|
412
|
-
});
|
|
413
|
-
var I = h$1((exports, t$7) => {
|
|
414
|
-
const n$4 = process.platform === "win32";
|
|
415
|
-
function r(e$7, t$8) {
|
|
416
|
-
return Object.assign(/* @__PURE__ */ new Error(`${t$8} ${e$7.command} ENOENT`), {
|
|
417
|
-
code: "ENOENT",
|
|
418
|
-
errno: "ENOENT",
|
|
419
|
-
syscall: `${t$8} ${e$7.command}`,
|
|
420
|
-
path: e$7.command,
|
|
421
|
-
spawnargs: e$7.args
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
function i$8(e$7, t$8) {
|
|
425
|
-
if (!n$4) return;
|
|
426
|
-
const r$3 = e$7.emit;
|
|
427
|
-
e$7.emit = function(n$5, i$9) {
|
|
428
|
-
if (n$5 === "exit") {
|
|
429
|
-
const n$6 = a$11(i$9, t$8, "spawn");
|
|
430
|
-
if (n$6) return r$3.call(e$7, "error", n$6);
|
|
431
|
-
}
|
|
432
|
-
return r$3.apply(e$7, arguments);
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
function a$11(e$7, t$8) {
|
|
436
|
-
if (n$4 && e$7 === 1 && !t$8.file) return r(t$8.original, "spawn");
|
|
437
|
-
return null;
|
|
438
|
-
}
|
|
439
|
-
function o$6(e$7, t$8) {
|
|
440
|
-
if (n$4 && e$7 === 1 && !t$8.file) return r(t$8.original, "spawnSync");
|
|
441
|
-
return null;
|
|
442
|
-
}
|
|
443
|
-
t$7.exports = {
|
|
444
|
-
hookChildProcess: i$8,
|
|
445
|
-
verifyENOENT: a$11,
|
|
446
|
-
verifyENOENTSync: o$6,
|
|
447
|
-
notFoundError: r
|
|
448
|
-
};
|
|
449
|
-
});
|
|
450
|
-
var R$2 = _$1(h$1((exports, t$7) => {
|
|
451
|
-
const n$4 = v$2("child_process");
|
|
452
|
-
const r = F$3();
|
|
453
|
-
const i$8 = I();
|
|
454
|
-
function a$11(e$7, t$8, a$12) {
|
|
455
|
-
const o$7 = r(e$7, t$8, a$12);
|
|
456
|
-
const s$8 = n$4.spawn(o$7.command, o$7.args, o$7.options);
|
|
457
|
-
i$8.hookChildProcess(s$8, o$7);
|
|
458
|
-
return s$8;
|
|
459
|
-
}
|
|
460
|
-
function o$6(e$7, t$8, a$12) {
|
|
461
|
-
const o$7 = r(e$7, t$8, a$12);
|
|
462
|
-
const s$8 = n$4.spawnSync(o$7.command, o$7.args, o$7.options);
|
|
463
|
-
s$8.error = s$8.error || i$8.verifyENOENTSync(s$8.status, o$7);
|
|
464
|
-
return s$8;
|
|
465
|
-
}
|
|
466
|
-
t$7.exports = a$11;
|
|
467
|
-
t$7.exports.spawn = a$11;
|
|
468
|
-
t$7.exports.sync = o$6;
|
|
469
|
-
t$7.exports._parse = r;
|
|
470
|
-
t$7.exports._enoent = i$8;
|
|
471
|
-
})(), 1);
|
|
472
|
-
var z$1 = class extends Error {
|
|
473
|
-
result;
|
|
474
|
-
output;
|
|
475
|
-
get exitCode() {
|
|
476
|
-
if (this.result.exitCode !== null) return this.result.exitCode;
|
|
477
|
-
}
|
|
478
|
-
constructor(e$7, t$7) {
|
|
479
|
-
super(`Process exited with non-zero status (${e$7.exitCode})`);
|
|
480
|
-
this.result = e$7;
|
|
481
|
-
this.output = t$7;
|
|
482
|
-
}
|
|
483
|
-
};
|
|
484
|
-
const B = {
|
|
485
|
-
timeout: void 0,
|
|
486
|
-
persist: false
|
|
487
|
-
};
|
|
488
|
-
const V = { windowsHide: true };
|
|
489
|
-
function H$2(e$7, t$7) {
|
|
490
|
-
return {
|
|
491
|
-
command: normalize$1(e$7),
|
|
492
|
-
args: t$7 ?? []
|
|
493
|
-
};
|
|
494
|
-
}
|
|
495
|
-
function U(e$7) {
|
|
496
|
-
const t$7 = new AbortController();
|
|
497
|
-
for (const n$4 of e$7) {
|
|
498
|
-
if (n$4.aborted) {
|
|
499
|
-
t$7.abort();
|
|
500
|
-
return n$4;
|
|
501
|
-
}
|
|
502
|
-
const e$8 = () => {
|
|
503
|
-
t$7.abort(n$4.reason);
|
|
504
|
-
};
|
|
505
|
-
n$4.addEventListener("abort", e$8, { signal: t$7.signal });
|
|
506
|
-
}
|
|
507
|
-
return t$7.signal;
|
|
508
|
-
}
|
|
509
|
-
async function W(e$7) {
|
|
510
|
-
let t$7 = "";
|
|
511
|
-
for await (const n$4 of e$7) t$7 += n$4.toString();
|
|
512
|
-
return t$7;
|
|
513
|
-
}
|
|
514
|
-
var G$1 = class {
|
|
515
|
-
_process;
|
|
516
|
-
_aborted = false;
|
|
517
|
-
_options;
|
|
518
|
-
_command;
|
|
519
|
-
_args;
|
|
520
|
-
_resolveClose;
|
|
521
|
-
_processClosed;
|
|
522
|
-
_thrownError;
|
|
523
|
-
get process() {
|
|
524
|
-
return this._process;
|
|
525
|
-
}
|
|
526
|
-
get pid() {
|
|
527
|
-
return this._process?.pid;
|
|
528
|
-
}
|
|
529
|
-
get exitCode() {
|
|
530
|
-
if (this._process && this._process.exitCode !== null) return this._process.exitCode;
|
|
531
|
-
}
|
|
532
|
-
constructor(e$7, t$7, n$4) {
|
|
533
|
-
this._options = {
|
|
534
|
-
...B,
|
|
535
|
-
...n$4
|
|
536
|
-
};
|
|
537
|
-
this._command = e$7;
|
|
538
|
-
this._args = t$7 ?? [];
|
|
539
|
-
this._processClosed = new Promise((e$8) => {
|
|
540
|
-
this._resolveClose = e$8;
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
kill(e$7) {
|
|
544
|
-
return this._process?.kill(e$7) === true;
|
|
545
|
-
}
|
|
546
|
-
get aborted() {
|
|
547
|
-
return this._aborted;
|
|
548
|
-
}
|
|
549
|
-
get killed() {
|
|
550
|
-
return this._process?.killed === true;
|
|
551
|
-
}
|
|
552
|
-
pipe(e$7, t$7, n$4) {
|
|
553
|
-
return q$1(e$7, t$7, {
|
|
554
|
-
...n$4,
|
|
555
|
-
stdin: this
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
async *[Symbol.asyncIterator]() {
|
|
559
|
-
const e$7 = this._process;
|
|
560
|
-
if (!e$7) return;
|
|
561
|
-
const t$7 = [];
|
|
562
|
-
if (this._streamErr) t$7.push(this._streamErr);
|
|
563
|
-
if (this._streamOut) t$7.push(this._streamOut);
|
|
564
|
-
const n$4 = w$2(t$7);
|
|
565
|
-
const r = c.createInterface({ input: n$4 });
|
|
566
|
-
for await (const e$8 of r) yield e$8.toString();
|
|
567
|
-
await this._processClosed;
|
|
568
|
-
e$7.removeAllListeners();
|
|
569
|
-
if (this._thrownError) throw this._thrownError;
|
|
570
|
-
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new z$1(this);
|
|
571
|
-
}
|
|
572
|
-
async _waitForOutput() {
|
|
573
|
-
const e$7 = this._process;
|
|
574
|
-
if (!e$7) throw new Error("No process was started");
|
|
575
|
-
const [t$7, n$4] = await Promise.all([this._streamOut ? W(this._streamOut) : "", this._streamErr ? W(this._streamErr) : ""]);
|
|
576
|
-
await this._processClosed;
|
|
577
|
-
if (this._options?.stdin) await this._options.stdin;
|
|
578
|
-
e$7.removeAllListeners();
|
|
579
|
-
if (this._thrownError) throw this._thrownError;
|
|
580
|
-
const r = {
|
|
581
|
-
stderr: n$4,
|
|
582
|
-
stdout: t$7,
|
|
583
|
-
exitCode: this.exitCode
|
|
584
|
-
};
|
|
585
|
-
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new z$1(this, r);
|
|
586
|
-
return r;
|
|
587
|
-
}
|
|
588
|
-
then(e$7, t$7) {
|
|
589
|
-
return this._waitForOutput().then(e$7, t$7);
|
|
590
|
-
}
|
|
591
|
-
_streamOut;
|
|
592
|
-
_streamErr;
|
|
593
|
-
spawn() {
|
|
594
|
-
const e$7 = cwd();
|
|
595
|
-
const n$4 = this._options;
|
|
596
|
-
const r = {
|
|
597
|
-
...V,
|
|
598
|
-
...n$4.nodeOptions
|
|
599
|
-
};
|
|
600
|
-
const i$8 = [];
|
|
601
|
-
this._resetState();
|
|
602
|
-
if (n$4.timeout !== void 0) i$8.push(AbortSignal.timeout(n$4.timeout));
|
|
603
|
-
if (n$4.signal !== void 0) i$8.push(n$4.signal);
|
|
604
|
-
if (n$4.persist === true) r.detached = true;
|
|
605
|
-
if (i$8.length > 0) r.signal = U(i$8);
|
|
606
|
-
r.env = C$1(e$7, r.env);
|
|
607
|
-
const { command: a$11, args: s$8 } = H$2(this._command, this._args);
|
|
608
|
-
const c$6 = (0, R$2._parse)(a$11, s$8, r);
|
|
609
|
-
const l$3 = spawn(c$6.command, c$6.args, c$6.options);
|
|
610
|
-
if (l$3.stderr) this._streamErr = l$3.stderr;
|
|
611
|
-
if (l$3.stdout) this._streamOut = l$3.stdout;
|
|
612
|
-
this._process = l$3;
|
|
613
|
-
l$3.once("error", this._onError);
|
|
614
|
-
l$3.once("close", this._onClose);
|
|
615
|
-
if (n$4.stdin !== void 0 && l$3.stdin && n$4.stdin.process) {
|
|
616
|
-
const { stdout: e$8 } = n$4.stdin.process;
|
|
617
|
-
if (e$8) e$8.pipe(l$3.stdin);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
_resetState() {
|
|
621
|
-
this._aborted = false;
|
|
622
|
-
this._processClosed = new Promise((e$7) => {
|
|
623
|
-
this._resolveClose = e$7;
|
|
624
|
-
});
|
|
625
|
-
this._thrownError = void 0;
|
|
626
|
-
}
|
|
627
|
-
_onError = (e$7) => {
|
|
628
|
-
if (e$7.name === "AbortError" && (!(e$7.cause instanceof Error) || e$7.cause.name !== "TimeoutError")) {
|
|
629
|
-
this._aborted = true;
|
|
630
|
-
return;
|
|
631
|
-
}
|
|
632
|
-
this._thrownError = e$7;
|
|
633
|
-
};
|
|
634
|
-
_onClose = () => {
|
|
635
|
-
if (this._resolveClose) this._resolveClose();
|
|
636
|
-
};
|
|
637
|
-
};
|
|
638
|
-
const K = (e$7, t$7, n$4) => {
|
|
639
|
-
const r = new G$1(e$7, t$7, n$4);
|
|
640
|
-
r.spawn();
|
|
641
|
-
return r;
|
|
642
|
-
};
|
|
643
|
-
const q$1 = K;
|
|
644
|
-
|
|
645
|
-
//#endregion
|
|
646
|
-
//#region node_modules/.pnpm/nypm@0.6.2/node_modules/nypm/dist/shared/nypm.CLjaS_sz.mjs
|
|
647
|
-
async function findup(cwd$1, match, options = {}) {
|
|
648
|
-
const segments = normalize$2(cwd$1).split("/");
|
|
649
|
-
while (segments.length > 0) {
|
|
650
|
-
const result = await match(segments.join("/") || "/");
|
|
651
|
-
if (result || !options.includeParentDirs) return result;
|
|
652
|
-
segments.pop();
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
function cached(fn) {
|
|
656
|
-
let v$3;
|
|
657
|
-
return () => {
|
|
658
|
-
if (v$3 === void 0) v$3 = fn().then((r) => {
|
|
659
|
-
v$3 = r;
|
|
660
|
-
return v$3;
|
|
661
|
-
});
|
|
662
|
-
return v$3;
|
|
663
|
-
};
|
|
664
|
-
}
|
|
665
|
-
const hasCorepack = cached(async () => {
|
|
666
|
-
if (globalThis.process?.versions?.webcontainer) return false;
|
|
667
|
-
try {
|
|
668
|
-
const { exitCode } = await K("corepack", ["--version"]);
|
|
669
|
-
return exitCode === 0;
|
|
670
|
-
} catch {
|
|
671
|
-
return false;
|
|
672
|
-
}
|
|
673
|
-
});
|
|
674
|
-
async function executeCommand(command, args, options = {}) {
|
|
675
|
-
const xArgs = command === "npm" || command === "bun" || command === "deno" || !await hasCorepack() ? [command, args] : ["corepack", [command, ...args]];
|
|
676
|
-
const { exitCode, stdout, stderr } = await K(xArgs[0], xArgs[1], { nodeOptions: {
|
|
677
|
-
cwd: resolve$2(options.cwd || process.cwd()),
|
|
678
|
-
env: options.env,
|
|
679
|
-
stdio: options.silent ? "pipe" : "inherit"
|
|
680
|
-
} });
|
|
681
|
-
if (exitCode !== 0) throw new Error(`\`${xArgs.flat().join(" ")}\` failed.${options.silent ? [
|
|
682
|
-
"",
|
|
683
|
-
stdout,
|
|
684
|
-
stderr
|
|
685
|
-
].join("\n") : ""}`);
|
|
686
|
-
}
|
|
687
|
-
const NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG = "No package manager auto-detected.";
|
|
688
|
-
async function resolveOperationOptions(options = {}) {
|
|
689
|
-
const cwd$1 = options.cwd || process.cwd();
|
|
690
|
-
const env = {
|
|
691
|
-
...process.env,
|
|
692
|
-
...options.env
|
|
693
|
-
};
|
|
694
|
-
const packageManager = (typeof options.packageManager === "string" ? packageManagers.find((pm) => pm.name === options.packageManager) : options.packageManager) || await detectPackageManager(options.cwd || process.cwd());
|
|
695
|
-
if (!packageManager) throw new Error(NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG);
|
|
696
|
-
return {
|
|
697
|
-
cwd: cwd$1,
|
|
698
|
-
env,
|
|
699
|
-
silent: options.silent ?? false,
|
|
700
|
-
packageManager,
|
|
701
|
-
dev: options.dev ?? false,
|
|
702
|
-
workspace: options.workspace,
|
|
703
|
-
global: options.global ?? false,
|
|
704
|
-
dry: options.dry ?? false
|
|
705
|
-
};
|
|
706
|
-
}
|
|
707
|
-
function getWorkspaceArgs(options) {
|
|
708
|
-
if (!options.workspace) return [];
|
|
709
|
-
const workspacePkg = typeof options.workspace === "string" && options.workspace !== "" ? options.workspace : void 0;
|
|
710
|
-
if (options.packageManager.name === "pnpm") return workspacePkg ? ["--filter", workspacePkg] : ["--workspace-root"];
|
|
711
|
-
if (options.packageManager.name === "npm") return workspacePkg ? ["-w", workspacePkg] : ["--workspaces"];
|
|
712
|
-
if (options.packageManager.name === "yarn") if (!options.packageManager.majorVersion || options.packageManager.majorVersion === "1") return workspacePkg ? ["--cwd", workspacePkg] : ["-W"];
|
|
713
|
-
else return workspacePkg ? ["workspace", workspacePkg] : [];
|
|
714
|
-
return [];
|
|
715
|
-
}
|
|
716
|
-
function parsePackageManagerField(packageManager) {
|
|
717
|
-
const [name, _version] = (packageManager || "").split("@");
|
|
718
|
-
const [version, buildMeta] = _version?.split("+") || [];
|
|
719
|
-
if (name && name !== "-" && /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(name)) return {
|
|
720
|
-
name,
|
|
721
|
-
version,
|
|
722
|
-
buildMeta
|
|
723
|
-
};
|
|
724
|
-
const sanitized = name.replace(/\W+/g, "");
|
|
725
|
-
return {
|
|
726
|
-
name: sanitized,
|
|
727
|
-
version,
|
|
728
|
-
buildMeta,
|
|
729
|
-
warnings: [`Abnormal characters found in \`packageManager\` field, sanitizing from \`${name}\` to \`${sanitized}\``]
|
|
730
|
-
};
|
|
731
|
-
}
|
|
732
|
-
const packageManagers = [
|
|
733
|
-
{
|
|
734
|
-
name: "npm",
|
|
735
|
-
command: "npm",
|
|
736
|
-
lockFile: "package-lock.json"
|
|
737
|
-
},
|
|
738
|
-
{
|
|
739
|
-
name: "pnpm",
|
|
740
|
-
command: "pnpm",
|
|
741
|
-
lockFile: "pnpm-lock.yaml",
|
|
742
|
-
files: ["pnpm-workspace.yaml"]
|
|
743
|
-
},
|
|
744
|
-
{
|
|
745
|
-
name: "bun",
|
|
746
|
-
command: "bun",
|
|
747
|
-
lockFile: ["bun.lockb", "bun.lock"]
|
|
748
|
-
},
|
|
749
|
-
{
|
|
750
|
-
name: "yarn",
|
|
751
|
-
command: "yarn",
|
|
752
|
-
lockFile: "yarn.lock",
|
|
753
|
-
files: [".yarnrc.yml"]
|
|
754
|
-
},
|
|
755
|
-
{
|
|
756
|
-
name: "deno",
|
|
757
|
-
command: "deno",
|
|
758
|
-
lockFile: "deno.lock",
|
|
759
|
-
files: ["deno.json"]
|
|
760
|
-
}
|
|
761
|
-
];
|
|
762
|
-
async function detectPackageManager(cwd$1, options = {}) {
|
|
763
|
-
const detected = await findup(resolve$2(cwd$1 || "."), async (path$2) => {
|
|
764
|
-
if (!options.ignorePackageJSON) {
|
|
765
|
-
const packageJSONPath = join$2(path$2, "package.json");
|
|
766
|
-
if (existsSync(packageJSONPath)) {
|
|
767
|
-
const packageJSON = JSON.parse(await readFile(packageJSONPath, "utf8"));
|
|
768
|
-
if (packageJSON?.packageManager) {
|
|
769
|
-
const { name, version = "0.0.0", buildMeta, warnings } = parsePackageManagerField(packageJSON.packageManager);
|
|
770
|
-
if (name) {
|
|
771
|
-
const majorVersion = version.split(".")[0];
|
|
772
|
-
const packageManager = packageManagers.find((pm) => pm.name === name && pm.majorVersion === majorVersion) || packageManagers.find((pm) => pm.name === name);
|
|
773
|
-
return {
|
|
774
|
-
name,
|
|
775
|
-
command: name,
|
|
776
|
-
version,
|
|
777
|
-
majorVersion,
|
|
778
|
-
buildMeta,
|
|
779
|
-
warnings,
|
|
780
|
-
files: packageManager?.files,
|
|
781
|
-
lockFile: packageManager?.lockFile
|
|
782
|
-
};
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
if (existsSync(join$2(path$2, "deno.json"))) return packageManagers.find((pm) => pm.name === "deno");
|
|
787
|
-
}
|
|
788
|
-
if (!options.ignoreLockFile) {
|
|
789
|
-
for (const packageManager of packageManagers) if ([packageManager.lockFile, packageManager.files].flat().filter(Boolean).some((file) => existsSync(resolve$2(path$2, file)))) return { ...packageManager };
|
|
790
|
-
}
|
|
791
|
-
}, { includeParentDirs: options.includeParentDirs ?? true });
|
|
792
|
-
if (!detected && !options.ignoreArgv) {
|
|
793
|
-
const scriptArg = process.argv[1];
|
|
794
|
-
if (scriptArg) {
|
|
795
|
-
for (const packageManager of packageManagers) if ((/* @__PURE__ */ new RegExp(`[/\\\\]\\.?${packageManager.command}`)).test(scriptArg)) return packageManager;
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
return detected;
|
|
799
|
-
}
|
|
800
|
-
async function installDependencies(options = {}) {
|
|
801
|
-
const resolvedOptions = await resolveOperationOptions(options);
|
|
802
|
-
const commandArgs = options.frozenLockFile ? {
|
|
803
|
-
npm: ["ci"],
|
|
804
|
-
yarn: ["install", "--immutable"],
|
|
805
|
-
bun: ["install", "--frozen-lockfile"],
|
|
806
|
-
pnpm: ["install", "--frozen-lockfile"],
|
|
807
|
-
deno: ["install", "--frozen"]
|
|
808
|
-
}[resolvedOptions.packageManager.name] : ["install"];
|
|
809
|
-
if (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, commandArgs, {
|
|
810
|
-
cwd: resolvedOptions.cwd,
|
|
811
|
-
silent: resolvedOptions.silent
|
|
812
|
-
});
|
|
813
|
-
return { exec: {
|
|
814
|
-
command: resolvedOptions.packageManager.command,
|
|
815
|
-
args: commandArgs
|
|
816
|
-
} };
|
|
817
|
-
}
|
|
818
|
-
async function addDependency(name, options = {}) {
|
|
819
|
-
const resolvedOptions = await resolveOperationOptions(options);
|
|
820
|
-
const names = Array.isArray(name) ? name : [name];
|
|
821
|
-
if (resolvedOptions.packageManager.name === "deno") {
|
|
822
|
-
for (let i$8 = 0; i$8 < names.length; i$8++) if (!/^(npm|jsr|file):.+$/.test(names[i$8])) names[i$8] = `npm:${names[i$8]}`;
|
|
823
|
-
}
|
|
824
|
-
if (names.length === 0) return {};
|
|
825
|
-
const args = (resolvedOptions.packageManager.name === "yarn" ? [
|
|
826
|
-
...getWorkspaceArgs(resolvedOptions),
|
|
827
|
-
resolvedOptions.global && resolvedOptions.packageManager.majorVersion === "1" ? "global" : "",
|
|
828
|
-
"add",
|
|
829
|
-
resolvedOptions.dev ? "-D" : "",
|
|
830
|
-
...names
|
|
831
|
-
] : [
|
|
832
|
-
resolvedOptions.packageManager.name === "npm" ? "install" : "add",
|
|
833
|
-
...getWorkspaceArgs(resolvedOptions),
|
|
834
|
-
resolvedOptions.dev ? "-D" : "",
|
|
835
|
-
resolvedOptions.global ? "-g" : "",
|
|
836
|
-
...names
|
|
837
|
-
]).filter(Boolean);
|
|
838
|
-
if (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, args, {
|
|
839
|
-
cwd: resolvedOptions.cwd,
|
|
840
|
-
silent: resolvedOptions.silent
|
|
841
|
-
});
|
|
842
|
-
if (!resolvedOptions.dry && options.installPeerDependencies) {
|
|
843
|
-
const existingPkg = await readPackageJSON(resolvedOptions.cwd);
|
|
844
|
-
const peerDeps = [];
|
|
845
|
-
const peerDevDeps = [];
|
|
846
|
-
for (const _name of names) {
|
|
847
|
-
const pkgName = _name.match(/^(.[^@]+)/)?.[0];
|
|
848
|
-
const pkg = await readPackageJSON(pkgName, { url: resolvedOptions.cwd }).catch(() => ({}));
|
|
849
|
-
if (!pkg.peerDependencies || pkg.name !== pkgName) continue;
|
|
850
|
-
for (const [peerDependency, version] of Object.entries(pkg.peerDependencies)) {
|
|
851
|
-
if (pkg.peerDependenciesMeta?.[peerDependency]?.optional) continue;
|
|
852
|
-
if (existingPkg.dependencies?.[peerDependency] || existingPkg.devDependencies?.[peerDependency]) continue;
|
|
853
|
-
(pkg.peerDependenciesMeta?.[peerDependency]?.dev ? peerDevDeps : peerDeps).push(`${peerDependency}@${version}`);
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
if (peerDeps.length > 0) await addDependency(peerDeps, { ...resolvedOptions });
|
|
857
|
-
if (peerDevDeps.length > 0) await addDevDependency(peerDevDeps, { ...resolvedOptions });
|
|
858
|
-
}
|
|
859
|
-
return { exec: {
|
|
860
|
-
command: resolvedOptions.packageManager.command,
|
|
861
|
-
args
|
|
862
|
-
} };
|
|
863
|
-
}
|
|
864
|
-
async function addDevDependency(name, options = {}) {
|
|
865
|
-
return await addDependency(name, {
|
|
866
|
-
...options,
|
|
867
|
-
dev: true
|
|
868
|
-
});
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
//#endregion
|
|
872
|
-
//#region node_modules/.pnpm/nypm@0.6.2/node_modules/nypm/dist/index.mjs
|
|
873
|
-
var dist_exports$1 = /* @__PURE__ */ __exportAll({ addDevDependency: () => addDevDependency });
|
|
874
|
-
|
|
875
|
-
//#endregion
|
|
876
|
-
//#region node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs
|
|
877
|
-
const e$6 = globalThis.Blob, o$5 = globalThis.File, a$10 = globalThis.FormData, s$7 = globalThis.Headers, t$6 = globalThis.Request, h = globalThis.Response, i$7 = globalThis.AbortController, l$1 = globalThis.fetch || (() => {
|
|
878
|
-
throw new Error("[node-fetch-native] Failed to fetch: `globalThis.fetch` is not available!");
|
|
879
|
-
});
|
|
880
|
-
|
|
881
|
-
//#endregion
|
|
882
|
-
//#region node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs
|
|
883
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
884
|
-
function getDefaultExportFromCjs(x$1) {
|
|
885
|
-
return x$1 && x$1.__esModule && Object.prototype.hasOwnProperty.call(x$1, "default") ? x$1["default"] : x$1;
|
|
886
|
-
}
|
|
887
|
-
var i$6, t$5;
|
|
888
|
-
function s$6() {
|
|
889
|
-
if (t$5) return i$6;
|
|
890
|
-
t$5 = 1;
|
|
891
|
-
const n$4 = new Map([
|
|
892
|
-
["C", "cwd"],
|
|
893
|
-
["f", "file"],
|
|
894
|
-
["z", "gzip"],
|
|
895
|
-
["P", "preservePaths"],
|
|
896
|
-
["U", "unlink"],
|
|
897
|
-
["strip-components", "strip"],
|
|
898
|
-
["stripComponents", "strip"],
|
|
899
|
-
["keep-newer", "newer"],
|
|
900
|
-
["keepNewer", "newer"],
|
|
901
|
-
["keep-newer-files", "newer"],
|
|
902
|
-
["keepNewerFiles", "newer"],
|
|
903
|
-
["k", "keep"],
|
|
904
|
-
["keep-existing", "keep"],
|
|
905
|
-
["keepExisting", "keep"],
|
|
906
|
-
["m", "noMtime"],
|
|
907
|
-
["no-mtime", "noMtime"],
|
|
908
|
-
["p", "preserveOwner"],
|
|
909
|
-
["L", "follow"],
|
|
910
|
-
["h", "follow"]
|
|
911
|
-
]);
|
|
912
|
-
return i$6 = (r) => r ? Object.keys(r).map((e$7) => [n$4.has(e$7) ? n$4.get(e$7) : e$7, r[e$7]]).reduce((e$7, p$2) => (e$7[p$2[0]] = p$2[1], e$7), Object.create(null)) : {}, i$6;
|
|
913
|
-
}
|
|
914
|
-
var e$5, t$4;
|
|
915
|
-
function c$4() {
|
|
916
|
-
return t$4 || (t$4 = 1, e$5 = (o$6) => class extends o$6 {
|
|
917
|
-
warn(n$4, i$8, r = {}) {
|
|
918
|
-
this.file && (r.file = this.file), this.cwd && (r.cwd = this.cwd), r.code = i$8 instanceof Error && i$8.code || n$4, r.tarCode = n$4, !this.strict && r.recoverable !== false ? (i$8 instanceof Error && (r = Object.assign(i$8, r), i$8 = i$8.message), this.emit("warn", r.tarCode, i$8, r)) : i$8 instanceof Error ? this.emit("error", Object.assign(i$8, r)) : this.emit("error", Object.assign(/* @__PURE__ */ new Error(`${n$4}: ${i$8}`), r));
|
|
919
|
-
}
|
|
920
|
-
}), e$5;
|
|
921
|
-
}
|
|
922
|
-
var e$4 = {};
|
|
923
|
-
var a$9;
|
|
924
|
-
function n$3() {
|
|
925
|
-
return a$9 ? e$4 : (a$9 = 1, function(e$7) {
|
|
926
|
-
e$7.name = new Map([
|
|
927
|
-
["0", "File"],
|
|
928
|
-
["", "OldFile"],
|
|
929
|
-
["1", "Link"],
|
|
930
|
-
["2", "SymbolicLink"],
|
|
931
|
-
["3", "CharacterDevice"],
|
|
932
|
-
["4", "BlockDevice"],
|
|
933
|
-
["5", "Directory"],
|
|
934
|
-
["6", "FIFO"],
|
|
935
|
-
["7", "ContiguousFile"],
|
|
936
|
-
["g", "GlobalExtendedHeader"],
|
|
937
|
-
["x", "ExtendedHeader"],
|
|
938
|
-
["A", "SolarisACL"],
|
|
939
|
-
["D", "GNUDumpDir"],
|
|
940
|
-
["I", "Inode"],
|
|
941
|
-
["K", "NextFileHasLongLinkpath"],
|
|
942
|
-
["L", "NextFileHasLongPath"],
|
|
943
|
-
["M", "ContinuationFile"],
|
|
944
|
-
["N", "OldGnuLongPath"],
|
|
945
|
-
["S", "SparseFile"],
|
|
946
|
-
["V", "TapeVolumeHeader"],
|
|
947
|
-
["X", "OldExtendedHeader"]
|
|
948
|
-
]), e$7.code = new Map(Array.from(e$7.name).map((i$8) => [i$8[1], i$8[0]]));
|
|
949
|
-
}(e$4), e$4);
|
|
950
|
-
}
|
|
951
|
-
var f$3, i$5;
|
|
952
|
-
function w$1() {
|
|
953
|
-
if (i$5) return f$3;
|
|
954
|
-
i$5 = 1;
|
|
955
|
-
const v$3 = (e$7, r) => {
|
|
956
|
-
if (Number.isSafeInteger(e$7)) e$7 < 0 ? g$1(e$7, r) : p$2(e$7, r);
|
|
957
|
-
else throw Error("cannot encode number outside of javascript safe integer range");
|
|
958
|
-
return r;
|
|
959
|
-
}, p$2 = (e$7, r) => {
|
|
960
|
-
r[0] = 128;
|
|
961
|
-
for (var o$6 = r.length; o$6 > 1; o$6--) r[o$6 - 1] = e$7 & 255, e$7 = Math.floor(e$7 / 256);
|
|
962
|
-
}, g$1 = (e$7, r) => {
|
|
963
|
-
r[0] = 255;
|
|
964
|
-
var o$6 = false;
|
|
965
|
-
e$7 = e$7 * -1;
|
|
966
|
-
for (var s$8 = r.length; s$8 > 1; s$8--) {
|
|
967
|
-
var a$11 = e$7 & 255;
|
|
968
|
-
e$7 = Math.floor(e$7 / 256), o$6 ? r[s$8 - 1] = l$3(a$11) : a$11 === 0 ? r[s$8 - 1] = 0 : (o$6 = true, r[s$8 - 1] = c$6(a$11));
|
|
969
|
-
}
|
|
970
|
-
}, h$2 = (e$7) => {
|
|
971
|
-
const r = e$7[0], o$6 = r === 128 ? d$1(e$7.slice(1, e$7.length)) : r === 255 ? x$1(e$7) : null;
|
|
972
|
-
if (o$6 === null) throw Error("invalid base256 encoding");
|
|
973
|
-
if (!Number.isSafeInteger(o$6)) throw Error("parsed number outside of javascript safe integer range");
|
|
974
|
-
return o$6;
|
|
975
|
-
}, x$1 = (e$7) => {
|
|
976
|
-
for (var r = e$7.length, o$6 = 0, s$8 = false, a$11 = r - 1; a$11 > -1; a$11--) {
|
|
977
|
-
var n$4 = e$7[a$11], t$7;
|
|
978
|
-
s$8 ? t$7 = l$3(n$4) : n$4 === 0 ? t$7 = n$4 : (s$8 = true, t$7 = c$6(n$4)), t$7 !== 0 && (o$6 -= t$7 * Math.pow(256, r - a$11 - 1));
|
|
979
|
-
}
|
|
980
|
-
return o$6;
|
|
981
|
-
}, d$1 = (e$7) => {
|
|
982
|
-
for (var r = e$7.length, o$6 = 0, s$8 = r - 1; s$8 > -1; s$8--) {
|
|
983
|
-
var a$11 = e$7[s$8];
|
|
984
|
-
a$11 !== 0 && (o$6 += a$11 * Math.pow(256, r - s$8 - 1));
|
|
985
|
-
}
|
|
986
|
-
return o$6;
|
|
987
|
-
}, l$3 = (e$7) => (255 ^ e$7) & 255, c$6 = (e$7) => (255 ^ e$7) + 1 & 255;
|
|
988
|
-
return f$3 = {
|
|
989
|
-
encode: v$3,
|
|
990
|
-
parse: h$2
|
|
991
|
-
}, f$3;
|
|
992
|
-
}
|
|
993
|
-
var k, w;
|
|
994
|
-
function E() {
|
|
995
|
-
if (w) return k;
|
|
996
|
-
w = 1;
|
|
997
|
-
const u$6 = n$3(), x$1 = path.posix, y$4 = w$1(), P$2 = Symbol("slurp"), a$11 = Symbol("type");
|
|
998
|
-
class B$1 {
|
|
999
|
-
constructor(e$7, t$7, i$8, h$2) {
|
|
1000
|
-
this.cksumValid = false, this.needPax = false, this.nullBlock = false, this.block = null, this.path = null, this.mode = null, this.uid = null, this.gid = null, this.size = null, this.mtime = null, this.cksum = null, this[a$11] = "0", this.linkpath = null, this.uname = null, this.gname = null, this.devmaj = 0, this.devmin = 0, this.atime = null, this.ctime = null, Buffer.isBuffer(e$7) ? this.decode(e$7, t$7 || 0, i$8, h$2) : e$7 && this.set(e$7);
|
|
1001
|
-
}
|
|
1002
|
-
decode(e$7, t$7, i$8, h$2) {
|
|
1003
|
-
if (t$7 || (t$7 = 0), !e$7 || !(e$7.length >= t$7 + 512)) throw new Error("need 512 bytes for header");
|
|
1004
|
-
if (this.path = d$1(e$7, t$7, 100), this.mode = r(e$7, t$7 + 100, 8), this.uid = r(e$7, t$7 + 108, 8), this.gid = r(e$7, t$7 + 116, 8), this.size = r(e$7, t$7 + 124, 12), this.mtime = o$6(e$7, t$7 + 136, 12), this.cksum = r(e$7, t$7 + 148, 12), this[P$2](i$8), this[P$2](h$2, true), this[a$11] = d$1(e$7, t$7 + 156, 1), this[a$11] === "" && (this[a$11] = "0"), this[a$11] === "0" && this.path.slice(-1) === "/" && (this[a$11] = "5"), this[a$11] === "5" && (this.size = 0), this.linkpath = d$1(e$7, t$7 + 157, 100), e$7.slice(t$7 + 257, t$7 + 265).toString() === "ustar\x0000") if (this.uname = d$1(e$7, t$7 + 265, 32), this.gname = d$1(e$7, t$7 + 297, 32), this.devmaj = r(e$7, t$7 + 329, 8), this.devmin = r(e$7, t$7 + 337, 8), e$7[t$7 + 475] !== 0) this.path = d$1(e$7, t$7 + 345, 155) + "/" + this.path;
|
|
1005
|
-
else {
|
|
1006
|
-
const n$4 = d$1(e$7, t$7 + 345, 130);
|
|
1007
|
-
n$4 && (this.path = n$4 + "/" + this.path), this.atime = o$6(e$7, t$7 + 476, 12), this.ctime = o$6(e$7, t$7 + 488, 12);
|
|
1008
|
-
}
|
|
1009
|
-
let l$3 = 256;
|
|
1010
|
-
for (let n$4 = t$7; n$4 < t$7 + 148; n$4++) l$3 += e$7[n$4];
|
|
1011
|
-
for (let n$4 = t$7 + 156; n$4 < t$7 + 512; n$4++) l$3 += e$7[n$4];
|
|
1012
|
-
this.cksumValid = l$3 === this.cksum, this.cksum === null && l$3 === 256 && (this.nullBlock = true);
|
|
1013
|
-
}
|
|
1014
|
-
[P$2](e$7, t$7) {
|
|
1015
|
-
for (const i$8 in e$7) e$7[i$8] !== null && e$7[i$8] !== void 0 && !(t$7 && i$8 === "path") && (this[i$8] = e$7[i$8]);
|
|
1016
|
-
}
|
|
1017
|
-
encode(e$7, t$7) {
|
|
1018
|
-
if (e$7 || (e$7 = this.block = Buffer.alloc(512), t$7 = 0), t$7 || (t$7 = 0), !(e$7.length >= t$7 + 512)) throw new Error("need 512 bytes for header");
|
|
1019
|
-
const i$8 = this.ctime || this.atime ? 130 : 155, h$2 = L(this.path || "", i$8), l$3 = h$2[0], n$4 = h$2[1];
|
|
1020
|
-
this.needPax = h$2[2], this.needPax = m$4(e$7, t$7, 100, l$3) || this.needPax, this.needPax = c$6(e$7, t$7 + 100, 8, this.mode) || this.needPax, this.needPax = c$6(e$7, t$7 + 108, 8, this.uid) || this.needPax, this.needPax = c$6(e$7, t$7 + 116, 8, this.gid) || this.needPax, this.needPax = c$6(e$7, t$7 + 124, 12, this.size) || this.needPax, this.needPax = g$1(e$7, t$7 + 136, 12, this.mtime) || this.needPax, e$7[t$7 + 156] = this[a$11].charCodeAt(0), this.needPax = m$4(e$7, t$7 + 157, 100, this.linkpath) || this.needPax, e$7.write("ustar\x0000", t$7 + 257, 8), this.needPax = m$4(e$7, t$7 + 265, 32, this.uname) || this.needPax, this.needPax = m$4(e$7, t$7 + 297, 32, this.gname) || this.needPax, this.needPax = c$6(e$7, t$7 + 329, 8, this.devmaj) || this.needPax, this.needPax = c$6(e$7, t$7 + 337, 8, this.devmin) || this.needPax, this.needPax = m$4(e$7, t$7 + 345, i$8, n$4) || this.needPax, e$7[t$7 + 475] !== 0 ? this.needPax = m$4(e$7, t$7 + 345, 155, n$4) || this.needPax : (this.needPax = m$4(e$7, t$7 + 345, 130, n$4) || this.needPax, this.needPax = g$1(e$7, t$7 + 476, 12, this.atime) || this.needPax, this.needPax = g$1(e$7, t$7 + 488, 12, this.ctime) || this.needPax);
|
|
1021
|
-
let S$2 = 256;
|
|
1022
|
-
for (let p$2 = t$7; p$2 < t$7 + 148; p$2++) S$2 += e$7[p$2];
|
|
1023
|
-
for (let p$2 = t$7 + 156; p$2 < t$7 + 512; p$2++) S$2 += e$7[p$2];
|
|
1024
|
-
return this.cksum = S$2, c$6(e$7, t$7 + 148, 8, this.cksum), this.cksumValid = true, this.needPax;
|
|
1025
|
-
}
|
|
1026
|
-
set(e$7) {
|
|
1027
|
-
for (const t$7 in e$7) e$7[t$7] !== null && e$7[t$7] !== void 0 && (this[t$7] = e$7[t$7]);
|
|
1028
|
-
}
|
|
1029
|
-
get type() {
|
|
1030
|
-
return u$6.name.get(this[a$11]) || this[a$11];
|
|
1031
|
-
}
|
|
1032
|
-
get typeKey() {
|
|
1033
|
-
return this[a$11];
|
|
1034
|
-
}
|
|
1035
|
-
set type(e$7) {
|
|
1036
|
-
u$6.code.has(e$7) ? this[a$11] = u$6.code.get(e$7) : this[a$11] = e$7;
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
const L = (s$8, e$7) => {
|
|
1040
|
-
let i$8 = s$8, h$2 = "", l$3;
|
|
1041
|
-
const n$4 = x$1.parse(s$8).root || ".";
|
|
1042
|
-
if (Buffer.byteLength(i$8) < 100) l$3 = [
|
|
1043
|
-
i$8,
|
|
1044
|
-
h$2,
|
|
1045
|
-
false
|
|
1046
|
-
];
|
|
1047
|
-
else {
|
|
1048
|
-
h$2 = x$1.dirname(i$8), i$8 = x$1.basename(i$8);
|
|
1049
|
-
do
|
|
1050
|
-
Buffer.byteLength(i$8) <= 100 && Buffer.byteLength(h$2) <= e$7 ? l$3 = [
|
|
1051
|
-
i$8,
|
|
1052
|
-
h$2,
|
|
1053
|
-
false
|
|
1054
|
-
] : Buffer.byteLength(i$8) > 100 && Buffer.byteLength(h$2) <= e$7 ? l$3 = [
|
|
1055
|
-
i$8.slice(0, 99),
|
|
1056
|
-
h$2,
|
|
1057
|
-
true
|
|
1058
|
-
] : (i$8 = x$1.join(x$1.basename(h$2), i$8), h$2 = x$1.dirname(h$2));
|
|
1059
|
-
while (h$2 !== n$4 && !l$3);
|
|
1060
|
-
l$3 || (l$3 = [
|
|
1061
|
-
s$8.slice(0, 99),
|
|
1062
|
-
"",
|
|
1063
|
-
true
|
|
1064
|
-
]);
|
|
1065
|
-
}
|
|
1066
|
-
return l$3;
|
|
1067
|
-
}, d$1 = (s$8, e$7, t$7) => s$8.slice(e$7, e$7 + t$7).toString("utf8").replace(/\0.*/, ""), o$6 = (s$8, e$7, t$7) => N$1(r(s$8, e$7, t$7)), N$1 = (s$8) => s$8 === null ? null : /* @__PURE__ */ new Date(s$8 * 1e3), r = (s$8, e$7, t$7) => s$8[e$7] & 128 ? y$4.parse(s$8.slice(e$7, e$7 + t$7)) : j$3(s$8, e$7, t$7), q$2 = (s$8) => isNaN(s$8) ? null : s$8, j$3 = (s$8, e$7, t$7) => q$2(parseInt(s$8.slice(e$7, e$7 + t$7).toString("utf8").replace(/\0.*$/, "").trim(), 8)), v$3 = {
|
|
1068
|
-
12: 8589934591,
|
|
1069
|
-
8: 2097151
|
|
1070
|
-
}, c$6 = (s$8, e$7, t$7, i$8) => i$8 === null ? false : i$8 > v$3[t$7] || i$8 < 0 ? (y$4.encode(i$8, s$8.slice(e$7, e$7 + t$7)), true) : ($(s$8, e$7, t$7, i$8), false), $ = (s$8, e$7, t$7, i$8) => s$8.write(_$2(i$8, t$7), e$7, t$7, "ascii"), _$2 = (s$8, e$7) => z$2(Math.floor(s$8).toString(8), e$7), z$2 = (s$8, e$7) => (s$8.length === e$7 - 1 ? s$8 : new Array(e$7 - s$8.length - 1).join("0") + s$8 + " ") + "\0", g$1 = (s$8, e$7, t$7, i$8) => i$8 === null ? false : c$6(s$8, e$7, t$7, i$8.getTime() / 1e3), A$1 = new Array(156).join("\0"), m$4 = (s$8, e$7, t$7, i$8) => i$8 === null ? false : (s$8.write(i$8 + A$1, e$7, t$7, "utf8"), i$8.length !== Buffer.byteLength(i$8) || i$8.length > t$7);
|
|
1071
|
-
return k = B$1, k;
|
|
1072
|
-
}
|
|
1073
|
-
var e$3, t$3;
|
|
1074
|
-
function i$4() {
|
|
1075
|
-
return t$3 || (t$3 = 1, e$3 = function(o$6) {
|
|
1076
|
-
o$6.prototype[Symbol.iterator] = function* () {
|
|
1077
|
-
for (let r = this.head; r; r = r.next) yield r.value;
|
|
1078
|
-
};
|
|
1079
|
-
}), e$3;
|
|
1080
|
-
}
|
|
1081
|
-
var u$4, a$8;
|
|
1082
|
-
function c$3() {
|
|
1083
|
-
if (a$8) return u$4;
|
|
1084
|
-
a$8 = 1, u$4 = r, r.Node = s$8, r.create = r;
|
|
1085
|
-
function r(t$7) {
|
|
1086
|
-
var i$8 = this;
|
|
1087
|
-
if (i$8 instanceof r || (i$8 = new r()), i$8.tail = null, i$8.head = null, i$8.length = 0, t$7 && typeof t$7.forEach == "function") t$7.forEach(function(n$4) {
|
|
1088
|
-
i$8.push(n$4);
|
|
1089
|
-
});
|
|
1090
|
-
else if (arguments.length > 0) for (var e$7 = 0, h$2 = arguments.length; e$7 < h$2; e$7++) i$8.push(arguments[e$7]);
|
|
1091
|
-
return i$8;
|
|
1092
|
-
}
|
|
1093
|
-
r.prototype.removeNode = function(t$7) {
|
|
1094
|
-
if (t$7.list !== this) throw new Error("removing node which does not belong to this list");
|
|
1095
|
-
var i$8 = t$7.next, e$7 = t$7.prev;
|
|
1096
|
-
return i$8 && (i$8.prev = e$7), e$7 && (e$7.next = i$8), t$7 === this.head && (this.head = i$8), t$7 === this.tail && (this.tail = e$7), t$7.list.length--, t$7.next = null, t$7.prev = null, t$7.list = null, i$8;
|
|
1097
|
-
}, r.prototype.unshiftNode = function(t$7) {
|
|
1098
|
-
if (t$7 !== this.head) {
|
|
1099
|
-
t$7.list && t$7.list.removeNode(t$7);
|
|
1100
|
-
var i$8 = this.head;
|
|
1101
|
-
t$7.list = this, t$7.next = i$8, i$8 && (i$8.prev = t$7), this.head = t$7, this.tail || (this.tail = t$7), this.length++;
|
|
1102
|
-
}
|
|
1103
|
-
}, r.prototype.pushNode = function(t$7) {
|
|
1104
|
-
if (t$7 !== this.tail) {
|
|
1105
|
-
t$7.list && t$7.list.removeNode(t$7);
|
|
1106
|
-
var i$8 = this.tail;
|
|
1107
|
-
t$7.list = this, t$7.prev = i$8, i$8 && (i$8.next = t$7), this.tail = t$7, this.head || (this.head = t$7), this.length++;
|
|
1108
|
-
}
|
|
1109
|
-
}, r.prototype.push = function() {
|
|
1110
|
-
for (var t$7 = 0, i$8 = arguments.length; t$7 < i$8; t$7++) f$5(this, arguments[t$7]);
|
|
1111
|
-
return this.length;
|
|
1112
|
-
}, r.prototype.unshift = function() {
|
|
1113
|
-
for (var t$7 = 0, i$8 = arguments.length; t$7 < i$8; t$7++) o$6(this, arguments[t$7]);
|
|
1114
|
-
return this.length;
|
|
1115
|
-
}, r.prototype.pop = function() {
|
|
1116
|
-
if (this.tail) {
|
|
1117
|
-
var t$7 = this.tail.value;
|
|
1118
|
-
return this.tail = this.tail.prev, this.tail ? this.tail.next = null : this.head = null, this.length--, t$7;
|
|
1119
|
-
}
|
|
1120
|
-
}, r.prototype.shift = function() {
|
|
1121
|
-
if (this.head) {
|
|
1122
|
-
var t$7 = this.head.value;
|
|
1123
|
-
return this.head = this.head.next, this.head ? this.head.prev = null : this.tail = null, this.length--, t$7;
|
|
1124
|
-
}
|
|
1125
|
-
}, r.prototype.forEach = function(t$7, i$8) {
|
|
1126
|
-
i$8 = i$8 || this;
|
|
1127
|
-
for (var e$7 = this.head, h$2 = 0; e$7 !== null; h$2++) t$7.call(i$8, e$7.value, h$2, this), e$7 = e$7.next;
|
|
1128
|
-
}, r.prototype.forEachReverse = function(t$7, i$8) {
|
|
1129
|
-
i$8 = i$8 || this;
|
|
1130
|
-
for (var e$7 = this.tail, h$2 = this.length - 1; e$7 !== null; h$2--) t$7.call(i$8, e$7.value, h$2, this), e$7 = e$7.prev;
|
|
1131
|
-
}, r.prototype.get = function(t$7) {
|
|
1132
|
-
for (var i$8 = 0, e$7 = this.head; e$7 !== null && i$8 < t$7; i$8++) e$7 = e$7.next;
|
|
1133
|
-
if (i$8 === t$7 && e$7 !== null) return e$7.value;
|
|
1134
|
-
}, r.prototype.getReverse = function(t$7) {
|
|
1135
|
-
for (var i$8 = 0, e$7 = this.tail; e$7 !== null && i$8 < t$7; i$8++) e$7 = e$7.prev;
|
|
1136
|
-
if (i$8 === t$7 && e$7 !== null) return e$7.value;
|
|
1137
|
-
}, r.prototype.map = function(t$7, i$8) {
|
|
1138
|
-
i$8 = i$8 || this;
|
|
1139
|
-
for (var e$7 = new r(), h$2 = this.head; h$2 !== null;) e$7.push(t$7.call(i$8, h$2.value, this)), h$2 = h$2.next;
|
|
1140
|
-
return e$7;
|
|
1141
|
-
}, r.prototype.mapReverse = function(t$7, i$8) {
|
|
1142
|
-
i$8 = i$8 || this;
|
|
1143
|
-
for (var e$7 = new r(), h$2 = this.tail; h$2 !== null;) e$7.push(t$7.call(i$8, h$2.value, this)), h$2 = h$2.prev;
|
|
1144
|
-
return e$7;
|
|
1145
|
-
}, r.prototype.reduce = function(t$7, i$8) {
|
|
1146
|
-
var e$7, h$2 = this.head;
|
|
1147
|
-
if (arguments.length > 1) e$7 = i$8;
|
|
1148
|
-
else if (this.head) h$2 = this.head.next, e$7 = this.head.value;
|
|
1149
|
-
else throw new TypeError("Reduce of empty list with no initial value");
|
|
1150
|
-
for (var n$4 = 0; h$2 !== null; n$4++) e$7 = t$7(e$7, h$2.value, n$4), h$2 = h$2.next;
|
|
1151
|
-
return e$7;
|
|
1152
|
-
}, r.prototype.reduceReverse = function(t$7, i$8) {
|
|
1153
|
-
var e$7, h$2 = this.tail;
|
|
1154
|
-
if (arguments.length > 1) e$7 = i$8;
|
|
1155
|
-
else if (this.tail) h$2 = this.tail.prev, e$7 = this.tail.value;
|
|
1156
|
-
else throw new TypeError("Reduce of empty list with no initial value");
|
|
1157
|
-
for (var n$4 = this.length - 1; h$2 !== null; n$4--) e$7 = t$7(e$7, h$2.value, n$4), h$2 = h$2.prev;
|
|
1158
|
-
return e$7;
|
|
1159
|
-
}, r.prototype.toArray = function() {
|
|
1160
|
-
for (var t$7 = new Array(this.length), i$8 = 0, e$7 = this.head; e$7 !== null; i$8++) t$7[i$8] = e$7.value, e$7 = e$7.next;
|
|
1161
|
-
return t$7;
|
|
1162
|
-
}, r.prototype.toArrayReverse = function() {
|
|
1163
|
-
for (var t$7 = new Array(this.length), i$8 = 0, e$7 = this.tail; e$7 !== null; i$8++) t$7[i$8] = e$7.value, e$7 = e$7.prev;
|
|
1164
|
-
return t$7;
|
|
1165
|
-
}, r.prototype.slice = function(t$7, i$8) {
|
|
1166
|
-
i$8 = i$8 || this.length, i$8 < 0 && (i$8 += this.length), t$7 = t$7 || 0, t$7 < 0 && (t$7 += this.length);
|
|
1167
|
-
var e$7 = new r();
|
|
1168
|
-
if (i$8 < t$7 || i$8 < 0) return e$7;
|
|
1169
|
-
t$7 < 0 && (t$7 = 0), i$8 > this.length && (i$8 = this.length);
|
|
1170
|
-
for (var h$2 = 0, n$4 = this.head; n$4 !== null && h$2 < t$7; h$2++) n$4 = n$4.next;
|
|
1171
|
-
for (; n$4 !== null && h$2 < i$8; h$2++, n$4 = n$4.next) e$7.push(n$4.value);
|
|
1172
|
-
return e$7;
|
|
1173
|
-
}, r.prototype.sliceReverse = function(t$7, i$8) {
|
|
1174
|
-
i$8 = i$8 || this.length, i$8 < 0 && (i$8 += this.length), t$7 = t$7 || 0, t$7 < 0 && (t$7 += this.length);
|
|
1175
|
-
var e$7 = new r();
|
|
1176
|
-
if (i$8 < t$7 || i$8 < 0) return e$7;
|
|
1177
|
-
t$7 < 0 && (t$7 = 0), i$8 > this.length && (i$8 = this.length);
|
|
1178
|
-
for (var h$2 = this.length, n$4 = this.tail; n$4 !== null && h$2 > i$8; h$2--) n$4 = n$4.prev;
|
|
1179
|
-
for (; n$4 !== null && h$2 > t$7; h$2--, n$4 = n$4.prev) e$7.push(n$4.value);
|
|
1180
|
-
return e$7;
|
|
1181
|
-
}, r.prototype.splice = function(t$7, i$8, ...e$7) {
|
|
1182
|
-
t$7 > this.length && (t$7 = this.length - 1), t$7 < 0 && (t$7 = this.length + t$7);
|
|
1183
|
-
for (var h$2 = 0, n$4 = this.head; n$4 !== null && h$2 < t$7; h$2++) n$4 = n$4.next;
|
|
1184
|
-
for (var l$3 = [], h$2 = 0; n$4 && h$2 < i$8; h$2++) l$3.push(n$4.value), n$4 = this.removeNode(n$4);
|
|
1185
|
-
n$4 === null && (n$4 = this.tail), n$4 !== this.head && n$4 !== this.tail && (n$4 = n$4.prev);
|
|
1186
|
-
for (var h$2 = 0; h$2 < e$7.length; h$2++) n$4 = v$3(this, n$4, e$7[h$2]);
|
|
1187
|
-
return l$3;
|
|
1188
|
-
}, r.prototype.reverse = function() {
|
|
1189
|
-
for (var t$7 = this.head, i$8 = this.tail, e$7 = t$7; e$7 !== null; e$7 = e$7.prev) {
|
|
1190
|
-
var h$2 = e$7.prev;
|
|
1191
|
-
e$7.prev = e$7.next, e$7.next = h$2;
|
|
1192
|
-
}
|
|
1193
|
-
return this.head = i$8, this.tail = t$7, this;
|
|
1194
|
-
};
|
|
1195
|
-
function v$3(t$7, i$8, e$7) {
|
|
1196
|
-
var h$2 = i$8 === t$7.head ? new s$8(e$7, null, i$8, t$7) : new s$8(e$7, i$8, i$8.next, t$7);
|
|
1197
|
-
return h$2.next === null && (t$7.tail = h$2), h$2.prev === null && (t$7.head = h$2), t$7.length++, h$2;
|
|
1198
|
-
}
|
|
1199
|
-
function f$5(t$7, i$8) {
|
|
1200
|
-
t$7.tail = new s$8(i$8, t$7.tail, null, t$7), t$7.head || (t$7.head = t$7.tail), t$7.length++;
|
|
1201
|
-
}
|
|
1202
|
-
function o$6(t$7, i$8) {
|
|
1203
|
-
t$7.head = new s$8(i$8, null, t$7.head, t$7), t$7.tail || (t$7.tail = t$7.head), t$7.length++;
|
|
1204
|
-
}
|
|
1205
|
-
function s$8(t$7, i$8, e$7, h$2) {
|
|
1206
|
-
if (!(this instanceof s$8)) return new s$8(t$7, i$8, e$7, h$2);
|
|
1207
|
-
this.list = h$2, this.value = t$7, i$8 ? (i$8.next = this, this.prev = i$8) : this.prev = null, e$7 ? (e$7.prev = this, this.next = e$7) : this.next = null;
|
|
1208
|
-
}
|
|
1209
|
-
try {
|
|
1210
|
-
i$4()(r);
|
|
1211
|
-
} catch {}
|
|
1212
|
-
return u$4;
|
|
1213
|
-
}
|
|
1214
|
-
var s$5 = {};
|
|
1215
|
-
var X$1;
|
|
1216
|
-
function ft() {
|
|
1217
|
-
if (X$1) return s$5;
|
|
1218
|
-
X$1 = 1;
|
|
1219
|
-
const H$3 = typeof process == "object" && process ? process : {
|
|
1220
|
-
stdout: null,
|
|
1221
|
-
stderr: null
|
|
1222
|
-
}, Z = nt, q$2 = ot, G$2 = ht.StringDecoder, m$4 = Symbol("EOF"), d$1 = Symbol("maybeEmitEnd"), y$4 = Symbol("emittedEnd"), R$3 = Symbol("emittingEnd"), g$1 = Symbol("emittedError"), B$1 = Symbol("closed"), Y = Symbol("read"), T$2 = Symbol("flush"), $ = Symbol("flushChunk"), f$5 = Symbol("encoding"), c$6 = Symbol("decoder"), M$1 = Symbol("flowing"), S$2 = Symbol("paused"), b$1 = Symbol("resume"), i$8 = Symbol("buffer"), a$11 = Symbol("pipes"), n$4 = Symbol("bufferLength"), j$3 = Symbol("bufferPush"), I$1 = Symbol("bufferShift"), o$6 = Symbol("objectMode"), r = Symbol("destroyed"), P$2 = Symbol("error"), x$1 = Symbol("emitData"), V$1 = Symbol("emitEnd"), N$1 = Symbol("emitEnd2"), p$2 = Symbol("async"), _$2 = Symbol("abort"), O$4 = Symbol("aborted"), E$2 = Symbol("signal"), w$3 = (h$2) => Promise.resolve().then(h$2), J$1 = commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1", K$1 = J$1 && Symbol.asyncIterator || Symbol("asyncIterator not implemented"), W$1 = J$1 && Symbol.iterator || Symbol("iterator not implemented"), k$2 = (h$2) => h$2 === "end" || h$2 === "finish" || h$2 === "prefinish", tt$1 = (h$2) => h$2 instanceof ArrayBuffer || typeof h$2 == "object" && h$2.constructor && h$2.constructor.name === "ArrayBuffer" && h$2.byteLength >= 0, et = (h$2) => !Buffer.isBuffer(h$2) && ArrayBuffer.isView(h$2);
|
|
1223
|
-
class z$2 {
|
|
1224
|
-
constructor(t$7, e$7, s$8) {
|
|
1225
|
-
this.src = t$7, this.dest = e$7, this.opts = s$8, this.ondrain = () => t$7[b$1](), e$7.on("drain", this.ondrain);
|
|
1226
|
-
}
|
|
1227
|
-
unpipe() {
|
|
1228
|
-
this.dest.removeListener("drain", this.ondrain);
|
|
1229
|
-
}
|
|
1230
|
-
proxyErrors() {}
|
|
1231
|
-
end() {
|
|
1232
|
-
this.unpipe(), this.opts.end && this.dest.end();
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
class st extends z$2 {
|
|
1236
|
-
unpipe() {
|
|
1237
|
-
this.src.removeListener("error", this.proxyErrors), super.unpipe();
|
|
1238
|
-
}
|
|
1239
|
-
constructor(t$7, e$7, s$8) {
|
|
1240
|
-
super(t$7, e$7, s$8), this.proxyErrors = (l$3) => e$7.emit("error", l$3), t$7.on("error", this.proxyErrors);
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
class F$4 extends q$2 {
|
|
1244
|
-
constructor(t$7) {
|
|
1245
|
-
super(), this[M$1] = false, this[S$2] = false, this[a$11] = [], this[i$8] = [], this[o$6] = t$7 && t$7.objectMode || false, this[o$6] ? this[f$5] = null : this[f$5] = t$7 && t$7.encoding || null, this[f$5] === "buffer" && (this[f$5] = null), this[p$2] = t$7 && !!t$7.async || false, this[c$6] = this[f$5] ? new G$2(this[f$5]) : null, this[m$4] = false, this[y$4] = false, this[R$3] = false, this[B$1] = false, this[g$1] = null, this.writable = true, this.readable = true, this[n$4] = 0, this[r] = false, t$7 && t$7.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[i$8] }), t$7 && t$7.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[a$11] }), this[E$2] = t$7 && t$7.signal, this[O$4] = false, this[E$2] && (this[E$2].addEventListener("abort", () => this[_$2]()), this[E$2].aborted && this[_$2]());
|
|
1246
|
-
}
|
|
1247
|
-
get bufferLength() {
|
|
1248
|
-
return this[n$4];
|
|
1249
|
-
}
|
|
1250
|
-
get encoding() {
|
|
1251
|
-
return this[f$5];
|
|
1252
|
-
}
|
|
1253
|
-
set encoding(t$7) {
|
|
1254
|
-
if (this[o$6]) throw new Error("cannot set encoding in objectMode");
|
|
1255
|
-
if (this[f$5] && t$7 !== this[f$5] && (this[c$6] && this[c$6].lastNeed || this[n$4])) throw new Error("cannot change encoding");
|
|
1256
|
-
this[f$5] !== t$7 && (this[c$6] = t$7 ? new G$2(t$7) : null, this[i$8].length && (this[i$8] = this[i$8].map((e$7) => this[c$6].write(e$7)))), this[f$5] = t$7;
|
|
1257
|
-
}
|
|
1258
|
-
setEncoding(t$7) {
|
|
1259
|
-
this.encoding = t$7;
|
|
1260
|
-
}
|
|
1261
|
-
get objectMode() {
|
|
1262
|
-
return this[o$6];
|
|
1263
|
-
}
|
|
1264
|
-
set objectMode(t$7) {
|
|
1265
|
-
this[o$6] = this[o$6] || !!t$7;
|
|
1266
|
-
}
|
|
1267
|
-
get async() {
|
|
1268
|
-
return this[p$2];
|
|
1269
|
-
}
|
|
1270
|
-
set async(t$7) {
|
|
1271
|
-
this[p$2] = this[p$2] || !!t$7;
|
|
1272
|
-
}
|
|
1273
|
-
[_$2]() {
|
|
1274
|
-
this[O$4] = true, this.emit("abort", this[E$2].reason), this.destroy(this[E$2].reason);
|
|
1275
|
-
}
|
|
1276
|
-
get aborted() {
|
|
1277
|
-
return this[O$4];
|
|
1278
|
-
}
|
|
1279
|
-
set aborted(t$7) {}
|
|
1280
|
-
write(t$7, e$7, s$8) {
|
|
1281
|
-
if (this[O$4]) return false;
|
|
1282
|
-
if (this[m$4]) throw new Error("write after end");
|
|
1283
|
-
if (this[r]) return this.emit("error", Object.assign(/* @__PURE__ */ new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true;
|
|
1284
|
-
typeof e$7 == "function" && (s$8 = e$7, e$7 = "utf8"), e$7 || (e$7 = "utf8");
|
|
1285
|
-
const l$3 = this[p$2] ? w$3 : (u$6) => u$6();
|
|
1286
|
-
return !this[o$6] && !Buffer.isBuffer(t$7) && (et(t$7) ? t$7 = Buffer.from(t$7.buffer, t$7.byteOffset, t$7.byteLength) : tt$1(t$7) ? t$7 = Buffer.from(t$7) : typeof t$7 != "string" && (this.objectMode = true)), this[o$6] ? (this.flowing && this[n$4] !== 0 && this[T$2](true), this.flowing ? this.emit("data", t$7) : this[j$3](t$7), this[n$4] !== 0 && this.emit("readable"), s$8 && l$3(s$8), this.flowing) : t$7.length ? (typeof t$7 == "string" && !(e$7 === this[f$5] && !this[c$6].lastNeed) && (t$7 = Buffer.from(t$7, e$7)), Buffer.isBuffer(t$7) && this[f$5] && (t$7 = this[c$6].write(t$7)), this.flowing && this[n$4] !== 0 && this[T$2](true), this.flowing ? this.emit("data", t$7) : this[j$3](t$7), this[n$4] !== 0 && this.emit("readable"), s$8 && l$3(s$8), this.flowing) : (this[n$4] !== 0 && this.emit("readable"), s$8 && l$3(s$8), this.flowing);
|
|
1287
|
-
}
|
|
1288
|
-
read(t$7) {
|
|
1289
|
-
if (this[r]) return null;
|
|
1290
|
-
if (this[n$4] === 0 || t$7 === 0 || t$7 > this[n$4]) return this[d$1](), null;
|
|
1291
|
-
this[o$6] && (t$7 = null), this[i$8].length > 1 && !this[o$6] && (this.encoding ? this[i$8] = [this[i$8].join("")] : this[i$8] = [Buffer.concat(this[i$8], this[n$4])]);
|
|
1292
|
-
const e$7 = this[Y](t$7 || null, this[i$8][0]);
|
|
1293
|
-
return this[d$1](), e$7;
|
|
1294
|
-
}
|
|
1295
|
-
[Y](t$7, e$7) {
|
|
1296
|
-
return t$7 === e$7.length || t$7 === null ? this[I$1]() : (this[i$8][0] = e$7.slice(t$7), e$7 = e$7.slice(0, t$7), this[n$4] -= t$7), this.emit("data", e$7), !this[i$8].length && !this[m$4] && this.emit("drain"), e$7;
|
|
1297
|
-
}
|
|
1298
|
-
end(t$7, e$7, s$8) {
|
|
1299
|
-
return typeof t$7 == "function" && (s$8 = t$7, t$7 = null), typeof e$7 == "function" && (s$8 = e$7, e$7 = "utf8"), t$7 && this.write(t$7, e$7), s$8 && this.once("end", s$8), this[m$4] = true, this.writable = false, (this.flowing || !this[S$2]) && this[d$1](), this;
|
|
1300
|
-
}
|
|
1301
|
-
[b$1]() {
|
|
1302
|
-
this[r] || (this[S$2] = false, this[M$1] = true, this.emit("resume"), this[i$8].length ? this[T$2]() : this[m$4] ? this[d$1]() : this.emit("drain"));
|
|
1303
|
-
}
|
|
1304
|
-
resume() {
|
|
1305
|
-
return this[b$1]();
|
|
1306
|
-
}
|
|
1307
|
-
pause() {
|
|
1308
|
-
this[M$1] = false, this[S$2] = true;
|
|
1309
|
-
}
|
|
1310
|
-
get destroyed() {
|
|
1311
|
-
return this[r];
|
|
1312
|
-
}
|
|
1313
|
-
get flowing() {
|
|
1314
|
-
return this[M$1];
|
|
1315
|
-
}
|
|
1316
|
-
get paused() {
|
|
1317
|
-
return this[S$2];
|
|
1318
|
-
}
|
|
1319
|
-
[j$3](t$7) {
|
|
1320
|
-
this[o$6] ? this[n$4] += 1 : this[n$4] += t$7.length, this[i$8].push(t$7);
|
|
1321
|
-
}
|
|
1322
|
-
[I$1]() {
|
|
1323
|
-
return this[o$6] ? this[n$4] -= 1 : this[n$4] -= this[i$8][0].length, this[i$8].shift();
|
|
1324
|
-
}
|
|
1325
|
-
[T$2](t$7) {
|
|
1326
|
-
do ;
|
|
1327
|
-
while (this[$](this[I$1]()) && this[i$8].length);
|
|
1328
|
-
!t$7 && !this[i$8].length && !this[m$4] && this.emit("drain");
|
|
1329
|
-
}
|
|
1330
|
-
[$](t$7) {
|
|
1331
|
-
return this.emit("data", t$7), this.flowing;
|
|
1332
|
-
}
|
|
1333
|
-
pipe(t$7, e$7) {
|
|
1334
|
-
if (this[r]) return;
|
|
1335
|
-
const s$8 = this[y$4];
|
|
1336
|
-
return e$7 = e$7 || {}, t$7 === H$3.stdout || t$7 === H$3.stderr ? e$7.end = false : e$7.end = e$7.end !== false, e$7.proxyErrors = !!e$7.proxyErrors, s$8 ? e$7.end && t$7.end() : (this[a$11].push(e$7.proxyErrors ? new st(this, t$7, e$7) : new z$2(this, t$7, e$7)), this[p$2] ? w$3(() => this[b$1]()) : this[b$1]()), t$7;
|
|
1337
|
-
}
|
|
1338
|
-
unpipe(t$7) {
|
|
1339
|
-
const e$7 = this[a$11].find((s$8) => s$8.dest === t$7);
|
|
1340
|
-
e$7 && (this[a$11].splice(this[a$11].indexOf(e$7), 1), e$7.unpipe());
|
|
1341
|
-
}
|
|
1342
|
-
addListener(t$7, e$7) {
|
|
1343
|
-
return this.on(t$7, e$7);
|
|
1344
|
-
}
|
|
1345
|
-
on(t$7, e$7) {
|
|
1346
|
-
const s$8 = super.on(t$7, e$7);
|
|
1347
|
-
return t$7 === "data" && !this[a$11].length && !this.flowing ? this[b$1]() : t$7 === "readable" && this[n$4] !== 0 ? super.emit("readable") : k$2(t$7) && this[y$4] ? (super.emit(t$7), this.removeAllListeners(t$7)) : t$7 === "error" && this[g$1] && (this[p$2] ? w$3(() => e$7.call(this, this[g$1])) : e$7.call(this, this[g$1])), s$8;
|
|
1348
|
-
}
|
|
1349
|
-
get emittedEnd() {
|
|
1350
|
-
return this[y$4];
|
|
1351
|
-
}
|
|
1352
|
-
[d$1]() {
|
|
1353
|
-
!this[R$3] && !this[y$4] && !this[r] && this[i$8].length === 0 && this[m$4] && (this[R$3] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[B$1] && this.emit("close"), this[R$3] = false);
|
|
1354
|
-
}
|
|
1355
|
-
emit(t$7, e$7, ...s$8) {
|
|
1356
|
-
if (t$7 !== "error" && t$7 !== "close" && t$7 !== r && this[r]) return;
|
|
1357
|
-
if (t$7 === "data") return !this[o$6] && !e$7 ? false : this[p$2] ? w$3(() => this[x$1](e$7)) : this[x$1](e$7);
|
|
1358
|
-
if (t$7 === "end") return this[V$1]();
|
|
1359
|
-
if (t$7 === "close") {
|
|
1360
|
-
if (this[B$1] = true, !this[y$4] && !this[r]) return;
|
|
1361
|
-
const u$6 = super.emit("close");
|
|
1362
|
-
return this.removeAllListeners("close"), u$6;
|
|
1363
|
-
} else if (t$7 === "error") {
|
|
1364
|
-
this[g$1] = e$7, super.emit(P$2, e$7);
|
|
1365
|
-
const u$6 = !this[E$2] || this.listeners("error").length ? super.emit("error", e$7) : false;
|
|
1366
|
-
return this[d$1](), u$6;
|
|
1367
|
-
} else if (t$7 === "resume") {
|
|
1368
|
-
const u$6 = super.emit("resume");
|
|
1369
|
-
return this[d$1](), u$6;
|
|
1370
|
-
} else if (t$7 === "finish" || t$7 === "prefinish") {
|
|
1371
|
-
const u$6 = super.emit(t$7);
|
|
1372
|
-
return this.removeAllListeners(t$7), u$6;
|
|
1373
|
-
}
|
|
1374
|
-
const l$3 = super.emit(t$7, e$7, ...s$8);
|
|
1375
|
-
return this[d$1](), l$3;
|
|
1376
|
-
}
|
|
1377
|
-
[x$1](t$7) {
|
|
1378
|
-
for (const s$8 of this[a$11]) s$8.dest.write(t$7) === false && this.pause();
|
|
1379
|
-
const e$7 = super.emit("data", t$7);
|
|
1380
|
-
return this[d$1](), e$7;
|
|
1381
|
-
}
|
|
1382
|
-
[V$1]() {
|
|
1383
|
-
this[y$4] || (this[y$4] = true, this.readable = false, this[p$2] ? w$3(() => this[N$1]()) : this[N$1]());
|
|
1384
|
-
}
|
|
1385
|
-
[N$1]() {
|
|
1386
|
-
if (this[c$6]) {
|
|
1387
|
-
const e$7 = this[c$6].end();
|
|
1388
|
-
if (e$7) {
|
|
1389
|
-
for (const s$8 of this[a$11]) s$8.dest.write(e$7);
|
|
1390
|
-
super.emit("data", e$7);
|
|
1391
|
-
}
|
|
1392
|
-
}
|
|
1393
|
-
for (const e$7 of this[a$11]) e$7.end();
|
|
1394
|
-
const t$7 = super.emit("end");
|
|
1395
|
-
return this.removeAllListeners("end"), t$7;
|
|
1396
|
-
}
|
|
1397
|
-
collect() {
|
|
1398
|
-
const t$7 = [];
|
|
1399
|
-
this[o$6] || (t$7.dataLength = 0);
|
|
1400
|
-
const e$7 = this.promise();
|
|
1401
|
-
return this.on("data", (s$8) => {
|
|
1402
|
-
t$7.push(s$8), this[o$6] || (t$7.dataLength += s$8.length);
|
|
1403
|
-
}), e$7.then(() => t$7);
|
|
1404
|
-
}
|
|
1405
|
-
concat() {
|
|
1406
|
-
return this[o$6] ? Promise.reject(/* @__PURE__ */ new Error("cannot concat in objectMode")) : this.collect().then((t$7) => this[o$6] ? Promise.reject(/* @__PURE__ */ new Error("cannot concat in objectMode")) : this[f$5] ? t$7.join("") : Buffer.concat(t$7, t$7.dataLength));
|
|
1407
|
-
}
|
|
1408
|
-
promise() {
|
|
1409
|
-
return new Promise((t$7, e$7) => {
|
|
1410
|
-
this.on(r, () => e$7(/* @__PURE__ */ new Error("stream destroyed"))), this.on("error", (s$8) => e$7(s$8)), this.on("end", () => t$7());
|
|
1411
|
-
});
|
|
1412
|
-
}
|
|
1413
|
-
[K$1]() {
|
|
1414
|
-
let t$7 = false;
|
|
1415
|
-
const e$7 = () => (this.pause(), t$7 = true, Promise.resolve({ done: true }));
|
|
1416
|
-
return {
|
|
1417
|
-
next: () => {
|
|
1418
|
-
if (t$7) return e$7();
|
|
1419
|
-
const l$3 = this.read();
|
|
1420
|
-
if (l$3 !== null) return Promise.resolve({
|
|
1421
|
-
done: false,
|
|
1422
|
-
value: l$3
|
|
1423
|
-
});
|
|
1424
|
-
if (this[m$4]) return e$7();
|
|
1425
|
-
let u$6 = null, Q = null;
|
|
1426
|
-
const A$1 = (L) => {
|
|
1427
|
-
this.removeListener("data", U$1), this.removeListener("end", C$2), this.removeListener(r, D$1), e$7(), Q(L);
|
|
1428
|
-
}, U$1 = (L) => {
|
|
1429
|
-
this.removeListener("error", A$1), this.removeListener("end", C$2), this.removeListener(r, D$1), this.pause(), u$6({
|
|
1430
|
-
value: L,
|
|
1431
|
-
done: !!this[m$4]
|
|
1432
|
-
});
|
|
1433
|
-
}, C$2 = () => {
|
|
1434
|
-
this.removeListener("error", A$1), this.removeListener("data", U$1), this.removeListener(r, D$1), e$7(), u$6({ done: true });
|
|
1435
|
-
}, D$1 = () => A$1(/* @__PURE__ */ new Error("stream destroyed"));
|
|
1436
|
-
return new Promise((L, it) => {
|
|
1437
|
-
Q = it, u$6 = L, this.once(r, D$1), this.once("error", A$1), this.once("end", C$2), this.once("data", U$1);
|
|
1438
|
-
});
|
|
1439
|
-
},
|
|
1440
|
-
throw: e$7,
|
|
1441
|
-
return: e$7,
|
|
1442
|
-
[K$1]() {
|
|
1443
|
-
return this;
|
|
1444
|
-
}
|
|
1445
|
-
};
|
|
1446
|
-
}
|
|
1447
|
-
[W$1]() {
|
|
1448
|
-
let t$7 = false;
|
|
1449
|
-
const e$7 = () => (this.pause(), this.removeListener(P$2, e$7), this.removeListener(r, e$7), this.removeListener("end", e$7), t$7 = true, { done: true }), s$8 = () => {
|
|
1450
|
-
if (t$7) return e$7();
|
|
1451
|
-
const l$3 = this.read();
|
|
1452
|
-
return l$3 === null ? e$7() : { value: l$3 };
|
|
1453
|
-
};
|
|
1454
|
-
return this.once("end", e$7), this.once(P$2, e$7), this.once(r, e$7), {
|
|
1455
|
-
next: s$8,
|
|
1456
|
-
throw: e$7,
|
|
1457
|
-
return: e$7,
|
|
1458
|
-
[W$1]() {
|
|
1459
|
-
return this;
|
|
1460
|
-
}
|
|
1461
|
-
};
|
|
1462
|
-
}
|
|
1463
|
-
destroy(t$7) {
|
|
1464
|
-
return this[r] ? (t$7 ? this.emit("error", t$7) : this.emit(r), this) : (this[r] = true, this[i$8].length = 0, this[n$4] = 0, typeof this.close == "function" && !this[B$1] && this.close(), t$7 ? this.emit("error", t$7) : this.emit(r), this);
|
|
1465
|
-
}
|
|
1466
|
-
static isStream(t$7) {
|
|
1467
|
-
return !!t$7 && (t$7 instanceof F$4 || t$7 instanceof q$2 || t$7 instanceof Z && (typeof t$7.pipe == "function" || typeof t$7.write == "function" && typeof t$7.end == "function"));
|
|
1468
|
-
}
|
|
1469
|
-
}
|
|
1470
|
-
return s$5.Minipass = F$4, s$5;
|
|
1471
|
-
}
|
|
1472
|
-
var e$2, o$4;
|
|
1473
|
-
function a$7() {
|
|
1474
|
-
return o$4 || (o$4 = 1, e$2 = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) !== "win32" ? (r) => r : (r) => r && r.replace(/\\/g, "/")), e$2;
|
|
1475
|
-
}
|
|
1476
|
-
var n$2, a$6;
|
|
1477
|
-
function u$3() {
|
|
1478
|
-
if (a$6) return n$2;
|
|
1479
|
-
a$6 = 1;
|
|
1480
|
-
const { Minipass: o$6 } = ft(), s$8 = a$7(), r = Symbol("slurp");
|
|
1481
|
-
return n$2 = class extends o$6 {
|
|
1482
|
-
constructor(t$7, e$7, i$8) {
|
|
1483
|
-
switch (super(), this.pause(), this.extended = e$7, this.globalExtended = i$8, this.header = t$7, this.startBlockSize = 512 * Math.ceil(t$7.size / 512), this.blockRemain = this.startBlockSize, this.remain = t$7.size, this.type = t$7.type, this.meta = false, this.ignore = false, this.type) {
|
|
1484
|
-
case "File":
|
|
1485
|
-
case "OldFile":
|
|
1486
|
-
case "Link":
|
|
1487
|
-
case "SymbolicLink":
|
|
1488
|
-
case "CharacterDevice":
|
|
1489
|
-
case "BlockDevice":
|
|
1490
|
-
case "Directory":
|
|
1491
|
-
case "FIFO":
|
|
1492
|
-
case "ContiguousFile":
|
|
1493
|
-
case "GNUDumpDir": break;
|
|
1494
|
-
case "NextFileHasLongLinkpath":
|
|
1495
|
-
case "NextFileHasLongPath":
|
|
1496
|
-
case "OldGnuLongPath":
|
|
1497
|
-
case "GlobalExtendedHeader":
|
|
1498
|
-
case "ExtendedHeader":
|
|
1499
|
-
case "OldExtendedHeader":
|
|
1500
|
-
this.meta = true;
|
|
1501
|
-
break;
|
|
1502
|
-
default: this.ignore = true;
|
|
1503
|
-
}
|
|
1504
|
-
this.path = s$8(t$7.path), this.mode = t$7.mode, this.mode && (this.mode = this.mode & 4095), this.uid = t$7.uid, this.gid = t$7.gid, this.uname = t$7.uname, this.gname = t$7.gname, this.size = t$7.size, this.mtime = t$7.mtime, this.atime = t$7.atime, this.ctime = t$7.ctime, this.linkpath = s$8(t$7.linkpath), this.uname = t$7.uname, this.gname = t$7.gname, e$7 && this[r](e$7), i$8 && this[r](i$8, true);
|
|
1505
|
-
}
|
|
1506
|
-
write(t$7) {
|
|
1507
|
-
const e$7 = t$7.length;
|
|
1508
|
-
if (e$7 > this.blockRemain) throw new Error("writing more to entry than is appropriate");
|
|
1509
|
-
const i$8 = this.remain, c$6 = this.blockRemain;
|
|
1510
|
-
return this.remain = Math.max(0, i$8 - e$7), this.blockRemain = Math.max(0, c$6 - e$7), this.ignore ? true : i$8 >= e$7 ? super.write(t$7) : super.write(t$7.slice(0, i$8));
|
|
1511
|
-
}
|
|
1512
|
-
[r](t$7, e$7) {
|
|
1513
|
-
for (const i$8 in t$7) t$7[i$8] !== null && t$7[i$8] !== void 0 && !(e$7 && i$8 === "path") && (this[i$8] = i$8 === "path" || i$8 === "linkpath" ? s$8(t$7[i$8]) : t$7[i$8]);
|
|
1514
|
-
}
|
|
1515
|
-
}, n$2;
|
|
1516
|
-
}
|
|
1517
|
-
var r$2, a$5;
|
|
1518
|
-
function f$2() {
|
|
1519
|
-
if (a$5) return r$2;
|
|
1520
|
-
a$5 = 1;
|
|
1521
|
-
const c$6 = E(), d$1 = path;
|
|
1522
|
-
class h$2 {
|
|
1523
|
-
constructor(e$7, n$4) {
|
|
1524
|
-
this.atime = e$7.atime || null, this.charset = e$7.charset || null, this.comment = e$7.comment || null, this.ctime = e$7.ctime || null, this.gid = e$7.gid || null, this.gname = e$7.gname || null, this.linkpath = e$7.linkpath || null, this.mtime = e$7.mtime || null, this.path = e$7.path || null, this.size = e$7.size || null, this.uid = e$7.uid || null, this.uname = e$7.uname || null, this.dev = e$7.dev || null, this.ino = e$7.ino || null, this.nlink = e$7.nlink || null, this.global = n$4 || false;
|
|
1525
|
-
}
|
|
1526
|
-
encode() {
|
|
1527
|
-
const e$7 = this.encodeBody();
|
|
1528
|
-
if (e$7 === "") return null;
|
|
1529
|
-
const n$4 = Buffer.byteLength(e$7), l$3 = 512 * Math.ceil(1 + n$4 / 512), i$8 = Buffer.allocUnsafe(l$3);
|
|
1530
|
-
for (let t$7 = 0; t$7 < 512; t$7++) i$8[t$7] = 0;
|
|
1531
|
-
new c$6({
|
|
1532
|
-
path: ("PaxHeader/" + d$1.basename(this.path)).slice(0, 99),
|
|
1533
|
-
mode: this.mode || 420,
|
|
1534
|
-
uid: this.uid || null,
|
|
1535
|
-
gid: this.gid || null,
|
|
1536
|
-
size: n$4,
|
|
1537
|
-
mtime: this.mtime || null,
|
|
1538
|
-
type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader",
|
|
1539
|
-
linkpath: "",
|
|
1540
|
-
uname: this.uname || "",
|
|
1541
|
-
gname: this.gname || "",
|
|
1542
|
-
devmaj: 0,
|
|
1543
|
-
devmin: 0,
|
|
1544
|
-
atime: this.atime || null,
|
|
1545
|
-
ctime: this.ctime || null
|
|
1546
|
-
}).encode(i$8), i$8.write(e$7, 512, n$4, "utf8");
|
|
1547
|
-
for (let t$7 = n$4 + 512; t$7 < i$8.length; t$7++) i$8[t$7] = 0;
|
|
1548
|
-
return i$8;
|
|
1549
|
-
}
|
|
1550
|
-
encodeBody() {
|
|
1551
|
-
return this.encodeField("path") + this.encodeField("ctime") + this.encodeField("atime") + this.encodeField("dev") + this.encodeField("ino") + this.encodeField("nlink") + this.encodeField("charset") + this.encodeField("comment") + this.encodeField("gid") + this.encodeField("gname") + this.encodeField("linkpath") + this.encodeField("mtime") + this.encodeField("size") + this.encodeField("uid") + this.encodeField("uname");
|
|
1552
|
-
}
|
|
1553
|
-
encodeField(e$7) {
|
|
1554
|
-
if (this[e$7] === null || this[e$7] === void 0) return "";
|
|
1555
|
-
const n$4 = this[e$7] instanceof Date ? this[e$7].getTime() / 1e3 : this[e$7], l$3 = " " + (e$7 === "dev" || e$7 === "ino" || e$7 === "nlink" ? "SCHILY." : "") + e$7 + "=" + n$4 + `
|
|
1556
|
-
`, i$8 = Buffer.byteLength(l$3);
|
|
1557
|
-
let t$7 = Math.floor(Math.log(i$8) / Math.log(10)) + 1;
|
|
1558
|
-
return i$8 + t$7 >= Math.pow(10, t$7) && (t$7 += 1), t$7 + i$8 + l$3;
|
|
1559
|
-
}
|
|
1560
|
-
}
|
|
1561
|
-
h$2.parse = (s$8, e$7, n$4) => new h$2(o$6(u$6(s$8), e$7), n$4);
|
|
1562
|
-
const o$6 = (s$8, e$7) => e$7 ? Object.keys(s$8).reduce((n$4, l$3) => (n$4[l$3] = s$8[l$3], n$4), e$7) : s$8, u$6 = (s$8) => s$8.replace(/\n$/, "").split(`
|
|
1563
|
-
`).reduce(m$4, Object.create(null)), m$4 = (s$8, e$7) => {
|
|
1564
|
-
const n$4 = parseInt(e$7, 10);
|
|
1565
|
-
if (n$4 !== Buffer.byteLength(e$7) + 1) return s$8;
|
|
1566
|
-
e$7 = e$7.slice((n$4 + " ").length);
|
|
1567
|
-
const l$3 = e$7.split("="), i$8 = l$3.shift().replace(/^SCHILY\.(dev|ino|nlink)/, "$1");
|
|
1568
|
-
if (!i$8) return s$8;
|
|
1569
|
-
const t$7 = l$3.join("=");
|
|
1570
|
-
return s$8[i$8] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i$8) ? /* @__PURE__ */ new Date(t$7 * 1e3) : /^[0-9]+$/.test(t$7) ? +t$7 : t$7, s$8;
|
|
1571
|
-
};
|
|
1572
|
-
return r$2 = h$2, r$2;
|
|
1573
|
-
}
|
|
1574
|
-
var i$3 = {};
|
|
1575
|
-
var _, R$1;
|
|
1576
|
-
function T() {
|
|
1577
|
-
if (R$1) return _;
|
|
1578
|
-
R$1 = 1;
|
|
1579
|
-
const E$2 = O$2.constants || { ZLIB_VERNUM: 4736 };
|
|
1580
|
-
return _ = Object.freeze(Object.assign(Object.create(null), {
|
|
1581
|
-
Z_NO_FLUSH: 0,
|
|
1582
|
-
Z_PARTIAL_FLUSH: 1,
|
|
1583
|
-
Z_SYNC_FLUSH: 2,
|
|
1584
|
-
Z_FULL_FLUSH: 3,
|
|
1585
|
-
Z_FINISH: 4,
|
|
1586
|
-
Z_BLOCK: 5,
|
|
1587
|
-
Z_OK: 0,
|
|
1588
|
-
Z_STREAM_END: 1,
|
|
1589
|
-
Z_NEED_DICT: 2,
|
|
1590
|
-
Z_ERRNO: -1,
|
|
1591
|
-
Z_STREAM_ERROR: -2,
|
|
1592
|
-
Z_DATA_ERROR: -3,
|
|
1593
|
-
Z_MEM_ERROR: -4,
|
|
1594
|
-
Z_BUF_ERROR: -5,
|
|
1595
|
-
Z_VERSION_ERROR: -6,
|
|
1596
|
-
Z_NO_COMPRESSION: 0,
|
|
1597
|
-
Z_BEST_SPEED: 1,
|
|
1598
|
-
Z_BEST_COMPRESSION: 9,
|
|
1599
|
-
Z_DEFAULT_COMPRESSION: -1,
|
|
1600
|
-
Z_FILTERED: 1,
|
|
1601
|
-
Z_HUFFMAN_ONLY: 2,
|
|
1602
|
-
Z_RLE: 3,
|
|
1603
|
-
Z_FIXED: 4,
|
|
1604
|
-
Z_DEFAULT_STRATEGY: 0,
|
|
1605
|
-
DEFLATE: 1,
|
|
1606
|
-
INFLATE: 2,
|
|
1607
|
-
GZIP: 3,
|
|
1608
|
-
GUNZIP: 4,
|
|
1609
|
-
DEFLATERAW: 5,
|
|
1610
|
-
INFLATERAW: 6,
|
|
1611
|
-
UNZIP: 7,
|
|
1612
|
-
BROTLI_DECODE: 8,
|
|
1613
|
-
BROTLI_ENCODE: 9,
|
|
1614
|
-
Z_MIN_WINDOWBITS: 8,
|
|
1615
|
-
Z_MAX_WINDOWBITS: 15,
|
|
1616
|
-
Z_DEFAULT_WINDOWBITS: 15,
|
|
1617
|
-
Z_MIN_CHUNK: 64,
|
|
1618
|
-
Z_MAX_CHUNK: Infinity,
|
|
1619
|
-
Z_DEFAULT_CHUNK: 16384,
|
|
1620
|
-
Z_MIN_MEMLEVEL: 1,
|
|
1621
|
-
Z_MAX_MEMLEVEL: 9,
|
|
1622
|
-
Z_DEFAULT_MEMLEVEL: 8,
|
|
1623
|
-
Z_MIN_LEVEL: -1,
|
|
1624
|
-
Z_MAX_LEVEL: 9,
|
|
1625
|
-
Z_DEFAULT_LEVEL: -1,
|
|
1626
|
-
BROTLI_OPERATION_PROCESS: 0,
|
|
1627
|
-
BROTLI_OPERATION_FLUSH: 1,
|
|
1628
|
-
BROTLI_OPERATION_FINISH: 2,
|
|
1629
|
-
BROTLI_OPERATION_EMIT_METADATA: 3,
|
|
1630
|
-
BROTLI_MODE_GENERIC: 0,
|
|
1631
|
-
BROTLI_MODE_TEXT: 1,
|
|
1632
|
-
BROTLI_MODE_FONT: 2,
|
|
1633
|
-
BROTLI_DEFAULT_MODE: 0,
|
|
1634
|
-
BROTLI_MIN_QUALITY: 0,
|
|
1635
|
-
BROTLI_MAX_QUALITY: 11,
|
|
1636
|
-
BROTLI_DEFAULT_QUALITY: 11,
|
|
1637
|
-
BROTLI_MIN_WINDOW_BITS: 10,
|
|
1638
|
-
BROTLI_MAX_WINDOW_BITS: 24,
|
|
1639
|
-
BROTLI_LARGE_MAX_WINDOW_BITS: 30,
|
|
1640
|
-
BROTLI_DEFAULT_WINDOW: 22,
|
|
1641
|
-
BROTLI_MIN_INPUT_BLOCK_BITS: 16,
|
|
1642
|
-
BROTLI_MAX_INPUT_BLOCK_BITS: 24,
|
|
1643
|
-
BROTLI_PARAM_MODE: 0,
|
|
1644
|
-
BROTLI_PARAM_QUALITY: 1,
|
|
1645
|
-
BROTLI_PARAM_LGWIN: 2,
|
|
1646
|
-
BROTLI_PARAM_LGBLOCK: 3,
|
|
1647
|
-
BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4,
|
|
1648
|
-
BROTLI_PARAM_SIZE_HINT: 5,
|
|
1649
|
-
BROTLI_PARAM_LARGE_WINDOW: 6,
|
|
1650
|
-
BROTLI_PARAM_NPOSTFIX: 7,
|
|
1651
|
-
BROTLI_PARAM_NDIRECT: 8,
|
|
1652
|
-
BROTLI_DECODER_RESULT_ERROR: 0,
|
|
1653
|
-
BROTLI_DECODER_RESULT_SUCCESS: 1,
|
|
1654
|
-
BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2,
|
|
1655
|
-
BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3,
|
|
1656
|
-
BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0,
|
|
1657
|
-
BROTLI_DECODER_PARAM_LARGE_WINDOW: 1,
|
|
1658
|
-
BROTLI_DECODER_NO_ERROR: 0,
|
|
1659
|
-
BROTLI_DECODER_SUCCESS: 1,
|
|
1660
|
-
BROTLI_DECODER_NEEDS_MORE_INPUT: 2,
|
|
1661
|
-
BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3,
|
|
1662
|
-
BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1,
|
|
1663
|
-
BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2,
|
|
1664
|
-
BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3,
|
|
1665
|
-
BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4,
|
|
1666
|
-
BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5,
|
|
1667
|
-
BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6,
|
|
1668
|
-
BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7,
|
|
1669
|
-
BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8,
|
|
1670
|
-
BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9,
|
|
1671
|
-
BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10,
|
|
1672
|
-
BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11,
|
|
1673
|
-
BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12,
|
|
1674
|
-
BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13,
|
|
1675
|
-
BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14,
|
|
1676
|
-
BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15,
|
|
1677
|
-
BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16,
|
|
1678
|
-
BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19,
|
|
1679
|
-
BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20,
|
|
1680
|
-
BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21,
|
|
1681
|
-
BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22,
|
|
1682
|
-
BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25,
|
|
1683
|
-
BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26,
|
|
1684
|
-
BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27,
|
|
1685
|
-
BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30,
|
|
1686
|
-
BROTLI_DECODER_ERROR_UNREACHABLE: -31
|
|
1687
|
-
}, E$2)), _;
|
|
1688
|
-
}
|
|
1689
|
-
var j, H$1;
|
|
1690
|
-
function tt() {
|
|
1691
|
-
if (H$1) return j;
|
|
1692
|
-
H$1 = 1;
|
|
1693
|
-
const I$1 = typeof process == "object" && process ? process : {
|
|
1694
|
-
stdout: null,
|
|
1695
|
-
stderr: null
|
|
1696
|
-
}, Y = nt, x$1 = ot, N$1 = ht.StringDecoder, u$6 = Symbol("EOF"), a$11 = Symbol("maybeEmitEnd"), c$6 = Symbol("emittedEnd"), S$2 = Symbol("emittingEnd"), E$2 = Symbol("emittedError"), w$3 = Symbol("closed"), P$2 = Symbol("read"), L = Symbol("flush"), _$2 = Symbol("flushChunk"), h$2 = Symbol("encoding"), m$4 = Symbol("decoder"), M$1 = Symbol("flowing"), y$4 = Symbol("paused"), p$2 = Symbol("resume"), s$8 = Symbol("bufferLength"), T$2 = Symbol("bufferPush"), B$1 = Symbol("bufferShift"), r = Symbol("objectMode"), n$4 = Symbol("destroyed"), D$1 = Symbol("emitData"), F$4 = Symbol("emitEnd"), R$3 = Symbol("emitEnd2"), d$1 = Symbol("async"), b$1 = (o$6) => Promise.resolve().then(o$6), C$2 = commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1", $ = C$2 && Symbol.asyncIterator || Symbol("asyncIterator not implemented"), G$2 = C$2 && Symbol.iterator || Symbol("iterator not implemented"), V$1 = (o$6) => o$6 === "end" || o$6 === "finish" || o$6 === "prefinish", v$3 = (o$6) => o$6 instanceof ArrayBuffer || typeof o$6 == "object" && o$6.constructor && o$6.constructor.name === "ArrayBuffer" && o$6.byteLength >= 0, J$1 = (o$6) => !Buffer.isBuffer(o$6) && ArrayBuffer.isView(o$6);
|
|
1697
|
-
class U$1 {
|
|
1698
|
-
constructor(t$7, e$7, i$8) {
|
|
1699
|
-
this.src = t$7, this.dest = e$7, this.opts = i$8, this.ondrain = () => t$7[p$2](), e$7.on("drain", this.ondrain);
|
|
1700
|
-
}
|
|
1701
|
-
unpipe() {
|
|
1702
|
-
this.dest.removeListener("drain", this.ondrain);
|
|
1703
|
-
}
|
|
1704
|
-
proxyErrors() {}
|
|
1705
|
-
end() {
|
|
1706
|
-
this.unpipe(), this.opts.end && this.dest.end();
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
class K$1 extends U$1 {
|
|
1710
|
-
unpipe() {
|
|
1711
|
-
this.src.removeListener("error", this.proxyErrors), super.unpipe();
|
|
1712
|
-
}
|
|
1713
|
-
constructor(t$7, e$7, i$8) {
|
|
1714
|
-
super(t$7, e$7, i$8), this.proxyErrors = (l$3) => e$7.emit("error", l$3), t$7.on("error", this.proxyErrors);
|
|
1715
|
-
}
|
|
1716
|
-
}
|
|
1717
|
-
return j = class q$2 extends x$1 {
|
|
1718
|
-
constructor(t$7) {
|
|
1719
|
-
super(), this[M$1] = false, this[y$4] = false, this.pipes = [], this.buffer = [], this[r] = t$7 && t$7.objectMode || false, this[r] ? this[h$2] = null : this[h$2] = t$7 && t$7.encoding || null, this[h$2] === "buffer" && (this[h$2] = null), this[d$1] = t$7 && !!t$7.async || false, this[m$4] = this[h$2] ? new N$1(this[h$2]) : null, this[u$6] = false, this[c$6] = false, this[S$2] = false, this[w$3] = false, this[E$2] = null, this.writable = true, this.readable = true, this[s$8] = 0, this[n$4] = false;
|
|
1720
|
-
}
|
|
1721
|
-
get bufferLength() {
|
|
1722
|
-
return this[s$8];
|
|
1723
|
-
}
|
|
1724
|
-
get encoding() {
|
|
1725
|
-
return this[h$2];
|
|
1726
|
-
}
|
|
1727
|
-
set encoding(t$7) {
|
|
1728
|
-
if (this[r]) throw new Error("cannot set encoding in objectMode");
|
|
1729
|
-
if (this[h$2] && t$7 !== this[h$2] && (this[m$4] && this[m$4].lastNeed || this[s$8])) throw new Error("cannot change encoding");
|
|
1730
|
-
this[h$2] !== t$7 && (this[m$4] = t$7 ? new N$1(t$7) : null, this.buffer.length && (this.buffer = this.buffer.map((e$7) => this[m$4].write(e$7)))), this[h$2] = t$7;
|
|
1731
|
-
}
|
|
1732
|
-
setEncoding(t$7) {
|
|
1733
|
-
this.encoding = t$7;
|
|
1734
|
-
}
|
|
1735
|
-
get objectMode() {
|
|
1736
|
-
return this[r];
|
|
1737
|
-
}
|
|
1738
|
-
set objectMode(t$7) {
|
|
1739
|
-
this[r] = this[r] || !!t$7;
|
|
1740
|
-
}
|
|
1741
|
-
get async() {
|
|
1742
|
-
return this[d$1];
|
|
1743
|
-
}
|
|
1744
|
-
set async(t$7) {
|
|
1745
|
-
this[d$1] = this[d$1] || !!t$7;
|
|
1746
|
-
}
|
|
1747
|
-
write(t$7, e$7, i$8) {
|
|
1748
|
-
if (this[u$6]) throw new Error("write after end");
|
|
1749
|
-
if (this[n$4]) return this.emit("error", Object.assign(/* @__PURE__ */ new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true;
|
|
1750
|
-
typeof e$7 == "function" && (i$8 = e$7, e$7 = "utf8"), e$7 || (e$7 = "utf8");
|
|
1751
|
-
const l$3 = this[d$1] ? b$1 : (f$5) => f$5();
|
|
1752
|
-
return !this[r] && !Buffer.isBuffer(t$7) && (J$1(t$7) ? t$7 = Buffer.from(t$7.buffer, t$7.byteOffset, t$7.byteLength) : v$3(t$7) ? t$7 = Buffer.from(t$7) : typeof t$7 != "string" && (this.objectMode = true)), this[r] ? (this.flowing && this[s$8] !== 0 && this[L](true), this.flowing ? this.emit("data", t$7) : this[T$2](t$7), this[s$8] !== 0 && this.emit("readable"), i$8 && l$3(i$8), this.flowing) : t$7.length ? (typeof t$7 == "string" && !(e$7 === this[h$2] && !this[m$4].lastNeed) && (t$7 = Buffer.from(t$7, e$7)), Buffer.isBuffer(t$7) && this[h$2] && (t$7 = this[m$4].write(t$7)), this.flowing && this[s$8] !== 0 && this[L](true), this.flowing ? this.emit("data", t$7) : this[T$2](t$7), this[s$8] !== 0 && this.emit("readable"), i$8 && l$3(i$8), this.flowing) : (this[s$8] !== 0 && this.emit("readable"), i$8 && l$3(i$8), this.flowing);
|
|
1753
|
-
}
|
|
1754
|
-
read(t$7) {
|
|
1755
|
-
if (this[n$4]) return null;
|
|
1756
|
-
if (this[s$8] === 0 || t$7 === 0 || t$7 > this[s$8]) return this[a$11](), null;
|
|
1757
|
-
this[r] && (t$7 = null), this.buffer.length > 1 && !this[r] && (this.encoding ? this.buffer = [this.buffer.join("")] : this.buffer = [Buffer.concat(this.buffer, this[s$8])]);
|
|
1758
|
-
const e$7 = this[P$2](t$7 || null, this.buffer[0]);
|
|
1759
|
-
return this[a$11](), e$7;
|
|
1760
|
-
}
|
|
1761
|
-
[P$2](t$7, e$7) {
|
|
1762
|
-
return t$7 === e$7.length || t$7 === null ? this[B$1]() : (this.buffer[0] = e$7.slice(t$7), e$7 = e$7.slice(0, t$7), this[s$8] -= t$7), this.emit("data", e$7), !this.buffer.length && !this[u$6] && this.emit("drain"), e$7;
|
|
1763
|
-
}
|
|
1764
|
-
end(t$7, e$7, i$8) {
|
|
1765
|
-
return typeof t$7 == "function" && (i$8 = t$7, t$7 = null), typeof e$7 == "function" && (i$8 = e$7, e$7 = "utf8"), t$7 && this.write(t$7, e$7), i$8 && this.once("end", i$8), this[u$6] = true, this.writable = false, (this.flowing || !this[y$4]) && this[a$11](), this;
|
|
1766
|
-
}
|
|
1767
|
-
[p$2]() {
|
|
1768
|
-
this[n$4] || (this[y$4] = false, this[M$1] = true, this.emit("resume"), this.buffer.length ? this[L]() : this[u$6] ? this[a$11]() : this.emit("drain"));
|
|
1769
|
-
}
|
|
1770
|
-
resume() {
|
|
1771
|
-
return this[p$2]();
|
|
1772
|
-
}
|
|
1773
|
-
pause() {
|
|
1774
|
-
this[M$1] = false, this[y$4] = true;
|
|
1775
|
-
}
|
|
1776
|
-
get destroyed() {
|
|
1777
|
-
return this[n$4];
|
|
1778
|
-
}
|
|
1779
|
-
get flowing() {
|
|
1780
|
-
return this[M$1];
|
|
1781
|
-
}
|
|
1782
|
-
get paused() {
|
|
1783
|
-
return this[y$4];
|
|
1784
|
-
}
|
|
1785
|
-
[T$2](t$7) {
|
|
1786
|
-
this[r] ? this[s$8] += 1 : this[s$8] += t$7.length, this.buffer.push(t$7);
|
|
1787
|
-
}
|
|
1788
|
-
[B$1]() {
|
|
1789
|
-
return this.buffer.length && (this[r] ? this[s$8] -= 1 : this[s$8] -= this.buffer[0].length), this.buffer.shift();
|
|
1790
|
-
}
|
|
1791
|
-
[L](t$7) {
|
|
1792
|
-
do ;
|
|
1793
|
-
while (this[_$2](this[B$1]()));
|
|
1794
|
-
!t$7 && !this.buffer.length && !this[u$6] && this.emit("drain");
|
|
1795
|
-
}
|
|
1796
|
-
[_$2](t$7) {
|
|
1797
|
-
return t$7 ? (this.emit("data", t$7), this.flowing) : false;
|
|
1798
|
-
}
|
|
1799
|
-
pipe(t$7, e$7) {
|
|
1800
|
-
if (this[n$4]) return;
|
|
1801
|
-
const i$8 = this[c$6];
|
|
1802
|
-
return e$7 = e$7 || {}, t$7 === I$1.stdout || t$7 === I$1.stderr ? e$7.end = false : e$7.end = e$7.end !== false, e$7.proxyErrors = !!e$7.proxyErrors, i$8 ? e$7.end && t$7.end() : (this.pipes.push(e$7.proxyErrors ? new K$1(this, t$7, e$7) : new U$1(this, t$7, e$7)), this[d$1] ? b$1(() => this[p$2]()) : this[p$2]()), t$7;
|
|
1803
|
-
}
|
|
1804
|
-
unpipe(t$7) {
|
|
1805
|
-
const e$7 = this.pipes.find((i$8) => i$8.dest === t$7);
|
|
1806
|
-
e$7 && (this.pipes.splice(this.pipes.indexOf(e$7), 1), e$7.unpipe());
|
|
1807
|
-
}
|
|
1808
|
-
addListener(t$7, e$7) {
|
|
1809
|
-
return this.on(t$7, e$7);
|
|
1810
|
-
}
|
|
1811
|
-
on(t$7, e$7) {
|
|
1812
|
-
const i$8 = super.on(t$7, e$7);
|
|
1813
|
-
return t$7 === "data" && !this.pipes.length && !this.flowing ? this[p$2]() : t$7 === "readable" && this[s$8] !== 0 ? super.emit("readable") : V$1(t$7) && this[c$6] ? (super.emit(t$7), this.removeAllListeners(t$7)) : t$7 === "error" && this[E$2] && (this[d$1] ? b$1(() => e$7.call(this, this[E$2])) : e$7.call(this, this[E$2])), i$8;
|
|
1814
|
-
}
|
|
1815
|
-
get emittedEnd() {
|
|
1816
|
-
return this[c$6];
|
|
1817
|
-
}
|
|
1818
|
-
[a$11]() {
|
|
1819
|
-
!this[S$2] && !this[c$6] && !this[n$4] && this.buffer.length === 0 && this[u$6] && (this[S$2] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[w$3] && this.emit("close"), this[S$2] = false);
|
|
1820
|
-
}
|
|
1821
|
-
emit(t$7, e$7, ...i$8) {
|
|
1822
|
-
if (t$7 !== "error" && t$7 !== "close" && t$7 !== n$4 && this[n$4]) return;
|
|
1823
|
-
if (t$7 === "data") return e$7 ? this[d$1] ? b$1(() => this[D$1](e$7)) : this[D$1](e$7) : false;
|
|
1824
|
-
if (t$7 === "end") return this[F$4]();
|
|
1825
|
-
if (t$7 === "close") {
|
|
1826
|
-
if (this[w$3] = true, !this[c$6] && !this[n$4]) return;
|
|
1827
|
-
const f$5 = super.emit("close");
|
|
1828
|
-
return this.removeAllListeners("close"), f$5;
|
|
1829
|
-
} else if (t$7 === "error") {
|
|
1830
|
-
this[E$2] = e$7;
|
|
1831
|
-
const f$5 = super.emit("error", e$7);
|
|
1832
|
-
return this[a$11](), f$5;
|
|
1833
|
-
} else if (t$7 === "resume") {
|
|
1834
|
-
const f$5 = super.emit("resume");
|
|
1835
|
-
return this[a$11](), f$5;
|
|
1836
|
-
} else if (t$7 === "finish" || t$7 === "prefinish") {
|
|
1837
|
-
const f$5 = super.emit(t$7);
|
|
1838
|
-
return this.removeAllListeners(t$7), f$5;
|
|
1839
|
-
}
|
|
1840
|
-
const l$3 = super.emit(t$7, e$7, ...i$8);
|
|
1841
|
-
return this[a$11](), l$3;
|
|
1842
|
-
}
|
|
1843
|
-
[D$1](t$7) {
|
|
1844
|
-
for (const i$8 of this.pipes) i$8.dest.write(t$7) === false && this.pause();
|
|
1845
|
-
const e$7 = super.emit("data", t$7);
|
|
1846
|
-
return this[a$11](), e$7;
|
|
1847
|
-
}
|
|
1848
|
-
[F$4]() {
|
|
1849
|
-
this[c$6] || (this[c$6] = true, this.readable = false, this[d$1] ? b$1(() => this[R$3]()) : this[R$3]());
|
|
1850
|
-
}
|
|
1851
|
-
[R$3]() {
|
|
1852
|
-
if (this[m$4]) {
|
|
1853
|
-
const e$7 = this[m$4].end();
|
|
1854
|
-
if (e$7) {
|
|
1855
|
-
for (const i$8 of this.pipes) i$8.dest.write(e$7);
|
|
1856
|
-
super.emit("data", e$7);
|
|
1857
|
-
}
|
|
1858
|
-
}
|
|
1859
|
-
for (const e$7 of this.pipes) e$7.end();
|
|
1860
|
-
const t$7 = super.emit("end");
|
|
1861
|
-
return this.removeAllListeners("end"), t$7;
|
|
1862
|
-
}
|
|
1863
|
-
collect() {
|
|
1864
|
-
const t$7 = [];
|
|
1865
|
-
this[r] || (t$7.dataLength = 0);
|
|
1866
|
-
const e$7 = this.promise();
|
|
1867
|
-
return this.on("data", (i$8) => {
|
|
1868
|
-
t$7.push(i$8), this[r] || (t$7.dataLength += i$8.length);
|
|
1869
|
-
}), e$7.then(() => t$7);
|
|
1870
|
-
}
|
|
1871
|
-
concat() {
|
|
1872
|
-
return this[r] ? Promise.reject(/* @__PURE__ */ new Error("cannot concat in objectMode")) : this.collect().then((t$7) => this[r] ? Promise.reject(/* @__PURE__ */ new Error("cannot concat in objectMode")) : this[h$2] ? t$7.join("") : Buffer.concat(t$7, t$7.dataLength));
|
|
1873
|
-
}
|
|
1874
|
-
promise() {
|
|
1875
|
-
return new Promise((t$7, e$7) => {
|
|
1876
|
-
this.on(n$4, () => e$7(/* @__PURE__ */ new Error("stream destroyed"))), this.on("error", (i$8) => e$7(i$8)), this.on("end", () => t$7());
|
|
1877
|
-
});
|
|
1878
|
-
}
|
|
1879
|
-
[$]() {
|
|
1880
|
-
return { next: () => {
|
|
1881
|
-
const e$7 = this.read();
|
|
1882
|
-
if (e$7 !== null) return Promise.resolve({
|
|
1883
|
-
done: false,
|
|
1884
|
-
value: e$7
|
|
1885
|
-
});
|
|
1886
|
-
if (this[u$6]) return Promise.resolve({ done: true });
|
|
1887
|
-
let i$8 = null, l$3 = null;
|
|
1888
|
-
const f$5 = (g$1) => {
|
|
1889
|
-
this.removeListener("data", A$1), this.removeListener("end", O$4), l$3(g$1);
|
|
1890
|
-
}, A$1 = (g$1) => {
|
|
1891
|
-
this.removeListener("error", f$5), this.removeListener("end", O$4), this.pause(), i$8({
|
|
1892
|
-
value: g$1,
|
|
1893
|
-
done: !!this[u$6]
|
|
1894
|
-
});
|
|
1895
|
-
}, O$4 = () => {
|
|
1896
|
-
this.removeListener("error", f$5), this.removeListener("data", A$1), i$8({ done: true });
|
|
1897
|
-
}, W$1 = () => f$5(/* @__PURE__ */ new Error("stream destroyed"));
|
|
1898
|
-
return new Promise((g$1, z$2) => {
|
|
1899
|
-
l$3 = z$2, i$8 = g$1, this.once(n$4, W$1), this.once("error", f$5), this.once("end", O$4), this.once("data", A$1);
|
|
1900
|
-
});
|
|
1901
|
-
} };
|
|
1902
|
-
}
|
|
1903
|
-
[G$2]() {
|
|
1904
|
-
return { next: () => {
|
|
1905
|
-
const e$7 = this.read();
|
|
1906
|
-
return {
|
|
1907
|
-
value: e$7,
|
|
1908
|
-
done: e$7 === null
|
|
1909
|
-
};
|
|
1910
|
-
} };
|
|
1911
|
-
}
|
|
1912
|
-
destroy(t$7) {
|
|
1913
|
-
return this[n$4] ? (t$7 ? this.emit("error", t$7) : this.emit(n$4), this) : (this[n$4] = true, this.buffer.length = 0, this[s$8] = 0, typeof this.close == "function" && !this[w$3] && this.close(), t$7 ? this.emit("error", t$7) : this.emit(n$4), this);
|
|
1914
|
-
}
|
|
1915
|
-
static isStream(t$7) {
|
|
1916
|
-
return !!t$7 && (t$7 instanceof q$2 || t$7 instanceof x$1 || t$7 instanceof Y && (typeof t$7.pipe == "function" || typeof t$7.write == "function" && typeof t$7.end == "function"));
|
|
1917
|
-
}
|
|
1918
|
-
}, j;
|
|
1919
|
-
}
|
|
1920
|
-
var C;
|
|
1921
|
-
function J() {
|
|
1922
|
-
if (C) return i$3;
|
|
1923
|
-
C = 1;
|
|
1924
|
-
const w$3 = j$1, n$4 = P.Buffer, z$2 = O$2, u$6 = i$3.constants = T(), L = tt(), E$2 = n$4.concat, c$6 = Symbol("_superWrite");
|
|
1925
|
-
class d$1 extends Error {
|
|
1926
|
-
constructor(s$8) {
|
|
1927
|
-
super("zlib: " + s$8.message), this.code = s$8.code, this.errno = s$8.errno, this.code || (this.code = "ZLIB_ERROR"), this.message = "zlib: " + s$8.message, Error.captureStackTrace(this, this.constructor);
|
|
1928
|
-
}
|
|
1929
|
-
get name() {
|
|
1930
|
-
return "ZlibError";
|
|
1931
|
-
}
|
|
1932
|
-
}
|
|
1933
|
-
const Z = Symbol("opts"), p$2 = Symbol("flushFlag"), I$1 = Symbol("finishFlushFlag"), y$4 = Symbol("fullFlushFlag"), t$7 = Symbol("handle"), _$2 = Symbol("onError"), f$5 = Symbol("sawError"), F$4 = Symbol("level"), S$2 = Symbol("strategy"), g$1 = Symbol("ended");
|
|
1934
|
-
class x$1 extends L {
|
|
1935
|
-
constructor(s$8, e$7) {
|
|
1936
|
-
if (!s$8 || typeof s$8 != "object") throw new TypeError("invalid options for ZlibBase constructor");
|
|
1937
|
-
super(s$8), this[f$5] = false, this[g$1] = false, this[Z] = s$8, this[p$2] = s$8.flush, this[I$1] = s$8.finishFlush;
|
|
1938
|
-
try {
|
|
1939
|
-
this[t$7] = new z$2[e$7](s$8);
|
|
1940
|
-
} catch (i$8) {
|
|
1941
|
-
throw new d$1(i$8);
|
|
1942
|
-
}
|
|
1943
|
-
this[_$2] = (i$8) => {
|
|
1944
|
-
this[f$5] || (this[f$5] = true, this.close(), this.emit("error", i$8));
|
|
1945
|
-
}, this[t$7].on("error", (i$8) => this[_$2](new d$1(i$8))), this.once("end", () => this.close);
|
|
1946
|
-
}
|
|
1947
|
-
close() {
|
|
1948
|
-
this[t$7] && (this[t$7].close(), this[t$7] = null, this.emit("close"));
|
|
1949
|
-
}
|
|
1950
|
-
reset() {
|
|
1951
|
-
if (!this[f$5]) return w$3(this[t$7], "zlib binding closed"), this[t$7].reset();
|
|
1952
|
-
}
|
|
1953
|
-
flush(s$8) {
|
|
1954
|
-
this.ended || (typeof s$8 != "number" && (s$8 = this[y$4]), this.write(Object.assign(n$4.alloc(0), { [p$2]: s$8 })));
|
|
1955
|
-
}
|
|
1956
|
-
end(s$8, e$7, i$8) {
|
|
1957
|
-
return s$8 && this.write(s$8, e$7), this.flush(this[I$1]), this[g$1] = true, super.end(null, null, i$8);
|
|
1958
|
-
}
|
|
1959
|
-
get ended() {
|
|
1960
|
-
return this[g$1];
|
|
1961
|
-
}
|
|
1962
|
-
write(s$8, e$7, i$8) {
|
|
1963
|
-
if (typeof e$7 == "function" && (i$8 = e$7, e$7 = "utf8"), typeof s$8 == "string" && (s$8 = n$4.from(s$8, e$7)), this[f$5]) return;
|
|
1964
|
-
w$3(this[t$7], "zlib binding closed");
|
|
1965
|
-
const m$4 = this[t$7]._handle, R$3 = m$4.close;
|
|
1966
|
-
m$4.close = () => {};
|
|
1967
|
-
const G$2 = this[t$7].close;
|
|
1968
|
-
this[t$7].close = () => {}, n$4.concat = (l$3) => l$3;
|
|
1969
|
-
let h$2;
|
|
1970
|
-
try {
|
|
1971
|
-
const l$3 = typeof s$8[p$2] == "number" ? s$8[p$2] : this[p$2];
|
|
1972
|
-
h$2 = this[t$7]._processChunk(s$8, l$3), n$4.concat = E$2;
|
|
1973
|
-
} catch (l$3) {
|
|
1974
|
-
n$4.concat = E$2, this[_$2](new d$1(l$3));
|
|
1975
|
-
} finally {
|
|
1976
|
-
this[t$7] && (this[t$7]._handle = m$4, m$4.close = R$3, this[t$7].close = G$2, this[t$7].removeAllListeners("error"));
|
|
1977
|
-
}
|
|
1978
|
-
this[t$7] && this[t$7].on("error", (l$3) => this[_$2](new d$1(l$3)));
|
|
1979
|
-
let b$1;
|
|
1980
|
-
if (h$2) if (Array.isArray(h$2) && h$2.length > 0) {
|
|
1981
|
-
b$1 = this[c$6](n$4.from(h$2[0]));
|
|
1982
|
-
for (let l$3 = 1; l$3 < h$2.length; l$3++) b$1 = this[c$6](h$2[l$3]);
|
|
1983
|
-
} else b$1 = this[c$6](n$4.from(h$2));
|
|
1984
|
-
return i$8 && i$8(), b$1;
|
|
1985
|
-
}
|
|
1986
|
-
[c$6](s$8) {
|
|
1987
|
-
return super.write(s$8);
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
class a$11 extends x$1 {
|
|
1991
|
-
constructor(s$8, e$7) {
|
|
1992
|
-
s$8 = s$8 || {}, s$8.flush = s$8.flush || u$6.Z_NO_FLUSH, s$8.finishFlush = s$8.finishFlush || u$6.Z_FINISH, super(s$8, e$7), this[y$4] = u$6.Z_FULL_FLUSH, this[F$4] = s$8.level, this[S$2] = s$8.strategy;
|
|
1993
|
-
}
|
|
1994
|
-
params(s$8, e$7) {
|
|
1995
|
-
if (!this[f$5]) {
|
|
1996
|
-
if (!this[t$7]) throw new Error("cannot switch params when binding is closed");
|
|
1997
|
-
if (!this[t$7].params) throw new Error("not supported in this implementation");
|
|
1998
|
-
if (this[F$4] !== s$8 || this[S$2] !== e$7) {
|
|
1999
|
-
this.flush(u$6.Z_SYNC_FLUSH), w$3(this[t$7], "zlib binding closed");
|
|
2000
|
-
const i$8 = this[t$7].flush;
|
|
2001
|
-
this[t$7].flush = (m$4, R$3) => {
|
|
2002
|
-
this.flush(m$4), R$3();
|
|
2003
|
-
};
|
|
2004
|
-
try {
|
|
2005
|
-
this[t$7].params(s$8, e$7);
|
|
2006
|
-
} finally {
|
|
2007
|
-
this[t$7].flush = i$8;
|
|
2008
|
-
}
|
|
2009
|
-
this[t$7] && (this[F$4] = s$8, this[S$2] = e$7);
|
|
2010
|
-
}
|
|
2011
|
-
}
|
|
2012
|
-
}
|
|
2013
|
-
}
|
|
2014
|
-
class q$2 extends a$11 {
|
|
2015
|
-
constructor(s$8) {
|
|
2016
|
-
super(s$8, "Deflate");
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
class D$1 extends a$11 {
|
|
2020
|
-
constructor(s$8) {
|
|
2021
|
-
super(s$8, "Inflate");
|
|
2022
|
-
}
|
|
2023
|
-
}
|
|
2024
|
-
const B$1 = Symbol("_portable");
|
|
2025
|
-
class $ extends a$11 {
|
|
2026
|
-
constructor(s$8) {
|
|
2027
|
-
super(s$8, "Gzip"), this[B$1] = s$8 && !!s$8.portable;
|
|
2028
|
-
}
|
|
2029
|
-
[c$6](s$8) {
|
|
2030
|
-
return this[B$1] ? (this[B$1] = false, s$8[9] = 255, super[c$6](s$8)) : super[c$6](s$8);
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
class N$1 extends a$11 {
|
|
2034
|
-
constructor(s$8) {
|
|
2035
|
-
super(s$8, "Gunzip");
|
|
2036
|
-
}
|
|
2037
|
-
}
|
|
2038
|
-
class H$3 extends a$11 {
|
|
2039
|
-
constructor(s$8) {
|
|
2040
|
-
super(s$8, "DeflateRaw");
|
|
2041
|
-
}
|
|
2042
|
-
}
|
|
2043
|
-
let T$1$1 = class T$2 extends a$11 {
|
|
2044
|
-
constructor(s$8) {
|
|
2045
|
-
super(s$8, "InflateRaw");
|
|
2046
|
-
}
|
|
2047
|
-
};
|
|
2048
|
-
class U$1 extends a$11 {
|
|
2049
|
-
constructor(s$8) {
|
|
2050
|
-
super(s$8, "Unzip");
|
|
2051
|
-
}
|
|
2052
|
-
}
|
|
2053
|
-
class O$4 extends x$1 {
|
|
2054
|
-
constructor(s$8, e$7) {
|
|
2055
|
-
s$8 = s$8 || {}, s$8.flush = s$8.flush || u$6.BROTLI_OPERATION_PROCESS, s$8.finishFlush = s$8.finishFlush || u$6.BROTLI_OPERATION_FINISH, super(s$8, e$7), this[y$4] = u$6.BROTLI_OPERATION_FLUSH;
|
|
2056
|
-
}
|
|
2057
|
-
}
|
|
2058
|
-
class v$3 extends O$4 {
|
|
2059
|
-
constructor(s$8) {
|
|
2060
|
-
super(s$8, "BrotliCompress");
|
|
2061
|
-
}
|
|
2062
|
-
}
|
|
2063
|
-
class A$1 extends O$4 {
|
|
2064
|
-
constructor(s$8) {
|
|
2065
|
-
super(s$8, "BrotliDecompress");
|
|
2066
|
-
}
|
|
2067
|
-
}
|
|
2068
|
-
return i$3.Deflate = q$2, i$3.Inflate = D$1, i$3.Gzip = $, i$3.Gunzip = N$1, i$3.DeflateRaw = H$3, i$3.InflateRaw = T$1$1, i$3.Unzip = U$1, typeof z$2.BrotliCompress == "function" ? (i$3.BrotliCompress = v$3, i$3.BrotliDecompress = A$1) : i$3.BrotliCompress = i$3.BrotliDecompress = class {
|
|
2069
|
-
constructor() {
|
|
2070
|
-
throw new Error("Brotli is not supported in this version of Node.js");
|
|
2071
|
-
}
|
|
2072
|
-
}, i$3;
|
|
2073
|
-
}
|
|
2074
|
-
var O$1, F$2;
|
|
2075
|
-
function rt() {
|
|
2076
|
-
if (F$2) return O$1;
|
|
2077
|
-
F$2 = 1;
|
|
2078
|
-
const P$2 = c$4(), $ = E(), v$3 = nt, W$1 = c$3(), G$2 = 1024 * 1024, k$2 = u$3(), C$2 = f$2(), x$1 = J(), { nextTick: j$3 } = nt$1, B$1 = Buffer.from([31, 139]), h$2 = Symbol("state"), d$1 = Symbol("writeEntry"), a$11 = Symbol("readEntry"), I$1 = Symbol("nextEntry"), U$1 = Symbol("processEntry"), l$3 = Symbol("extendedHeader"), y$4 = Symbol("globalExtendedHeader"), c$6 = Symbol("meta"), H$3 = Symbol("emitMeta"), n$4 = Symbol("buffer"), f$5 = Symbol("queue"), u$6 = Symbol("ended"), L = Symbol("emittedEnd"), b$1 = Symbol("emit"), r = Symbol("unzip"), _$2 = Symbol("consumeChunk"), g$1 = Symbol("consumeChunkSub"), q$2 = Symbol("consumeBody"), z$2 = Symbol("consumeMeta"), Y = Symbol("consumeHeader"), N$1 = Symbol("consuming"), D$1 = Symbol("bufferConcat"), M$1 = Symbol("maybeEnd"), S$2 = Symbol("writing"), m$4 = Symbol("aborted"), T$2 = Symbol("onDone"), E$1$1 = Symbol("sawValidEntry"), R$3 = Symbol("sawNullBlock"), A$1 = Symbol("sawEOF"), V$1 = Symbol("closeStream"), K$1 = (X$2) => true;
|
|
2079
|
-
return O$1 = P$2(class extends v$3 {
|
|
2080
|
-
constructor(t$7) {
|
|
2081
|
-
t$7 = t$7 || {}, super(t$7), this.file = t$7.file || "", this[E$1$1] = null, this.on(T$2, (s$8) => {
|
|
2082
|
-
(this[h$2] === "begin" || this[E$1$1] === false) && this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format");
|
|
2083
|
-
}), t$7.ondone ? this.on(T$2, t$7.ondone) : this.on(T$2, (s$8) => {
|
|
2084
|
-
this.emit("prefinish"), this.emit("finish"), this.emit("end");
|
|
2085
|
-
}), this.strict = !!t$7.strict, this.maxMetaEntrySize = t$7.maxMetaEntrySize || G$2, this.filter = typeof t$7.filter == "function" ? t$7.filter : K$1;
|
|
2086
|
-
const i$8 = t$7.file && (t$7.file.endsWith(".tar.br") || t$7.file.endsWith(".tbr"));
|
|
2087
|
-
this.brotli = !t$7.gzip && t$7.brotli !== void 0 ? t$7.brotli : i$8 ? void 0 : false, this.writable = true, this.readable = false, this[f$5] = new W$1(), this[n$4] = null, this[a$11] = null, this[d$1] = null, this[h$2] = "begin", this[c$6] = "", this[l$3] = null, this[y$4] = null, this[u$6] = false, this[r] = null, this[m$4] = false, this[R$3] = false, this[A$1] = false, this.on("end", () => this[V$1]()), typeof t$7.onwarn == "function" && this.on("warn", t$7.onwarn), typeof t$7.onentry == "function" && this.on("entry", t$7.onentry);
|
|
2088
|
-
}
|
|
2089
|
-
[Y](t$7, i$8) {
|
|
2090
|
-
this[E$1$1] === null && (this[E$1$1] = false);
|
|
2091
|
-
let s$8;
|
|
2092
|
-
try {
|
|
2093
|
-
s$8 = new $(t$7, i$8, this[l$3], this[y$4]);
|
|
2094
|
-
} catch (o$6) {
|
|
2095
|
-
return this.warn("TAR_ENTRY_INVALID", o$6);
|
|
2096
|
-
}
|
|
2097
|
-
if (s$8.nullBlock) this[R$3] ? (this[A$1] = true, this[h$2] === "begin" && (this[h$2] = "header"), this[b$1]("eof")) : (this[R$3] = true, this[b$1]("nullBlock"));
|
|
2098
|
-
else if (this[R$3] = false, !s$8.cksumValid) this.warn("TAR_ENTRY_INVALID", "checksum failure", { header: s$8 });
|
|
2099
|
-
else if (!s$8.path) this.warn("TAR_ENTRY_INVALID", "path is required", { header: s$8 });
|
|
2100
|
-
else {
|
|
2101
|
-
const o$6 = s$8.type;
|
|
2102
|
-
if (/^(Symbolic)?Link$/.test(o$6) && !s$8.linkpath) this.warn("TAR_ENTRY_INVALID", "linkpath required", { header: s$8 });
|
|
2103
|
-
else if (!/^(Symbolic)?Link$/.test(o$6) && s$8.linkpath) this.warn("TAR_ENTRY_INVALID", "linkpath forbidden", { header: s$8 });
|
|
2104
|
-
else {
|
|
2105
|
-
const e$7 = this[d$1] = new k$2(s$8, this[l$3], this[y$4]);
|
|
2106
|
-
if (!this[E$1$1]) if (e$7.remain) {
|
|
2107
|
-
const w$3 = () => {
|
|
2108
|
-
e$7.invalid || (this[E$1$1] = true);
|
|
2109
|
-
};
|
|
2110
|
-
e$7.on("end", w$3);
|
|
2111
|
-
} else this[E$1$1] = true;
|
|
2112
|
-
e$7.meta ? e$7.size > this.maxMetaEntrySize ? (e$7.ignore = true, this[b$1]("ignoredEntry", e$7), this[h$2] = "ignore", e$7.resume()) : e$7.size > 0 && (this[c$6] = "", e$7.on("data", (w$3) => this[c$6] += w$3), this[h$2] = "meta") : (this[l$3] = null, e$7.ignore = e$7.ignore || !this.filter(e$7.path, e$7), e$7.ignore ? (this[b$1]("ignoredEntry", e$7), this[h$2] = e$7.remain ? "ignore" : "header", e$7.resume()) : (e$7.remain ? this[h$2] = "body" : (this[h$2] = "header", e$7.end()), this[a$11] ? this[f$5].push(e$7) : (this[f$5].push(e$7), this[I$1]())));
|
|
2113
|
-
}
|
|
2114
|
-
}
|
|
2115
|
-
}
|
|
2116
|
-
[V$1]() {
|
|
2117
|
-
j$3(() => this.emit("close"));
|
|
2118
|
-
}
|
|
2119
|
-
[U$1](t$7) {
|
|
2120
|
-
let i$8 = true;
|
|
2121
|
-
return t$7 ? Array.isArray(t$7) ? this.emit.apply(this, t$7) : (this[a$11] = t$7, this.emit("entry", t$7), t$7.emittedEnd || (t$7.on("end", (s$8) => this[I$1]()), i$8 = false)) : (this[a$11] = null, i$8 = false), i$8;
|
|
2122
|
-
}
|
|
2123
|
-
[I$1]() {
|
|
2124
|
-
do ;
|
|
2125
|
-
while (this[U$1](this[f$5].shift()));
|
|
2126
|
-
if (!this[f$5].length) {
|
|
2127
|
-
const t$7 = this[a$11];
|
|
2128
|
-
!t$7 || t$7.flowing || t$7.size === t$7.remain ? this[S$2] || this.emit("drain") : t$7.once("drain", (s$8) => this.emit("drain"));
|
|
2129
|
-
}
|
|
2130
|
-
}
|
|
2131
|
-
[q$2](t$7, i$8) {
|
|
2132
|
-
const s$8 = this[d$1], o$6 = s$8.blockRemain, e$7 = o$6 >= t$7.length && i$8 === 0 ? t$7 : t$7.slice(i$8, i$8 + o$6);
|
|
2133
|
-
return s$8.write(e$7), s$8.blockRemain || (this[h$2] = "header", this[d$1] = null, s$8.end()), e$7.length;
|
|
2134
|
-
}
|
|
2135
|
-
[z$2](t$7, i$8) {
|
|
2136
|
-
const s$8 = this[d$1], o$6 = this[q$2](t$7, i$8);
|
|
2137
|
-
return this[d$1] || this[H$3](s$8), o$6;
|
|
2138
|
-
}
|
|
2139
|
-
[b$1](t$7, i$8, s$8) {
|
|
2140
|
-
!this[f$5].length && !this[a$11] ? this.emit(t$7, i$8, s$8) : this[f$5].push([
|
|
2141
|
-
t$7,
|
|
2142
|
-
i$8,
|
|
2143
|
-
s$8
|
|
2144
|
-
]);
|
|
2145
|
-
}
|
|
2146
|
-
[H$3](t$7) {
|
|
2147
|
-
switch (this[b$1]("meta", this[c$6]), t$7.type) {
|
|
2148
|
-
case "ExtendedHeader":
|
|
2149
|
-
case "OldExtendedHeader":
|
|
2150
|
-
this[l$3] = C$2.parse(this[c$6], this[l$3], false);
|
|
2151
|
-
break;
|
|
2152
|
-
case "GlobalExtendedHeader":
|
|
2153
|
-
this[y$4] = C$2.parse(this[c$6], this[y$4], true);
|
|
2154
|
-
break;
|
|
2155
|
-
case "NextFileHasLongPath":
|
|
2156
|
-
case "OldGnuLongPath":
|
|
2157
|
-
this[l$3] = this[l$3] || Object.create(null), this[l$3].path = this[c$6].replace(/\0.*/, "");
|
|
2158
|
-
break;
|
|
2159
|
-
case "NextFileHasLongLinkpath":
|
|
2160
|
-
this[l$3] = this[l$3] || Object.create(null), this[l$3].linkpath = this[c$6].replace(/\0.*/, "");
|
|
2161
|
-
break;
|
|
2162
|
-
default: throw new Error("unknown meta: " + t$7.type);
|
|
2163
|
-
}
|
|
2164
|
-
}
|
|
2165
|
-
abort(t$7) {
|
|
2166
|
-
this[m$4] = true, this.emit("abort", t$7), this.warn("TAR_ABORT", t$7, { recoverable: false });
|
|
2167
|
-
}
|
|
2168
|
-
write(t$7) {
|
|
2169
|
-
if (this[m$4]) return;
|
|
2170
|
-
if ((this[r] === null || this.brotli === void 0 && this[r] === false) && t$7) {
|
|
2171
|
-
if (this[n$4] && (t$7 = Buffer.concat([this[n$4], t$7]), this[n$4] = null), t$7.length < B$1.length) return this[n$4] = t$7, true;
|
|
2172
|
-
for (let e$7 = 0; this[r] === null && e$7 < B$1.length; e$7++) t$7[e$7] !== B$1[e$7] && (this[r] = false);
|
|
2173
|
-
const o$6 = this.brotli === void 0;
|
|
2174
|
-
if (this[r] === false && o$6) if (t$7.length < 512) if (this[u$6]) this.brotli = true;
|
|
2175
|
-
else return this[n$4] = t$7, true;
|
|
2176
|
-
else try {
|
|
2177
|
-
new $(t$7.slice(0, 512)), this.brotli = !1;
|
|
2178
|
-
} catch {
|
|
2179
|
-
this.brotli = true;
|
|
2180
|
-
}
|
|
2181
|
-
if (this[r] === null || this[r] === false && this.brotli) {
|
|
2182
|
-
const e$7 = this[u$6];
|
|
2183
|
-
this[u$6] = false, this[r] = this[r] === null ? new x$1.Unzip() : new x$1.BrotliDecompress(), this[r].on("data", (p$2) => this[_$2](p$2)), this[r].on("error", (p$2) => this.abort(p$2)), this[r].on("end", (p$2) => {
|
|
2184
|
-
this[u$6] = true, this[_$2]();
|
|
2185
|
-
}), this[S$2] = true;
|
|
2186
|
-
const w$3 = this[r][e$7 ? "end" : "write"](t$7);
|
|
2187
|
-
return this[S$2] = false, w$3;
|
|
2188
|
-
}
|
|
2189
|
-
}
|
|
2190
|
-
this[S$2] = true, this[r] ? this[r].write(t$7) : this[_$2](t$7), this[S$2] = false;
|
|
2191
|
-
const s$8 = this[f$5].length ? false : this[a$11] ? this[a$11].flowing : true;
|
|
2192
|
-
return !s$8 && !this[f$5].length && this[a$11].once("drain", (o$6) => this.emit("drain")), s$8;
|
|
2193
|
-
}
|
|
2194
|
-
[D$1](t$7) {
|
|
2195
|
-
t$7 && !this[m$4] && (this[n$4] = this[n$4] ? Buffer.concat([this[n$4], t$7]) : t$7);
|
|
2196
|
-
}
|
|
2197
|
-
[M$1]() {
|
|
2198
|
-
if (this[u$6] && !this[L] && !this[m$4] && !this[N$1]) {
|
|
2199
|
-
this[L] = true;
|
|
2200
|
-
const t$7 = this[d$1];
|
|
2201
|
-
if (t$7 && t$7.blockRemain) {
|
|
2202
|
-
const i$8 = this[n$4] ? this[n$4].length : 0;
|
|
2203
|
-
this.warn("TAR_BAD_ARCHIVE", `Truncated input (needed ${t$7.blockRemain} more bytes, only ${i$8} available)`, { entry: t$7 }), this[n$4] && t$7.write(this[n$4]), t$7.end();
|
|
2204
|
-
}
|
|
2205
|
-
this[b$1](T$2);
|
|
2206
|
-
}
|
|
2207
|
-
}
|
|
2208
|
-
[_$2](t$7) {
|
|
2209
|
-
if (this[N$1]) this[D$1](t$7);
|
|
2210
|
-
else if (!t$7 && !this[n$4]) this[M$1]();
|
|
2211
|
-
else {
|
|
2212
|
-
if (this[N$1] = true, this[n$4]) {
|
|
2213
|
-
this[D$1](t$7);
|
|
2214
|
-
const i$8 = this[n$4];
|
|
2215
|
-
this[n$4] = null, this[g$1](i$8);
|
|
2216
|
-
} else this[g$1](t$7);
|
|
2217
|
-
for (; this[n$4] && this[n$4].length >= 512 && !this[m$4] && !this[A$1];) {
|
|
2218
|
-
const i$8 = this[n$4];
|
|
2219
|
-
this[n$4] = null, this[g$1](i$8);
|
|
2220
|
-
}
|
|
2221
|
-
this[N$1] = false;
|
|
2222
|
-
}
|
|
2223
|
-
(!this[n$4] || this[u$6]) && this[M$1]();
|
|
2224
|
-
}
|
|
2225
|
-
[g$1](t$7) {
|
|
2226
|
-
let i$8 = 0;
|
|
2227
|
-
const s$8 = t$7.length;
|
|
2228
|
-
for (; i$8 + 512 <= s$8 && !this[m$4] && !this[A$1];) switch (this[h$2]) {
|
|
2229
|
-
case "begin":
|
|
2230
|
-
case "header":
|
|
2231
|
-
this[Y](t$7, i$8), i$8 += 512;
|
|
2232
|
-
break;
|
|
2233
|
-
case "ignore":
|
|
2234
|
-
case "body":
|
|
2235
|
-
i$8 += this[q$2](t$7, i$8);
|
|
2236
|
-
break;
|
|
2237
|
-
case "meta":
|
|
2238
|
-
i$8 += this[z$2](t$7, i$8);
|
|
2239
|
-
break;
|
|
2240
|
-
default: throw new Error("invalid state: " + this[h$2]);
|
|
2241
|
-
}
|
|
2242
|
-
i$8 < s$8 && (this[n$4] ? this[n$4] = Buffer.concat([t$7.slice(i$8), this[n$4]]) : this[n$4] = t$7.slice(i$8));
|
|
2243
|
-
}
|
|
2244
|
-
end(t$7) {
|
|
2245
|
-
this[m$4] || (this[r] ? this[r].end(t$7) : (this[u$6] = true, this.brotli === void 0 && (t$7 = t$7 || Buffer.alloc(0)), this.write(t$7)));
|
|
2246
|
-
}
|
|
2247
|
-
}), O$1;
|
|
2248
|
-
}
|
|
2249
|
-
var s$4 = {};
|
|
2250
|
-
var v$1;
|
|
2251
|
-
function X() {
|
|
2252
|
-
if (v$1) return s$4;
|
|
2253
|
-
v$1 = 1;
|
|
2254
|
-
const H$3 = tt(), I$1 = nt.EventEmitter, r = nativeFs;
|
|
2255
|
-
let R$3 = r.writev;
|
|
2256
|
-
if (!R$3) {
|
|
2257
|
-
const c$6 = process.binding("fs"), t$7 = c$6.FSReqWrap || c$6.FSReqCallback;
|
|
2258
|
-
R$3 = (e$7, i$8, $, A$1) => {
|
|
2259
|
-
const G$2 = (J$1, K$1) => A$1(J$1, K$1, i$8), j$3 = new t$7();
|
|
2260
|
-
j$3.oncomplete = G$2, c$6.writeBuffers(e$7, i$8, $, j$3);
|
|
2261
|
-
};
|
|
2262
|
-
}
|
|
2263
|
-
const m$4 = Symbol("_autoClose"), h$2 = Symbol("_close"), g$1 = Symbol("_ended"), s$8 = Symbol("_fd"), B$1 = Symbol("_finished"), o$6 = Symbol("_flags"), x$1 = Symbol("_flush"), z$2 = Symbol("_handleChunk"), T$2 = Symbol("_makeBuf"), q$2 = Symbol("_mode"), E$2 = Symbol("_needDrain"), d$1 = Symbol("_onerror"), y$4 = Symbol("_onopen"), W$1 = Symbol("_onread"), _$2 = Symbol("_onwrite"), a$11 = Symbol("_open"), l$3 = Symbol("_path"), u$6 = Symbol("_pos"), n$4 = Symbol("_queue"), S$2 = Symbol("_read"), M$1 = Symbol("_readSize"), f$5 = Symbol("_reading"), k$2 = Symbol("_remain"), N$1 = Symbol("_size"), C$2 = Symbol("_write"), b$1 = Symbol("_writing"), F$4 = Symbol("_defaultFlag"), p$2 = Symbol("_errored");
|
|
2264
|
-
class D$1 extends H$3 {
|
|
2265
|
-
constructor(t$7, e$7) {
|
|
2266
|
-
if (e$7 = e$7 || {}, super(e$7), this.readable = true, this.writable = false, typeof t$7 != "string") throw new TypeError("path must be a string");
|
|
2267
|
-
this[p$2] = false, this[s$8] = typeof e$7.fd == "number" ? e$7.fd : null, this[l$3] = t$7, this[M$1] = e$7.readSize || 16 * 1024 * 1024, this[f$5] = false, this[N$1] = typeof e$7.size == "number" ? e$7.size : Infinity, this[k$2] = this[N$1], this[m$4] = typeof e$7.autoClose == "boolean" ? e$7.autoClose : true, typeof this[s$8] == "number" ? this[S$2]() : this[a$11]();
|
|
2268
|
-
}
|
|
2269
|
-
get fd() {
|
|
2270
|
-
return this[s$8];
|
|
2271
|
-
}
|
|
2272
|
-
get path() {
|
|
2273
|
-
return this[l$3];
|
|
2274
|
-
}
|
|
2275
|
-
write() {
|
|
2276
|
-
throw new TypeError("this is a readable stream");
|
|
2277
|
-
}
|
|
2278
|
-
end() {
|
|
2279
|
-
throw new TypeError("this is a readable stream");
|
|
2280
|
-
}
|
|
2281
|
-
[a$11]() {
|
|
2282
|
-
r.open(this[l$3], "r", (t$7, e$7) => this[y$4](t$7, e$7));
|
|
2283
|
-
}
|
|
2284
|
-
[y$4](t$7, e$7) {
|
|
2285
|
-
t$7 ? this[d$1](t$7) : (this[s$8] = e$7, this.emit("open", e$7), this[S$2]());
|
|
2286
|
-
}
|
|
2287
|
-
[T$2]() {
|
|
2288
|
-
return Buffer.allocUnsafe(Math.min(this[M$1], this[k$2]));
|
|
2289
|
-
}
|
|
2290
|
-
[S$2]() {
|
|
2291
|
-
if (!this[f$5]) {
|
|
2292
|
-
this[f$5] = true;
|
|
2293
|
-
const t$7 = this[T$2]();
|
|
2294
|
-
if (t$7.length === 0) return process.nextTick(() => this[W$1](null, 0, t$7));
|
|
2295
|
-
r.read(this[s$8], t$7, 0, t$7.length, null, (e$7, i$8, $) => this[W$1](e$7, i$8, $));
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
[W$1](t$7, e$7, i$8) {
|
|
2299
|
-
this[f$5] = false, t$7 ? this[d$1](t$7) : this[z$2](e$7, i$8) && this[S$2]();
|
|
2300
|
-
}
|
|
2301
|
-
[h$2]() {
|
|
2302
|
-
if (this[m$4] && typeof this[s$8] == "number") {
|
|
2303
|
-
const t$7 = this[s$8];
|
|
2304
|
-
this[s$8] = null, r.close(t$7, (e$7) => e$7 ? this.emit("error", e$7) : this.emit("close"));
|
|
2305
|
-
}
|
|
2306
|
-
}
|
|
2307
|
-
[d$1](t$7) {
|
|
2308
|
-
this[f$5] = true, this[h$2](), this.emit("error", t$7);
|
|
2309
|
-
}
|
|
2310
|
-
[z$2](t$7, e$7) {
|
|
2311
|
-
let i$8 = false;
|
|
2312
|
-
return this[k$2] -= t$7, t$7 > 0 && (i$8 = super.write(t$7 < e$7.length ? e$7.slice(0, t$7) : e$7)), (t$7 === 0 || this[k$2] <= 0) && (i$8 = false, this[h$2](), super.end()), i$8;
|
|
2313
|
-
}
|
|
2314
|
-
emit(t$7, e$7) {
|
|
2315
|
-
switch (t$7) {
|
|
2316
|
-
case "prefinish":
|
|
2317
|
-
case "finish": break;
|
|
2318
|
-
case "drain":
|
|
2319
|
-
typeof this[s$8] == "number" && this[S$2]();
|
|
2320
|
-
break;
|
|
2321
|
-
case "error": return this[p$2] ? void 0 : (this[p$2] = true, super.emit(t$7, e$7));
|
|
2322
|
-
default: return super.emit(t$7, e$7);
|
|
2323
|
-
}
|
|
2324
|
-
}
|
|
2325
|
-
}
|
|
2326
|
-
class P$2 extends D$1 {
|
|
2327
|
-
[a$11]() {
|
|
2328
|
-
let t$7 = true;
|
|
2329
|
-
try {
|
|
2330
|
-
this[y$4](null, r.openSync(this[l$3], "r")), t$7 = !1;
|
|
2331
|
-
} finally {
|
|
2332
|
-
t$7 && this[h$2]();
|
|
2333
|
-
}
|
|
2334
|
-
}
|
|
2335
|
-
[S$2]() {
|
|
2336
|
-
let t$7 = true;
|
|
2337
|
-
try {
|
|
2338
|
-
if (!this[f$5]) {
|
|
2339
|
-
this[f$5] = !0;
|
|
2340
|
-
do {
|
|
2341
|
-
const e$7 = this[T$2](), i$8 = e$7.length === 0 ? 0 : r.readSync(this[s$8], e$7, 0, e$7.length, null);
|
|
2342
|
-
if (!this[z$2](i$8, e$7)) break;
|
|
2343
|
-
} while (!0);
|
|
2344
|
-
this[f$5] = !1;
|
|
2345
|
-
}
|
|
2346
|
-
t$7 = !1;
|
|
2347
|
-
} finally {
|
|
2348
|
-
t$7 && this[h$2]();
|
|
2349
|
-
}
|
|
2350
|
-
}
|
|
2351
|
-
[h$2]() {
|
|
2352
|
-
if (this[m$4] && typeof this[s$8] == "number") {
|
|
2353
|
-
const t$7 = this[s$8];
|
|
2354
|
-
this[s$8] = null, r.closeSync(t$7), this.emit("close");
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
}
|
|
2358
|
-
class O$4 extends I$1 {
|
|
2359
|
-
constructor(t$7, e$7) {
|
|
2360
|
-
e$7 = e$7 || {}, super(e$7), this.readable = false, this.writable = true, this[p$2] = false, this[b$1] = false, this[g$1] = false, this[E$2] = false, this[n$4] = [], this[l$3] = t$7, this[s$8] = typeof e$7.fd == "number" ? e$7.fd : null, this[q$2] = e$7.mode === void 0 ? 438 : e$7.mode, this[u$6] = typeof e$7.start == "number" ? e$7.start : null, this[m$4] = typeof e$7.autoClose == "boolean" ? e$7.autoClose : true;
|
|
2361
|
-
const i$8 = this[u$6] !== null ? "r+" : "w";
|
|
2362
|
-
this[F$4] = e$7.flags === void 0, this[o$6] = this[F$4] ? i$8 : e$7.flags, this[s$8] === null && this[a$11]();
|
|
2363
|
-
}
|
|
2364
|
-
emit(t$7, e$7) {
|
|
2365
|
-
if (t$7 === "error") {
|
|
2366
|
-
if (this[p$2]) return;
|
|
2367
|
-
this[p$2] = true;
|
|
2368
|
-
}
|
|
2369
|
-
return super.emit(t$7, e$7);
|
|
2370
|
-
}
|
|
2371
|
-
get fd() {
|
|
2372
|
-
return this[s$8];
|
|
2373
|
-
}
|
|
2374
|
-
get path() {
|
|
2375
|
-
return this[l$3];
|
|
2376
|
-
}
|
|
2377
|
-
[d$1](t$7) {
|
|
2378
|
-
this[h$2](), this[b$1] = true, this.emit("error", t$7);
|
|
2379
|
-
}
|
|
2380
|
-
[a$11]() {
|
|
2381
|
-
r.open(this[l$3], this[o$6], this[q$2], (t$7, e$7) => this[y$4](t$7, e$7));
|
|
2382
|
-
}
|
|
2383
|
-
[y$4](t$7, e$7) {
|
|
2384
|
-
this[F$4] && this[o$6] === "r+" && t$7 && t$7.code === "ENOENT" ? (this[o$6] = "w", this[a$11]()) : t$7 ? this[d$1](t$7) : (this[s$8] = e$7, this.emit("open", e$7), this[x$1]());
|
|
2385
|
-
}
|
|
2386
|
-
end(t$7, e$7) {
|
|
2387
|
-
return t$7 && this.write(t$7, e$7), this[g$1] = true, !this[b$1] && !this[n$4].length && typeof this[s$8] == "number" && this[_$2](null, 0), this;
|
|
2388
|
-
}
|
|
2389
|
-
write(t$7, e$7) {
|
|
2390
|
-
return typeof t$7 == "string" && (t$7 = Buffer.from(t$7, e$7)), this[g$1] ? (this.emit("error", /* @__PURE__ */ new Error("write() after end()")), false) : this[s$8] === null || this[b$1] || this[n$4].length ? (this[n$4].push(t$7), this[E$2] = true, false) : (this[b$1] = true, this[C$2](t$7), true);
|
|
2391
|
-
}
|
|
2392
|
-
[C$2](t$7) {
|
|
2393
|
-
r.write(this[s$8], t$7, 0, t$7.length, this[u$6], (e$7, i$8) => this[_$2](e$7, i$8));
|
|
2394
|
-
}
|
|
2395
|
-
[_$2](t$7, e$7) {
|
|
2396
|
-
t$7 ? this[d$1](t$7) : (this[u$6] !== null && (this[u$6] += e$7), this[n$4].length ? this[x$1]() : (this[b$1] = false, this[g$1] && !this[B$1] ? (this[B$1] = true, this[h$2](), this.emit("finish")) : this[E$2] && (this[E$2] = false, this.emit("drain"))));
|
|
2397
|
-
}
|
|
2398
|
-
[x$1]() {
|
|
2399
|
-
if (this[n$4].length === 0) this[g$1] && this[_$2](null, 0);
|
|
2400
|
-
else if (this[n$4].length === 1) this[C$2](this[n$4].pop());
|
|
2401
|
-
else {
|
|
2402
|
-
const t$7 = this[n$4];
|
|
2403
|
-
this[n$4] = [], R$3(this[s$8], t$7, this[u$6], (e$7, i$8) => this[_$2](e$7, i$8));
|
|
2404
|
-
}
|
|
2405
|
-
}
|
|
2406
|
-
[h$2]() {
|
|
2407
|
-
if (this[m$4] && typeof this[s$8] == "number") {
|
|
2408
|
-
const t$7 = this[s$8];
|
|
2409
|
-
this[s$8] = null, r.close(t$7, (e$7) => e$7 ? this.emit("error", e$7) : this.emit("close"));
|
|
2410
|
-
}
|
|
2411
|
-
}
|
|
2412
|
-
}
|
|
2413
|
-
class U$1 extends O$4 {
|
|
2414
|
-
[a$11]() {
|
|
2415
|
-
let t$7;
|
|
2416
|
-
if (this[F$4] && this[o$6] === "r+") try {
|
|
2417
|
-
t$7 = r.openSync(this[l$3], this[o$6], this[q$2]);
|
|
2418
|
-
} catch (e$7) {
|
|
2419
|
-
if (e$7.code === "ENOENT") return this[o$6] = "w", this[a$11]();
|
|
2420
|
-
throw e$7;
|
|
2421
|
-
}
|
|
2422
|
-
else t$7 = r.openSync(this[l$3], this[o$6], this[q$2]);
|
|
2423
|
-
this[y$4](null, t$7);
|
|
2424
|
-
}
|
|
2425
|
-
[h$2]() {
|
|
2426
|
-
if (this[m$4] && typeof this[s$8] == "number") {
|
|
2427
|
-
const t$7 = this[s$8];
|
|
2428
|
-
this[s$8] = null, r.closeSync(t$7), this.emit("close");
|
|
2429
|
-
}
|
|
2430
|
-
}
|
|
2431
|
-
[C$2](t$7) {
|
|
2432
|
-
let e$7 = true;
|
|
2433
|
-
try {
|
|
2434
|
-
this[_$2](null, r.writeSync(this[s$8], t$7, 0, t$7.length, this[u$6])), e$7 = !1;
|
|
2435
|
-
} finally {
|
|
2436
|
-
if (e$7) try {
|
|
2437
|
-
this[h$2]();
|
|
2438
|
-
} catch {}
|
|
2439
|
-
}
|
|
2440
|
-
}
|
|
2441
|
-
}
|
|
2442
|
-
return s$4.ReadStream = D$1, s$4.ReadStreamSync = P$2, s$4.WriteStream = O$4, s$4.WriteStreamSync = U$1, s$4;
|
|
2443
|
-
}
|
|
2444
|
-
var r$1 = { exports: {} };
|
|
2445
|
-
var i$2, m$2;
|
|
2446
|
-
function t$2() {
|
|
2447
|
-
if (m$2) return i$2;
|
|
2448
|
-
m$2 = 1;
|
|
2449
|
-
const { promisify: n$4 } = a$a, e$7 = nativeFs;
|
|
2450
|
-
return i$2 = (r) => {
|
|
2451
|
-
if (!r) r = {
|
|
2452
|
-
mode: 511,
|
|
2453
|
-
fs: e$7
|
|
2454
|
-
};
|
|
2455
|
-
else if (typeof r == "object") r = {
|
|
2456
|
-
mode: 511,
|
|
2457
|
-
fs: e$7,
|
|
2458
|
-
...r
|
|
2459
|
-
};
|
|
2460
|
-
else if (typeof r == "number") r = {
|
|
2461
|
-
mode: r,
|
|
2462
|
-
fs: e$7
|
|
2463
|
-
};
|
|
2464
|
-
else if (typeof r == "string") r = {
|
|
2465
|
-
mode: parseInt(r, 8),
|
|
2466
|
-
fs: e$7
|
|
2467
|
-
};
|
|
2468
|
-
else throw new TypeError("invalid options argument");
|
|
2469
|
-
return r.mkdir = r.mkdir || r.fs.mkdir || e$7.mkdir, r.mkdirAsync = n$4(r.mkdir), r.stat = r.stat || r.fs.stat || e$7.stat, r.statAsync = n$4(r.stat), r.statSync = r.statSync || r.fs.statSync || e$7.statSync, r.mkdirSync = r.mkdirSync || r.fs.mkdirSync || e$7.mkdirSync, r;
|
|
2470
|
-
}, i$2;
|
|
2471
|
-
}
|
|
2472
|
-
var e$1, t$1;
|
|
2473
|
-
function u$2() {
|
|
2474
|
-
if (t$1) return e$1;
|
|
2475
|
-
t$1 = 1;
|
|
2476
|
-
const s$8 = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform, { resolve: o$6, parse: n$4 } = path;
|
|
2477
|
-
return e$1 = (r) => {
|
|
2478
|
-
if (/\0/.test(r)) throw Object.assign(/* @__PURE__ */ new TypeError("path must be a string without null bytes"), {
|
|
2479
|
-
path: r,
|
|
2480
|
-
code: "ERR_INVALID_ARG_VALUE"
|
|
2481
|
-
});
|
|
2482
|
-
if (r = o$6(r), s$8 === "win32") {
|
|
2483
|
-
const i$8 = /[*|"<>?:]/, { root: a$11 } = n$4(r);
|
|
2484
|
-
if (i$8.test(r.substr(a$11.length))) throw Object.assign(/* @__PURE__ */ new Error("Illegal characters in path."), {
|
|
2485
|
-
path: r,
|
|
2486
|
-
code: "EINVAL"
|
|
2487
|
-
});
|
|
2488
|
-
}
|
|
2489
|
-
return r;
|
|
2490
|
-
}, e$1;
|
|
2491
|
-
}
|
|
2492
|
-
var i$1, c$2;
|
|
2493
|
-
function t() {
|
|
2494
|
-
if (c$2) return i$1;
|
|
2495
|
-
c$2 = 1;
|
|
2496
|
-
const { dirname: u$6 } = path, f$5 = (r, e$7, n$4 = void 0) => n$4 === e$7 ? Promise.resolve() : r.statAsync(e$7).then((d$1) => d$1.isDirectory() ? n$4 : void 0, (d$1) => d$1.code === "ENOENT" ? f$5(r, u$6(e$7), e$7) : void 0), o$6 = (r, e$7, n$4 = void 0) => {
|
|
2497
|
-
if (n$4 !== e$7) try {
|
|
2498
|
-
return r.statSync(e$7).isDirectory() ? n$4 : void 0;
|
|
2499
|
-
} catch (d$1) {
|
|
2500
|
-
return d$1.code === "ENOENT" ? o$6(r, u$6(e$7), e$7) : void 0;
|
|
2501
|
-
}
|
|
2502
|
-
};
|
|
2503
|
-
return i$1 = {
|
|
2504
|
-
findMade: f$5,
|
|
2505
|
-
findMadeSync: o$6
|
|
2506
|
-
}, i$1;
|
|
2507
|
-
}
|
|
2508
|
-
var o$3, a$4;
|
|
2509
|
-
function y$2() {
|
|
2510
|
-
if (a$4) return o$3;
|
|
2511
|
-
a$4 = 1;
|
|
2512
|
-
const { dirname: f$5 } = path, t$7 = (n$4, e$7, c$6) => {
|
|
2513
|
-
e$7.recursive = false;
|
|
2514
|
-
const i$8 = f$5(n$4);
|
|
2515
|
-
return i$8 === n$4 ? e$7.mkdirAsync(n$4, e$7).catch((r) => {
|
|
2516
|
-
if (r.code !== "EISDIR") throw r;
|
|
2517
|
-
}) : e$7.mkdirAsync(n$4, e$7).then(() => c$6 || n$4, (r) => {
|
|
2518
|
-
if (r.code === "ENOENT") return t$7(i$8, e$7).then((u$6) => t$7(n$4, e$7, u$6));
|
|
2519
|
-
if (r.code !== "EEXIST" && r.code !== "EROFS") throw r;
|
|
2520
|
-
return e$7.statAsync(n$4).then((u$6) => {
|
|
2521
|
-
if (u$6.isDirectory()) return c$6;
|
|
2522
|
-
throw r;
|
|
2523
|
-
}, () => {
|
|
2524
|
-
throw r;
|
|
2525
|
-
});
|
|
2526
|
-
});
|
|
2527
|
-
}, d$1 = (n$4, e$7, c$6) => {
|
|
2528
|
-
const i$8 = f$5(n$4);
|
|
2529
|
-
if (e$7.recursive = false, i$8 === n$4) try {
|
|
2530
|
-
return e$7.mkdirSync(n$4, e$7);
|
|
2531
|
-
} catch (r) {
|
|
2532
|
-
if (r.code !== "EISDIR") throw r;
|
|
2533
|
-
return;
|
|
2534
|
-
}
|
|
2535
|
-
try {
|
|
2536
|
-
return e$7.mkdirSync(n$4, e$7), c$6 || n$4;
|
|
2537
|
-
} catch (r) {
|
|
2538
|
-
if (r.code === "ENOENT") return d$1(n$4, e$7, d$1(i$8, e$7, c$6));
|
|
2539
|
-
if (r.code !== "EEXIST" && r.code !== "EROFS") throw r;
|
|
2540
|
-
try {
|
|
2541
|
-
if (!e$7.statSync(n$4).isDirectory()) throw r;
|
|
2542
|
-
} catch {
|
|
2543
|
-
throw r;
|
|
2544
|
-
}
|
|
2545
|
-
}
|
|
2546
|
-
};
|
|
2547
|
-
return o$3 = {
|
|
2548
|
-
mkdirpManual: t$7,
|
|
2549
|
-
mkdirpManualSync: d$1
|
|
2550
|
-
}, o$3;
|
|
2551
|
-
}
|
|
2552
|
-
var c$1, m$1;
|
|
2553
|
-
function s$3() {
|
|
2554
|
-
if (m$1) return c$1;
|
|
2555
|
-
m$1 = 1;
|
|
2556
|
-
const { dirname: u$6 } = path, { findMade: d$1, findMadeSync: t$1$1 } = t(), { mkdirpManual: a$11, mkdirpManualSync: k$2 } = y$2();
|
|
2557
|
-
return c$1 = {
|
|
2558
|
-
mkdirpNative: (e$7, r) => (r.recursive = true, u$6(e$7) === e$7 ? r.mkdirAsync(e$7, r) : d$1(r, e$7).then((n$4) => r.mkdirAsync(e$7, r).then(() => n$4).catch((i$8) => {
|
|
2559
|
-
if (i$8.code === "ENOENT") return a$11(e$7, r);
|
|
2560
|
-
throw i$8;
|
|
2561
|
-
}))),
|
|
2562
|
-
mkdirpNativeSync: (e$7, r) => {
|
|
2563
|
-
if (r.recursive = true, u$6(e$7) === e$7) return r.mkdirSync(e$7, r);
|
|
2564
|
-
const n$4 = t$1$1(r, e$7);
|
|
2565
|
-
try {
|
|
2566
|
-
return r.mkdirSync(e$7, r), n$4;
|
|
2567
|
-
} catch (i$8) {
|
|
2568
|
-
if (i$8.code === "ENOENT") return k$2(e$7, r);
|
|
2569
|
-
throw i$8;
|
|
2570
|
-
}
|
|
2571
|
-
}
|
|
2572
|
-
}, c$1;
|
|
2573
|
-
}
|
|
2574
|
-
var s$2, n$1;
|
|
2575
|
-
function a$3() {
|
|
2576
|
-
if (n$1) return s$2;
|
|
2577
|
-
n$1 = 1;
|
|
2578
|
-
const i$8 = nativeFs, e$7 = (process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version).replace(/^v/, "").split("."), t$7 = +e$7[0] > 10 || +e$7[0] == 10 && +e$7[1] >= 12;
|
|
2579
|
-
return s$2 = {
|
|
2580
|
-
useNative: t$7 ? (r) => r.mkdir === i$8.mkdir : () => false,
|
|
2581
|
-
useNativeSync: t$7 ? (r) => r.mkdirSync === i$8.mkdirSync : () => false
|
|
2582
|
-
}, s$2;
|
|
2583
|
-
}
|
|
2584
|
-
var m, s$1;
|
|
2585
|
-
function S() {
|
|
2586
|
-
if (s$1) return m;
|
|
2587
|
-
s$1 = 1;
|
|
2588
|
-
const i$8 = t$2(), u$6 = u$2(), { mkdirpNative: a$11, mkdirpNativeSync: c$6 } = s$3(), { mkdirpManual: o$6, mkdirpManualSync: q$2 } = y$2(), { useNative: t$7, useNativeSync: _$2 } = a$3(), n$4 = (e$7, r) => (e$7 = u$6(e$7), r = i$8(r), t$7(r) ? a$11(e$7, r) : o$6(e$7, r)), d$1 = (e$7, r) => (e$7 = u$6(e$7), r = i$8(r), _$2(r) ? c$6(e$7, r) : q$2(e$7, r));
|
|
2589
|
-
return n$4.sync = d$1, n$4.native = (e$7, r) => a$11(u$6(e$7), i$8(r)), n$4.manual = (e$7, r) => o$6(u$6(e$7), i$8(r)), n$4.nativeSync = (e$7, r) => c$6(u$6(e$7), i$8(r)), n$4.manualSync = (e$7, r) => q$2(u$6(e$7), i$8(r)), m = n$4, m;
|
|
2590
|
-
}
|
|
2591
|
-
var y$1, O;
|
|
2592
|
-
function F$1() {
|
|
2593
|
-
if (O) return y$1;
|
|
2594
|
-
O = 1;
|
|
2595
|
-
const c$6 = nativeFs, a$11 = path, T$2 = c$6.lchown ? "lchown" : "chown", I$1 = c$6.lchownSync ? "lchownSync" : "chownSync", i$8 = c$6.lchown && !process.version.match(/v1[1-9]+\./) && !process.version.match(/v10\.[6-9]/), u$6 = (r, e$7, n$4) => {
|
|
2596
|
-
try {
|
|
2597
|
-
return c$6[I$1](r, e$7, n$4);
|
|
2598
|
-
} catch (t$7) {
|
|
2599
|
-
if (t$7.code !== "ENOENT") throw t$7;
|
|
2600
|
-
}
|
|
2601
|
-
}, D$1 = (r, e$7, n$4) => {
|
|
2602
|
-
try {
|
|
2603
|
-
return c$6.chownSync(r, e$7, n$4);
|
|
2604
|
-
} catch (t$7) {
|
|
2605
|
-
if (t$7.code !== "ENOENT") throw t$7;
|
|
2606
|
-
}
|
|
2607
|
-
}, _$2 = i$8 ? (r, e$7, n$4, t$7) => (o$6) => {
|
|
2608
|
-
!o$6 || o$6.code !== "EISDIR" ? t$7(o$6) : c$6.chown(r, e$7, n$4, t$7);
|
|
2609
|
-
} : (r, e$7, n$4, t$7) => t$7, w$3 = i$8 ? (r, e$7, n$4) => {
|
|
2610
|
-
try {
|
|
2611
|
-
return u$6(r, e$7, n$4);
|
|
2612
|
-
} catch (t$7) {
|
|
2613
|
-
if (t$7.code !== "EISDIR") throw t$7;
|
|
2614
|
-
D$1(r, e$7, n$4);
|
|
2615
|
-
}
|
|
2616
|
-
} : (r, e$7, n$4) => u$6(r, e$7, n$4), R$3 = process.version;
|
|
2617
|
-
let N$1 = (r, e$7, n$4) => c$6.readdir(r, e$7, n$4), q$2 = (r, e$7) => c$6.readdirSync(r, e$7);
|
|
2618
|
-
/^v4\./.test(R$3) && (N$1 = (r, e$7, n$4) => c$6.readdir(r, n$4));
|
|
2619
|
-
const h$2 = (r, e$7, n$4, t$7) => {
|
|
2620
|
-
c$6[T$2](r, e$7, n$4, _$2(r, e$7, n$4, (o$6) => {
|
|
2621
|
-
t$7(o$6 && o$6.code !== "ENOENT" ? o$6 : null);
|
|
2622
|
-
}));
|
|
2623
|
-
}, S$2 = (r, e$7, n$4, t$7, o$6) => {
|
|
2624
|
-
if (typeof e$7 == "string") return c$6.lstat(a$11.resolve(r, e$7), (s$8, f$5) => {
|
|
2625
|
-
if (s$8) return o$6(s$8.code !== "ENOENT" ? s$8 : null);
|
|
2626
|
-
f$5.name = e$7, S$2(r, f$5, n$4, t$7, o$6);
|
|
2627
|
-
});
|
|
2628
|
-
if (e$7.isDirectory()) E$2(a$11.resolve(r, e$7.name), n$4, t$7, (s$8) => {
|
|
2629
|
-
if (s$8) return o$6(s$8);
|
|
2630
|
-
h$2(a$11.resolve(r, e$7.name), n$4, t$7, o$6);
|
|
2631
|
-
});
|
|
2632
|
-
else h$2(a$11.resolve(r, e$7.name), n$4, t$7, o$6);
|
|
2633
|
-
}, E$2 = (r, e$7, n$4, t$7) => {
|
|
2634
|
-
N$1(r, { withFileTypes: true }, (o$6, s$8) => {
|
|
2635
|
-
if (o$6) {
|
|
2636
|
-
if (o$6.code === "ENOENT") return t$7();
|
|
2637
|
-
if (o$6.code !== "ENOTDIR" && o$6.code !== "ENOTSUP") return t$7(o$6);
|
|
2638
|
-
}
|
|
2639
|
-
if (o$6 || !s$8.length) return h$2(r, e$7, n$4, t$7);
|
|
2640
|
-
let f$5 = s$8.length, v$3 = null;
|
|
2641
|
-
const H$3 = (l$3) => {
|
|
2642
|
-
if (!v$3) {
|
|
2643
|
-
if (l$3) return t$7(v$3 = l$3);
|
|
2644
|
-
if (--f$5 === 0) return h$2(r, e$7, n$4, t$7);
|
|
2645
|
-
}
|
|
2646
|
-
};
|
|
2647
|
-
s$8.forEach((l$3) => S$2(r, l$3, e$7, n$4, H$3));
|
|
2648
|
-
});
|
|
2649
|
-
}, C$2 = (r, e$7, n$4, t$7) => {
|
|
2650
|
-
if (typeof e$7 == "string") try {
|
|
2651
|
-
const o$6 = c$6.lstatSync(a$11.resolve(r, e$7));
|
|
2652
|
-
o$6.name = e$7, e$7 = o$6;
|
|
2653
|
-
} catch (o$6) {
|
|
2654
|
-
if (o$6.code === "ENOENT") return;
|
|
2655
|
-
throw o$6;
|
|
2656
|
-
}
|
|
2657
|
-
e$7.isDirectory() && m$4(a$11.resolve(r, e$7.name), n$4, t$7), w$3(a$11.resolve(r, e$7.name), n$4, t$7);
|
|
2658
|
-
}, m$4 = (r, e$7, n$4) => {
|
|
2659
|
-
let t$7;
|
|
2660
|
-
try {
|
|
2661
|
-
t$7 = q$2(r, { withFileTypes: !0 });
|
|
2662
|
-
} catch (o$6) {
|
|
2663
|
-
if (o$6.code === "ENOENT") return;
|
|
2664
|
-
if (o$6.code === "ENOTDIR" || o$6.code === "ENOTSUP") return w$3(r, e$7, n$4);
|
|
2665
|
-
throw o$6;
|
|
2666
|
-
}
|
|
2667
|
-
return t$7 && t$7.length && t$7.forEach((o$6) => C$2(r, o$6, e$7, n$4)), w$3(r, e$7, n$4);
|
|
2668
|
-
};
|
|
2669
|
-
return y$1 = E$2, E$2.sync = m$4, y$1;
|
|
2670
|
-
}
|
|
2671
|
-
var R;
|
|
2672
|
-
function H() {
|
|
2673
|
-
if (R) return r$1.exports;
|
|
2674
|
-
R = 1;
|
|
2675
|
-
const g$1 = S(), l$3 = nativeFs, p$2 = path, x$1 = F$1(), y$4 = a$7();
|
|
2676
|
-
class D$1 extends Error {
|
|
2677
|
-
constructor(e$7, s$8) {
|
|
2678
|
-
super("Cannot extract through symbolic link"), this.path = s$8, this.symlink = e$7;
|
|
2679
|
-
}
|
|
2680
|
-
get name() {
|
|
2681
|
-
return "SylinkError";
|
|
2682
|
-
}
|
|
2683
|
-
}
|
|
2684
|
-
class E$2 extends Error {
|
|
2685
|
-
constructor(e$7, s$8) {
|
|
2686
|
-
super(s$8 + ": Cannot cd into '" + e$7 + "'"), this.path = e$7, this.code = s$8;
|
|
2687
|
-
}
|
|
2688
|
-
get name() {
|
|
2689
|
-
return "CwdError";
|
|
2690
|
-
}
|
|
2691
|
-
}
|
|
2692
|
-
const v$3 = (n$4, e$7) => n$4.get(y$4(e$7)), q$2 = (n$4, e$7, s$8) => n$4.set(y$4(e$7), s$8), I$1 = (n$4, e$7) => {
|
|
2693
|
-
l$3.stat(n$4, (s$8, r) => {
|
|
2694
|
-
(s$8 || !r.isDirectory()) && (s$8 = new E$2(n$4, s$8 && s$8.code || "ENOTDIR")), e$7(s$8);
|
|
2695
|
-
});
|
|
2696
|
-
};
|
|
2697
|
-
r$1.exports = (n$4, e$7, s$8) => {
|
|
2698
|
-
n$4 = y$4(n$4);
|
|
2699
|
-
const r = e$7.umask, c$6 = e$7.mode | 448, f$5 = (c$6 & r) !== 0, t$7 = e$7.uid, i$8 = e$7.gid, a$11 = typeof t$7 == "number" && typeof i$8 == "number" && (t$7 !== e$7.processUid || i$8 !== e$7.processGid), u$6 = e$7.preserve, m$4 = e$7.unlink, h$2 = e$7.cache, d$1 = y$4(e$7.cwd), w$3 = (k$2, o$6) => {
|
|
2700
|
-
k$2 ? s$8(k$2) : (q$2(h$2, n$4, true), o$6 && a$11 ? x$1(o$6, t$7, i$8, (G$2) => w$3(G$2)) : f$5 ? l$3.chmod(n$4, c$6, s$8) : s$8());
|
|
2701
|
-
};
|
|
2702
|
-
if (h$2 && v$3(h$2, n$4) === true) return w$3();
|
|
2703
|
-
if (n$4 === d$1) return I$1(n$4, w$3);
|
|
2704
|
-
if (u$6) return g$1(n$4, { mode: c$6 }).then((k$2) => w$3(null, k$2), w$3);
|
|
2705
|
-
C$2(d$1, y$4(p$2.relative(d$1, n$4)).split("/"), c$6, h$2, m$4, d$1, null, w$3);
|
|
2706
|
-
};
|
|
2707
|
-
const C$2 = (n$4, e$7, s$8, r, c$6, f$5, t$7, i$8) => {
|
|
2708
|
-
if (!e$7.length) return i$8(null, t$7);
|
|
2709
|
-
const a$11 = e$7.shift(), u$6 = y$4(p$2.resolve(n$4 + "/" + a$11));
|
|
2710
|
-
if (v$3(r, u$6)) return C$2(u$6, e$7, s$8, r, c$6, f$5, t$7, i$8);
|
|
2711
|
-
l$3.mkdir(u$6, s$8, j$3(u$6, e$7, s$8, r, c$6, f$5, t$7, i$8));
|
|
2712
|
-
}, j$3 = (n$4, e$7, s$8, r, c$6, f$5, t$7, i$8) => (a$11) => {
|
|
2713
|
-
a$11 ? l$3.lstat(n$4, (u$6, m$4) => {
|
|
2714
|
-
if (u$6) u$6.path = u$6.path && y$4(u$6.path), i$8(u$6);
|
|
2715
|
-
else if (m$4.isDirectory()) C$2(n$4, e$7, s$8, r, c$6, f$5, t$7, i$8);
|
|
2716
|
-
else if (c$6) l$3.unlink(n$4, (h$2) => {
|
|
2717
|
-
if (h$2) return i$8(h$2);
|
|
2718
|
-
l$3.mkdir(n$4, s$8, j$3(n$4, e$7, s$8, r, c$6, f$5, t$7, i$8));
|
|
2719
|
-
});
|
|
2720
|
-
else {
|
|
2721
|
-
if (m$4.isSymbolicLink()) return i$8(new D$1(n$4, n$4 + "/" + e$7.join("/")));
|
|
2722
|
-
i$8(a$11);
|
|
2723
|
-
}
|
|
2724
|
-
}) : (t$7 = t$7 || n$4, C$2(n$4, e$7, s$8, r, c$6, f$5, t$7, i$8));
|
|
2725
|
-
}, L = (n$4) => {
|
|
2726
|
-
let e$7 = false, s$8 = "ENOTDIR";
|
|
2727
|
-
try {
|
|
2728
|
-
e$7 = l$3.statSync(n$4).isDirectory();
|
|
2729
|
-
} catch (r) {
|
|
2730
|
-
s$8 = r.code;
|
|
2731
|
-
} finally {
|
|
2732
|
-
if (!e$7) throw new E$2(n$4, s$8);
|
|
2733
|
-
}
|
|
2734
|
-
};
|
|
2735
|
-
return r$1.exports.sync = (n$4, e$7) => {
|
|
2736
|
-
n$4 = y$4(n$4);
|
|
2737
|
-
const s$8 = e$7.umask, r = e$7.mode | 448, c$6 = (r & s$8) !== 0, f$5 = e$7.uid, t$7 = e$7.gid, i$8 = typeof f$5 == "number" && typeof t$7 == "number" && (f$5 !== e$7.processUid || t$7 !== e$7.processGid), a$11 = e$7.preserve, u$6 = e$7.unlink, m$4 = e$7.cache, h$2 = y$4(e$7.cwd), d$1 = (k$2) => {
|
|
2738
|
-
q$2(m$4, n$4, true), k$2 && i$8 && x$1.sync(k$2, f$5, t$7), c$6 && l$3.chmodSync(n$4, r);
|
|
2739
|
-
};
|
|
2740
|
-
if (m$4 && v$3(m$4, n$4) === true) return d$1();
|
|
2741
|
-
if (n$4 === h$2) return L(h$2), d$1();
|
|
2742
|
-
if (a$11) return d$1(g$1.sync(n$4, r));
|
|
2743
|
-
const $ = y$4(p$2.relative(h$2, n$4)).split("/");
|
|
2744
|
-
let S$2 = null;
|
|
2745
|
-
for (let k$2 = $.shift(), o$6 = h$2; k$2 && (o$6 += "/" + k$2); k$2 = $.shift()) if (o$6 = y$4(p$2.resolve(o$6)), !v$3(m$4, o$6)) try {
|
|
2746
|
-
l$3.mkdirSync(o$6, r), S$2 = S$2 || o$6, q$2(m$4, o$6, !0);
|
|
2747
|
-
} catch {
|
|
2748
|
-
const M$1 = l$3.lstatSync(o$6);
|
|
2749
|
-
if (M$1.isDirectory()) {
|
|
2750
|
-
q$2(m$4, o$6, true);
|
|
2751
|
-
continue;
|
|
2752
|
-
} else if (u$6) {
|
|
2753
|
-
l$3.unlinkSync(o$6), l$3.mkdirSync(o$6, r), S$2 = S$2 || o$6, q$2(m$4, o$6, true);
|
|
2754
|
-
continue;
|
|
2755
|
-
} else if (M$1.isSymbolicLink()) return new D$1(o$6, o$6 + "/" + $.join("/"));
|
|
2756
|
-
}
|
|
2757
|
-
return d$1(S$2);
|
|
2758
|
-
}, r$1.exports;
|
|
2759
|
-
}
|
|
2760
|
-
var a$2, i;
|
|
2761
|
-
function p() {
|
|
2762
|
-
if (i) return a$2;
|
|
2763
|
-
i = 1;
|
|
2764
|
-
const o$6 = [
|
|
2765
|
-
"|",
|
|
2766
|
-
"<",
|
|
2767
|
-
">",
|
|
2768
|
-
"?",
|
|
2769
|
-
":"
|
|
2770
|
-
], t$7 = o$6.map((e$7) => String.fromCharCode(61440 + e$7.charCodeAt(0))), s$8 = new Map(o$6.map((e$7, r) => [e$7, t$7[r]])), c$6 = new Map(t$7.map((e$7, r) => [e$7, o$6[r]]));
|
|
2771
|
-
return a$2 = {
|
|
2772
|
-
encode: (e$7) => o$6.reduce((r, n$4) => r.split(n$4).join(s$8.get(n$4)), e$7),
|
|
2773
|
-
decode: (e$7) => t$7.reduce((r, n$4) => r.split(n$4).join(c$6.get(n$4)), e$7)
|
|
2774
|
-
}, a$2;
|
|
2775
|
-
}
|
|
2776
|
-
var o$2, n;
|
|
2777
|
-
function a$1() {
|
|
2778
|
-
if (n) return o$2;
|
|
2779
|
-
n = 1;
|
|
2780
|
-
const r = Object.create(null), { hasOwnProperty: i$8 } = Object.prototype;
|
|
2781
|
-
return o$2 = (e$7) => (i$8.call(r, e$7) || (r[e$7] = e$7.normalize("NFD")), r[e$7]), o$2;
|
|
2782
|
-
}
|
|
2783
|
-
var a, l;
|
|
2784
|
-
function s() {
|
|
2785
|
-
return l || (l = 1, a = (r) => {
|
|
2786
|
-
let e$7 = r.length - 1, i$8 = -1;
|
|
2787
|
-
for (; e$7 > -1 && r.charAt(e$7) === "/";) i$8 = e$7, e$7--;
|
|
2788
|
-
return i$8 === -1 ? r : r.slice(0, i$8);
|
|
2789
|
-
}), a;
|
|
2790
|
-
}
|
|
2791
|
-
var u$1, f$1;
|
|
2792
|
-
function z() {
|
|
2793
|
-
if (f$1) return u$1;
|
|
2794
|
-
f$1 = 1;
|
|
2795
|
-
const l$3 = j$1, m$4 = a$1(), g$1 = s(), { join: d$1 } = path, q$2 = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32";
|
|
2796
|
-
return u$1 = () => {
|
|
2797
|
-
const i$8 = /* @__PURE__ */ new Map(), c$6 = /* @__PURE__ */ new Map(), v$3 = (e$7) => e$7.split("/").slice(0, -1).reduce((o$6, r) => (o$6.length && (r = d$1(o$6[o$6.length - 1], r)), o$6.push(r || "/"), o$6), []), a$11 = /* @__PURE__ */ new Set(), w$3 = (e$7) => {
|
|
2798
|
-
const s$8 = c$6.get(e$7);
|
|
2799
|
-
if (!s$8) throw new Error("function does not have any path reservations");
|
|
2800
|
-
return {
|
|
2801
|
-
paths: s$8.paths.map((o$6) => i$8.get(o$6)),
|
|
2802
|
-
dirs: [...s$8.dirs].map((o$6) => i$8.get(o$6))
|
|
2803
|
-
};
|
|
2804
|
-
}, h$2 = (e$7) => {
|
|
2805
|
-
const { paths: s$8, dirs: o$6 } = w$3(e$7);
|
|
2806
|
-
return s$8.every((r) => r[0] === e$7) && o$6.every((r) => r[0] instanceof Set && r[0].has(e$7));
|
|
2807
|
-
}, p$2 = (e$7) => a$11.has(e$7) || !h$2(e$7) ? false : (a$11.add(e$7), e$7(() => S$2(e$7)), true), S$2 = (e$7) => {
|
|
2808
|
-
if (!a$11.has(e$7)) return false;
|
|
2809
|
-
const { paths: s$8, dirs: o$6 } = c$6.get(e$7), r = /* @__PURE__ */ new Set();
|
|
2810
|
-
return s$8.forEach((t$7) => {
|
|
2811
|
-
const n$4 = i$8.get(t$7);
|
|
2812
|
-
l$3.equal(n$4[0], e$7), n$4.length === 1 ? i$8.delete(t$7) : (n$4.shift(), typeof n$4[0] == "function" ? r.add(n$4[0]) : n$4[0].forEach((E$2) => r.add(E$2)));
|
|
2813
|
-
}), o$6.forEach((t$7) => {
|
|
2814
|
-
const n$4 = i$8.get(t$7);
|
|
2815
|
-
l$3(n$4[0] instanceof Set), n$4[0].size === 1 && n$4.length === 1 ? i$8.delete(t$7) : n$4[0].size === 1 ? (n$4.shift(), r.add(n$4[0])) : n$4[0].delete(e$7);
|
|
2816
|
-
}), a$11.delete(e$7), r.forEach((t$7) => p$2(t$7)), true;
|
|
2817
|
-
};
|
|
2818
|
-
return {
|
|
2819
|
-
check: h$2,
|
|
2820
|
-
reserve: (e$7, s$8) => {
|
|
2821
|
-
e$7 = q$2 ? ["win32 parallelization disabled"] : e$7.map((r) => g$1(d$1(m$4(r))).toLowerCase());
|
|
2822
|
-
const o$6 = new Set(e$7.map((r) => v$3(r)).reduce((r, t$7) => r.concat(t$7)));
|
|
2823
|
-
return c$6.set(s$8, {
|
|
2824
|
-
dirs: o$6,
|
|
2825
|
-
paths: e$7
|
|
2826
|
-
}), e$7.forEach((r) => {
|
|
2827
|
-
const t$7 = i$8.get(r);
|
|
2828
|
-
t$7 ? t$7.push(s$8) : i$8.set(r, [s$8]);
|
|
2829
|
-
}), o$6.forEach((r) => {
|
|
2830
|
-
const t$7 = i$8.get(r);
|
|
2831
|
-
t$7 ? t$7[t$7.length - 1] instanceof Set ? t$7[t$7.length - 1].add(s$8) : t$7.push(new Set([s$8])) : i$8.set(r, [new Set([s$8])]);
|
|
2832
|
-
}), p$2(s$8);
|
|
2833
|
-
}
|
|
2834
|
-
};
|
|
2835
|
-
}, u$1;
|
|
2836
|
-
}
|
|
2837
|
-
var o$1, u;
|
|
2838
|
-
function c$5() {
|
|
2839
|
-
if (u) return o$1;
|
|
2840
|
-
u = 1;
|
|
2841
|
-
const { isAbsolute: l$3, parse: t$7 } = path.win32;
|
|
2842
|
-
return o$1 = (r) => {
|
|
2843
|
-
let s$8 = "", e$7 = t$7(r);
|
|
2844
|
-
for (; l$3(r) || e$7.root;) {
|
|
2845
|
-
const i$8 = r.charAt(0) === "/" && r.slice(0, 4) !== "//?/" ? "/" : e$7.root;
|
|
2846
|
-
r = r.slice(i$8.length), s$8 += i$8, e$7 = t$7(r);
|
|
2847
|
-
}
|
|
2848
|
-
return [s$8, r];
|
|
2849
|
-
}, o$1;
|
|
2850
|
-
}
|
|
2851
|
-
var e, o;
|
|
2852
|
-
function F() {
|
|
2853
|
-
if (o) return e;
|
|
2854
|
-
o = 1;
|
|
2855
|
-
const t$7 = process.env.__FAKE_PLATFORM__ || process.platform, s$8 = typeof Bun < "u" ? false : t$7 === "win32", { O_CREAT: _$2, O_TRUNC: a$11, O_WRONLY: i$8, UV_FS_O_FILEMAP: r = 0 } = (commonjsGlobal.__FAKE_TESTING_FS__ || nativeFs).constants, c$6 = s$8 && !!r, f$5 = 512 * 1024, p$2 = r | a$11 | _$2 | i$8;
|
|
2856
|
-
return e = c$6 ? (l$3) => l$3 < f$5 ? p$2 : "w" : () => "w", e;
|
|
2857
|
-
}
|
|
2858
|
-
var G, y;
|
|
2859
|
-
function Os() {
|
|
2860
|
-
if (y) return G;
|
|
2861
|
-
y = 1;
|
|
2862
|
-
const ss = j$1, is = rt(), r = nativeFs, es = X(), w$3 = path, M$1 = H(), K$1 = p(), ts = z(), os$1 = c$5(), l$3 = a$7(), rs = s(), hs = a$1(), H$1$1 = Symbol("onEntry"), q$2 = Symbol("checkFs"), Y = Symbol("checkFs2"), v$3 = Symbol("pruneCache"), N$1 = Symbol("isReusable"), d$1 = Symbol("makeFs"), U$1 = Symbol("file"), F$1$1 = Symbol("directory"), O$4 = Symbol("link"), B$1 = Symbol("symlink"), z$1$1 = Symbol("hardlink"), W$1 = Symbol("unsupported"), j$3 = Symbol("checkPath"), b$1 = Symbol("mkdir"), m$4 = Symbol("onError"), $ = Symbol("pending"), V$1 = Symbol("pend"), S$2 = Symbol("unpend"), P$2 = Symbol("ended"), A$1 = Symbol("maybeClose"), x$1 = Symbol("skip"), E$2 = Symbol("doChown"), R$3 = Symbol("uid"), _$2 = Symbol("gid"), g$1 = Symbol("checkedCwd"), X$1$1 = Ds, J$1 = F(), C$2 = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32", cs = 1024, as = (a$11, s$8) => {
|
|
2863
|
-
if (!C$2) return r.unlink(a$11, s$8);
|
|
2864
|
-
const i$8 = a$11 + ".DELETE." + X$1$1.randomBytes(16).toString("hex");
|
|
2865
|
-
r.rename(a$11, i$8, (e$7) => {
|
|
2866
|
-
if (e$7) return s$8(e$7);
|
|
2867
|
-
r.unlink(i$8, s$8);
|
|
2868
|
-
});
|
|
2869
|
-
}, us = (a$11) => {
|
|
2870
|
-
if (!C$2) return r.unlinkSync(a$11);
|
|
2871
|
-
const s$8 = a$11 + ".DELETE." + X$1$1.randomBytes(16).toString("hex");
|
|
2872
|
-
r.renameSync(a$11, s$8), r.unlinkSync(s$8);
|
|
2873
|
-
}, Q = (a$11, s$8, i$8) => a$11 === a$11 >>> 0 ? a$11 : s$8 === s$8 >>> 0 ? s$8 : i$8, Z = (a$11) => rs(l$3(hs(a$11))).toLowerCase(), ns = (a$11, s$8) => {
|
|
2874
|
-
s$8 = Z(s$8);
|
|
2875
|
-
for (const i$8 of a$11.keys()) {
|
|
2876
|
-
const e$7 = Z(i$8);
|
|
2877
|
-
(e$7 === s$8 || e$7.indexOf(s$8 + "/") === 0) && a$11.delete(i$8);
|
|
2878
|
-
}
|
|
2879
|
-
}, ms = (a$11) => {
|
|
2880
|
-
for (const s$8 of a$11.keys()) a$11.delete(s$8);
|
|
2881
|
-
};
|
|
2882
|
-
class L extends is {
|
|
2883
|
-
constructor(s$8) {
|
|
2884
|
-
if (s$8 || (s$8 = {}), s$8.ondone = (i$8) => {
|
|
2885
|
-
this[P$2] = true, this[A$1]();
|
|
2886
|
-
}, super(s$8), this[g$1] = false, this.reservations = ts(), this.transform = typeof s$8.transform == "function" ? s$8.transform : null, this.writable = true, this.readable = false, this[$] = 0, this[P$2] = false, this.dirCache = s$8.dirCache || /* @__PURE__ */ new Map(), typeof s$8.uid == "number" || typeof s$8.gid == "number") {
|
|
2887
|
-
if (typeof s$8.uid != "number" || typeof s$8.gid != "number") throw new TypeError("cannot set owner without number uid and gid");
|
|
2888
|
-
if (s$8.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
|
|
2889
|
-
this.uid = s$8.uid, this.gid = s$8.gid, this.setOwner = true;
|
|
2890
|
-
} else this.uid = null, this.gid = null, this.setOwner = false;
|
|
2891
|
-
s$8.preserveOwner === void 0 && typeof s$8.uid != "number" ? this.preserveOwner = process.getuid && process.getuid() === 0 : this.preserveOwner = !!s$8.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : null, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : null, this.maxDepth = typeof s$8.maxDepth == "number" ? s$8.maxDepth : cs, this.forceChown = s$8.forceChown === true, this.win32 = !!s$8.win32 || C$2, this.newer = !!s$8.newer, this.keep = !!s$8.keep, this.noMtime = !!s$8.noMtime, this.preservePaths = !!s$8.preservePaths, this.unlink = !!s$8.unlink, this.cwd = l$3(w$3.resolve(s$8.cwd || process.cwd())), this.strip = +s$8.strip || 0, this.processUmask = s$8.noChmod ? 0 : process.umask(), this.umask = typeof s$8.umask == "number" ? s$8.umask : this.processUmask, this.dmode = s$8.dmode || 511 & ~this.umask, this.fmode = s$8.fmode || 438 & ~this.umask, this.on("entry", (i$8) => this[H$1$1](i$8));
|
|
2892
|
-
}
|
|
2893
|
-
warn(s$8, i$8, e$7 = {}) {
|
|
2894
|
-
return (s$8 === "TAR_BAD_ARCHIVE" || s$8 === "TAR_ABORT") && (e$7.recoverable = false), super.warn(s$8, i$8, e$7);
|
|
2895
|
-
}
|
|
2896
|
-
[A$1]() {
|
|
2897
|
-
this[P$2] && this[$] === 0 && (this.emit("prefinish"), this.emit("finish"), this.emit("end"));
|
|
2898
|
-
}
|
|
2899
|
-
[j$3](s$8) {
|
|
2900
|
-
const i$8 = l$3(s$8.path), e$7 = i$8.split("/");
|
|
2901
|
-
if (this.strip) {
|
|
2902
|
-
if (e$7.length < this.strip) return false;
|
|
2903
|
-
if (s$8.type === "Link") {
|
|
2904
|
-
const t$7 = l$3(s$8.linkpath).split("/");
|
|
2905
|
-
if (t$7.length >= this.strip) s$8.linkpath = t$7.slice(this.strip).join("/");
|
|
2906
|
-
else return false;
|
|
2907
|
-
}
|
|
2908
|
-
e$7.splice(0, this.strip), s$8.path = e$7.join("/");
|
|
2909
|
-
}
|
|
2910
|
-
if (isFinite(this.maxDepth) && e$7.length > this.maxDepth) return this.warn("TAR_ENTRY_ERROR", "path excessively deep", {
|
|
2911
|
-
entry: s$8,
|
|
2912
|
-
path: i$8,
|
|
2913
|
-
depth: e$7.length,
|
|
2914
|
-
maxDepth: this.maxDepth
|
|
2915
|
-
}), false;
|
|
2916
|
-
if (!this.preservePaths) {
|
|
2917
|
-
if (e$7.includes("..") || C$2 && /^[a-z]:\.\.$/i.test(e$7[0])) return this.warn("TAR_ENTRY_ERROR", "path contains '..'", {
|
|
2918
|
-
entry: s$8,
|
|
2919
|
-
path: i$8
|
|
2920
|
-
}), false;
|
|
2921
|
-
const [t$7, o$6] = os$1(i$8);
|
|
2922
|
-
t$7 && (s$8.path = o$6, this.warn("TAR_ENTRY_INFO", `stripping ${t$7} from absolute path`, {
|
|
2923
|
-
entry: s$8,
|
|
2924
|
-
path: i$8
|
|
2925
|
-
}));
|
|
2926
|
-
}
|
|
2927
|
-
if (w$3.isAbsolute(s$8.path) ? s$8.absolute = l$3(w$3.resolve(s$8.path)) : s$8.absolute = l$3(w$3.resolve(this.cwd, s$8.path)), !this.preservePaths && s$8.absolute.indexOf(this.cwd + "/") !== 0 && s$8.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", {
|
|
2928
|
-
entry: s$8,
|
|
2929
|
-
path: l$3(s$8.path),
|
|
2930
|
-
resolvedPath: s$8.absolute,
|
|
2931
|
-
cwd: this.cwd
|
|
2932
|
-
}), false;
|
|
2933
|
-
if (s$8.absolute === this.cwd && s$8.type !== "Directory" && s$8.type !== "GNUDumpDir") return false;
|
|
2934
|
-
if (this.win32) {
|
|
2935
|
-
const { root: t$7 } = w$3.win32.parse(s$8.absolute);
|
|
2936
|
-
s$8.absolute = t$7 + K$1.encode(s$8.absolute.slice(t$7.length));
|
|
2937
|
-
const { root: o$6 } = w$3.win32.parse(s$8.path);
|
|
2938
|
-
s$8.path = o$6 + K$1.encode(s$8.path.slice(o$6.length));
|
|
2939
|
-
}
|
|
2940
|
-
return true;
|
|
2941
|
-
}
|
|
2942
|
-
[H$1$1](s$8) {
|
|
2943
|
-
if (!this[j$3](s$8)) return s$8.resume();
|
|
2944
|
-
switch (ss.equal(typeof s$8.absolute, "string"), s$8.type) {
|
|
2945
|
-
case "Directory":
|
|
2946
|
-
case "GNUDumpDir": s$8.mode && (s$8.mode = s$8.mode | 448);
|
|
2947
|
-
case "File":
|
|
2948
|
-
case "OldFile":
|
|
2949
|
-
case "ContiguousFile":
|
|
2950
|
-
case "Link":
|
|
2951
|
-
case "SymbolicLink": return this[q$2](s$8);
|
|
2952
|
-
case "CharacterDevice":
|
|
2953
|
-
case "BlockDevice":
|
|
2954
|
-
case "FIFO":
|
|
2955
|
-
default: return this[W$1](s$8);
|
|
2956
|
-
}
|
|
2957
|
-
}
|
|
2958
|
-
[m$4](s$8, i$8) {
|
|
2959
|
-
s$8.name === "CwdError" ? this.emit("error", s$8) : (this.warn("TAR_ENTRY_ERROR", s$8, { entry: i$8 }), this[S$2](), i$8.resume());
|
|
2960
|
-
}
|
|
2961
|
-
[b$1](s$8, i$8, e$7) {
|
|
2962
|
-
M$1(l$3(s$8), {
|
|
2963
|
-
uid: this.uid,
|
|
2964
|
-
gid: this.gid,
|
|
2965
|
-
processUid: this.processUid,
|
|
2966
|
-
processGid: this.processGid,
|
|
2967
|
-
umask: this.processUmask,
|
|
2968
|
-
preserve: this.preservePaths,
|
|
2969
|
-
unlink: this.unlink,
|
|
2970
|
-
cache: this.dirCache,
|
|
2971
|
-
cwd: this.cwd,
|
|
2972
|
-
mode: i$8,
|
|
2973
|
-
noChmod: this.noChmod
|
|
2974
|
-
}, e$7);
|
|
2975
|
-
}
|
|
2976
|
-
[E$2](s$8) {
|
|
2977
|
-
return this.forceChown || this.preserveOwner && (typeof s$8.uid == "number" && s$8.uid !== this.processUid || typeof s$8.gid == "number" && s$8.gid !== this.processGid) || typeof this.uid == "number" && this.uid !== this.processUid || typeof this.gid == "number" && this.gid !== this.processGid;
|
|
2978
|
-
}
|
|
2979
|
-
[R$3](s$8) {
|
|
2980
|
-
return Q(this.uid, s$8.uid, this.processUid);
|
|
2981
|
-
}
|
|
2982
|
-
[_$2](s$8) {
|
|
2983
|
-
return Q(this.gid, s$8.gid, this.processGid);
|
|
2984
|
-
}
|
|
2985
|
-
[U$1](s$8, i$8) {
|
|
2986
|
-
const e$7 = s$8.mode & 4095 || this.fmode, t$7 = new es.WriteStream(s$8.absolute, {
|
|
2987
|
-
flags: J$1(s$8.size),
|
|
2988
|
-
mode: e$7,
|
|
2989
|
-
autoClose: false
|
|
2990
|
-
});
|
|
2991
|
-
t$7.on("error", (c$6) => {
|
|
2992
|
-
t$7.fd && r.close(t$7.fd, () => {}), t$7.write = () => true, this[m$4](c$6, s$8), i$8();
|
|
2993
|
-
});
|
|
2994
|
-
let o$6 = 1;
|
|
2995
|
-
const u$6 = (c$6) => {
|
|
2996
|
-
if (c$6) {
|
|
2997
|
-
t$7.fd && r.close(t$7.fd, () => {}), this[m$4](c$6, s$8), i$8();
|
|
2998
|
-
return;
|
|
2999
|
-
}
|
|
3000
|
-
--o$6 === 0 && r.close(t$7.fd, (n$4) => {
|
|
3001
|
-
n$4 ? this[m$4](n$4, s$8) : this[S$2](), i$8();
|
|
3002
|
-
});
|
|
3003
|
-
};
|
|
3004
|
-
t$7.on("finish", (c$6) => {
|
|
3005
|
-
const n$4 = s$8.absolute, p$2 = t$7.fd;
|
|
3006
|
-
if (s$8.mtime && !this.noMtime) {
|
|
3007
|
-
o$6++;
|
|
3008
|
-
const f$5 = s$8.atime || /* @__PURE__ */ new Date(), k$2 = s$8.mtime;
|
|
3009
|
-
r.futimes(p$2, f$5, k$2, (D$1) => D$1 ? r.utimes(n$4, f$5, k$2, (I$1) => u$6(I$1 && D$1)) : u$6());
|
|
3010
|
-
}
|
|
3011
|
-
if (this[E$2](s$8)) {
|
|
3012
|
-
o$6++;
|
|
3013
|
-
const f$5 = this[R$3](s$8), k$2 = this[_$2](s$8);
|
|
3014
|
-
r.fchown(p$2, f$5, k$2, (D$1) => D$1 ? r.chown(n$4, f$5, k$2, (I$1) => u$6(I$1 && D$1)) : u$6());
|
|
3015
|
-
}
|
|
3016
|
-
u$6();
|
|
3017
|
-
});
|
|
3018
|
-
const h$2 = this.transform && this.transform(s$8) || s$8;
|
|
3019
|
-
h$2 !== s$8 && (h$2.on("error", (c$6) => {
|
|
3020
|
-
this[m$4](c$6, s$8), i$8();
|
|
3021
|
-
}), s$8.pipe(h$2)), h$2.pipe(t$7);
|
|
3022
|
-
}
|
|
3023
|
-
[F$1$1](s$8, i$8) {
|
|
3024
|
-
const e$7 = s$8.mode & 4095 || this.dmode;
|
|
3025
|
-
this[b$1](s$8.absolute, e$7, (t$7) => {
|
|
3026
|
-
if (t$7) {
|
|
3027
|
-
this[m$4](t$7, s$8), i$8();
|
|
3028
|
-
return;
|
|
3029
|
-
}
|
|
3030
|
-
let o$6 = 1;
|
|
3031
|
-
const u$6 = (h$2) => {
|
|
3032
|
-
--o$6 === 0 && (i$8(), this[S$2](), s$8.resume());
|
|
3033
|
-
};
|
|
3034
|
-
s$8.mtime && !this.noMtime && (o$6++, r.utimes(s$8.absolute, s$8.atime || /* @__PURE__ */ new Date(), s$8.mtime, u$6)), this[E$2](s$8) && (o$6++, r.chown(s$8.absolute, this[R$3](s$8), this[_$2](s$8), u$6)), u$6();
|
|
3035
|
-
});
|
|
3036
|
-
}
|
|
3037
|
-
[W$1](s$8) {
|
|
3038
|
-
s$8.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${s$8.type}`, { entry: s$8 }), s$8.resume();
|
|
3039
|
-
}
|
|
3040
|
-
[B$1](s$8, i$8) {
|
|
3041
|
-
this[O$4](s$8, s$8.linkpath, "symlink", i$8);
|
|
3042
|
-
}
|
|
3043
|
-
[z$1$1](s$8, i$8) {
|
|
3044
|
-
const e$7 = l$3(w$3.resolve(this.cwd, s$8.linkpath));
|
|
3045
|
-
this[O$4](s$8, e$7, "link", i$8);
|
|
3046
|
-
}
|
|
3047
|
-
[V$1]() {
|
|
3048
|
-
this[$]++;
|
|
3049
|
-
}
|
|
3050
|
-
[S$2]() {
|
|
3051
|
-
this[$]--, this[A$1]();
|
|
3052
|
-
}
|
|
3053
|
-
[x$1](s$8) {
|
|
3054
|
-
this[S$2](), s$8.resume();
|
|
3055
|
-
}
|
|
3056
|
-
[N$1](s$8, i$8) {
|
|
3057
|
-
return s$8.type === "File" && !this.unlink && i$8.isFile() && i$8.nlink <= 1 && !C$2;
|
|
3058
|
-
}
|
|
3059
|
-
[q$2](s$8) {
|
|
3060
|
-
this[V$1]();
|
|
3061
|
-
const i$8 = [s$8.path];
|
|
3062
|
-
s$8.linkpath && i$8.push(s$8.linkpath), this.reservations.reserve(i$8, (e$7) => this[Y](s$8, e$7));
|
|
3063
|
-
}
|
|
3064
|
-
[v$3](s$8) {
|
|
3065
|
-
s$8.type === "SymbolicLink" ? ms(this.dirCache) : s$8.type !== "Directory" && ns(this.dirCache, s$8.absolute);
|
|
3066
|
-
}
|
|
3067
|
-
[Y](s$8, i$8) {
|
|
3068
|
-
this[v$3](s$8);
|
|
3069
|
-
const e$7 = (h$2) => {
|
|
3070
|
-
this[v$3](s$8), i$8(h$2);
|
|
3071
|
-
}, t$7 = () => {
|
|
3072
|
-
this[b$1](this.cwd, this.dmode, (h$2) => {
|
|
3073
|
-
if (h$2) {
|
|
3074
|
-
this[m$4](h$2, s$8), e$7();
|
|
3075
|
-
return;
|
|
3076
|
-
}
|
|
3077
|
-
this[g$1] = true, o$6();
|
|
3078
|
-
});
|
|
3079
|
-
}, o$6 = () => {
|
|
3080
|
-
if (s$8.absolute !== this.cwd) {
|
|
3081
|
-
const h$2 = l$3(w$3.dirname(s$8.absolute));
|
|
3082
|
-
if (h$2 !== this.cwd) return this[b$1](h$2, this.dmode, (c$6) => {
|
|
3083
|
-
if (c$6) {
|
|
3084
|
-
this[m$4](c$6, s$8), e$7();
|
|
3085
|
-
return;
|
|
3086
|
-
}
|
|
3087
|
-
u$6();
|
|
3088
|
-
});
|
|
3089
|
-
}
|
|
3090
|
-
u$6();
|
|
3091
|
-
}, u$6 = () => {
|
|
3092
|
-
r.lstat(s$8.absolute, (h$2, c$6) => {
|
|
3093
|
-
if (c$6 && (this.keep || this.newer && c$6.mtime > s$8.mtime)) {
|
|
3094
|
-
this[x$1](s$8), e$7();
|
|
3095
|
-
return;
|
|
3096
|
-
}
|
|
3097
|
-
if (h$2 || this[N$1](s$8, c$6)) return this[d$1](null, s$8, e$7);
|
|
3098
|
-
if (c$6.isDirectory()) {
|
|
3099
|
-
if (s$8.type === "Directory") {
|
|
3100
|
-
const n$4 = !this.noChmod && s$8.mode && (c$6.mode & 4095) !== s$8.mode, p$2 = (f$5) => this[d$1](f$5, s$8, e$7);
|
|
3101
|
-
return n$4 ? r.chmod(s$8.absolute, s$8.mode, p$2) : p$2();
|
|
3102
|
-
}
|
|
3103
|
-
if (s$8.absolute !== this.cwd) return r.rmdir(s$8.absolute, (n$4) => this[d$1](n$4, s$8, e$7));
|
|
3104
|
-
}
|
|
3105
|
-
if (s$8.absolute === this.cwd) return this[d$1](null, s$8, e$7);
|
|
3106
|
-
as(s$8.absolute, (n$4) => this[d$1](n$4, s$8, e$7));
|
|
3107
|
-
});
|
|
3108
|
-
};
|
|
3109
|
-
this[g$1] ? o$6() : t$7();
|
|
3110
|
-
}
|
|
3111
|
-
[d$1](s$8, i$8, e$7) {
|
|
3112
|
-
if (s$8) {
|
|
3113
|
-
this[m$4](s$8, i$8), e$7();
|
|
3114
|
-
return;
|
|
3115
|
-
}
|
|
3116
|
-
switch (i$8.type) {
|
|
3117
|
-
case "File":
|
|
3118
|
-
case "OldFile":
|
|
3119
|
-
case "ContiguousFile": return this[U$1](i$8, e$7);
|
|
3120
|
-
case "Link": return this[z$1$1](i$8, e$7);
|
|
3121
|
-
case "SymbolicLink": return this[B$1](i$8, e$7);
|
|
3122
|
-
case "Directory":
|
|
3123
|
-
case "GNUDumpDir": return this[F$1$1](i$8, e$7);
|
|
3124
|
-
}
|
|
3125
|
-
}
|
|
3126
|
-
[O$4](s$8, i$8, e$7, t$7) {
|
|
3127
|
-
r[e$7](i$8, s$8.absolute, (o$6) => {
|
|
3128
|
-
o$6 ? this[m$4](o$6, s$8) : (this[S$2](), s$8.resume()), t$7();
|
|
3129
|
-
});
|
|
3130
|
-
}
|
|
3131
|
-
}
|
|
3132
|
-
const T$2 = (a$11) => {
|
|
3133
|
-
try {
|
|
3134
|
-
return [null, a$11()];
|
|
3135
|
-
} catch (s$8) {
|
|
3136
|
-
return [s$8, null];
|
|
3137
|
-
}
|
|
3138
|
-
};
|
|
3139
|
-
class ls extends L {
|
|
3140
|
-
[d$1](s$8, i$8) {
|
|
3141
|
-
return super[d$1](s$8, i$8, () => {});
|
|
3142
|
-
}
|
|
3143
|
-
[q$2](s$8) {
|
|
3144
|
-
if (this[v$3](s$8), !this[g$1]) {
|
|
3145
|
-
const o$6 = this[b$1](this.cwd, this.dmode);
|
|
3146
|
-
if (o$6) return this[m$4](o$6, s$8);
|
|
3147
|
-
this[g$1] = true;
|
|
3148
|
-
}
|
|
3149
|
-
if (s$8.absolute !== this.cwd) {
|
|
3150
|
-
const o$6 = l$3(w$3.dirname(s$8.absolute));
|
|
3151
|
-
if (o$6 !== this.cwd) {
|
|
3152
|
-
const u$6 = this[b$1](o$6, this.dmode);
|
|
3153
|
-
if (u$6) return this[m$4](u$6, s$8);
|
|
3154
|
-
}
|
|
3155
|
-
}
|
|
3156
|
-
const [i$8, e$7] = T$2(() => r.lstatSync(s$8.absolute));
|
|
3157
|
-
if (e$7 && (this.keep || this.newer && e$7.mtime > s$8.mtime)) return this[x$1](s$8);
|
|
3158
|
-
if (i$8 || this[N$1](s$8, e$7)) return this[d$1](null, s$8);
|
|
3159
|
-
if (e$7.isDirectory()) {
|
|
3160
|
-
if (s$8.type === "Directory") {
|
|
3161
|
-
const [h$2] = !this.noChmod && s$8.mode && (e$7.mode & 4095) !== s$8.mode ? T$2(() => {
|
|
3162
|
-
r.chmodSync(s$8.absolute, s$8.mode);
|
|
3163
|
-
}) : [];
|
|
3164
|
-
return this[d$1](h$2, s$8);
|
|
3165
|
-
}
|
|
3166
|
-
const [o$6] = T$2(() => r.rmdirSync(s$8.absolute));
|
|
3167
|
-
this[d$1](o$6, s$8);
|
|
3168
|
-
}
|
|
3169
|
-
const [t$7] = s$8.absolute === this.cwd ? [] : T$2(() => us(s$8.absolute));
|
|
3170
|
-
this[d$1](t$7, s$8);
|
|
3171
|
-
}
|
|
3172
|
-
[U$1](s$8, i$8) {
|
|
3173
|
-
const e$7 = s$8.mode & 4095 || this.fmode, t$7 = (h$2) => {
|
|
3174
|
-
let c$6;
|
|
3175
|
-
try {
|
|
3176
|
-
r.closeSync(o$6);
|
|
3177
|
-
} catch (n$4) {
|
|
3178
|
-
c$6 = n$4;
|
|
3179
|
-
}
|
|
3180
|
-
(h$2 || c$6) && this[m$4](h$2 || c$6, s$8), i$8();
|
|
3181
|
-
};
|
|
3182
|
-
let o$6;
|
|
3183
|
-
try {
|
|
3184
|
-
o$6 = r.openSync(s$8.absolute, J$1(s$8.size), e$7);
|
|
3185
|
-
} catch (h$2) {
|
|
3186
|
-
return t$7(h$2);
|
|
3187
|
-
}
|
|
3188
|
-
const u$6 = this.transform && this.transform(s$8) || s$8;
|
|
3189
|
-
u$6 !== s$8 && (u$6.on("error", (h$2) => this[m$4](h$2, s$8)), s$8.pipe(u$6)), u$6.on("data", (h$2) => {
|
|
3190
|
-
try {
|
|
3191
|
-
r.writeSync(o$6, h$2, 0, h$2.length);
|
|
3192
|
-
} catch (c$6) {
|
|
3193
|
-
t$7(c$6);
|
|
3194
|
-
}
|
|
3195
|
-
}), u$6.on("end", (h$2) => {
|
|
3196
|
-
let c$6 = null;
|
|
3197
|
-
if (s$8.mtime && !this.noMtime) {
|
|
3198
|
-
const n$4 = s$8.atime || /* @__PURE__ */ new Date(), p$2 = s$8.mtime;
|
|
3199
|
-
try {
|
|
3200
|
-
r.futimesSync(o$6, n$4, p$2);
|
|
3201
|
-
} catch (f$5) {
|
|
3202
|
-
try {
|
|
3203
|
-
r.utimesSync(s$8.absolute, n$4, p$2);
|
|
3204
|
-
} catch {
|
|
3205
|
-
c$6 = f$5;
|
|
3206
|
-
}
|
|
3207
|
-
}
|
|
3208
|
-
}
|
|
3209
|
-
if (this[E$2](s$8)) {
|
|
3210
|
-
const n$4 = this[R$3](s$8), p$2 = this[_$2](s$8);
|
|
3211
|
-
try {
|
|
3212
|
-
r.fchownSync(o$6, n$4, p$2);
|
|
3213
|
-
} catch (f$5) {
|
|
3214
|
-
try {
|
|
3215
|
-
r.chownSync(s$8.absolute, n$4, p$2);
|
|
3216
|
-
} catch {
|
|
3217
|
-
c$6 = c$6 || f$5;
|
|
3218
|
-
}
|
|
3219
|
-
}
|
|
3220
|
-
}
|
|
3221
|
-
t$7(c$6);
|
|
3222
|
-
});
|
|
3223
|
-
}
|
|
3224
|
-
[F$1$1](s$8, i$8) {
|
|
3225
|
-
const e$7 = s$8.mode & 4095 || this.dmode, t$7 = this[b$1](s$8.absolute, e$7);
|
|
3226
|
-
if (t$7) {
|
|
3227
|
-
this[m$4](t$7, s$8), i$8();
|
|
3228
|
-
return;
|
|
3229
|
-
}
|
|
3230
|
-
if (s$8.mtime && !this.noMtime) try {
|
|
3231
|
-
r.utimesSync(s$8.absolute, s$8.atime || /* @__PURE__ */ new Date(), s$8.mtime);
|
|
3232
|
-
} catch {}
|
|
3233
|
-
if (this[E$2](s$8)) try {
|
|
3234
|
-
r.chownSync(s$8.absolute, this[R$3](s$8), this[_$2](s$8));
|
|
3235
|
-
} catch {}
|
|
3236
|
-
i$8(), s$8.resume();
|
|
3237
|
-
}
|
|
3238
|
-
[b$1](s$8, i$8) {
|
|
3239
|
-
try {
|
|
3240
|
-
return M$1.sync(l$3(s$8), {
|
|
3241
|
-
uid: this.uid,
|
|
3242
|
-
gid: this.gid,
|
|
3243
|
-
processUid: this.processUid,
|
|
3244
|
-
processGid: this.processGid,
|
|
3245
|
-
umask: this.processUmask,
|
|
3246
|
-
preserve: this.preservePaths,
|
|
3247
|
-
unlink: this.unlink,
|
|
3248
|
-
cache: this.dirCache,
|
|
3249
|
-
cwd: this.cwd,
|
|
3250
|
-
mode: i$8
|
|
3251
|
-
});
|
|
3252
|
-
} catch (e$7) {
|
|
3253
|
-
return e$7;
|
|
3254
|
-
}
|
|
3255
|
-
}
|
|
3256
|
-
[O$4](s$8, i$8, e$7, t$7) {
|
|
3257
|
-
try {
|
|
3258
|
-
r[e$7 + "Sync"](i$8, s$8.absolute), t$7(), s$8.resume();
|
|
3259
|
-
} catch (o$6) {
|
|
3260
|
-
return this[m$4](o$6, s$8);
|
|
3261
|
-
}
|
|
3262
|
-
}
|
|
3263
|
-
}
|
|
3264
|
-
return L.Sync = ls, G = L, G;
|
|
3265
|
-
}
|
|
3266
|
-
var f, q;
|
|
3267
|
-
function v() {
|
|
3268
|
-
if (q) return f;
|
|
3269
|
-
q = 1;
|
|
3270
|
-
const w$3 = s$6(), u$6 = Os(), p$2 = nativeFs, y$4 = X(), l$3 = path, m$4 = s();
|
|
3271
|
-
f = (r, e$7, o$6) => {
|
|
3272
|
-
typeof r == "function" ? (o$6 = r, e$7 = null, r = {}) : Array.isArray(r) && (e$7 = r, r = {}), typeof e$7 == "function" && (o$6 = e$7, e$7 = null), e$7 ? e$7 = Array.from(e$7) : e$7 = [];
|
|
3273
|
-
const t$7 = w$3(r);
|
|
3274
|
-
if (t$7.sync && typeof o$6 == "function") throw new TypeError("callback not supported for sync tar functions");
|
|
3275
|
-
if (!t$7.file && typeof o$6 == "function") throw new TypeError("callback only supported with file option");
|
|
3276
|
-
return e$7.length && d$1(t$7, e$7), t$7.file && t$7.sync ? $(t$7) : t$7.file ? h$2(t$7, o$6) : t$7.sync ? x$1(t$7) : z$2(t$7);
|
|
3277
|
-
};
|
|
3278
|
-
const d$1 = (r, e$7) => {
|
|
3279
|
-
const o$6 = new Map(e$7.map((n$4) => [m$4(n$4), true])), t$7 = r.filter, s$8 = (n$4, i$8) => {
|
|
3280
|
-
const a$11 = i$8 || l$3.parse(n$4).root || ".", c$6 = n$4 === a$11 ? false : o$6.has(n$4) ? o$6.get(n$4) : s$8(l$3.dirname(n$4), a$11);
|
|
3281
|
-
return o$6.set(n$4, c$6), c$6;
|
|
3282
|
-
};
|
|
3283
|
-
r.filter = t$7 ? (n$4, i$8) => t$7(n$4, i$8) && s$8(m$4(n$4)) : (n$4) => s$8(m$4(n$4));
|
|
3284
|
-
}, $ = (r) => {
|
|
3285
|
-
const e$7 = new u$6.Sync(r), o$6 = r.file, t$7 = p$2.statSync(o$6), s$8 = r.maxReadSize || 16 * 1024 * 1024;
|
|
3286
|
-
new y$4.ReadStreamSync(o$6, {
|
|
3287
|
-
readSize: s$8,
|
|
3288
|
-
size: t$7.size
|
|
3289
|
-
}).pipe(e$7);
|
|
3290
|
-
}, h$2 = (r, e$7) => {
|
|
3291
|
-
const o$6 = new u$6(r), t$7 = r.maxReadSize || 16 * 1024 * 1024, s$8 = r.file, n$4 = new Promise((i$8, a$11) => {
|
|
3292
|
-
o$6.on("error", a$11), o$6.on("close", i$8), p$2.stat(s$8, (c$6, R$3) => {
|
|
3293
|
-
if (c$6) a$11(c$6);
|
|
3294
|
-
else {
|
|
3295
|
-
const S$2 = new y$4.ReadStream(s$8, {
|
|
3296
|
-
readSize: t$7,
|
|
3297
|
-
size: R$3.size
|
|
3298
|
-
});
|
|
3299
|
-
S$2.on("error", a$11), S$2.pipe(o$6);
|
|
3300
|
-
}
|
|
3301
|
-
});
|
|
3302
|
-
});
|
|
3303
|
-
return e$7 ? n$4.then(e$7, e$7) : n$4;
|
|
3304
|
-
}, x$1 = (r) => new u$6.Sync(r), z$2 = (r) => new u$6(r);
|
|
3305
|
-
return f;
|
|
3306
|
-
}
|
|
3307
|
-
const tarExtract = getDefaultExportFromCjs(v());
|
|
3308
|
-
async function download(url, filePath, options = {}) {
|
|
3309
|
-
const infoPath = filePath + ".json";
|
|
3310
|
-
const info = JSON.parse(await readFile(infoPath, "utf8").catch(() => "{}"));
|
|
3311
|
-
const etag = (await sendFetch(url, {
|
|
3312
|
-
method: "HEAD",
|
|
3313
|
-
headers: options.headers
|
|
3314
|
-
}).catch(() => void 0))?.headers.get("etag");
|
|
3315
|
-
if (info.etag === etag && existsSync(filePath)) return;
|
|
3316
|
-
if (typeof etag === "string") info.etag = etag;
|
|
3317
|
-
const response = await sendFetch(url, { headers: options.headers });
|
|
3318
|
-
if (response.status >= 400) throw new Error(`Failed to download ${url}: ${response.status} ${response.statusText}`);
|
|
3319
|
-
const stream = createWriteStream(filePath);
|
|
3320
|
-
await promisify(pipeline)(response.body, stream);
|
|
3321
|
-
await writeFile(infoPath, JSON.stringify(info), "utf8");
|
|
3322
|
-
}
|
|
3323
|
-
const inputRegex = /^(?<repo>[\w.-]+\/[\w.-]+)(?<subdir>[^#]+)?(?<ref>#[\w./@-]+)?/;
|
|
3324
|
-
function parseGitURI(input) {
|
|
3325
|
-
const m$4 = input.match(inputRegex)?.groups || {};
|
|
3326
|
-
return {
|
|
3327
|
-
repo: m$4.repo,
|
|
3328
|
-
subdir: m$4.subdir || "/",
|
|
3329
|
-
ref: m$4.ref ? m$4.ref.slice(1) : "main"
|
|
3330
|
-
};
|
|
3331
|
-
}
|
|
3332
|
-
function debug(...args) {
|
|
3333
|
-
if (process.env.DEBUG) console.debug("[giget]", ...args);
|
|
3334
|
-
}
|
|
3335
|
-
async function sendFetch(url, options = {}) {
|
|
3336
|
-
if (options.headers?.["sec-fetch-mode"]) options.mode = options.headers["sec-fetch-mode"];
|
|
3337
|
-
const res = await l$1(url, {
|
|
3338
|
-
...options,
|
|
3339
|
-
headers: normalizeHeaders(options.headers)
|
|
3340
|
-
}).catch((error) => {
|
|
3341
|
-
throw new Error(`Failed to download ${url}: ${error}`, { cause: error });
|
|
3342
|
-
});
|
|
3343
|
-
if (options.validateStatus && res.status >= 400) throw new Error(`Failed to fetch ${url}: ${res.status} ${res.statusText}`);
|
|
3344
|
-
return res;
|
|
3345
|
-
}
|
|
3346
|
-
function cacheDirectory() {
|
|
3347
|
-
const cacheDir = process.env.XDG_CACHE_HOME ? resolve$2(process.env.XDG_CACHE_HOME, "giget") : resolve$2(homedir(), ".cache/giget");
|
|
3348
|
-
if (process.platform === "win32") {
|
|
3349
|
-
const windowsCacheDir = resolve$2(tmpdir(), "giget");
|
|
3350
|
-
if (!existsSync(windowsCacheDir) && existsSync(cacheDir)) try {
|
|
3351
|
-
renameSync(cacheDir, windowsCacheDir);
|
|
3352
|
-
} catch {}
|
|
3353
|
-
return windowsCacheDir;
|
|
3354
|
-
}
|
|
3355
|
-
return cacheDir;
|
|
3356
|
-
}
|
|
3357
|
-
function normalizeHeaders(headers = {}) {
|
|
3358
|
-
const normalized = {};
|
|
3359
|
-
for (const [key, value] of Object.entries(headers)) {
|
|
3360
|
-
if (!value) continue;
|
|
3361
|
-
normalized[key.toLowerCase()] = value;
|
|
3362
|
-
}
|
|
3363
|
-
return normalized;
|
|
3364
|
-
}
|
|
3365
|
-
const http = async (input, options) => {
|
|
3366
|
-
if (input.endsWith(".json")) return await _httpJSON(input, options);
|
|
3367
|
-
const url = new URL(input);
|
|
3368
|
-
let name = basename$2(url.pathname);
|
|
3369
|
-
try {
|
|
3370
|
-
const head = await sendFetch(url.href, {
|
|
3371
|
-
method: "HEAD",
|
|
3372
|
-
validateStatus: true,
|
|
3373
|
-
headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 }
|
|
3374
|
-
});
|
|
3375
|
-
if ((head.headers.get("content-type") || "").includes("application/json")) return await _httpJSON(input, options);
|
|
3376
|
-
const filename = head.headers.get("content-disposition")?.match(/filename="?(.+)"?/)?.[1];
|
|
3377
|
-
if (filename) name = filename.split(".")[0];
|
|
3378
|
-
} catch (error) {
|
|
3379
|
-
debug(`Failed to fetch HEAD for ${url.href}:`, error);
|
|
3380
|
-
}
|
|
3381
|
-
return {
|
|
3382
|
-
name: `${name}-${url.href.slice(0, 8)}`,
|
|
3383
|
-
version: "",
|
|
3384
|
-
subdir: "",
|
|
3385
|
-
tar: url.href,
|
|
3386
|
-
defaultDir: name,
|
|
3387
|
-
headers: { Authorization: options.auth ? `Bearer ${options.auth}` : void 0 }
|
|
3388
|
-
};
|
|
3389
|
-
};
|
|
3390
|
-
const _httpJSON = async (input, options) => {
|
|
3391
|
-
const info = await (await sendFetch(input, {
|
|
3392
|
-
validateStatus: true,
|
|
3393
|
-
headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 }
|
|
3394
|
-
})).json();
|
|
3395
|
-
if (!info.tar || !info.name) throw new Error(`Invalid template info from ${input}. name or tar fields are missing!`);
|
|
3396
|
-
return info;
|
|
3397
|
-
};
|
|
3398
|
-
const github = (input, options) => {
|
|
3399
|
-
const parsed = parseGitURI(input);
|
|
3400
|
-
const githubAPIURL = process.env.GIGET_GITHUB_URL || "https://api.github.com";
|
|
3401
|
-
return {
|
|
3402
|
-
name: parsed.repo.replace("/", "-"),
|
|
3403
|
-
version: parsed.ref,
|
|
3404
|
-
subdir: parsed.subdir,
|
|
3405
|
-
headers: {
|
|
3406
|
-
Authorization: options.auth ? `Bearer ${options.auth}` : void 0,
|
|
3407
|
-
Accept: "application/vnd.github+json",
|
|
3408
|
-
"X-GitHub-Api-Version": "2022-11-28"
|
|
3409
|
-
},
|
|
3410
|
-
url: `${githubAPIURL.replace("api.github.com", "github.com")}/${parsed.repo}/tree/${parsed.ref}${parsed.subdir}`,
|
|
3411
|
-
tar: `${githubAPIURL}/repos/${parsed.repo}/tarball/${parsed.ref}`
|
|
3412
|
-
};
|
|
3413
|
-
};
|
|
3414
|
-
const gitlab = (input, options) => {
|
|
3415
|
-
const parsed = parseGitURI(input);
|
|
3416
|
-
const gitlab2 = process.env.GIGET_GITLAB_URL || "https://gitlab.com";
|
|
3417
|
-
return {
|
|
3418
|
-
name: parsed.repo.replace("/", "-"),
|
|
3419
|
-
version: parsed.ref,
|
|
3420
|
-
subdir: parsed.subdir,
|
|
3421
|
-
headers: {
|
|
3422
|
-
authorization: options.auth ? `Bearer ${options.auth}` : void 0,
|
|
3423
|
-
"sec-fetch-mode": "same-origin"
|
|
3424
|
-
},
|
|
3425
|
-
url: `${gitlab2}/${parsed.repo}/tree/${parsed.ref}${parsed.subdir}`,
|
|
3426
|
-
tar: `${gitlab2}/${parsed.repo}/-/archive/${parsed.ref}.tar.gz`
|
|
3427
|
-
};
|
|
3428
|
-
};
|
|
3429
|
-
const bitbucket = (input, options) => {
|
|
3430
|
-
const parsed = parseGitURI(input);
|
|
3431
|
-
return {
|
|
3432
|
-
name: parsed.repo.replace("/", "-"),
|
|
3433
|
-
version: parsed.ref,
|
|
3434
|
-
subdir: parsed.subdir,
|
|
3435
|
-
headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 },
|
|
3436
|
-
url: `https://bitbucket.com/${parsed.repo}/src/${parsed.ref}${parsed.subdir}`,
|
|
3437
|
-
tar: `https://bitbucket.org/${parsed.repo}/get/${parsed.ref}.tar.gz`
|
|
3438
|
-
};
|
|
3439
|
-
};
|
|
3440
|
-
const sourcehut = (input, options) => {
|
|
3441
|
-
const parsed = parseGitURI(input);
|
|
3442
|
-
return {
|
|
3443
|
-
name: parsed.repo.replace("/", "-"),
|
|
3444
|
-
version: parsed.ref,
|
|
3445
|
-
subdir: parsed.subdir,
|
|
3446
|
-
headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 },
|
|
3447
|
-
url: `https://git.sr.ht/~${parsed.repo}/tree/${parsed.ref}/item${parsed.subdir}`,
|
|
3448
|
-
tar: `https://git.sr.ht/~${parsed.repo}/archive/${parsed.ref}.tar.gz`
|
|
3449
|
-
};
|
|
3450
|
-
};
|
|
3451
|
-
const providers = {
|
|
3452
|
-
http,
|
|
3453
|
-
https: http,
|
|
3454
|
-
github,
|
|
3455
|
-
gh: github,
|
|
3456
|
-
gitlab,
|
|
3457
|
-
bitbucket,
|
|
3458
|
-
sourcehut
|
|
3459
|
-
};
|
|
3460
|
-
const DEFAULT_REGISTRY = "https://raw.githubusercontent.com/unjs/giget/main/templates";
|
|
3461
|
-
const registryProvider = (registryEndpoint = DEFAULT_REGISTRY, options = {}) => {
|
|
3462
|
-
return async (input) => {
|
|
3463
|
-
const start = Date.now();
|
|
3464
|
-
const registryURL = `${registryEndpoint}/${input}.json`;
|
|
3465
|
-
const result = await sendFetch(registryURL, { headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 } });
|
|
3466
|
-
if (result.status >= 400) throw new Error(`Failed to download ${input} template info from ${registryURL}: ${result.status} ${result.statusText}`);
|
|
3467
|
-
const info = await result.json();
|
|
3468
|
-
if (!info.tar || !info.name) throw new Error(`Invalid template info from ${registryURL}. name or tar fields are missing!`);
|
|
3469
|
-
debug(`Fetched ${input} template info from ${registryURL} in ${Date.now() - start}ms`);
|
|
3470
|
-
return info;
|
|
3471
|
-
};
|
|
3472
|
-
};
|
|
3473
|
-
const sourceProtoRe = /^([\w-.]+):/;
|
|
3474
|
-
async function downloadTemplate(input, options = {}) {
|
|
3475
|
-
options = defu({
|
|
3476
|
-
registry: process.env.GIGET_REGISTRY,
|
|
3477
|
-
auth: process.env.GIGET_AUTH
|
|
3478
|
-
}, options);
|
|
3479
|
-
const registry = options.registry === false ? void 0 : registryProvider(options.registry, { auth: options.auth });
|
|
3480
|
-
let providerName = options.provider || (registry ? "registry" : "github");
|
|
3481
|
-
let source = input;
|
|
3482
|
-
const sourceProviderMatch = input.match(sourceProtoRe);
|
|
3483
|
-
if (sourceProviderMatch) {
|
|
3484
|
-
providerName = sourceProviderMatch[1];
|
|
3485
|
-
source = input.slice(sourceProviderMatch[0].length);
|
|
3486
|
-
if (providerName === "http" || providerName === "https") source = input;
|
|
3487
|
-
}
|
|
3488
|
-
const provider = options.providers?.[providerName] || providers[providerName] || registry;
|
|
3489
|
-
if (!provider) throw new Error(`Unsupported provider: ${providerName}`);
|
|
3490
|
-
const template = await Promise.resolve().then(() => provider(source, { auth: options.auth })).catch((error) => {
|
|
3491
|
-
throw new Error(`Failed to download template from ${providerName}: ${error.message}`);
|
|
3492
|
-
});
|
|
3493
|
-
if (!template) throw new Error(`Failed to resolve template from ${providerName}`);
|
|
3494
|
-
template.name = (template.name || "template").replace(/[^\da-z-]/gi, "-");
|
|
3495
|
-
template.defaultDir = (template.defaultDir || template.name).replace(/[^\da-z-]/gi, "-");
|
|
3496
|
-
const tarPath = resolve$2(resolve$2(cacheDirectory(), providerName, template.name), (template.version || template.name) + ".tar.gz");
|
|
3497
|
-
if (options.preferOffline && existsSync(tarPath)) options.offline = true;
|
|
3498
|
-
if (!options.offline) {
|
|
3499
|
-
await mkdir(dirname$2(tarPath), { recursive: true });
|
|
3500
|
-
const s2 = Date.now();
|
|
3501
|
-
await download(template.tar, tarPath, { headers: {
|
|
3502
|
-
Authorization: options.auth ? `Bearer ${options.auth}` : void 0,
|
|
3503
|
-
...normalizeHeaders(template.headers)
|
|
3504
|
-
} }).catch((error) => {
|
|
3505
|
-
if (!existsSync(tarPath)) throw error;
|
|
3506
|
-
debug("Download error. Using cached version:", error);
|
|
3507
|
-
options.offline = true;
|
|
3508
|
-
});
|
|
3509
|
-
debug(`Downloaded ${template.tar} to ${tarPath} in ${Date.now() - s2}ms`);
|
|
3510
|
-
}
|
|
3511
|
-
if (!existsSync(tarPath)) throw new Error(`Tarball not found: ${tarPath} (offline: ${options.offline})`);
|
|
3512
|
-
const extractPath = resolve$2(resolve$2(options.cwd || "."), options.dir || template.defaultDir);
|
|
3513
|
-
if (options.forceClean) await rm(extractPath, {
|
|
3514
|
-
recursive: true,
|
|
3515
|
-
force: true
|
|
3516
|
-
});
|
|
3517
|
-
if (!options.force && existsSync(extractPath) && readdirSync(extractPath).length > 0) throw new Error(`Destination ${extractPath} already exists.`);
|
|
3518
|
-
await mkdir(extractPath, { recursive: true });
|
|
3519
|
-
const s$8 = Date.now();
|
|
3520
|
-
const subdir = template.subdir?.replace(/^\//, "") || "";
|
|
3521
|
-
await tarExtract({
|
|
3522
|
-
file: tarPath,
|
|
3523
|
-
cwd: extractPath,
|
|
3524
|
-
onentry(entry) {
|
|
3525
|
-
entry.path = entry.path.split("/").splice(1).join("/");
|
|
3526
|
-
if (subdir) if (entry.path.startsWith(subdir + "/")) entry.path = entry.path.slice(subdir.length);
|
|
3527
|
-
else entry.path = "";
|
|
3528
|
-
}
|
|
3529
|
-
});
|
|
3530
|
-
debug(`Extracted to ${extractPath} in ${Date.now() - s$8}ms`);
|
|
3531
|
-
if (options.install) {
|
|
3532
|
-
debug("Installing dependencies...");
|
|
3533
|
-
await installDependencies({
|
|
3534
|
-
cwd: extractPath,
|
|
3535
|
-
silent: options.silent
|
|
3536
|
-
});
|
|
3537
|
-
}
|
|
3538
|
-
return {
|
|
3539
|
-
...template,
|
|
3540
|
-
source,
|
|
3541
|
-
dir: extractPath
|
|
3542
|
-
};
|
|
3543
|
-
}
|
|
3544
|
-
|
|
3545
|
-
//#endregion
|
|
3546
|
-
//#region node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs
|
|
3547
|
-
var dist_exports = /* @__PURE__ */ __exportAll({ downloadTemplate: () => downloadTemplate });
|
|
3548
|
-
|
|
3549
|
-
//#endregion
|
|
3550
|
-
export { addDependency as a, installDependencies as c, dist_exports$1 as i, packageManagers as l, downloadTemplate as n, addDevDependency as o, registryProvider as r, detectPackageManager as s, dist_exports as t };
|