@highstate/cli 0.7.1 → 0.7.3
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/assets/tsconfig.base.json +21 -0
- package/dist/main.js +1285 -13978
- package/package.json +18 -8
- package/src/commands/build.ts +94 -0
- package/src/commands/designer.ts +73 -0
- package/src/main.ts +17 -0
- package/src/shared/index.ts +4 -0
- package/src/shared/logger.ts +54 -0
- package/src/shared/schema-transformer.ts +75 -0
- package/src/shared/services.ts +20 -0
- package/src/shared/source-hash-calculator.ts +219 -0
- package/dist/index-CfX7oR0h.js +0 -215
- package/dist/main-fVI30_8j.js +0 -520
package/dist/main-fVI30_8j.js
DELETED
@@ -1,520 +0,0 @@
|
|
1
|
-
import { createRequire } from 'node:module';
|
2
|
-
import { spawn } from 'child_process';
|
3
|
-
import { normalize, delimiter, resolve, dirname } from 'path';
|
4
|
-
import { cwd } from 'process';
|
5
|
-
import { PassThrough } from 'stream';
|
6
|
-
import me from 'readline';
|
7
|
-
|
8
|
-
const require = createRequire(import.meta.url);
|
9
|
-
var St = Object.create;
|
10
|
-
var $ = Object.defineProperty;
|
11
|
-
var kt = Object.getOwnPropertyDescriptor;
|
12
|
-
var Tt = Object.getOwnPropertyNames;
|
13
|
-
var At = Object.getPrototypeOf, Rt = Object.prototype.hasOwnProperty;
|
14
|
-
var h = /* @__PURE__ */ ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, {
|
15
|
-
get: (e, n) => (typeof require < "u" ? require : e)[n]
|
16
|
-
}) : t)(function(t) {
|
17
|
-
if (typeof require < "u") return require.apply(this, arguments);
|
18
|
-
throw Error('Dynamic require of "' + t + '" is not supported');
|
19
|
-
});
|
20
|
-
var l = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
|
21
|
-
var $t = (t, e, n, r) => {
|
22
|
-
if (e && typeof e == "object" || typeof e == "function")
|
23
|
-
for (let s of Tt(e))
|
24
|
-
!Rt.call(t, s) && s !== n && $(t, s, { get: () => e[s], enumerable: !(r = kt(e, s)) || r.enumerable });
|
25
|
-
return t;
|
26
|
-
};
|
27
|
-
var Nt = (t, e, n) => (n = t != null ? St(At(t)) : {}, $t(
|
28
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
29
|
-
// file that has been converted to a CommonJS file using a Babel-
|
30
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
31
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
32
|
-
$(n, "default", { value: t, enumerable: true }) ,
|
33
|
-
t
|
34
|
-
));
|
35
|
-
var W = l((Se, H) => {
|
36
|
-
H.exports = z;
|
37
|
-
z.sync = Wt;
|
38
|
-
var j = h("fs");
|
39
|
-
function Ht(t, e) {
|
40
|
-
var n = e.pathExt !== void 0 ? e.pathExt : process.env.PATHEXT;
|
41
|
-
if (!n || (n = n.split(";"), n.indexOf("") !== -1))
|
42
|
-
return true;
|
43
|
-
for (var r = 0; r < n.length; r++) {
|
44
|
-
var s = n[r].toLowerCase();
|
45
|
-
if (s && t.substr(-s.length).toLowerCase() === s)
|
46
|
-
return true;
|
47
|
-
}
|
48
|
-
return false;
|
49
|
-
}
|
50
|
-
function F(t, e, n) {
|
51
|
-
return !t.isSymbolicLink() && !t.isFile() ? false : Ht(e, n);
|
52
|
-
}
|
53
|
-
function z(t, e, n) {
|
54
|
-
j.stat(t, function(r, s) {
|
55
|
-
n(r, r ? false : F(s, t, e));
|
56
|
-
});
|
57
|
-
}
|
58
|
-
function Wt(t, e) {
|
59
|
-
return F(j.statSync(t), t, e);
|
60
|
-
}
|
61
|
-
});
|
62
|
-
var X = l((ke, B) => {
|
63
|
-
B.exports = K;
|
64
|
-
K.sync = Dt;
|
65
|
-
var D = h("fs");
|
66
|
-
function K(t, e, n) {
|
67
|
-
D.stat(t, function(r, s) {
|
68
|
-
n(r, r ? false : M(s, e));
|
69
|
-
});
|
70
|
-
}
|
71
|
-
function Dt(t, e) {
|
72
|
-
return M(D.statSync(t), e);
|
73
|
-
}
|
74
|
-
function M(t, e) {
|
75
|
-
return t.isFile() && Kt(t, e);
|
76
|
-
}
|
77
|
-
function Kt(t, e) {
|
78
|
-
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;
|
79
|
-
return p;
|
80
|
-
}
|
81
|
-
});
|
82
|
-
var U = l((Ae, G) => {
|
83
|
-
h("fs"); var v;
|
84
|
-
process.platform === "win32" || global.TESTING_WINDOWS ? v = W() : v = X();
|
85
|
-
G.exports = y;
|
86
|
-
y.sync = Mt;
|
87
|
-
function y(t, e, n) {
|
88
|
-
if (typeof e == "function" && (n = e, e = {}), !n) {
|
89
|
-
if (typeof Promise != "function")
|
90
|
-
throw new TypeError("callback not provided");
|
91
|
-
return new Promise(function(r, s) {
|
92
|
-
y(t, e || {}, function(o, i) {
|
93
|
-
o ? s(o) : r(i);
|
94
|
-
});
|
95
|
-
});
|
96
|
-
}
|
97
|
-
v(t, e || {}, function(r, s) {
|
98
|
-
r && (r.code === "EACCES" || e && e.ignoreErrors) && (r = null, s = false), n(r, s);
|
99
|
-
});
|
100
|
-
}
|
101
|
-
function Mt(t, e) {
|
102
|
-
try {
|
103
|
-
return v.sync(t, e || {});
|
104
|
-
} catch (n) {
|
105
|
-
if (e && e.ignoreErrors || n.code === "EACCES")
|
106
|
-
return false;
|
107
|
-
throw n;
|
108
|
-
}
|
109
|
-
}
|
110
|
-
});
|
111
|
-
var et = l((Re, tt) => {
|
112
|
-
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) => {
|
113
|
-
let n = e.colon || Bt, r = t.match(/\//) || g && t.match(/\\/) ? [""] : [
|
114
|
-
// windows always checks the cwd first
|
115
|
-
...g ? [process.cwd()] : [],
|
116
|
-
...(e.path || process.env.PATH || /* istanbul ignore next: very unusual */
|
117
|
-
"").split(n)
|
118
|
-
], s = g ? e.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "", o = g ? s.split(n) : [""];
|
119
|
-
return g && t.indexOf(".") !== -1 && o[0] !== "" && o.unshift(""), {
|
120
|
-
pathEnv: r,
|
121
|
-
pathExt: o,
|
122
|
-
pathExtExe: s
|
123
|
-
};
|
124
|
-
}, Z = (t, e, n) => {
|
125
|
-
typeof e == "function" && (n = e, e = {}), e || (e = {});
|
126
|
-
let { pathEnv: r, pathExt: s, pathExtExe: o } = Q(t, e), i = [], a = (u) => new Promise((f, p) => {
|
127
|
-
if (u === r.length)
|
128
|
-
return e.all && i.length ? f(i) : p(J(t));
|
129
|
-
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;
|
130
|
-
f(c(b, u, 0));
|
131
|
-
}), c = (u, f, p) => new Promise((d, w) => {
|
132
|
-
if (p === s.length)
|
133
|
-
return d(a(f + 1));
|
134
|
-
let m = s[p];
|
135
|
-
V(u + m, { pathExt: o }, (b, Ot) => {
|
136
|
-
if (!b && Ot)
|
137
|
-
if (e.all)
|
138
|
-
i.push(u + m);
|
139
|
-
else
|
140
|
-
return d(u + m);
|
141
|
-
return d(c(u, f, p + 1));
|
142
|
-
});
|
143
|
-
});
|
144
|
-
return n ? a(0).then((u) => n(null, u), n) : a(0);
|
145
|
-
}, Xt = (t, e) => {
|
146
|
-
e = e || {};
|
147
|
-
let { pathEnv: n, pathExt: r, pathExtExe: s } = Q(t, e), o = [];
|
148
|
-
for (let i = 0; i < n.length; i++) {
|
149
|
-
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;
|
150
|
-
for (let p = 0; p < r.length; p++) {
|
151
|
-
let d = f + r[p];
|
152
|
-
try {
|
153
|
-
if (V.sync(d, { pathExt: s }))
|
154
|
-
if (e.all)
|
155
|
-
o.push(d);
|
156
|
-
else
|
157
|
-
return d;
|
158
|
-
} catch {
|
159
|
-
}
|
160
|
-
}
|
161
|
-
}
|
162
|
-
if (e.all && o.length)
|
163
|
-
return o;
|
164
|
-
if (e.nothrow)
|
165
|
-
return null;
|
166
|
-
throw J(t);
|
167
|
-
};
|
168
|
-
tt.exports = Z;
|
169
|
-
Z.sync = Xt;
|
170
|
-
});
|
171
|
-
var rt = l(($e, _) => {
|
172
|
-
var nt = (t = {}) => {
|
173
|
-
let e = t.env || process.env;
|
174
|
-
return (t.platform || process.platform) !== "win32" ? "PATH" : Object.keys(e).reverse().find((r) => r.toUpperCase() === "PATH") || "Path";
|
175
|
-
};
|
176
|
-
_.exports = nt;
|
177
|
-
_.exports.default = nt;
|
178
|
-
});
|
179
|
-
var ct = l((Ne, it) => {
|
180
|
-
var st = h("path"), Gt = et(), Ut = rt();
|
181
|
-
function ot(t, e) {
|
182
|
-
let n = t.options.env || process.env, r = process.cwd(), s = t.options.cwd != null, o = s && process.chdir !== void 0 && !process.chdir.disabled;
|
183
|
-
if (o)
|
184
|
-
try {
|
185
|
-
process.chdir(t.options.cwd);
|
186
|
-
} catch {
|
187
|
-
}
|
188
|
-
let i;
|
189
|
-
try {
|
190
|
-
i = Gt.sync(t.command, {
|
191
|
-
path: n[Ut({ env: n })],
|
192
|
-
pathExt: e ? st.delimiter : void 0
|
193
|
-
});
|
194
|
-
} catch {
|
195
|
-
} finally {
|
196
|
-
o && process.chdir(r);
|
197
|
-
}
|
198
|
-
return i && (i = st.resolve(s ? t.options.cwd : "", i)), i;
|
199
|
-
}
|
200
|
-
function Yt(t) {
|
201
|
-
return ot(t) || ot(t, true);
|
202
|
-
}
|
203
|
-
it.exports = Yt;
|
204
|
-
});
|
205
|
-
var ut = l((qe, P) => {
|
206
|
-
var C = /([()\][%!^"`<>&|;, *?])/g;
|
207
|
-
function Vt(t) {
|
208
|
-
return t = t.replace(C, "^$1"), t;
|
209
|
-
}
|
210
|
-
function Jt(t, e) {
|
211
|
-
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;
|
212
|
-
}
|
213
|
-
P.exports.command = Vt;
|
214
|
-
P.exports.argument = Jt;
|
215
|
-
});
|
216
|
-
var lt = l((Ie, at) => {
|
217
|
-
at.exports = /^#!(.*)/;
|
218
|
-
});
|
219
|
-
var dt = l((Le, pt) => {
|
220
|
-
var Qt = lt();
|
221
|
-
pt.exports = (t = "") => {
|
222
|
-
let e = t.match(Qt);
|
223
|
-
if (!e)
|
224
|
-
return null;
|
225
|
-
let [n, r] = e[0].replace(/#! ?/, "").split(" "), s = n.split("/").pop();
|
226
|
-
return s === "env" ? r : r ? `${s} ${r}` : s;
|
227
|
-
};
|
228
|
-
});
|
229
|
-
var ht = l((je, ft) => {
|
230
|
-
var O = h("fs"), Zt = dt();
|
231
|
-
function te(t) {
|
232
|
-
let n = Buffer.alloc(150), r;
|
233
|
-
try {
|
234
|
-
r = O.openSync(t, "r"), O.readSync(r, n, 0, 150, 0), O.closeSync(r);
|
235
|
-
} catch {
|
236
|
-
}
|
237
|
-
return Zt(n.toString());
|
238
|
-
}
|
239
|
-
ft.exports = te;
|
240
|
-
});
|
241
|
-
var wt = l((Fe, Et) => {
|
242
|
-
var ee = h("path"), mt = ct(), gt = ut(), ne = ht(), re = process.platform === "win32", se = /\.(?:com|exe)$/i, oe = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
243
|
-
function ie(t) {
|
244
|
-
t.file = mt(t);
|
245
|
-
let e = t.file && ne(t.file);
|
246
|
-
return e ? (t.args.unshift(t.file), t.command = e, mt(t)) : t.file;
|
247
|
-
}
|
248
|
-
function ce(t) {
|
249
|
-
if (!re)
|
250
|
-
return t;
|
251
|
-
let e = ie(t), n = !se.test(e);
|
252
|
-
if (t.options.forceShell || n) {
|
253
|
-
let r = oe.test(e);
|
254
|
-
t.command = ee.normalize(t.command), t.command = gt.command(t.command), t.args = t.args.map((o) => gt.argument(o, r));
|
255
|
-
let s = [t.command].concat(t.args).join(" ");
|
256
|
-
t.args = ["/d", "/s", "/c", `"${s}"`], t.command = process.env.comspec || "cmd.exe", t.options.windowsVerbatimArguments = true;
|
257
|
-
}
|
258
|
-
return t;
|
259
|
-
}
|
260
|
-
function ue(t, e, n) {
|
261
|
-
e && !Array.isArray(e) && (n = e, e = null), e = e ? e.slice(0) : [], n = Object.assign({}, n);
|
262
|
-
let r = {
|
263
|
-
command: t,
|
264
|
-
args: e,
|
265
|
-
options: n,
|
266
|
-
file: void 0,
|
267
|
-
original: {
|
268
|
-
command: t,
|
269
|
-
args: e
|
270
|
-
}
|
271
|
-
};
|
272
|
-
return n.shell ? r : ce(r);
|
273
|
-
}
|
274
|
-
Et.exports = ue;
|
275
|
-
});
|
276
|
-
var bt = l((ze, vt) => {
|
277
|
-
var S = process.platform === "win32";
|
278
|
-
function k(t, e) {
|
279
|
-
return Object.assign(new Error(`${e} ${t.command} ENOENT`), {
|
280
|
-
code: "ENOENT",
|
281
|
-
errno: "ENOENT",
|
282
|
-
syscall: `${e} ${t.command}`,
|
283
|
-
path: t.command,
|
284
|
-
spawnargs: t.args
|
285
|
-
});
|
286
|
-
}
|
287
|
-
function ae(t, e) {
|
288
|
-
if (!S)
|
289
|
-
return;
|
290
|
-
let n = t.emit;
|
291
|
-
t.emit = function(r, s) {
|
292
|
-
if (r === "exit") {
|
293
|
-
let o = xt(s, e);
|
294
|
-
if (o)
|
295
|
-
return n.call(t, "error", o);
|
296
|
-
}
|
297
|
-
return n.apply(t, arguments);
|
298
|
-
};
|
299
|
-
}
|
300
|
-
function xt(t, e) {
|
301
|
-
return S && t === 1 && !e.file ? k(e.original, "spawn") : null;
|
302
|
-
}
|
303
|
-
function le(t, e) {
|
304
|
-
return S && t === 1 && !e.file ? k(e.original, "spawnSync") : null;
|
305
|
-
}
|
306
|
-
vt.exports = {
|
307
|
-
hookChildProcess: ae,
|
308
|
-
verifyENOENT: xt,
|
309
|
-
verifyENOENTSync: le,
|
310
|
-
notFoundError: k
|
311
|
-
};
|
312
|
-
});
|
313
|
-
var Ct = l((He, E) => {
|
314
|
-
var yt = h("child_process"), T = wt(), A = bt();
|
315
|
-
function _t(t, e, n) {
|
316
|
-
let r = T(t, e, n), s = yt.spawn(r.command, r.args, r.options);
|
317
|
-
return A.hookChildProcess(s, r), s;
|
318
|
-
}
|
319
|
-
function pe(t, e, n) {
|
320
|
-
let r = T(t, e, n), s = yt.spawnSync(r.command, r.args, r.options);
|
321
|
-
return s.error = s.error || A.verifyENOENTSync(s.status, r), s;
|
322
|
-
}
|
323
|
-
E.exports = _t;
|
324
|
-
E.exports.spawn = _t;
|
325
|
-
E.exports.sync = pe;
|
326
|
-
E.exports._parse = T;
|
327
|
-
E.exports._enoent = A;
|
328
|
-
});
|
329
|
-
var Lt = /^path$/i, q = { key: "PATH", value: "" };
|
330
|
-
function jt(t) {
|
331
|
-
for (let e in t) {
|
332
|
-
if (!Object.prototype.hasOwnProperty.call(t, e) || !Lt.test(e))
|
333
|
-
continue;
|
334
|
-
let n = t[e];
|
335
|
-
return n ? { key: e, value: n } : q;
|
336
|
-
}
|
337
|
-
return q;
|
338
|
-
}
|
339
|
-
function Ft(t, e) {
|
340
|
-
let n = e.value.split(delimiter), r = t, s;
|
341
|
-
do
|
342
|
-
n.push(resolve(r, "node_modules", ".bin")), s = r, r = dirname(r);
|
343
|
-
while (r !== s);
|
344
|
-
return { key: e.key, value: n.join(delimiter) };
|
345
|
-
}
|
346
|
-
function I(t, e) {
|
347
|
-
let n = {
|
348
|
-
...process.env,
|
349
|
-
...e
|
350
|
-
}, r = Ft(t, jt(n));
|
351
|
-
return n[r.key] = r.value, n;
|
352
|
-
}
|
353
|
-
var L = (t) => {
|
354
|
-
let e = t.length, n = new PassThrough(), r = () => {
|
355
|
-
--e === 0 && n.emit("end");
|
356
|
-
};
|
357
|
-
for (let s of t)
|
358
|
-
s.pipe(n, { end: false }), s.on("end", r);
|
359
|
-
return n;
|
360
|
-
};
|
361
|
-
var Pt = Nt(Ct());
|
362
|
-
var x = class extends Error {
|
363
|
-
result;
|
364
|
-
output;
|
365
|
-
get exitCode() {
|
366
|
-
if (this.result.exitCode !== null)
|
367
|
-
return this.result.exitCode;
|
368
|
-
}
|
369
|
-
constructor(e, n) {
|
370
|
-
super(`Process exited with non-zero status (${e.exitCode})`), this.result = e, this.output = n;
|
371
|
-
}
|
372
|
-
};
|
373
|
-
var ge = {
|
374
|
-
timeout: void 0,
|
375
|
-
persist: false
|
376
|
-
}, Ee = {
|
377
|
-
windowsHide: true
|
378
|
-
};
|
379
|
-
function we(t, e) {
|
380
|
-
return {
|
381
|
-
command: normalize(t),
|
382
|
-
args: e ?? []
|
383
|
-
};
|
384
|
-
}
|
385
|
-
function xe(t) {
|
386
|
-
let e = new AbortController();
|
387
|
-
for (let n of t) {
|
388
|
-
if (n.aborted)
|
389
|
-
return e.abort(), n;
|
390
|
-
let r = () => {
|
391
|
-
e.abort(n.reason);
|
392
|
-
};
|
393
|
-
n.addEventListener("abort", r, {
|
394
|
-
signal: e.signal
|
395
|
-
});
|
396
|
-
}
|
397
|
-
return e.signal;
|
398
|
-
}
|
399
|
-
var R = class {
|
400
|
-
_process;
|
401
|
-
_aborted = false;
|
402
|
-
_options;
|
403
|
-
_command;
|
404
|
-
_args;
|
405
|
-
_resolveClose;
|
406
|
-
_processClosed;
|
407
|
-
_thrownError;
|
408
|
-
get process() {
|
409
|
-
return this._process;
|
410
|
-
}
|
411
|
-
get pid() {
|
412
|
-
return this._process?.pid;
|
413
|
-
}
|
414
|
-
get exitCode() {
|
415
|
-
if (this._process && this._process.exitCode !== null)
|
416
|
-
return this._process.exitCode;
|
417
|
-
}
|
418
|
-
constructor(e, n, r) {
|
419
|
-
this._options = {
|
420
|
-
...ge,
|
421
|
-
...r
|
422
|
-
}, this._command = e, this._args = n ?? [], this._processClosed = new Promise((s) => {
|
423
|
-
this._resolveClose = s;
|
424
|
-
});
|
425
|
-
}
|
426
|
-
kill(e) {
|
427
|
-
return this._process?.kill(e) === true;
|
428
|
-
}
|
429
|
-
get aborted() {
|
430
|
-
return this._aborted;
|
431
|
-
}
|
432
|
-
get killed() {
|
433
|
-
return this._process?.killed === true;
|
434
|
-
}
|
435
|
-
pipe(e, n, r) {
|
436
|
-
return be(e, n, {
|
437
|
-
...r,
|
438
|
-
stdin: this
|
439
|
-
});
|
440
|
-
}
|
441
|
-
async *[Symbol.asyncIterator]() {
|
442
|
-
let e = this._process;
|
443
|
-
if (!e)
|
444
|
-
return;
|
445
|
-
let n = [];
|
446
|
-
this._streamErr && n.push(this._streamErr), this._streamOut && n.push(this._streamOut);
|
447
|
-
let r = L(n), s = me.createInterface({
|
448
|
-
input: r
|
449
|
-
});
|
450
|
-
for await (let o of s)
|
451
|
-
yield o.toString();
|
452
|
-
if (await this._processClosed, e.removeAllListeners(), this._thrownError)
|
453
|
-
throw this._thrownError;
|
454
|
-
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0)
|
455
|
-
throw new x(this);
|
456
|
-
}
|
457
|
-
async _waitForOutput() {
|
458
|
-
let e = this._process;
|
459
|
-
if (!e)
|
460
|
-
throw new Error("No process was started");
|
461
|
-
let n = "", r = "";
|
462
|
-
if (this._streamOut)
|
463
|
-
for await (let o of this._streamOut)
|
464
|
-
r += o.toString();
|
465
|
-
if (this._streamErr)
|
466
|
-
for await (let o of this._streamErr)
|
467
|
-
n += o.toString();
|
468
|
-
if (await this._processClosed, this._options?.stdin && await this._options.stdin, e.removeAllListeners(), this._thrownError)
|
469
|
-
throw this._thrownError;
|
470
|
-
let s = {
|
471
|
-
stderr: n,
|
472
|
-
stdout: r,
|
473
|
-
exitCode: this.exitCode
|
474
|
-
};
|
475
|
-
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0)
|
476
|
-
throw new x(this, s);
|
477
|
-
return s;
|
478
|
-
}
|
479
|
-
then(e, n) {
|
480
|
-
return this._waitForOutput().then(e, n);
|
481
|
-
}
|
482
|
-
_streamOut;
|
483
|
-
_streamErr;
|
484
|
-
spawn() {
|
485
|
-
let e = cwd(), n = this._options, r = {
|
486
|
-
...Ee,
|
487
|
-
...n.nodeOptions
|
488
|
-
}, s = [];
|
489
|
-
this._resetState(), n.timeout !== void 0 && s.push(AbortSignal.timeout(n.timeout)), n.signal !== void 0 && s.push(n.signal), n.persist === true && (r.detached = true), s.length > 0 && (r.signal = xe(s)), r.env = I(e, r.env);
|
490
|
-
let { command: o, args: i } = we(this._command, this._args), a = (0, Pt._parse)(o, i, r), c = spawn(
|
491
|
-
a.command,
|
492
|
-
a.args,
|
493
|
-
a.options
|
494
|
-
);
|
495
|
-
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) {
|
496
|
-
let { stdout: u } = n.stdin.process;
|
497
|
-
u && u.pipe(c.stdin);
|
498
|
-
}
|
499
|
-
}
|
500
|
-
_resetState() {
|
501
|
-
this._aborted = false, this._processClosed = new Promise((e) => {
|
502
|
-
this._resolveClose = e;
|
503
|
-
}), this._thrownError = void 0;
|
504
|
-
}
|
505
|
-
_onError = (e) => {
|
506
|
-
if (e.name === "AbortError" && (!(e.cause instanceof Error) || e.cause.name !== "TimeoutError")) {
|
507
|
-
this._aborted = true;
|
508
|
-
return;
|
509
|
-
}
|
510
|
-
this._thrownError = e;
|
511
|
-
};
|
512
|
-
_onClose = () => {
|
513
|
-
this._resolveClose && this._resolveClose();
|
514
|
-
};
|
515
|
-
}, ve = (t, e, n) => {
|
516
|
-
let r = new R(t, e, n);
|
517
|
-
return r.spawn(), r;
|
518
|
-
}, be = ve;
|
519
|
-
|
520
|
-
export { R as ExecProcess, x as NonZeroExitError, be as exec, ve as x };
|