@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
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.28-beta.4
|
|
3
|
-
*
|
|
4
|
-
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
var e = Object.freeze({
|
|
8
|
-
NoBody: "SXL1001",
|
|
9
|
-
Anonymous: "SXL1002",
|
|
10
|
-
ParseError: "SXL1003",
|
|
11
|
-
InvalidParamType: "SXL2001",
|
|
12
|
-
InvalidReturnType: "SXL2002",
|
|
13
|
-
UndefinedInput: "SXL2003",
|
|
14
|
-
MissingType: "SXL2004",
|
|
15
|
-
UntypedArray: "SXL2005",
|
|
16
|
-
GenericArity: "SXL2006",
|
|
17
|
-
MultipleModifiers: "SXL2007",
|
|
18
|
-
ContextNotFirst: "SXL2010",
|
|
19
|
-
MultipleLambda: "SXL2020",
|
|
20
|
-
LambdaNotLast: "SXL2021",
|
|
21
|
-
LambdaScalarMismatch: "SXL2022",
|
|
22
|
-
LambdaReturn: "SXL2023",
|
|
23
|
-
FunctionReturn: "SXL2024",
|
|
24
|
-
LambdaArity: "SXL2025",
|
|
25
|
-
ArrayDepth: "SXL2030",
|
|
26
|
-
RepeatingPosition: "SXL2040",
|
|
27
|
-
MultipleRepeating: "SXL2041",
|
|
28
|
-
RepeatingSlots: "SXL2042",
|
|
29
|
-
RepeatingOptional: "SXL2043",
|
|
30
|
-
NoExports: "SXL3001",
|
|
31
|
-
UnknownParam: "SXL3002",
|
|
32
|
-
BuiltInName: "SXL3003",
|
|
33
|
-
MissingSummary: "SXL9001",
|
|
34
|
-
MissingParamDescription: "SXL9002",
|
|
35
|
-
MissingReturns: "SXL9003"
|
|
36
|
-
}), t = [
|
|
37
|
-
{
|
|
38
|
-
name: "summary",
|
|
39
|
-
group: "sheetxl",
|
|
40
|
-
description: "Short description shown in function tooltips and autocomplete."
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: "param",
|
|
44
|
-
group: "jsdoc",
|
|
45
|
-
description: "Document a parameter. A string union type becomes a dropdown of allowed options.",
|
|
46
|
-
snippet: "param ${1:name} ${2:description}"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: "returns",
|
|
50
|
-
aliases: ["return"],
|
|
51
|
-
group: "jsdoc",
|
|
52
|
-
description: "Describe the return value."
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: "category",
|
|
56
|
-
group: "sheetxl",
|
|
57
|
-
description: "Group the function under a category in the function list.",
|
|
58
|
-
snippet: "category ${1:name}"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: "name",
|
|
62
|
-
group: "sheetxl",
|
|
63
|
-
description: "Override the displayed function name.",
|
|
64
|
-
snippet: "name ${1:NAME}"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: "description",
|
|
68
|
-
group: "sheetxl",
|
|
69
|
-
description: "A longer description of the function."
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: "deprecated",
|
|
73
|
-
group: "sheetxl",
|
|
74
|
-
standalone: !0,
|
|
75
|
-
description: "Mark the function as deprecated (optionally with a reason)."
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: "hidden",
|
|
79
|
-
group: "sheetxl",
|
|
80
|
-
standalone: !0,
|
|
81
|
-
description: "Hide the function from the function list."
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: "example",
|
|
85
|
-
group: "jsdoc",
|
|
86
|
-
description: "Provide a usage example."
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
name: "see",
|
|
90
|
-
group: "jsdoc",
|
|
91
|
-
description: "Reference a related function or link."
|
|
92
|
-
}
|
|
93
|
-
], n = (() => {
|
|
94
|
-
let e = /* @__PURE__ */ new Map();
|
|
95
|
-
for (let n of t) if (e.set(n.name, n), n.aliases) for (let t of n.aliases) e.set(t, n);
|
|
96
|
-
return e;
|
|
97
|
-
})();
|
|
98
|
-
function r(e) {
|
|
99
|
-
return !0 === function(e) {
|
|
100
|
-
if (!e) return;
|
|
101
|
-
let t = (e.startsWith("@") ? e.slice(1) : e).toLowerCase();
|
|
102
|
-
return n.get(t);
|
|
103
|
-
}(e)?.standalone;
|
|
104
|
-
}
|
|
105
|
-
export { r as n, e as r, t };
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.28-beta.4
|
|
3
|
-
*
|
|
4
|
-
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import { t as e } from "./index.mjs";
|
|
8
|
-
import { analyzeModule as t } from "./CUJYmJq64kAxqquM.mjs";
|
|
9
|
-
import { t as n } from "./boW6I_VE4ZlDrs3P.mjs";
|
|
10
|
-
import { CommonUtils as r } from "@sheetxl/utils";
|
|
11
|
-
var i = null, a = null, o = { compilerOptions: { target: "esnext" } };
|
|
12
|
-
async function s(t, n, r = "/script.js", s = e) {
|
|
13
|
-
try {
|
|
14
|
-
let e = await async function() {
|
|
15
|
-
if (i) return i;
|
|
16
|
-
if (a) {
|
|
17
|
-
if (await a, !i) throw Error("ESBuild initialization promise resolved, but instance is not available.");
|
|
18
|
-
return i;
|
|
19
|
-
}
|
|
20
|
-
let e, t;
|
|
21
|
-
a = new Promise((n, r) => {
|
|
22
|
-
e = n, t = r;
|
|
23
|
-
});
|
|
24
|
-
try {
|
|
25
|
-
let { initialize: t } = await import("./BOT12k_HrUajuNNO.mjs");
|
|
26
|
-
return i = await t(), e(), i;
|
|
27
|
-
} catch (e) {
|
|
28
|
-
throw console.error("Failed to import or initialize esbuild:", e), a = null, t(e), e;
|
|
29
|
-
}
|
|
30
|
-
}(), t = "@sheetxl/primitives", c = `\n export const FormulaContext = globalThis.${s}?.FormulaContext;\n export const ScalarType = globalThis.${s}?.ScalarType;\n export const Observable = globalThis.${s}?.Observable;\n export const IRange = globalThis.${s}?.IRange;\n export const FormulaError = globalThis.${s}?.FormulaError;\n // Add more exports as needed\n `, l = await e.build({
|
|
31
|
-
entryPoints: [r],
|
|
32
|
-
bundle: !0,
|
|
33
|
-
write: !1,
|
|
34
|
-
format: "esm",
|
|
35
|
-
plugins: [{
|
|
36
|
-
name: "sheetxl-esbuild-in-memory",
|
|
37
|
-
setup(e) {
|
|
38
|
-
let i = "sheetxl-" + (/* @__PURE__ */ new Date()).getTime();
|
|
39
|
-
e.onResolve({ filter: RegExp(`^(${r.replace("/", "\\/")}|${t})$`) }, (e) => ({
|
|
40
|
-
path: e.path,
|
|
41
|
-
namespace: i
|
|
42
|
-
})), e.onResolve({ filter: /.*/ }, (e) => {
|
|
43
|
-
if (e.namespace !== i) return console.warn(`esbuild: Treating import "${e.path}" as external.`), {
|
|
44
|
-
path: e.path,
|
|
45
|
-
external: !0
|
|
46
|
-
};
|
|
47
|
-
}), e.onLoad({
|
|
48
|
-
filter: /.*/,
|
|
49
|
-
namespace: i
|
|
50
|
-
}, (e) => {
|
|
51
|
-
let a;
|
|
52
|
-
if (e.path === r) a = n;
|
|
53
|
-
else {
|
|
54
|
-
if (e.path !== t) return { errors: [{ text: `Cannot load unknown path in ${i}: ${e.path}` }] };
|
|
55
|
-
a = c;
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
contents: a,
|
|
59
|
-
loader: "ts"
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}],
|
|
64
|
-
sourcemap: "inline",
|
|
65
|
-
tsconfigRaw: o,
|
|
66
|
-
minify: !0,
|
|
67
|
-
platform: "neutral"
|
|
68
|
-
});
|
|
69
|
-
if (l.outputFiles && l.outputFiles.length > 0) return l.outputFiles[0].text;
|
|
70
|
-
throw l.errors && l.errors.length > 0 ? Error(`esbuild bundling failed: ${l.errors.map((e) => e.text).join("\n")}`) : Error("esbuild did not produce an output file.");
|
|
71
|
-
} catch (e) {
|
|
72
|
-
throw console.error("esbuild bundling process failed:", e), e;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
var c = async () => "\n interface FirstTest {\n isTrue?: boolean;\n }\n", l = null;
|
|
76
|
-
async function u() {
|
|
77
|
-
if (l) return l;
|
|
78
|
-
try {
|
|
79
|
-
return await (await import("./bmKxP3gmEczTpaFo.mjs")).initialize();
|
|
80
|
-
} catch (e) {
|
|
81
|
-
throw l = null, e;
|
|
82
|
-
} finally {
|
|
83
|
-
l = null;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
async function d(i) {
|
|
87
|
-
let a = i?.source ?? null;
|
|
88
|
-
if (!a) return {
|
|
89
|
-
module: null,
|
|
90
|
-
diagnostics: []
|
|
91
|
-
};
|
|
92
|
-
let o = (i.disableBundle || i.declarationsOnly) ?? !1, [l, d] = await Promise.all([c(), u()]), f = "", p = {
|
|
93
|
-
allowJs: !0,
|
|
94
|
-
declaration: !1,
|
|
95
|
-
sourceMap: !1,
|
|
96
|
-
inlineSourceMap: !1,
|
|
97
|
-
inlineSources: !1,
|
|
98
|
-
isolatedModules: !0,
|
|
99
|
-
preserveConstEnums: !1,
|
|
100
|
-
module: 99,
|
|
101
|
-
noResolve: !0,
|
|
102
|
-
emitDeclarationOnly: !1,
|
|
103
|
-
target: d.ScriptTarget.ES2020
|
|
104
|
-
}, m = "script", h = `${m}.ts`, g = "lib.d.ts", _ = "global.d.ts", v = {
|
|
105
|
-
[h]: a,
|
|
106
|
-
[g]: "\n/**\n * Represents the completion of an asynchronous operation\n */\ninterface Promise<T> {\n /**\n * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The\n * resolved value cannot be modified from the callback.\n * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).\n * @returns A Promise for the completion of the callback.\n */\n finally(onfinally?: (() => void) | undefined | null): Promise<T>;\n}\n",
|
|
107
|
-
[_]: l
|
|
108
|
-
}, y = d.createProgram([h, _], p, {
|
|
109
|
-
getSourceFile: (e, t, n, r) => d.createSourceFile(e, v[e], d.ScriptTarget.Latest, !0),
|
|
110
|
-
fileExists: (e) => v[e] !== void 0,
|
|
111
|
-
readFile: (e) => v[e],
|
|
112
|
-
writeFile: (e, t) => {
|
|
113
|
-
v[e] = t;
|
|
114
|
-
},
|
|
115
|
-
getCurrentDirectory: () => "./",
|
|
116
|
-
getCanonicalFileName: (e) => e,
|
|
117
|
-
useCaseSensitiveFileNames: () => !0,
|
|
118
|
-
getDefaultLibFileName: (e) => g,
|
|
119
|
-
getNewLine: () => "\n"
|
|
120
|
-
}), b = y.getTypeChecker(), x = y.getSourceFile(h);
|
|
121
|
-
y.emit(), f = v[`${m}.js`] ?? "";
|
|
122
|
-
let S = y.getSyntacticDiagnostics(x).map((e) => ({
|
|
123
|
-
start: e.start ?? 0,
|
|
124
|
-
length: e.length ?? 0,
|
|
125
|
-
severity: "error",
|
|
126
|
-
code: `TS${e.code}`,
|
|
127
|
-
message: d.flattenDiagnosticMessageText(e.messageText, "\n")
|
|
128
|
-
})), C = t(d, x, b, { builtInNames: i.builtInNames }), w = [...S, ...C.diagnostics], T = C.functions, E = C.autoRun, D = w.some((e) => e.severity === "error"), O = `${r.uuidV4()}-script`, k = null;
|
|
129
|
-
if (D) f = "";
|
|
130
|
-
else {
|
|
131
|
-
try {
|
|
132
|
-
o || (f = await s(0, f, m));
|
|
133
|
-
} catch {
|
|
134
|
-
console.warn("Error bundling script");
|
|
135
|
-
}
|
|
136
|
-
let t = f.indexOf(n);
|
|
137
|
-
t > -1 && (k = f.substring(t + n.length + 1, f.length), f = f.substring(0, t), f = f.replaceAll("globalThis." + e, e));
|
|
138
|
-
}
|
|
139
|
-
let A = {
|
|
140
|
-
functions: T,
|
|
141
|
-
commitId: O,
|
|
142
|
-
source: a,
|
|
143
|
-
name: "Script",
|
|
144
|
-
language: "typescript",
|
|
145
|
-
compiled: f
|
|
146
|
-
};
|
|
147
|
-
return k && (A.sourceMap = k), E && (A.autoRun = E), {
|
|
148
|
-
module: A,
|
|
149
|
-
diagnostics: w
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
export { d as compileModule };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.28-beta.4
|
|
3
|
-
*
|
|
4
|
-
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import * as e from "esbuild-wasm";
|
|
8
|
-
var t = null;
|
|
9
|
-
function n() {
|
|
10
|
-
return t ||= e.initialize({}).then(() => e), t;
|
|
11
|
-
}
|
|
12
|
-
export { n as initialize };
|