Comparing version 0.1.2 to 0.1.3-beta.0
621
dist/main.js
var St = Object.create; | ||
var y = Object.defineProperty; | ||
var kt = Object.getOwnPropertyDescriptor; | ||
var Tt = Object.getOwnPropertyNames; | ||
var q = Object.defineProperty; | ||
var Tt = Object.getOwnPropertyDescriptor; | ||
var kt = Object.getOwnPropertyNames; | ||
var At = Object.getPrototypeOf, Rt = Object.prototype.hasOwnProperty; | ||
var $t = (e, t, n) => t in e ? y(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; | ||
var h = /* @__PURE__ */ ((e) => typeof require != "undefined" ? require : typeof Proxy != "undefined" ? new Proxy(e, { | ||
get: (t, n) => (typeof require != "undefined" ? require : t)[n] | ||
}) : e)(function(e) { | ||
if (typeof require != "undefined") return require.apply(this, arguments); | ||
throw Error('Dynamic require of "' + e + '" is not supported'); | ||
var h = /* @__PURE__ */ ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, { | ||
get: (e, n) => (typeof require < "u" ? require : e)[n] | ||
}) : t)(function(t) { | ||
if (typeof require < "u") return require.apply(this, arguments); | ||
throw Error('Dynamic require of "' + t + '" is not supported'); | ||
}); | ||
var l = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports); | ||
var Nt = (e, t, n, r) => { | ||
if (t && typeof t == "object" || typeof t == "function") | ||
for (let s of Tt(t)) | ||
!Rt.call(e, s) && s !== n && y(e, s, { get: () => t[s], enumerable: !(r = kt(t, s)) || r.enumerable }); | ||
return e; | ||
var qt = (t, e) => () => (t && (e = t(t = 0)), e); | ||
var p = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports); | ||
var $t = (t, e, n, r) => { | ||
if (e && typeof e == "object" || typeof e == "function") | ||
for (let s of kt(e)) | ||
!Rt.call(t, s) && s !== n && q(t, s, { get: () => e[s], enumerable: !(r = Tt(e, s)) || r.enumerable }); | ||
return t; | ||
}; | ||
var qt = (e, t, n) => (n = e != null ? St(At(e)) : {}, Nt( | ||
var Nt = (t, e, n) => (n = t != null ? St(At(t)) : {}, $t( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
@@ -25,15 +25,22 @@ // file that has been converted to a CommonJS file using a Babel- | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
t || !e || !e.__esModule ? y(n, "default", { value: e, enumerable: !0 }) : n, | ||
e | ||
e || !t || !t.__esModule ? q(n, "default", { value: t, enumerable: !0 }) : n, | ||
t | ||
)); | ||
var p = (e, t, n) => $t(e, typeof t != "symbol" ? t + "" : t, n); | ||
// tsup-require-shim.ts | ||
import { createRequire as It } from "module"; | ||
var o = qt(() => { | ||
"use strict"; | ||
"require" in globalThis || (globalThis.require = It(import.meta.url)); | ||
}); | ||
// node_modules/isexe/windows.js | ||
var W = l((ke, z) => { | ||
var W = p((qe, z) => { | ||
"use strict"; | ||
o(); | ||
z.exports = H; | ||
H.sync = Dt; | ||
H.sync = Kt; | ||
var j = h("fs"); | ||
function Wt(e, t) { | ||
var n = t.pathExt !== void 0 ? t.pathExt : process.env.PATHEXT; | ||
function Dt(t, e) { | ||
var n = e.pathExt !== void 0 ? e.pathExt : process.env.PATHEXT; | ||
if (!n || (n = n.split(";"), n.indexOf("") !== -1)) | ||
@@ -43,3 +50,3 @@ return !0; | ||
var s = n[r].toLowerCase(); | ||
if (s && e.substr(-s.length).toLowerCase() === s) | ||
if (s && t.substr(-s.length).toLowerCase() === s) | ||
return !0; | ||
@@ -49,12 +56,12 @@ } | ||
} | ||
function F(e, t, n) { | ||
return !e.isSymbolicLink() && !e.isFile() ? !1 : Wt(t, n); | ||
function F(t, e, n) { | ||
return !t.isSymbolicLink() && !t.isFile() ? !1 : Dt(e, n); | ||
} | ||
function H(e, t, n) { | ||
j.stat(e, function(r, s) { | ||
n(r, r ? !1 : F(s, e, t)); | ||
function H(t, e, n) { | ||
j.stat(t, function(r, s) { | ||
n(r, r ? !1 : F(s, t, e)); | ||
}); | ||
} | ||
function Dt(e, t) { | ||
return F(j.statSync(e), e, t); | ||
function Kt(t, e) { | ||
return F(j.statSync(t), t, e); | ||
} | ||
@@ -64,20 +71,21 @@ }); | ||
// node_modules/isexe/mode.js | ||
var X = l((Te, B) => { | ||
var X = p((Ne, B) => { | ||
"use strict"; | ||
o(); | ||
B.exports = K; | ||
K.sync = Kt; | ||
K.sync = Mt; | ||
var D = h("fs"); | ||
function K(e, t, n) { | ||
D.stat(e, function(r, s) { | ||
n(r, r ? !1 : M(s, t)); | ||
function K(t, e, n) { | ||
D.stat(t, function(r, s) { | ||
n(r, r ? !1 : M(s, e)); | ||
}); | ||
} | ||
function Kt(e, t) { | ||
return M(D.statSync(e), t); | ||
function Mt(t, e) { | ||
return M(D.statSync(t), e); | ||
} | ||
function M(e, t) { | ||
return e.isFile() && Mt(e, t); | ||
function M(t, e) { | ||
return t.isFile() && Bt(t, e); | ||
} | ||
function Mt(e, t) { | ||
var n = e.mode, r = e.uid, s = e.gid, o = t.uid !== void 0 ? t.uid : process.getuid && process.getuid(), i = t.gid !== void 0 ? t.gid : process.getgid && process.getgid(), u = parseInt("100", 8), c = parseInt("010", 8), a = parseInt("001", 8), m = u | c, d = n & a || n & c && s === i || n & u && r === o || n & m && o === 0; | ||
function Bt(t, e) { | ||
var n = t.mode, r = t.uid, s = t.gid, i = e.uid !== void 0 ? e.uid : process.getuid && process.getuid(), c = e.gid !== void 0 ? e.gid : process.getgid && process.getgid(), l = parseInt("100", 8), a = parseInt("010", 8), u = parseInt("001", 8), m = l | a, d = n & u || n & a && s === c || n & l && r === i || n & m && i === 0; | ||
return d; | ||
@@ -88,27 +96,28 @@ } | ||
// node_modules/isexe/index.js | ||
var U = l((Re, G) => { | ||
var U = p((je, G) => { | ||
"use strict"; | ||
var Ae = h("fs"), x; | ||
process.platform === "win32" || global.TESTING_WINDOWS ? x = W() : x = X(); | ||
G.exports = _; | ||
_.sync = Bt; | ||
function _(e, t, n) { | ||
if (typeof t == "function" && (n = t, t = {}), !n) { | ||
o(); | ||
var Le = h("fs"), b; | ||
process.platform === "win32" || global.TESTING_WINDOWS ? b = W() : b = X(); | ||
G.exports = y; | ||
y.sync = Xt; | ||
function y(t, e, n) { | ||
if (typeof e == "function" && (n = e, e = {}), !n) { | ||
if (typeof Promise != "function") | ||
throw new TypeError("callback not provided"); | ||
return new Promise(function(r, s) { | ||
_(e, t || {}, function(o, i) { | ||
o ? s(o) : r(i); | ||
y(t, e || {}, function(i, c) { | ||
i ? s(i) : r(c); | ||
}); | ||
}); | ||
} | ||
x(e, t || {}, function(r, s) { | ||
r && (r.code === "EACCES" || t && t.ignoreErrors) && (r = null, s = !1), n(r, s); | ||
b(t, e || {}, function(r, s) { | ||
r && (r.code === "EACCES" || e && e.ignoreErrors) && (r = null, s = !1), n(r, s); | ||
}); | ||
} | ||
function Bt(e, t) { | ||
function Xt(t, e) { | ||
try { | ||
return x.sync(e, t || {}); | ||
return b.sync(t, e || {}); | ||
} catch (n) { | ||
if (t && t.ignoreErrors || n.code === "EACCES") | ||
if (e && e.ignoreErrors || n.code === "EACCES") | ||
return !1; | ||
@@ -121,42 +130,43 @@ throw n; | ||
// node_modules/which/which.js | ||
var et = l(($e, tt) => { | ||
var et = p((He, tt) => { | ||
"use strict"; | ||
var E = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys", Y = h("path"), Xt = E ? ";" : ":", V = U(), J = (e) => Object.assign(new Error(`not found: ${e}`), { code: "ENOENT" }), Q = (e, t) => { | ||
let n = t.colon || Xt, r = e.match(/\//) || E && e.match(/\\/) ? [""] : [ | ||
o(); | ||
var E = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys", Y = h("path"), Gt = E ? ";" : ":", V = U(), J = (t) => Object.assign(new Error(`not found: ${t}`), { code: "ENOENT" }), Q = (t, e) => { | ||
let n = e.colon || Gt, r = t.match(/\//) || E && t.match(/\\/) ? [""] : [ | ||
// windows always checks the cwd first | ||
...E ? [process.cwd()] : [], | ||
...(t.path || process.env.PATH || /* istanbul ignore next: very unusual */ | ||
...(e.path || process.env.PATH || /* istanbul ignore next: very unusual */ | ||
"").split(n) | ||
], s = E ? t.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "", o = E ? s.split(n) : [""]; | ||
return E && e.indexOf(".") !== -1 && o[0] !== "" && o.unshift(""), { | ||
], s = E ? e.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "", i = E ? s.split(n) : [""]; | ||
return E && t.indexOf(".") !== -1 && i[0] !== "" && i.unshift(""), { | ||
pathEnv: r, | ||
pathExt: o, | ||
pathExt: i, | ||
pathExtExe: s | ||
}; | ||
}, Z = (e, t, n) => { | ||
typeof t == "function" && (n = t, t = {}), t || (t = {}); | ||
let { pathEnv: r, pathExt: s, pathExtExe: o } = Q(e, t), i = [], u = (a) => new Promise((m, d) => { | ||
if (a === r.length) | ||
return t.all && i.length ? m(i) : d(J(e)); | ||
let f = r[a], w = /^".*"$/.test(f) ? f.slice(1, -1) : f, g = Y.join(w, e), b = !w && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + g : g; | ||
m(c(b, a, 0)); | ||
}), c = (a, m, d) => new Promise((f, w) => { | ||
}, Z = (t, e, n) => { | ||
typeof e == "function" && (n = e, e = {}), e || (e = {}); | ||
let { pathEnv: r, pathExt: s, pathExtExe: i } = Q(t, e), c = [], l = (u) => new Promise((m, d) => { | ||
if (u === r.length) | ||
return e.all && c.length ? m(c) : d(J(t)); | ||
let f = r[u], w = /^".*"$/.test(f) ? f.slice(1, -1) : f, g = Y.join(w, t), x = !w && /^\.[\\\/]/.test(t) ? t.slice(0, 2) + g : g; | ||
m(a(x, u, 0)); | ||
}), a = (u, m, d) => new Promise((f, w) => { | ||
if (d === s.length) | ||
return f(u(m + 1)); | ||
return f(l(m + 1)); | ||
let g = s[d]; | ||
V(a + g, { pathExt: o }, (b, Ct) => { | ||
if (!b && Ct) | ||
if (t.all) | ||
i.push(a + g); | ||
V(u + g, { pathExt: i }, (x, Ct) => { | ||
if (!x && Ct) | ||
if (e.all) | ||
c.push(u + g); | ||
else | ||
return f(a + g); | ||
return f(c(a, m, d + 1)); | ||
return f(u + g); | ||
return f(a(u, m, d + 1)); | ||
}); | ||
}); | ||
return n ? u(0).then((a) => n(null, a), n) : u(0); | ||
}, Gt = (e, t) => { | ||
t = t || {}; | ||
let { pathEnv: n, pathExt: r, pathExtExe: s } = Q(e, t), o = []; | ||
for (let i = 0; i < n.length; i++) { | ||
let u = n[i], c = /^".*"$/.test(u) ? u.slice(1, -1) : u, a = Y.join(c, e), m = !c && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + a : a; | ||
return n ? l(0).then((u) => n(null, u), n) : l(0); | ||
}, Ut = (t, e) => { | ||
e = e || {}; | ||
let { pathEnv: n, pathExt: r, pathExtExe: s } = Q(t, e), i = []; | ||
for (let c = 0; c < n.length; c++) { | ||
let l = n[c], a = /^".*"$/.test(l) ? l.slice(1, -1) : l, u = Y.join(a, t), m = !a && /^\.[\\\/]/.test(t) ? t.slice(0, 2) + u : u; | ||
for (let d = 0; d < r.length; d++) { | ||
@@ -166,77 +176,81 @@ let f = m + r[d]; | ||
if (V.sync(f, { pathExt: s })) | ||
if (t.all) | ||
o.push(f); | ||
if (e.all) | ||
i.push(f); | ||
else | ||
return f; | ||
} catch (w) { | ||
} catch { | ||
} | ||
} | ||
} | ||
if (t.all && o.length) | ||
return o; | ||
if (t.nothrow) | ||
if (e.all && i.length) | ||
return i; | ||
if (e.nothrow) | ||
return null; | ||
throw J(e); | ||
throw J(t); | ||
}; | ||
tt.exports = Z; | ||
Z.sync = Gt; | ||
Z.sync = Ut; | ||
}); | ||
// node_modules/path-key/index.js | ||
var rt = l((Ne, P) => { | ||
var rt = p((We, _) => { | ||
"use strict"; | ||
var nt = (e = {}) => { | ||
let t = e.env || process.env; | ||
return (e.platform || process.platform) !== "win32" ? "PATH" : Object.keys(t).reverse().find((r) => r.toUpperCase() === "PATH") || "Path"; | ||
o(); | ||
var nt = (t = {}) => { | ||
let e = t.env || process.env; | ||
return (t.platform || process.platform) !== "win32" ? "PATH" : Object.keys(e).reverse().find((r) => r.toUpperCase() === "PATH") || "Path"; | ||
}; | ||
P.exports = nt; | ||
P.exports.default = nt; | ||
_.exports = nt; | ||
_.exports.default = nt; | ||
}); | ||
// node_modules/cross-spawn/lib/util/resolveCommand.js | ||
var ct = l((qe, it) => { | ||
var ct = p((Ke, it) => { | ||
"use strict"; | ||
var st = h("path"), Ut = et(), Yt = rt(); | ||
function ot(e, t) { | ||
let n = e.options.env || process.env, r = process.cwd(), s = e.options.cwd != null, o = s && process.chdir !== void 0 && !process.chdir.disabled; | ||
if (o) | ||
o(); | ||
var st = h("path"), Yt = et(), Vt = rt(); | ||
function ot(t, e) { | ||
let n = t.options.env || process.env, r = process.cwd(), s = t.options.cwd != null, i = s && process.chdir !== void 0 && !process.chdir.disabled; | ||
if (i) | ||
try { | ||
process.chdir(e.options.cwd); | ||
} catch (u) { | ||
process.chdir(t.options.cwd); | ||
} catch { | ||
} | ||
let i; | ||
let c; | ||
try { | ||
i = Ut.sync(e.command, { | ||
path: n[Yt({ env: n })], | ||
pathExt: t ? st.delimiter : void 0 | ||
c = Yt.sync(t.command, { | ||
path: n[Vt({ env: n })], | ||
pathExt: e ? st.delimiter : void 0 | ||
}); | ||
} catch (u) { | ||
} catch { | ||
} finally { | ||
o && process.chdir(r); | ||
i && process.chdir(r); | ||
} | ||
return i && (i = st.resolve(s ? e.options.cwd : "", i)), i; | ||
return c && (c = st.resolve(s ? t.options.cwd : "", c)), c; | ||
} | ||
function Vt(e) { | ||
return ot(e) || ot(e, !0); | ||
function Jt(t) { | ||
return ot(t) || ot(t, !0); | ||
} | ||
it.exports = Vt; | ||
it.exports = Jt; | ||
}); | ||
// node_modules/cross-spawn/lib/util/escape.js | ||
var at = l((Ie, C) => { | ||
var at = p((Be, O) => { | ||
"use strict"; | ||
var O = /([()\][%!^"`<>&|;, *?])/g; | ||
function Jt(e) { | ||
return e = e.replace(O, "^$1"), e; | ||
o(); | ||
var P = /([()\][%!^"`<>&|;, *?])/g; | ||
function Qt(t) { | ||
return t = t.replace(P, "^$1"), t; | ||
} | ||
function Qt(e, t) { | ||
return e = `${e}`, e = e.replace(/(\\*)"/g, '$1$1\\"'), e = e.replace(/(\\*)$/, "$1$1"), e = `"${e}"`, e = e.replace(O, "^$1"), t && (e = e.replace(O, "^$1")), e; | ||
function Zt(t, e) { | ||
return t = `${t}`, t = t.replace(/(\\*)"/g, '$1$1\\"'), t = t.replace(/(\\*)$/, "$1$1"), t = `"${t}"`, t = t.replace(P, "^$1"), e && (t = t.replace(P, "^$1")), t; | ||
} | ||
C.exports.command = Jt; | ||
C.exports.argument = Qt; | ||
O.exports.command = Qt; | ||
O.exports.argument = Zt; | ||
}); | ||
// node_modules/shebang-regex/index.js | ||
var lt = l((Le, ut) => { | ||
var lt = p((Ge, ut) => { | ||
"use strict"; | ||
o(); | ||
ut.exports = /^#!(.*)/; | ||
@@ -246,10 +260,11 @@ }); | ||
// node_modules/shebang-command/index.js | ||
var dt = l((je, pt) => { | ||
var dt = p((Ye, pt) => { | ||
"use strict"; | ||
var Zt = lt(); | ||
pt.exports = (e = "") => { | ||
let t = e.match(Zt); | ||
if (!t) | ||
o(); | ||
var te = lt(); | ||
pt.exports = (t = "") => { | ||
let e = t.match(te); | ||
if (!e) | ||
return null; | ||
let [n, r] = t[0].replace(/#! ?/, "").split(" "), s = n.split("/").pop(); | ||
let [n, r] = e[0].replace(/#! ?/, "").split(" "), s = n.split("/").pop(); | ||
return s === "env" ? r : r ? `${s} ${r}` : s; | ||
@@ -260,90 +275,93 @@ }; | ||
// node_modules/cross-spawn/lib/util/readShebang.js | ||
var mt = l((Fe, ft) => { | ||
var mt = p((Je, ft) => { | ||
"use strict"; | ||
var S = h("fs"), te = dt(); | ||
function ee(e) { | ||
o(); | ||
var C = h("fs"), ee = dt(); | ||
function ne(t) { | ||
let n = Buffer.alloc(150), r; | ||
try { | ||
r = S.openSync(e, "r"), S.readSync(r, n, 0, 150, 0), S.closeSync(r); | ||
} catch (s) { | ||
r = C.openSync(t, "r"), C.readSync(r, n, 0, 150, 0), C.closeSync(r); | ||
} catch { | ||
} | ||
return te(n.toString()); | ||
return ee(n.toString()); | ||
} | ||
ft.exports = ee; | ||
ft.exports = ne; | ||
}); | ||
// node_modules/cross-spawn/lib/parse.js | ||
var vt = l((He, Et) => { | ||
var vt = p((Ze, Et) => { | ||
"use strict"; | ||
var ne = h("path"), ht = ct(), gt = at(), re = mt(), se = process.platform === "win32", oe = /\.(?:com|exe)$/i, ie = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; | ||
function ce(e) { | ||
e.file = ht(e); | ||
let t = e.file && re(e.file); | ||
return t ? (e.args.unshift(e.file), e.command = t, ht(e)) : e.file; | ||
o(); | ||
var re = h("path"), ht = ct(), gt = at(), se = mt(), oe = process.platform === "win32", ie = /\.(?:com|exe)$/i, ce = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; | ||
function ae(t) { | ||
t.file = ht(t); | ||
let e = t.file && se(t.file); | ||
return e ? (t.args.unshift(t.file), t.command = e, ht(t)) : t.file; | ||
} | ||
function ae(e) { | ||
if (!se) | ||
return e; | ||
let t = ce(e), n = !oe.test(t); | ||
if (e.options.forceShell || n) { | ||
let r = ie.test(t); | ||
e.command = ne.normalize(e.command), e.command = gt.command(e.command), e.args = e.args.map((o) => gt.argument(o, r)); | ||
let s = [e.command].concat(e.args).join(" "); | ||
e.args = ["/d", "/s", "/c", `"${s}"`], e.command = process.env.comspec || "cmd.exe", e.options.windowsVerbatimArguments = !0; | ||
function ue(t) { | ||
if (!oe) | ||
return t; | ||
let e = ae(t), n = !ie.test(e); | ||
if (t.options.forceShell || n) { | ||
let r = ce.test(e); | ||
t.command = re.normalize(t.command), t.command = gt.command(t.command), t.args = t.args.map((i) => gt.argument(i, r)); | ||
let s = [t.command].concat(t.args).join(" "); | ||
t.args = ["/d", "/s", "/c", `"${s}"`], t.command = process.env.comspec || "cmd.exe", t.options.windowsVerbatimArguments = !0; | ||
} | ||
return e; | ||
return t; | ||
} | ||
function ue(e, t, n) { | ||
t && !Array.isArray(t) && (n = t, t = null), t = t ? t.slice(0) : [], n = Object.assign({}, n); | ||
function le(t, e, n) { | ||
e && !Array.isArray(e) && (n = e, e = null), e = e ? e.slice(0) : [], n = Object.assign({}, n); | ||
let r = { | ||
command: e, | ||
args: t, | ||
command: t, | ||
args: e, | ||
options: n, | ||
file: void 0, | ||
original: { | ||
command: e, | ||
args: t | ||
command: t, | ||
args: e | ||
} | ||
}; | ||
return n.shell ? r : ae(r); | ||
return n.shell ? r : ue(r); | ||
} | ||
Et.exports = ue; | ||
Et.exports = le; | ||
}); | ||
// node_modules/cross-spawn/lib/enoent.js | ||
var bt = l((ze, xt) => { | ||
var xt = p((en, bt) => { | ||
"use strict"; | ||
var k = process.platform === "win32"; | ||
function T(e, t) { | ||
return Object.assign(new Error(`${t} ${e.command} ENOENT`), { | ||
o(); | ||
var S = process.platform === "win32"; | ||
function T(t, e) { | ||
return Object.assign(new Error(`${e} ${t.command} ENOENT`), { | ||
code: "ENOENT", | ||
errno: "ENOENT", | ||
syscall: `${t} ${e.command}`, | ||
path: e.command, | ||
spawnargs: e.args | ||
syscall: `${e} ${t.command}`, | ||
path: t.command, | ||
spawnargs: t.args | ||
}); | ||
} | ||
function le(e, t) { | ||
if (!k) | ||
function pe(t, e) { | ||
if (!S) | ||
return; | ||
let n = e.emit; | ||
e.emit = function(r, s) { | ||
let n = t.emit; | ||
t.emit = function(r, s) { | ||
if (r === "exit") { | ||
let o = wt(s, t, "spawn"); | ||
if (o) | ||
return n.call(e, "error", o); | ||
let i = wt(s, e, "spawn"); | ||
if (i) | ||
return n.call(t, "error", i); | ||
} | ||
return n.apply(e, arguments); | ||
return n.apply(t, arguments); | ||
}; | ||
} | ||
function wt(e, t) { | ||
return k && e === 1 && !t.file ? T(t.original, "spawn") : null; | ||
function wt(t, e) { | ||
return S && t === 1 && !e.file ? T(e.original, "spawn") : null; | ||
} | ||
function pe(e, t) { | ||
return k && e === 1 && !t.file ? T(t.original, "spawnSync") : null; | ||
function de(t, e) { | ||
return S && t === 1 && !e.file ? T(e.original, "spawnSync") : null; | ||
} | ||
xt.exports = { | ||
hookChildProcess: le, | ||
bt.exports = { | ||
hookChildProcess: pe, | ||
verifyENOENT: wt, | ||
verifyENOENTSync: pe, | ||
verifyENOENTSync: de, | ||
notFoundError: T | ||
@@ -354,53 +372,56 @@ }; | ||
// node_modules/cross-spawn/index.js | ||
var Pt = l((We, v) => { | ||
var Pt = p((rn, v) => { | ||
"use strict"; | ||
var yt = h("child_process"), A = vt(), R = bt(); | ||
function _t(e, t, n) { | ||
let r = A(e, t, n), s = yt.spawn(r.command, r.args, r.options); | ||
return R.hookChildProcess(s, r), s; | ||
o(); | ||
var yt = h("child_process"), k = vt(), A = xt(); | ||
function _t(t, e, n) { | ||
let r = k(t, e, n), s = yt.spawn(r.command, r.args, r.options); | ||
return A.hookChildProcess(s, r), s; | ||
} | ||
function de(e, t, n) { | ||
let r = A(e, t, n), s = yt.spawnSync(r.command, r.args, r.options); | ||
return s.error = s.error || R.verifyENOENTSync(s.status, r), s; | ||
function fe(t, e, n) { | ||
let r = k(t, e, n), s = yt.spawnSync(r.command, r.args, r.options); | ||
return s.error = s.error || A.verifyENOENTSync(s.status, r), s; | ||
} | ||
v.exports = _t; | ||
v.exports.spawn = _t; | ||
v.exports.sync = de; | ||
v.exports._parse = A; | ||
v.exports._enoent = R; | ||
v.exports.sync = fe; | ||
v.exports._parse = k; | ||
v.exports._enoent = A; | ||
}); | ||
// src/main.ts | ||
import { spawn as fe } from "child_process"; | ||
import { normalize as me } from "path"; | ||
import { cwd as he } from "process"; | ||
o(); | ||
import { spawn as me } from "child_process"; | ||
import { normalize as he } from "path"; | ||
import { cwd as ge } from "process"; | ||
// src/env.ts | ||
o(); | ||
import { | ||
delimiter as N, | ||
resolve as It, | ||
dirname as Lt | ||
delimiter as $, | ||
resolve as Lt, | ||
dirname as jt | ||
} from "path"; | ||
var jt = /^path$/i, q = { key: "PATH", value: "" }; | ||
function Ft(e) { | ||
for (let t in e) { | ||
if (!Object.prototype.hasOwnProperty.call(e, t) || !jt.test(t)) | ||
var Ft = /^path$/i, N = { key: "PATH", value: "" }; | ||
function Ht(t) { | ||
for (let e in t) { | ||
if (!Object.prototype.hasOwnProperty.call(t, e) || !Ft.test(e)) | ||
continue; | ||
let n = e[t]; | ||
return n ? { key: t, value: n } : q; | ||
let n = t[e]; | ||
return n ? { key: e, value: n } : N; | ||
} | ||
return q; | ||
return N; | ||
} | ||
function Ht(e, t) { | ||
let n = t.value.split(N), r = e, s; | ||
function zt(t, e) { | ||
let n = e.value.split($), r = t, s; | ||
do | ||
n.push(It(r, "node_modules", ".bin")), s = r, r = Lt(r); | ||
n.push(Lt(r, "node_modules", ".bin")), s = r, r = jt(r); | ||
while (r !== s); | ||
return { key: t.key, value: n.join(N) }; | ||
return { key: e.key, value: n.join($) }; | ||
} | ||
function I(e, t) { | ||
function I(t, e) { | ||
let n = { | ||
...process.env, | ||
...t | ||
}, r = Ht(e, Ft(n)); | ||
...e | ||
}, r = zt(t, Ht(n)); | ||
return n[r.key] = r.value, n; | ||
@@ -410,8 +431,9 @@ } | ||
// src/stream.ts | ||
import { PassThrough as zt } from "stream"; | ||
var L = (e) => { | ||
let t = e.length, n = new zt(), r = () => { | ||
--t === 0 && n.emit("end"); | ||
o(); | ||
import { PassThrough as Wt } from "stream"; | ||
var L = (t) => { | ||
let e = t.length, n = new Wt(), r = () => { | ||
--e === 0 && n.emit("end"); | ||
}; | ||
for (let s of e) | ||
for (let s of t) | ||
s.pipe(n, { end: !1 }), s.on("end", r); | ||
@@ -422,60 +444,39 @@ return n; | ||
// src/main.ts | ||
var Ot = qt(Pt(), 1); | ||
import ge from "readline"; | ||
var Ee = { | ||
var Ot = Nt(Pt(), 1); | ||
import Ee from "readline"; | ||
var ve = { | ||
timeout: 4e3, | ||
persist: !1 | ||
}, ve = { | ||
}, we = { | ||
windowsHide: !0 | ||
}; | ||
function we(e, t) { | ||
let n = me(e), r = t != null ? t : []; | ||
function be(t, e) { | ||
return { | ||
command: n, | ||
args: r | ||
command: he(t), | ||
args: e ?? [] | ||
}; | ||
} | ||
function xe(e) { | ||
let t = new AbortController(); | ||
for (let n of e) { | ||
function xe(t) { | ||
let e = new AbortController(); | ||
for (let n of t) { | ||
if (n.aborted) | ||
return t.abort(), n; | ||
return e.abort(), n; | ||
let r = () => { | ||
t.abort(n.reason); | ||
e.abort(n.reason); | ||
}; | ||
n.addEventListener("abort", r, { | ||
signal: t.signal | ||
signal: e.signal | ||
}); | ||
} | ||
return t.signal; | ||
return e.signal; | ||
} | ||
var $ = class { | ||
constructor(t, n, r) { | ||
p(this, "_process"); | ||
p(this, "_aborted", !1); | ||
p(this, "_options"); | ||
p(this, "_command"); | ||
p(this, "_args"); | ||
p(this, "_resolveClose"); | ||
p(this, "_processClosed"); | ||
p(this, "_thrownError"); | ||
p(this, "_streamOut"); | ||
p(this, "_streamErr"); | ||
p(this, "_onError", (t) => { | ||
if (t.name === "AbortError" && (!(t.cause instanceof Error) || t.cause.name !== "TimeoutError")) { | ||
this._aborted = !0; | ||
return; | ||
} | ||
this._thrownError = t; | ||
}); | ||
p(this, "_onClose", () => { | ||
this._resolveClose && this._resolveClose(); | ||
}); | ||
this._options = { | ||
...Ee, | ||
...r | ||
}, this._command = t, this._args = n != null ? n : [], this._processClosed = new Promise((s) => { | ||
this._resolveClose = s; | ||
}); | ||
} | ||
var R = class { | ||
_process; | ||
_aborted = !1; | ||
_options; | ||
_command; | ||
_args; | ||
_resolveClose; | ||
_processClosed; | ||
_thrownError; | ||
get process() { | ||
@@ -485,4 +486,3 @@ return this._process; | ||
get pid() { | ||
var t; | ||
return (t = this._process) == null ? void 0 : t.pid; | ||
return this._process?.pid; | ||
} | ||
@@ -493,6 +493,13 @@ get exitCode() { | ||
} | ||
kill(t) { | ||
var n; | ||
return ((n = this._process) == null ? void 0 : n.kill(t)) === !0; | ||
constructor(e, n, r) { | ||
this._options = { | ||
...ve, | ||
...r | ||
}, this._command = e, this._args = n ?? [], this._processClosed = new Promise((s) => { | ||
this._resolveClose = s; | ||
}); | ||
} | ||
kill(e) { | ||
return this._process?.kill(e) === !0; | ||
} | ||
get aborted() { | ||
@@ -502,7 +509,6 @@ return this._aborted; | ||
get killed() { | ||
var t; | ||
return ((t = this._process) == null ? void 0 : t.killed) === !0; | ||
return this._process?.killed === !0; | ||
} | ||
pipe(t, n, r) { | ||
return ye(t, n, { | ||
pipe(e, n, r) { | ||
return _e(e, n, { | ||
...r, | ||
@@ -513,19 +519,18 @@ stdin: this | ||
async *[Symbol.asyncIterator]() { | ||
let t = this._process; | ||
if (!t) | ||
let e = this._process; | ||
if (!e) | ||
return; | ||
let n = []; | ||
this._streamErr && n.push(this._streamErr), this._streamOut && n.push(this._streamOut); | ||
let r = L(n), s = ge.createInterface({ | ||
let r = L(n), s = Ee.createInterface({ | ||
input: r | ||
}); | ||
for await (let o of s) | ||
yield o.toString(); | ||
if (await this._processClosed, t.removeAllListeners(), this._thrownError) | ||
for await (let i of s) | ||
yield i.toString(); | ||
if (await this._processClosed, e.removeAllListeners(), this._thrownError) | ||
throw this._thrownError; | ||
} | ||
async _waitForOutput() { | ||
var o; | ||
let t = this._process; | ||
if (!t) | ||
let e = this._process; | ||
if (!e) | ||
throw new Error("No process was started"); | ||
@@ -539,3 +544,3 @@ let n = "", r = ""; | ||
r += i.toString(); | ||
if (await this._processClosed, (o = this._options) != null && o.stdin && await this._options.stdin, t.removeAllListeners(), this._thrownError) | ||
if (await this._processClosed, this._options?.stdin && await this._options.stdin, e.removeAllListeners(), this._thrownError) | ||
throw this._thrownError; | ||
@@ -547,34 +552,46 @@ return { | ||
} | ||
then(t, n) { | ||
return this._waitForOutput().then(t, n); | ||
then(e, n) { | ||
return this._waitForOutput().then(e, n); | ||
} | ||
_streamOut; | ||
_streamErr; | ||
spawn() { | ||
let t = he(), n = this._options, r = { | ||
...ve, | ||
let e = ge(), n = this._options, r = { | ||
...we, | ||
...n.nodeOptions | ||
}, s = []; | ||
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(t, r.env); | ||
let { command: o, args: i } = we(this._command, this._args), u = (0, Ot._parse)(o, i, r), c = fe( | ||
u.command, | ||
u.args, | ||
u.options | ||
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); | ||
let { command: i, args: c } = be(this._command, this._args), l = (0, Ot._parse)(i, c, r), a = me( | ||
l.command, | ||
l.args, | ||
l.options | ||
); | ||
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) { | ||
let { stdout: a } = n.stdin.process; | ||
a && a.pipe(c.stdin); | ||
if (a.stderr && (this._streamErr = a.stderr), a.stdout && (this._streamOut = a.stdout), this._process = a, a.once("error", this._onError), a.once("close", this._onClose), n.stdin !== void 0 && a.stdin && n.stdin.process) { | ||
let { stdout: u } = n.stdin.process; | ||
u && u.pipe(a.stdin); | ||
} | ||
} | ||
_resetState() { | ||
this._aborted = !1, this._processClosed = new Promise((t) => { | ||
this._resolveClose = t; | ||
this._aborted = !1, this._processClosed = new Promise((e) => { | ||
this._resolveClose = e; | ||
}), this._thrownError = void 0; | ||
} | ||
}, be = (e, t, n) => { | ||
let r = new $(e, t, n); | ||
_onError = (e) => { | ||
if (e.name === "AbortError" && (!(e.cause instanceof Error) || e.cause.name !== "TimeoutError")) { | ||
this._aborted = !0; | ||
return; | ||
} | ||
this._thrownError = e; | ||
}; | ||
_onClose = () => { | ||
this._resolveClose && this._resolveClose(); | ||
}; | ||
}, ye = (t, e, n) => { | ||
let r = new R(t, e, n); | ||
return r.spawn(), r; | ||
}, ye = be; | ||
}, _e = ye; | ||
export { | ||
$ as ExecProcess, | ||
ye as exec, | ||
be as x | ||
R as ExecProcess, | ||
_e as exec, | ||
ye as x | ||
}; |
{ | ||
"name": "tinyexec", | ||
"version": "0.1.2", | ||
"version": "0.1.3-beta.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "A minimal library for executing processes in Node", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1154
42732
26