sv 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_commonjsHelpers-n7_cr1vO.js +694 -0
- package/dist/_commonjsHelpers-n7_cr1vO.js.map +1 -0
- package/dist/bin.js +501 -44153
- package/dist/bin.js.map +1 -1
- package/dist/index.js +75 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/install.d.ts +14 -0
- package/dist/lib/testing.d.ts +31 -0
- package/dist/processor-SieBGHed.js +43144 -0
- package/dist/processor-SieBGHed.js.map +1 -0
- package/dist/shared.json +8 -0
- package/dist/testing.js +15581 -0
- package/dist/testing.js.map +1 -0
- package/package.json +12 -4
- package/dist/index-A89HFWzv.js +0 -137
- package/dist/index-A89HFWzv.js.map +0 -1
- package/dist/index.d.ts +0 -2
|
@@ -0,0 +1,694 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { createRequire } from 'node:module';
|
|
5
|
+
import { spawn } from 'child_process';
|
|
6
|
+
import { normalize, delimiter, resolve, dirname } from 'path';
|
|
7
|
+
import { cwd } from 'process';
|
|
8
|
+
import { PassThrough } from 'stream';
|
|
9
|
+
import me from 'readline';
|
|
10
|
+
|
|
11
|
+
function mkdirp(dir) {
|
|
12
|
+
try {
|
|
13
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
14
|
+
} catch (err) {
|
|
15
|
+
const e = err;
|
|
16
|
+
if (e.code === "EEXIST") return;
|
|
17
|
+
throw e;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function identity(x) {
|
|
21
|
+
return x;
|
|
22
|
+
}
|
|
23
|
+
function copy(from, to, rename = identity) {
|
|
24
|
+
if (!fs.existsSync(from)) return;
|
|
25
|
+
const stats = fs.statSync(from);
|
|
26
|
+
if (stats.isDirectory()) {
|
|
27
|
+
fs.readdirSync(from).forEach((file) => {
|
|
28
|
+
copy(path.join(from, file), path.join(to, rename(file)));
|
|
29
|
+
});
|
|
30
|
+
} else {
|
|
31
|
+
mkdirp(path.dirname(to));
|
|
32
|
+
fs.copyFileSync(from, to);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function dist(path2) {
|
|
36
|
+
const insideDistFolder = import.meta.url.includes("dist");
|
|
37
|
+
return fileURLToPath(
|
|
38
|
+
new URL(`./${!insideDistFolder ? "dist/" : ""}${path2}`, import.meta.url).href
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
const templateTypes = ["minimal", "demo", "library"];
|
|
42
|
+
const languageTypes = ["typescript", "checkjs", "none"];
|
|
43
|
+
function create(cwd, options) {
|
|
44
|
+
mkdirp(cwd);
|
|
45
|
+
write_template_files(options.template, options.types, options.name, cwd);
|
|
46
|
+
write_common_files(cwd, options, options.name);
|
|
47
|
+
}
|
|
48
|
+
const templates = templateTypes.map((dir) => {
|
|
49
|
+
const meta_file = dist(`templates/${dir}/meta.json`);
|
|
50
|
+
const { title, description } = JSON.parse(fs.readFileSync(meta_file, "utf8"));
|
|
51
|
+
return {
|
|
52
|
+
name: dir,
|
|
53
|
+
title,
|
|
54
|
+
description
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
function write_template_files(template, types, name, cwd) {
|
|
58
|
+
const dir = dist(`templates/${template}`);
|
|
59
|
+
copy(`${dir}/assets`, cwd, (name2) => name2.replace("DOT-", "."));
|
|
60
|
+
copy(`${dir}/package.json`, `${cwd}/package.json`);
|
|
61
|
+
const manifest = `${dir}/files.types=${types}.json`;
|
|
62
|
+
const files = JSON.parse(fs.readFileSync(manifest, "utf-8"));
|
|
63
|
+
files.forEach((file) => {
|
|
64
|
+
const dest = path.join(cwd, file.name);
|
|
65
|
+
mkdirp(path.dirname(dest));
|
|
66
|
+
fs.writeFileSync(dest, file.contents.replace(/~TODO~/g, name));
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function write_common_files(cwd, options, name) {
|
|
70
|
+
const shared = dist("shared.json");
|
|
71
|
+
const { files } = JSON.parse(fs.readFileSync(shared, "utf-8"));
|
|
72
|
+
const pkg_file = path.join(cwd, "package.json");
|
|
73
|
+
const pkg = (
|
|
74
|
+
/** @type {any} */
|
|
75
|
+
JSON.parse(fs.readFileSync(pkg_file, "utf-8"))
|
|
76
|
+
);
|
|
77
|
+
sort_files(files).forEach((file) => {
|
|
78
|
+
const include = file.include.every((condition) => matches_condition(condition, options));
|
|
79
|
+
const exclude = file.exclude.some((condition) => matches_condition(condition, options));
|
|
80
|
+
if (exclude || !include) return;
|
|
81
|
+
if (file.name === "package.json") {
|
|
82
|
+
const new_pkg = JSON.parse(file.contents);
|
|
83
|
+
merge(pkg, new_pkg);
|
|
84
|
+
} else {
|
|
85
|
+
const dest = path.join(cwd, file.name);
|
|
86
|
+
mkdirp(path.dirname(dest));
|
|
87
|
+
fs.writeFileSync(dest, file.contents);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
pkg.dependencies = sort_keys(pkg.dependencies);
|
|
91
|
+
pkg.devDependencies = sort_keys(pkg.devDependencies);
|
|
92
|
+
pkg.name = to_valid_package_name(name);
|
|
93
|
+
fs.writeFileSync(pkg_file, JSON.stringify(pkg, null, " ") + "\n");
|
|
94
|
+
}
|
|
95
|
+
function matches_condition(condition, options) {
|
|
96
|
+
if (templateTypes.includes(condition)) {
|
|
97
|
+
return options.template === condition;
|
|
98
|
+
}
|
|
99
|
+
if (languageTypes.includes(condition)) {
|
|
100
|
+
return options.types === condition;
|
|
101
|
+
}
|
|
102
|
+
return Boolean(options[condition]);
|
|
103
|
+
}
|
|
104
|
+
function merge(target, source) {
|
|
105
|
+
for (const key in source) {
|
|
106
|
+
if (key in target) {
|
|
107
|
+
const target_value = target[key];
|
|
108
|
+
const source_value = source[key];
|
|
109
|
+
if (typeof source_value !== typeof target_value || Array.isArray(source_value) !== Array.isArray(target_value)) {
|
|
110
|
+
throw new Error("Mismatched values");
|
|
111
|
+
}
|
|
112
|
+
if (typeof source_value === "object") {
|
|
113
|
+
merge(target_value, source_value);
|
|
114
|
+
} else {
|
|
115
|
+
target[key] = source_value;
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
target[key] = source[key];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function sort_keys(obj) {
|
|
123
|
+
if (!obj) return;
|
|
124
|
+
const sorted = {};
|
|
125
|
+
Object.keys(obj).sort().forEach((key) => {
|
|
126
|
+
sorted[key] = obj[key];
|
|
127
|
+
});
|
|
128
|
+
return sorted;
|
|
129
|
+
}
|
|
130
|
+
function sort_files(files) {
|
|
131
|
+
return files.sort((f1, f2) => {
|
|
132
|
+
const f1_more_generic = f1.include.every((include) => f2.include.includes(include)) && f1.exclude.every((exclude) => f2.exclude.includes(exclude));
|
|
133
|
+
const f2_more_generic = f2.include.every((include) => f1.include.includes(include)) && f2.exclude.every((exclude) => f1.exclude.includes(exclude));
|
|
134
|
+
const same = f1_more_generic && f2_more_generic;
|
|
135
|
+
const different = !f1_more_generic && !f2_more_generic;
|
|
136
|
+
return same || different ? 0 : f1_more_generic ? -1 : 1;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function to_valid_package_name(name) {
|
|
140
|
+
return name.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z0-9~.-]+/g, "-");
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const require = createRequire(import.meta.url);
|
|
144
|
+
var St = Object.create;
|
|
145
|
+
var $ = Object.defineProperty;
|
|
146
|
+
var kt = Object.getOwnPropertyDescriptor;
|
|
147
|
+
var Tt = Object.getOwnPropertyNames;
|
|
148
|
+
var At = Object.getPrototypeOf, Rt = Object.prototype.hasOwnProperty;
|
|
149
|
+
var h = /* @__PURE__ */ ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, {
|
|
150
|
+
get: (e, n) => (typeof require < "u" ? require : e)[n]
|
|
151
|
+
}) : t)(function(t) {
|
|
152
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
153
|
+
throw Error('Dynamic require of "' + t + '" is not supported');
|
|
154
|
+
});
|
|
155
|
+
var l = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
|
|
156
|
+
var $t = (t, e, n, r) => {
|
|
157
|
+
if (e && typeof e == "object" || typeof e == "function")
|
|
158
|
+
for (let s of Tt(e))
|
|
159
|
+
!Rt.call(t, s) && s !== n && $(t, s, { get: () => e[s], enumerable: !(r = kt(e, s)) || r.enumerable });
|
|
160
|
+
return t;
|
|
161
|
+
};
|
|
162
|
+
var Nt = (t, e, n) => (n = t != null ? St(At(t)) : {}, $t(
|
|
163
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
164
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
165
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
166
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
167
|
+
$(n, "default", { value: t, enumerable: !0 }) ,
|
|
168
|
+
t
|
|
169
|
+
));
|
|
170
|
+
|
|
171
|
+
// node_modules/isexe/windows.js
|
|
172
|
+
var W = l((Se, H) => {
|
|
173
|
+
H.exports = z;
|
|
174
|
+
z.sync = Wt;
|
|
175
|
+
var j = h("fs");
|
|
176
|
+
function Ht(t, e) {
|
|
177
|
+
var n = e.pathExt !== void 0 ? e.pathExt : process.env.PATHEXT;
|
|
178
|
+
if (!n || (n = n.split(";"), n.indexOf("") !== -1))
|
|
179
|
+
return !0;
|
|
180
|
+
for (var r = 0; r < n.length; r++) {
|
|
181
|
+
var s = n[r].toLowerCase();
|
|
182
|
+
if (s && t.substr(-s.length).toLowerCase() === s)
|
|
183
|
+
return !0;
|
|
184
|
+
}
|
|
185
|
+
return !1;
|
|
186
|
+
}
|
|
187
|
+
function F(t, e, n) {
|
|
188
|
+
return !t.isSymbolicLink() && !t.isFile() ? !1 : Ht(e, n);
|
|
189
|
+
}
|
|
190
|
+
function z(t, e, n) {
|
|
191
|
+
j.stat(t, function(r, s) {
|
|
192
|
+
n(r, r ? !1 : F(s, t, e));
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function Wt(t, e) {
|
|
196
|
+
return F(j.statSync(t), t, e);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
// node_modules/isexe/mode.js
|
|
201
|
+
var X = l((ke, B) => {
|
|
202
|
+
B.exports = K;
|
|
203
|
+
K.sync = Dt;
|
|
204
|
+
var D = h("fs");
|
|
205
|
+
function K(t, e, n) {
|
|
206
|
+
D.stat(t, function(r, s) {
|
|
207
|
+
n(r, r ? !1 : M(s, e));
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
function Dt(t, e) {
|
|
211
|
+
return M(D.statSync(t), e);
|
|
212
|
+
}
|
|
213
|
+
function M(t, e) {
|
|
214
|
+
return t.isFile() && Kt(t, e);
|
|
215
|
+
}
|
|
216
|
+
function Kt(t, e) {
|
|
217
|
+
var n = t.mode, r = t.uid, s = t.gid, o = e.uid !== void 0 ? e.uid : process.getuid && process.getuid(), i = e.gid !== void 0 ? e.gid : process.getgid && process.getgid(), a = parseInt("100", 8), c = parseInt("010", 8), u = parseInt("001", 8), f = a | c, p = n & u || n & c && s === i || n & a && r === o || n & f && o === 0;
|
|
218
|
+
return p;
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// node_modules/isexe/index.js
|
|
223
|
+
var U = l((Ae, G) => {
|
|
224
|
+
h("fs"); var v;
|
|
225
|
+
process.platform === "win32" || global.TESTING_WINDOWS ? v = W() : v = X();
|
|
226
|
+
G.exports = y;
|
|
227
|
+
y.sync = Mt;
|
|
228
|
+
function y(t, e, n) {
|
|
229
|
+
if (typeof e == "function" && (n = e, e = {}), !n) {
|
|
230
|
+
if (typeof Promise != "function")
|
|
231
|
+
throw new TypeError("callback not provided");
|
|
232
|
+
return new Promise(function(r, s) {
|
|
233
|
+
y(t, e || {}, function(o, i) {
|
|
234
|
+
o ? s(o) : r(i);
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
v(t, e || {}, function(r, s) {
|
|
239
|
+
r && (r.code === "EACCES" || e && e.ignoreErrors) && (r = null, s = !1), n(r, s);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
function Mt(t, e) {
|
|
243
|
+
try {
|
|
244
|
+
return v.sync(t, e || {});
|
|
245
|
+
} catch (n) {
|
|
246
|
+
if (e && e.ignoreErrors || n.code === "EACCES")
|
|
247
|
+
return !1;
|
|
248
|
+
throw n;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// node_modules/which/which.js
|
|
254
|
+
var et = l((Re, tt) => {
|
|
255
|
+
var g = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys", Y = h("path"), Bt = g ? ";" : ":", V = U(), J = (t) => Object.assign(new Error(`not found: ${t}`), { code: "ENOENT" }), Q = (t, e) => {
|
|
256
|
+
let n = e.colon || Bt, r = t.match(/\//) || g && t.match(/\\/) ? [""] : [
|
|
257
|
+
// windows always checks the cwd first
|
|
258
|
+
...g ? [process.cwd()] : [],
|
|
259
|
+
...(e.path || process.env.PATH || /* istanbul ignore next: very unusual */
|
|
260
|
+
"").split(n)
|
|
261
|
+
], s = g ? e.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "", o = g ? s.split(n) : [""];
|
|
262
|
+
return g && t.indexOf(".") !== -1 && o[0] !== "" && o.unshift(""), {
|
|
263
|
+
pathEnv: r,
|
|
264
|
+
pathExt: o,
|
|
265
|
+
pathExtExe: s
|
|
266
|
+
};
|
|
267
|
+
}, Z = (t, e, n) => {
|
|
268
|
+
typeof e == "function" && (n = e, e = {}), e || (e = {});
|
|
269
|
+
let { pathEnv: r, pathExt: s, pathExtExe: o } = Q(t, e), i = [], a = (u) => new Promise((f, p) => {
|
|
270
|
+
if (u === r.length)
|
|
271
|
+
return e.all && i.length ? f(i) : p(J(t));
|
|
272
|
+
let d = r[u], w = /^".*"$/.test(d) ? d.slice(1, -1) : d, m = Y.join(w, t), b = !w && /^\.[\\\/]/.test(t) ? t.slice(0, 2) + m : m;
|
|
273
|
+
f(c(b, u, 0));
|
|
274
|
+
}), c = (u, f, p) => new Promise((d, w) => {
|
|
275
|
+
if (p === s.length)
|
|
276
|
+
return d(a(f + 1));
|
|
277
|
+
let m = s[p];
|
|
278
|
+
V(u + m, { pathExt: o }, (b, Ot) => {
|
|
279
|
+
if (!b && Ot)
|
|
280
|
+
if (e.all)
|
|
281
|
+
i.push(u + m);
|
|
282
|
+
else
|
|
283
|
+
return d(u + m);
|
|
284
|
+
return d(c(u, f, p + 1));
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
return n ? a(0).then((u) => n(null, u), n) : a(0);
|
|
288
|
+
}, Xt = (t, e) => {
|
|
289
|
+
e = e || {};
|
|
290
|
+
let { pathEnv: n, pathExt: r, pathExtExe: s } = Q(t, e), o = [];
|
|
291
|
+
for (let i = 0; i < n.length; i++) {
|
|
292
|
+
let a = n[i], c = /^".*"$/.test(a) ? a.slice(1, -1) : a, u = Y.join(c, t), f = !c && /^\.[\\\/]/.test(t) ? t.slice(0, 2) + u : u;
|
|
293
|
+
for (let p = 0; p < r.length; p++) {
|
|
294
|
+
let d = f + r[p];
|
|
295
|
+
try {
|
|
296
|
+
if (V.sync(d, { pathExt: s }))
|
|
297
|
+
if (e.all)
|
|
298
|
+
o.push(d);
|
|
299
|
+
else
|
|
300
|
+
return d;
|
|
301
|
+
} catch {
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (e.all && o.length)
|
|
306
|
+
return o;
|
|
307
|
+
if (e.nothrow)
|
|
308
|
+
return null;
|
|
309
|
+
throw J(t);
|
|
310
|
+
};
|
|
311
|
+
tt.exports = Z;
|
|
312
|
+
Z.sync = Xt;
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
// node_modules/path-key/index.js
|
|
316
|
+
var rt = l(($e, _) => {
|
|
317
|
+
var nt = (t = {}) => {
|
|
318
|
+
let e = t.env || process.env;
|
|
319
|
+
return (t.platform || process.platform) !== "win32" ? "PATH" : Object.keys(e).reverse().find((r) => r.toUpperCase() === "PATH") || "Path";
|
|
320
|
+
};
|
|
321
|
+
_.exports = nt;
|
|
322
|
+
_.exports.default = nt;
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
// node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
326
|
+
var ct = l((Ne, it) => {
|
|
327
|
+
var st = h("path"), Gt = et(), Ut = rt();
|
|
328
|
+
function ot(t, e) {
|
|
329
|
+
let n = t.options.env || process.env, r = process.cwd(), s = t.options.cwd != null, o = s && process.chdir !== void 0 && !process.chdir.disabled;
|
|
330
|
+
if (o)
|
|
331
|
+
try {
|
|
332
|
+
process.chdir(t.options.cwd);
|
|
333
|
+
} catch {
|
|
334
|
+
}
|
|
335
|
+
let i;
|
|
336
|
+
try {
|
|
337
|
+
i = Gt.sync(t.command, {
|
|
338
|
+
path: n[Ut({ env: n })],
|
|
339
|
+
pathExt: e ? st.delimiter : void 0
|
|
340
|
+
});
|
|
341
|
+
} catch {
|
|
342
|
+
} finally {
|
|
343
|
+
o && process.chdir(r);
|
|
344
|
+
}
|
|
345
|
+
return i && (i = st.resolve(s ? t.options.cwd : "", i)), i;
|
|
346
|
+
}
|
|
347
|
+
function Yt(t) {
|
|
348
|
+
return ot(t) || ot(t, !0);
|
|
349
|
+
}
|
|
350
|
+
it.exports = Yt;
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
// node_modules/cross-spawn/lib/util/escape.js
|
|
354
|
+
var ut = l((qe, P) => {
|
|
355
|
+
var C = /([()\][%!^"`<>&|;, *?])/g;
|
|
356
|
+
function Vt(t) {
|
|
357
|
+
return t = t.replace(C, "^$1"), t;
|
|
358
|
+
}
|
|
359
|
+
function Jt(t, e) {
|
|
360
|
+
return t = `${t}`, t = t.replace(/(\\*)"/g, '$1$1\\"'), t = t.replace(/(\\*)$/, "$1$1"), t = `"${t}"`, t = t.replace(C, "^$1"), e && (t = t.replace(C, "^$1")), t;
|
|
361
|
+
}
|
|
362
|
+
P.exports.command = Vt;
|
|
363
|
+
P.exports.argument = Jt;
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
// node_modules/shebang-regex/index.js
|
|
367
|
+
var lt = l((Ie, at) => {
|
|
368
|
+
at.exports = /^#!(.*)/;
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
// node_modules/shebang-command/index.js
|
|
372
|
+
var dt = l((Le, pt) => {
|
|
373
|
+
var Qt = lt();
|
|
374
|
+
pt.exports = (t = "") => {
|
|
375
|
+
let e = t.match(Qt);
|
|
376
|
+
if (!e)
|
|
377
|
+
return null;
|
|
378
|
+
let [n, r] = e[0].replace(/#! ?/, "").split(" "), s = n.split("/").pop();
|
|
379
|
+
return s === "env" ? r : r ? `${s} ${r}` : s;
|
|
380
|
+
};
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
// node_modules/cross-spawn/lib/util/readShebang.js
|
|
384
|
+
var ht = l((je, ft) => {
|
|
385
|
+
var O = h("fs"), Zt = dt();
|
|
386
|
+
function te(t) {
|
|
387
|
+
let n = Buffer.alloc(150), r;
|
|
388
|
+
try {
|
|
389
|
+
r = O.openSync(t, "r"), O.readSync(r, n, 0, 150, 0), O.closeSync(r);
|
|
390
|
+
} catch {
|
|
391
|
+
}
|
|
392
|
+
return Zt(n.toString());
|
|
393
|
+
}
|
|
394
|
+
ft.exports = te;
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
// node_modules/cross-spawn/lib/parse.js
|
|
398
|
+
var wt = l((Fe, Et) => {
|
|
399
|
+
var ee = h("path"), mt = ct(), gt = ut(), ne = ht(), re = process.platform === "win32", se = /\.(?:com|exe)$/i, oe = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
400
|
+
function ie(t) {
|
|
401
|
+
t.file = mt(t);
|
|
402
|
+
let e = t.file && ne(t.file);
|
|
403
|
+
return e ? (t.args.unshift(t.file), t.command = e, mt(t)) : t.file;
|
|
404
|
+
}
|
|
405
|
+
function ce(t) {
|
|
406
|
+
if (!re)
|
|
407
|
+
return t;
|
|
408
|
+
let e = ie(t), n = !se.test(e);
|
|
409
|
+
if (t.options.forceShell || n) {
|
|
410
|
+
let r = oe.test(e);
|
|
411
|
+
t.command = ee.normalize(t.command), t.command = gt.command(t.command), t.args = t.args.map((o) => gt.argument(o, r));
|
|
412
|
+
let s = [t.command].concat(t.args).join(" ");
|
|
413
|
+
t.args = ["/d", "/s", "/c", `"${s}"`], t.command = process.env.comspec || "cmd.exe", t.options.windowsVerbatimArguments = !0;
|
|
414
|
+
}
|
|
415
|
+
return t;
|
|
416
|
+
}
|
|
417
|
+
function ue(t, e, n) {
|
|
418
|
+
e && !Array.isArray(e) && (n = e, e = null), e = e ? e.slice(0) : [], n = Object.assign({}, n);
|
|
419
|
+
let r = {
|
|
420
|
+
command: t,
|
|
421
|
+
args: e,
|
|
422
|
+
options: n,
|
|
423
|
+
file: void 0,
|
|
424
|
+
original: {
|
|
425
|
+
command: t,
|
|
426
|
+
args: e
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
return n.shell ? r : ce(r);
|
|
430
|
+
}
|
|
431
|
+
Et.exports = ue;
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
// node_modules/cross-spawn/lib/enoent.js
|
|
435
|
+
var bt = l((ze, vt) => {
|
|
436
|
+
var S = process.platform === "win32";
|
|
437
|
+
function k(t, e) {
|
|
438
|
+
return Object.assign(new Error(`${e} ${t.command} ENOENT`), {
|
|
439
|
+
code: "ENOENT",
|
|
440
|
+
errno: "ENOENT",
|
|
441
|
+
syscall: `${e} ${t.command}`,
|
|
442
|
+
path: t.command,
|
|
443
|
+
spawnargs: t.args
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
function ae(t, e) {
|
|
447
|
+
if (!S)
|
|
448
|
+
return;
|
|
449
|
+
let n = t.emit;
|
|
450
|
+
t.emit = function(r, s) {
|
|
451
|
+
if (r === "exit") {
|
|
452
|
+
let o = xt(s, e);
|
|
453
|
+
if (o)
|
|
454
|
+
return n.call(t, "error", o);
|
|
455
|
+
}
|
|
456
|
+
return n.apply(t, arguments);
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
function xt(t, e) {
|
|
460
|
+
return S && t === 1 && !e.file ? k(e.original, "spawn") : null;
|
|
461
|
+
}
|
|
462
|
+
function le(t, e) {
|
|
463
|
+
return S && t === 1 && !e.file ? k(e.original, "spawnSync") : null;
|
|
464
|
+
}
|
|
465
|
+
vt.exports = {
|
|
466
|
+
hookChildProcess: ae,
|
|
467
|
+
verifyENOENT: xt,
|
|
468
|
+
verifyENOENTSync: le,
|
|
469
|
+
notFoundError: k
|
|
470
|
+
};
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
// node_modules/cross-spawn/index.js
|
|
474
|
+
var Ct = l((He, E) => {
|
|
475
|
+
var yt = h("child_process"), T = wt(), A = bt();
|
|
476
|
+
function _t(t, e, n) {
|
|
477
|
+
let r = T(t, e, n), s = yt.spawn(r.command, r.args, r.options);
|
|
478
|
+
return A.hookChildProcess(s, r), s;
|
|
479
|
+
}
|
|
480
|
+
function pe(t, e, n) {
|
|
481
|
+
let r = T(t, e, n), s = yt.spawnSync(r.command, r.args, r.options);
|
|
482
|
+
return s.error = s.error || A.verifyENOENTSync(s.status, r), s;
|
|
483
|
+
}
|
|
484
|
+
E.exports = _t;
|
|
485
|
+
E.exports.spawn = _t;
|
|
486
|
+
E.exports.sync = pe;
|
|
487
|
+
E.exports._parse = T;
|
|
488
|
+
E.exports._enoent = A;
|
|
489
|
+
});
|
|
490
|
+
var Lt = /^path$/i, q = { key: "PATH", value: "" };
|
|
491
|
+
function jt(t) {
|
|
492
|
+
for (let e in t) {
|
|
493
|
+
if (!Object.prototype.hasOwnProperty.call(t, e) || !Lt.test(e))
|
|
494
|
+
continue;
|
|
495
|
+
let n = t[e];
|
|
496
|
+
return n ? { key: e, value: n } : q;
|
|
497
|
+
}
|
|
498
|
+
return q;
|
|
499
|
+
}
|
|
500
|
+
function Ft(t, e) {
|
|
501
|
+
let n = e.value.split(delimiter), r = t, s;
|
|
502
|
+
do
|
|
503
|
+
n.push(resolve(r, "node_modules", ".bin")), s = r, r = dirname(r);
|
|
504
|
+
while (r !== s);
|
|
505
|
+
return { key: e.key, value: n.join(delimiter) };
|
|
506
|
+
}
|
|
507
|
+
function I(t, e) {
|
|
508
|
+
let n = {
|
|
509
|
+
...process.env,
|
|
510
|
+
...e
|
|
511
|
+
}, r = Ft(t, jt(n));
|
|
512
|
+
return n[r.key] = r.value, n;
|
|
513
|
+
}
|
|
514
|
+
var L = (t) => {
|
|
515
|
+
let e = t.length, n = new PassThrough(), r = () => {
|
|
516
|
+
--e === 0 && n.emit("end");
|
|
517
|
+
};
|
|
518
|
+
for (let s of t)
|
|
519
|
+
s.pipe(n, { end: !1 }), s.on("end", r);
|
|
520
|
+
return n;
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
// src/main.ts
|
|
524
|
+
var Pt = Nt(Ct());
|
|
525
|
+
|
|
526
|
+
// src/non-zero-exit-error.ts
|
|
527
|
+
var x = class extends Error {
|
|
528
|
+
result;
|
|
529
|
+
output;
|
|
530
|
+
get exitCode() {
|
|
531
|
+
if (this.result.exitCode !== null)
|
|
532
|
+
return this.result.exitCode;
|
|
533
|
+
}
|
|
534
|
+
constructor(e, n) {
|
|
535
|
+
super(`Process exited with non-zero status (${e.exitCode})`), this.result = e, this.output = n;
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
// src/main.ts
|
|
540
|
+
var ge = {
|
|
541
|
+
timeout: void 0,
|
|
542
|
+
persist: !1
|
|
543
|
+
}, Ee = {
|
|
544
|
+
windowsHide: !0
|
|
545
|
+
};
|
|
546
|
+
function we(t, e) {
|
|
547
|
+
return {
|
|
548
|
+
command: normalize(t),
|
|
549
|
+
args: e ?? []
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
function xe(t) {
|
|
553
|
+
let e = new AbortController();
|
|
554
|
+
for (let n of t) {
|
|
555
|
+
if (n.aborted)
|
|
556
|
+
return e.abort(), n;
|
|
557
|
+
let r = () => {
|
|
558
|
+
e.abort(n.reason);
|
|
559
|
+
};
|
|
560
|
+
n.addEventListener("abort", r, {
|
|
561
|
+
signal: e.signal
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
return e.signal;
|
|
565
|
+
}
|
|
566
|
+
var R = class {
|
|
567
|
+
_process;
|
|
568
|
+
_aborted = !1;
|
|
569
|
+
_options;
|
|
570
|
+
_command;
|
|
571
|
+
_args;
|
|
572
|
+
_resolveClose;
|
|
573
|
+
_processClosed;
|
|
574
|
+
_thrownError;
|
|
575
|
+
get process() {
|
|
576
|
+
return this._process;
|
|
577
|
+
}
|
|
578
|
+
get pid() {
|
|
579
|
+
return this._process?.pid;
|
|
580
|
+
}
|
|
581
|
+
get exitCode() {
|
|
582
|
+
if (this._process && this._process.exitCode !== null)
|
|
583
|
+
return this._process.exitCode;
|
|
584
|
+
}
|
|
585
|
+
constructor(e, n, r) {
|
|
586
|
+
this._options = {
|
|
587
|
+
...ge,
|
|
588
|
+
...r
|
|
589
|
+
}, this._command = e, this._args = n ?? [], this._processClosed = new Promise((s) => {
|
|
590
|
+
this._resolveClose = s;
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
kill(e) {
|
|
594
|
+
return this._process?.kill(e) === !0;
|
|
595
|
+
}
|
|
596
|
+
get aborted() {
|
|
597
|
+
return this._aborted;
|
|
598
|
+
}
|
|
599
|
+
get killed() {
|
|
600
|
+
return this._process?.killed === !0;
|
|
601
|
+
}
|
|
602
|
+
pipe(e, n, r) {
|
|
603
|
+
return be(e, n, {
|
|
604
|
+
...r,
|
|
605
|
+
stdin: this
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
async *[Symbol.asyncIterator]() {
|
|
609
|
+
let e = this._process;
|
|
610
|
+
if (!e)
|
|
611
|
+
return;
|
|
612
|
+
let n = [];
|
|
613
|
+
this._streamErr && n.push(this._streamErr), this._streamOut && n.push(this._streamOut);
|
|
614
|
+
let r = L(n), s = me.createInterface({
|
|
615
|
+
input: r
|
|
616
|
+
});
|
|
617
|
+
for await (let o of s)
|
|
618
|
+
yield o.toString();
|
|
619
|
+
if (await this._processClosed, e.removeAllListeners(), this._thrownError)
|
|
620
|
+
throw this._thrownError;
|
|
621
|
+
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0)
|
|
622
|
+
throw new x(this);
|
|
623
|
+
}
|
|
624
|
+
async _waitForOutput() {
|
|
625
|
+
let e = this._process;
|
|
626
|
+
if (!e)
|
|
627
|
+
throw new Error("No process was started");
|
|
628
|
+
let n = "", r = "";
|
|
629
|
+
if (this._streamErr)
|
|
630
|
+
for await (let o of this._streamErr)
|
|
631
|
+
n += o.toString();
|
|
632
|
+
if (this._streamOut)
|
|
633
|
+
for await (let o of this._streamOut)
|
|
634
|
+
r += o.toString();
|
|
635
|
+
if (await this._processClosed, this._options?.stdin && await this._options.stdin, e.removeAllListeners(), this._thrownError)
|
|
636
|
+
throw this._thrownError;
|
|
637
|
+
let s = {
|
|
638
|
+
stderr: n,
|
|
639
|
+
stdout: r,
|
|
640
|
+
exitCode: this.exitCode
|
|
641
|
+
};
|
|
642
|
+
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0)
|
|
643
|
+
throw new x(this, s);
|
|
644
|
+
return s;
|
|
645
|
+
}
|
|
646
|
+
then(e, n) {
|
|
647
|
+
return this._waitForOutput().then(e, n);
|
|
648
|
+
}
|
|
649
|
+
_streamOut;
|
|
650
|
+
_streamErr;
|
|
651
|
+
spawn() {
|
|
652
|
+
let e = cwd(), n = this._options, r = {
|
|
653
|
+
...Ee,
|
|
654
|
+
...n.nodeOptions
|
|
655
|
+
}, s = [];
|
|
656
|
+
this._resetState(), n.timeout !== void 0 && s.push(AbortSignal.timeout(n.timeout)), n.signal !== void 0 && s.push(n.signal), n.persist === !0 && (r.detached = !0), s.length > 0 && (r.signal = xe(s)), r.env = I(e, r.env);
|
|
657
|
+
let { command: o, args: i } = we(this._command, this._args), a = (0, Pt._parse)(o, i, r), c = spawn(
|
|
658
|
+
a.command,
|
|
659
|
+
a.args,
|
|
660
|
+
a.options
|
|
661
|
+
);
|
|
662
|
+
if (c.stderr && (this._streamErr = c.stderr), c.stdout && (this._streamOut = c.stdout), this._process = c, c.once("error", this._onError), c.once("close", this._onClose), n.stdin !== void 0 && c.stdin && n.stdin.process) {
|
|
663
|
+
let { stdout: u } = n.stdin.process;
|
|
664
|
+
u && u.pipe(c.stdin);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
_resetState() {
|
|
668
|
+
this._aborted = !1, this._processClosed = new Promise((e) => {
|
|
669
|
+
this._resolveClose = e;
|
|
670
|
+
}), this._thrownError = void 0;
|
|
671
|
+
}
|
|
672
|
+
_onError = (e) => {
|
|
673
|
+
if (e.name === "AbortError" && (!(e.cause instanceof Error) || e.cause.name !== "TimeoutError")) {
|
|
674
|
+
this._aborted = !0;
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
this._thrownError = e;
|
|
678
|
+
};
|
|
679
|
+
_onClose = () => {
|
|
680
|
+
this._resolveClose && this._resolveClose();
|
|
681
|
+
};
|
|
682
|
+
}, ve = (t, e, n) => {
|
|
683
|
+
let r = new R(t, e, n);
|
|
684
|
+
return r.spawn(), r;
|
|
685
|
+
}, be = ve;
|
|
686
|
+
|
|
687
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
688
|
+
|
|
689
|
+
function getDefaultExportFromCjs (x) {
|
|
690
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
export { commonjsGlobal as a, be as b, create as c, getDefaultExportFromCjs as g, templates as t };
|
|
694
|
+
//# sourceMappingURL=_commonjsHelpers-n7_cr1vO.js.map
|