@sheetxl/scripting 0.7.28-beta.4 → 0.8.0-beta.10
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/README.md +4 -4
- package/browser/esm/21ztp96onxWNyfBZ.mjs +581 -0
- package/browser/esm/4VkvY2rXOd49uHcQ.mjs +4 -0
- package/browser/esm/B73J41HhbJvswDz1.mjs +17 -0
- package/browser/esm/B_2CC0NvNtPBw_ad.mjs +22 -0
- package/browser/esm/BvzmZuTo8xvOBJ6a.mjs +3627 -0
- package/browser/esm/BxiAkxNyUQseLNBv.mjs +10 -0
- package/browser/esm/D9jTpNifykCuQkTL.mjs +18 -0
- package/browser/esm/Ly2yqBRuG8dssY2w.mjs +162 -0
- package/browser/esm/NpFv8YNKRgVPGXOq.mjs +9 -0
- package/browser/esm/index.mjs +71 -41
- package/browser/esm/qjsNvVXUFvwuddu9.mjs +23 -0
- package/node/esm/4VkvY2rXOd49uHcQ.mjs +4 -0
- package/node/esm/B74CcyWYGHJL1E2s.mjs +581 -0
- package/node/esm/ClxOMp6IdEZdW4Qd.mjs +8 -0
- package/node/esm/D0CDObJV23Rxk8-r.mjs +15 -0
- package/node/esm/Dhbf7vOdddc7aiOT.mjs +23 -0
- package/node/esm/Dl6HzBX-qBm0gCfJ.mjs +20 -0
- package/node/esm/DoQf-VD0li_RugX4.mjs +161 -0
- package/node/esm/index.mjs +83 -141
- package/node/esm/og3Pk2ReS3UiORbF.mjs +21 -0
- package/package.json +6 -7
- package/types/src/compiler/Bundler.d.ts +1 -1
- package/types/src/compiler/insertRunGuard.d.ts +11 -0
- package/types/src/lib/typescript/typescript.browser.d.ts +6 -0
- package/types/src/lib/typescript/typescript.node.d.ts +11 -0
- package/types/src/linter/Linter.d.ts +7 -0
- package/types/src/runtime/RunGuard.d.ts +31 -0
- package/types/src/runtime/index.d.ts +1 -0
- package/types/src/type/CompileOptions.d.ts +50 -0
- package/types/src/type/CompiledModule.d.ts +36 -6
- package/types/src/type/Diagnostic.d.ts +25 -1
- package/types/src/type/Types.d.ts +44 -3
- package/browser/cjs/1_xhnTjP6m5oj6za.cjs +0 -21
- package/browser/cjs/B_2b6uA3WKl7970Q.cjs +0 -1
- package/browser/cjs/Bu4cZ8iSZ3rij-oV.cjs +0 -1
- package/browser/cjs/BvG8N7G_8CXIAlT-.cjs +0 -1
- package/browser/cjs/BwpBc8k-Fp1SAn7l.cjs +0 -1
- package/browser/cjs/C_7w8EJZpHw8ueuq.cjs +0 -1
- package/browser/cjs/C_IEgjM-hSJCv6Gm.cjs +0 -1
- package/browser/cjs/CctaCN_w3o34V9AR.cjs +0 -1
- package/browser/cjs/DSEShe7kGtxvljOr.cjs +0 -1
- package/browser/cjs/index.cjs +0 -1
- package/browser/cjs/qWYyYsBboXc9p0Lw.cjs +0 -7
- package/browser/esm/80oYnILw-_ixsNjP.mjs +0 -15
- package/browser/esm/BIKWt7VvnYQGipn8.mjs +0 -87
- package/browser/esm/BvzriDVNz7rvv-CN.mjs +0 -12
- package/browser/esm/BzbjwP47XqWR_dLy.mjs +0 -421
- package/browser/esm/CDBoNa-_uINySbpK.mjs +0 -152
- package/browser/esm/CUE7cb3UPOJM-3kD.mjs +0 -25
- package/browser/esm/DQW5CKiti4COASaz.mjs +0 -23
- package/browser/esm/NC0vOHwL24BJSQ_l.mjs +0 -27
- package/browser/esm/boW6I_VE4ZlDrs3P.mjs +0 -8
- package/browser/esm/iMHa0nIFHsIvws4V.mjs +0 -105
- package/node/esm/BHErJ0QgPjNC4lWi.mjs +0 -152
- package/node/esm/BOT12k_HrUajuNNO.mjs +0 -12
- package/node/esm/CUJYmJq64kAxqquM.mjs +0 -421
- package/node/esm/Dyqi5Bjd6JfFkMrp.mjs +0 -17
- package/node/esm/GDpQxq3gDBro-Loq.mjs +0 -27
- package/node/esm/VR8Qx9rC5rrXqlNV.mjs +0 -23
- package/node/esm/bmKxP3gmEczTpaFo.mjs +0 -14
- package/node/esm/boW6I_VE4ZlDrs3P.mjs +0 -8
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var a = Object.defineProperty, l = (r, o) => {
|
|
2
|
+
let e = {};
|
|
3
|
+
for (var t in r) a(e, t, { get: r[t], enumerable: !0 });
|
|
4
|
+
return o || a(e, Symbol.toStringTag, { value: "Module" }), e;
|
|
5
|
+
}, u = l({ GLOBAL_CONTEXT_VARIABLE: () => n }), n = "__SHEETXL";
|
|
6
|
+
export {
|
|
7
|
+
n,
|
|
8
|
+
l as r,
|
|
9
|
+
u as t
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var i = null;
|
|
2
|
+
async function o() {
|
|
3
|
+
return i || (i = new Promise(async (n, s) => {
|
|
4
|
+
try {
|
|
5
|
+
const e = "0.20.2", a = `https://esm.sh/esbuild-wasm@${e}`, t = `https://esm.sh/esbuild-wasm@${e}/esbuild.wasm`, r = (await import(
|
|
6
|
+
/* webpackIgnore: true */
|
|
7
|
+
/* @vite-ignore */
|
|
8
|
+
a
|
|
9
|
+
)).default;
|
|
10
|
+
await r.initialize({ wasmURL: t, worker: !1 }), n(r);
|
|
11
|
+
} catch (e) {
|
|
12
|
+
console.error("Error initializing esbuild:", e), i = null, s(new Error("The script bundler could not be loaded. Check your connection and try again.", { cause: e }));
|
|
13
|
+
}
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
o as initialize
|
|
18
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { n as x } from "./BxiAkxNyUQseLNBv.mjs";
|
|
2
|
+
import { r as U } from "./B73J41HhbJvswDz1.mjs";
|
|
3
|
+
import { analyzeModule as V } from "./21ztp96onxWNyfBZ.mjs";
|
|
4
|
+
import { t as I } from "./4VkvY2rXOd49uHcQ.mjs";
|
|
5
|
+
import { CommonUtils as X } from "@sheetxl/utils";
|
|
6
|
+
var f = null, w = null, q = { compilerOptions: { target: "esnext" } };
|
|
7
|
+
async function H(t, m, p = "/script.js", u = x, n = !1) {
|
|
8
|
+
try {
|
|
9
|
+
const d = await (async function() {
|
|
10
|
+
if (f) return f;
|
|
11
|
+
if (w) {
|
|
12
|
+
if (await w, !f) throw new Error("ESBuild initialization promise resolved, but instance is not available.");
|
|
13
|
+
return f;
|
|
14
|
+
}
|
|
15
|
+
let i, o;
|
|
16
|
+
w = new Promise((r, l) => {
|
|
17
|
+
i = r, o = l;
|
|
18
|
+
});
|
|
19
|
+
try {
|
|
20
|
+
const { initialize: r } = await import("./D9jTpNifykCuQkTL.mjs");
|
|
21
|
+
return f = await r(), i(), f;
|
|
22
|
+
} catch (r) {
|
|
23
|
+
throw console.error("Failed to import or initialize esbuild:", r), w = null, o(r), r;
|
|
24
|
+
}
|
|
25
|
+
})(), c = "@sheetxl/primitives", s = `
|
|
26
|
+
export const FormulaContext = globalThis.${u}?.FormulaContext;
|
|
27
|
+
export const ScalarType = globalThis.${u}?.ScalarType;
|
|
28
|
+
export const Observable = globalThis.${u}?.Observable;
|
|
29
|
+
export const IRange = globalThis.${u}?.IRange;
|
|
30
|
+
export const FormulaError = globalThis.${u}?.FormulaError;
|
|
31
|
+
// Add more exports as needed
|
|
32
|
+
`, a = await d.build({ entryPoints: [p], bundle: !0, write: !1, format: "esm", plugins: [{ name: "sheetxl-esbuild-in-memory", setup(i) {
|
|
33
|
+
const o = "sheetxl-" + (/* @__PURE__ */ new Date()).getTime();
|
|
34
|
+
i.onResolve({ filter: new RegExp(`^(${p.replace("/", "\\/")}|${c})$`) }, (r) => ({ path: r.path, namespace: o })), i.onResolve({ filter: /.*/ }, (r) => {
|
|
35
|
+
if (r.namespace !== o) return console.warn(`esbuild: Treating import "${r.path}" as external.`), { path: r.path, external: !0 };
|
|
36
|
+
}), i.onLoad({ filter: /.*/, namespace: o }, (r) => {
|
|
37
|
+
let l;
|
|
38
|
+
if (r.path === p) l = m;
|
|
39
|
+
else {
|
|
40
|
+
if (r.path !== c) return { errors: [{ text: `Cannot load unknown path in ${o}: ${r.path}` }] };
|
|
41
|
+
l = s;
|
|
42
|
+
}
|
|
43
|
+
return { contents: l, loader: "ts" };
|
|
44
|
+
});
|
|
45
|
+
} }], sourcemap: "inline", tsconfigRaw: q, minify: n, platform: "neutral" });
|
|
46
|
+
if (a.outputFiles && a.outputFiles.length > 0) return a.outputFiles[0].text;
|
|
47
|
+
throw a.errors && a.errors.length > 0 ? new Error(`esbuild bundling failed: ${a.errors.map((i) => i.text).join(`
|
|
48
|
+
`)}`) : new Error("esbuild did not produce an output file.");
|
|
49
|
+
} catch (d) {
|
|
50
|
+
throw console.error("esbuild bundling process failed:", d), d;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function Y(t, m, p) {
|
|
54
|
+
return (u) => {
|
|
55
|
+
const n = u.factory, d = () => n.createExpressionStatement(n.createCallChain(n.createPropertyAccessExpression(n.createIdentifier(x), "checkRun"), n.createToken(t.SyntaxKind.QuestionDotToken), void 0, [n.createStringLiteral(m), n.createNumericLiteral(p)])), c = (a) => {
|
|
56
|
+
const i = a.statements;
|
|
57
|
+
let o = 0;
|
|
58
|
+
for (; o < i.length && t.isExpressionStatement(i[o]) && t.isStringLiteral(i[o].expression); ) o++;
|
|
59
|
+
return n.updateBlock(a, [...i.slice(0, o), d(), ...i.slice(o)]);
|
|
60
|
+
}, s = (a) => {
|
|
61
|
+
if (((i) => t.isForStatement(i) || t.isForInStatement(i) || t.isForOfStatement(i) || t.isWhileStatement(i) || t.isDoStatement(i))(a)) {
|
|
62
|
+
const i = a.statement;
|
|
63
|
+
return t.visitEachChild(a, (o) => {
|
|
64
|
+
const r = s(o);
|
|
65
|
+
return o === i ? (l = r, t.isBlock(l) ? c(l) : n.createBlock([d(), l], !0)) : r;
|
|
66
|
+
var l;
|
|
67
|
+
}, u);
|
|
68
|
+
}
|
|
69
|
+
if (t.isFunctionLike(a) && a.body) {
|
|
70
|
+
const i = a.body;
|
|
71
|
+
return t.visitEachChild(a, (o) => {
|
|
72
|
+
const r = s(o);
|
|
73
|
+
return o === i ? (l = r, t.isBlock(l) ? c(l) : n.createBlock([d(), n.createReturnStatement(l)], !0)) : r;
|
|
74
|
+
var l;
|
|
75
|
+
}, u);
|
|
76
|
+
}
|
|
77
|
+
return t.visitEachChild(a, s, u);
|
|
78
|
+
};
|
|
79
|
+
return (a) => t.visitNode(a, s);
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
var Z = async () => `
|
|
83
|
+
interface FirstTest {
|
|
84
|
+
isTrue?: boolean;
|
|
85
|
+
}
|
|
86
|
+
`, v = null, L = "sheetxl.d.ts", N = "sheetxl-modules.d.ts", _ = ["lib.webworker.d.ts", "lib.es2020.d.ts", "lib.esnext.asynciterable.d.ts"], O = /* @__PURE__ */ new Map(), D = null, R = null;
|
|
87
|
+
async function ee() {
|
|
88
|
+
return R || (R = import("./B_2CC0NvNtPBw_ad.mjs").then(async (t) => {
|
|
89
|
+
const m = await j();
|
|
90
|
+
return t.readLibFile(m, "lib.es5.d.ts") !== void 0 ? t.readLibFile : null;
|
|
91
|
+
})), R;
|
|
92
|
+
}
|
|
93
|
+
async function j() {
|
|
94
|
+
if (v) return v;
|
|
95
|
+
try {
|
|
96
|
+
const t = await (await import("./B_2CC0NvNtPBw_ad.mjs")).initialize();
|
|
97
|
+
if (!t) throw new Error("TypeScript could not be loaded. Check your connection and try again.");
|
|
98
|
+
return t;
|
|
99
|
+
} catch (t) {
|
|
100
|
+
throw v = null, t;
|
|
101
|
+
} finally {
|
|
102
|
+
v = null;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async function le(t) {
|
|
106
|
+
const m = t?.source ?? null;
|
|
107
|
+
if (!m) return { module: null, diagnostics: [] };
|
|
108
|
+
const p = (t.disableBundle || t.declarationsOnly) ?? !1, [u, n, d] = await Promise.all([Z(), j(), t.ambientTypes ? ee() : null]), c = d ? t.ambientTypes ?? null : null;
|
|
109
|
+
let s = "";
|
|
110
|
+
const a = { allowJs: !0, declaration: !1, sourceMap: !1, inlineSourceMap: !1, inlineSources: !1, isolatedModules: !0, preserveConstEnums: !1, module: 99, noResolve: !0, emitDeclarationOnly: !1, target: n.ScriptTarget.ES2020, ...c ? { lib: _, skipLibCheck: !0, strict: !0 } : {} }, i = "script", o = `${i}.ts`, r = "lib.d.ts", l = "global.d.ts", g = { [o]: m, [r]: `
|
|
111
|
+
/**
|
|
112
|
+
* Represents the completion of an asynchronous operation
|
|
113
|
+
*/
|
|
114
|
+
interface Promise<T> {
|
|
115
|
+
/**
|
|
116
|
+
* Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
|
|
117
|
+
* resolved value cannot be modified from the callback.
|
|
118
|
+
* @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
|
|
119
|
+
* @returns A Promise for the completion of the callback.
|
|
120
|
+
*/
|
|
121
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
|
122
|
+
}
|
|
123
|
+
`, [l]: u, ...c ? { [L]: c, [N]: `declare module '@sheetxl/primitives' { export = SheetXL; }
|
|
124
|
+
` } : {} }, S = (e) => g[e] ?? (d && e.startsWith("lib.") ? d(n, e) : void 0), z = { getSourceFile: (e, $, te, ne) => {
|
|
125
|
+
if (e === L) return D?.text !== c && (D = { text: c, file: n.createSourceFile(e, c, n.ScriptTarget.Latest, !1) }), D.file;
|
|
126
|
+
if (g[e] === void 0) {
|
|
127
|
+
let y = O.get(e);
|
|
128
|
+
if (!y) {
|
|
129
|
+
const B = S(e);
|
|
130
|
+
if (B === void 0) return;
|
|
131
|
+
y = n.createSourceFile(e, B, n.ScriptTarget.Latest, !1), O.set(e, y);
|
|
132
|
+
}
|
|
133
|
+
return y;
|
|
134
|
+
}
|
|
135
|
+
return n.createSourceFile(e, g[e], n.ScriptTarget.Latest, !0);
|
|
136
|
+
}, fileExists: (e) => S(e) !== void 0, readFile: S, writeFile: (e, $) => {
|
|
137
|
+
g[e] = $;
|
|
138
|
+
}, getCurrentDirectory: () => "./", getCanonicalFileName: (e) => e, useCaseSensitiveFileNames: () => !0, getDefaultLibFileName: (e) => r, getNewLine: () => `
|
|
139
|
+
` }, h = n.createProgram([o, l, ...c ? [L, N] : []], a, z), A = h.getTypeChecker(), T = h.getSourceFile(o), F = t.runGuard;
|
|
140
|
+
h.emit(void 0, void 0, void 0, void 0, F ? { before: [Y(n, F.key, F.timeoutMs)] } : void 0), s = g[`${i}.js`] ?? "";
|
|
141
|
+
const M = (e) => ({ start: e.start ?? 0, length: e.length ?? 0, severity: e.category === n.DiagnosticCategory.Warning ? "warning" : "error", code: `TS${e.code}`, message: n.flattenDiagnosticMessageText(e.messageText, `
|
|
142
|
+
`) }), W = h.getSyntacticDiagnostics(T).map(M), G = c ? h.getSemanticDiagnostics(T).filter((e) => e.category === n.DiagnosticCategory.Error || e.category === n.DiagnosticCategory.Warning).map(M) : [], k = V(n, T, A, { builtInNames: t.builtInNames, isBuiltIn: t.isBuiltIn, lenient: t.lenient });
|
|
143
|
+
let b = [...W, ...G, ...k.diagnostics];
|
|
144
|
+
t.lenient && (b = b.filter((e) => e.code !== U.MissingType));
|
|
145
|
+
const J = k.functions, P = k.autoRun, K = b.some((e) => e.severity === "error"), Q = `${X.uuidV4()}-script`;
|
|
146
|
+
let C = null;
|
|
147
|
+
if (K) s = "";
|
|
148
|
+
else {
|
|
149
|
+
try {
|
|
150
|
+
p || (s = await H(0, s, i, void 0, t.minify ?? !1));
|
|
151
|
+
} catch {
|
|
152
|
+
console.warn("Error bundling script");
|
|
153
|
+
}
|
|
154
|
+
const e = s.indexOf(I);
|
|
155
|
+
e > -1 && (C = s.substring(e + I.length + 1, s.length), s = s.substring(0, e), s = s.replaceAll("globalThis." + x, x));
|
|
156
|
+
}
|
|
157
|
+
const E = { functions: J, commitId: Q, source: m, language: "typescript", compiled: s };
|
|
158
|
+
return C && (E.sourceMap = C), P && (E.autoRun = P), { module: E, diagnostics: b };
|
|
159
|
+
}
|
|
160
|
+
export {
|
|
161
|
+
le as compileModule
|
|
162
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { t } from "./4VkvY2rXOd49uHcQ.mjs";
|
|
2
|
+
async function a(r, e) {
|
|
3
|
+
let o = r;
|
|
4
|
+
return e?.sourceMap && (o += `
|
|
5
|
+
${t}=${e.sourceMap}`), new Function("url", "return import(url)")(`data:text/javascript,${encodeURIComponent(o)}`);
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
a as loadCompiledModule
|
|
9
|
+
};
|
package/browser/esm/index.mjs
CHANGED
|
@@ -1,41 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
import { r as d, t as g } from "./BxiAkxNyUQseLNBv.mjs";
|
|
2
|
+
import { r as M, t as T } from "./B73J41HhbJvswDz1.mjs";
|
|
3
|
+
import { CommonUtils as f } from "@sheetxl/utils";
|
|
4
|
+
var S = d({ RUN_INTERRUPTED: () => u, abort: () => h, check: () => y, isInterrupted: () => R, release: () => C }), r = /* @__PURE__ */ new Map(), m = 256, w = 16, u = "RunInterrupted";
|
|
5
|
+
function c(t) {
|
|
6
|
+
const n = new Error(t);
|
|
7
|
+
return n.name = u, n;
|
|
8
|
+
}
|
|
9
|
+
function s(t) {
|
|
10
|
+
let n = r.get(t);
|
|
11
|
+
if (!n) {
|
|
12
|
+
if (r.size >= m) {
|
|
13
|
+
const e = r.keys().next().value;
|
|
14
|
+
e !== void 0 && r.delete(e);
|
|
15
|
+
}
|
|
16
|
+
n = { started: Date.now(), calls: 0, stopped: null }, r.set(t, n);
|
|
17
|
+
}
|
|
18
|
+
return n;
|
|
19
|
+
}
|
|
20
|
+
function y(t, n) {
|
|
21
|
+
const e = s(t);
|
|
22
|
+
if (e.stopped) throw e.stopped;
|
|
23
|
+
if (++e.calls % w === 0 && Date.now() - e.started > n) throw e.stopped = c(`Run stopped: it exceeded the ${Math.round(n / 1e3)} s time limit.`), e.stopped;
|
|
24
|
+
}
|
|
25
|
+
function h(t, n = "Run cancelled.") {
|
|
26
|
+
s(t).stopped = c(n);
|
|
27
|
+
}
|
|
28
|
+
function C(t) {
|
|
29
|
+
r.delete(t);
|
|
30
|
+
}
|
|
31
|
+
function R(t) {
|
|
32
|
+
return t?.name === u;
|
|
33
|
+
}
|
|
34
|
+
async function b(t, n) {
|
|
35
|
+
const { loadCompiledModule: e } = await import("./NpFv8YNKRgVPGXOq.mjs");
|
|
36
|
+
return e(t, n);
|
|
37
|
+
}
|
|
38
|
+
var a = null, l = null, o = null, i = null;
|
|
39
|
+
async function v() {
|
|
40
|
+
return i || (i = (async () => {
|
|
41
|
+
const t = await (await import("./B_2CC0NvNtPBw_ad.mjs")).initialize();
|
|
42
|
+
if (!t) throw new Error("TypeScript could not be loaded. Check your connection and try again.");
|
|
43
|
+
return t;
|
|
44
|
+
})()).catch(() => {
|
|
45
|
+
i = null;
|
|
46
|
+
}), i;
|
|
47
|
+
}
|
|
48
|
+
var k = Object.freeze({ compile: async function(t) {
|
|
49
|
+
if (!t?.source) return { module: null, diagnostics: [] };
|
|
50
|
+
if (l && f.deepEqual(l, t)) return a;
|
|
51
|
+
const n = await (await (async function() {
|
|
52
|
+
if (o) return o;
|
|
53
|
+
const { TypeScriptCompiler: e } = await import("./qjsNvVXUFvwuddu9.mjs");
|
|
54
|
+
return o = new e();
|
|
55
|
+
})()).compileModule(t);
|
|
56
|
+
return a = n, l = t, n;
|
|
57
|
+
}, lint: async function(t, n) {
|
|
58
|
+
if (!t) return [];
|
|
59
|
+
const [e, { lintScript: p }] = await Promise.all([v(), import("./21ztp96onxWNyfBZ.mjs")]);
|
|
60
|
+
return p(e, t, n);
|
|
61
|
+
}, cleanup: function() {
|
|
62
|
+
o && (o.terminate(), o = null, a = null);
|
|
63
|
+
} });
|
|
64
|
+
export {
|
|
65
|
+
g as Constants,
|
|
66
|
+
M as DiagnosticCode,
|
|
67
|
+
T as DocTags,
|
|
68
|
+
S as RunGuard,
|
|
69
|
+
k as ScriptCompiler,
|
|
70
|
+
b as loadCompiledModule
|
|
71
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var t = class {
|
|
2
|
+
constructor(r = {}) {
|
|
3
|
+
this.workerWrapper = null;
|
|
4
|
+
}
|
|
5
|
+
async getWorkerWrapper() {
|
|
6
|
+
if (this.workerWrapper) return this.workerWrapper;
|
|
7
|
+
const { createCompilerWorker: r } = await import("./BvzmZuTo8xvOBJ6a.mjs");
|
|
8
|
+
return this.workerWrapper = await r(), this.workerWrapper;
|
|
9
|
+
}
|
|
10
|
+
async compileModule(r) {
|
|
11
|
+
try {
|
|
12
|
+
return (await this.getWorkerWrapper()).execute(r);
|
|
13
|
+
} catch (e) {
|
|
14
|
+
throw console.error("Failed to compile using worker:", e), e;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
terminate() {
|
|
18
|
+
this.workerWrapper?.terminate(), this.workerWrapper = null;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
t as TypeScriptCompiler
|
|
23
|
+
};
|