@sheetxl/scripting 0.8.0-beta.11 → 0.8.0-beta.13
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/browser/esm/{_cUijEyyZifD_LZf.mjs → CNf-ETo-nO1YJpZd.mjs} +1 -1
- package/{node/esm/Cgbq_-KJhRYkRJw-.mjs → browser/esm/CUERvTrIURHqOWKm.mjs} +281 -282
- package/browser/esm/{BPtHkO7z1Di3YIjV.mjs → CwhaPB7R93eqixfq.mjs} +2 -2
- package/browser/esm/DfSFyaySrD6y1NJY.mjs +17 -0
- package/browser/esm/index.mjs +3 -3
- package/browser/esm/{CV6NN6Ju5xBT1o6B.mjs → tbtsT5bS-wwAAvcu.mjs} +1442 -1387
- package/node/esm/{C8P-wHdBmweFS0Ex.mjs → 2OiXgLd8VwO6IeDg.mjs} +1 -1
- package/node/esm/{ByvsA4Gi2N_jmjO4.mjs → BDIcVjo-h3KFdXXo.mjs} +1 -1
- package/node/esm/BLO91PRuOQIsW_Ow.mjs +580 -0
- package/node/esm/index.mjs +9 -9
- package/node/esm/{CLpM4kzEeZk_kWj4.mjs → oWHIRxwwLexnOwAn.mjs} +1 -1
- package/package.json +3 -3
- package/types/src/type/CompiledModule.d.ts +1 -1
- package/types/src/type/Diagnostic.d.ts +0 -2
- package/browser/esm/B73J41HhbJvswDz1.mjs +0 -17
- package/browser/esm/Cg2-n5X_c3X8uPPp.mjs +0 -581
package/node/esm/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CommonUtils as f } from "@sheetxl/utils";
|
|
2
2
|
var c = Object.defineProperty, p = (e, n) => {
|
|
3
3
|
let t = {};
|
|
4
|
-
for (var
|
|
4
|
+
for (var o in e) c(t, o, { get: e[o], enumerable: !0 });
|
|
5
5
|
return n || c(t, Symbol.toStringTag, { value: "Module" }), t;
|
|
6
|
-
}, x = Object.freeze({ NoBody: "SXL1001", Anonymous: "SXL1002", ParseError: "SXL1003", InvalidParamType: "SXL2001", InvalidReturnType: "SXL2002", UndefinedInput: "SXL2003", MissingType: "SXL2004", UntypedArray: "SXL2005", GenericArity: "SXL2006",
|
|
6
|
+
}, x = Object.freeze({ NoBody: "SXL1001", Anonymous: "SXL1002", ParseError: "SXL1003", InvalidParamType: "SXL2001", InvalidReturnType: "SXL2002", UndefinedInput: "SXL2003", MissingType: "SXL2004", UntypedArray: "SXL2005", GenericArity: "SXL2006", ContextNotFirst: "SXL2010", MultipleLambda: "SXL2020", LambdaNotLast: "SXL2021", LambdaScalarMismatch: "SXL2022", LambdaReturn: "SXL2023", FunctionReturn: "SXL2024", LambdaArity: "SXL2025", ArrayDepth: "SXL2030", RepeatingPosition: "SXL2040", MultipleRepeating: "SXL2041", RepeatingSlots: "SXL2042", RepeatingOptional: "SXL2043", RepeatingMax: "SXL2044", EnumMixed: "SXL2050", EnumMemberNotConstant: "SXL2051", EnumNotLocal: "SXL2052", EnumMissingAlias: "SXL2053", EnumPosition: "SXL2054", EnumOmittedValue: "SXL2055", NoExports: "SXL3001", UnknownParam: "SXL3002", BuiltInName: "SXL3003", UnknownReturnKind: "SXL3005", InvalidName: "SXL3006", DuplicateName: "SXL3007", MissingSummary: "SXL9001", MissingParamDescription: "SXL9002", MissingReturns: "SXL9003", EnumDuplicateValue: "SXL9004", EnumMemberUndocumented: "SXL9005" }), L = [{ name: "param", group: "jsdoc", description: "Document a parameter. A string union type becomes a dropdown of allowed options.", snippet: "param ${1:name} ${2:description}" }, { name: "returns", aliases: ["return"], group: "jsdoc", description: "Describe the return value." }, { name: "category", group: "sheetxl", description: "Group the function under a category in the function list.", snippet: "category ${1:name}" }, { name: "name", group: "sheetxl", description: "A name an identifier cannot spell: the name formulas call a function by (MY.FUNC), or an enum member's label.", snippet: "name ${1:NAME}" }, { name: "description", group: "sheetxl", description: "A longer description of the function." }, { name: "deprecated", group: "sheetxl", standalone: !0, description: "Mark the function as deprecated (optionally with a reason)." }, { name: "hidden", group: "sheetxl", standalone: !0, description: "Hide the function from the function list." }, { name: "returnkind", group: "sheetxl", description: "Declare the value kind of the return (a ValueKind word, e.g. `number`, `array`, `reference`) where the type spelling cannot say it (a union return collapses to any).", snippet: "returnKind ${1:number}" }, { name: "example", group: "jsdoc", description: "Provide a usage example." }, { name: "see", group: "jsdoc", description: "Reference a related function or link." }], S = (() => {
|
|
7
7
|
const e = /* @__PURE__ */ new Map();
|
|
8
8
|
for (const n of L) if (e.set(n.name, n), n.aliases) for (const t of n.aliases) e.set(t, n);
|
|
9
9
|
return e;
|
|
@@ -49,29 +49,29 @@ async function C(e, n) {
|
|
|
49
49
|
const { loadCompiledModule: t } = await import("./D0CDObJV23Rxk8-r.mjs");
|
|
50
50
|
return t(e, n);
|
|
51
51
|
}
|
|
52
|
-
var s = null, u = null, r = null,
|
|
52
|
+
var s = null, u = null, r = null, i = null;
|
|
53
53
|
async function E() {
|
|
54
|
-
return
|
|
54
|
+
return i || (i = (async () => {
|
|
55
55
|
const e = await (await import("./og3Pk2ReS3UiORbF.mjs")).initialize();
|
|
56
56
|
if (!e) throw new Error("TypeScript could not be loaded. Check your connection and try again.");
|
|
57
57
|
return e;
|
|
58
58
|
})()).catch(() => {
|
|
59
|
-
|
|
60
|
-
}),
|
|
59
|
+
i = null;
|
|
60
|
+
}), i;
|
|
61
61
|
}
|
|
62
62
|
var D = Object.freeze({ compile: async function(e) {
|
|
63
63
|
if (!e?.source) return { module: null, diagnostics: [] };
|
|
64
64
|
if (u && f.deepEqual(u, e)) return s;
|
|
65
65
|
const n = await (await (async function() {
|
|
66
66
|
if (r) return r;
|
|
67
|
-
const { TypeScriptCompiler: t } = await import("./
|
|
67
|
+
const { TypeScriptCompiler: t } = await import("./oWHIRxwwLexnOwAn.mjs");
|
|
68
68
|
return r = new t();
|
|
69
69
|
})()).compileModule(e);
|
|
70
70
|
return s = n, u = e, n;
|
|
71
71
|
}, lint: async function(e, n) {
|
|
72
72
|
if (!e) return [];
|
|
73
|
-
const [t, { lintScript:
|
|
74
|
-
return
|
|
73
|
+
const [t, { lintScript: o }] = await Promise.all([E(), import("./BLO91PRuOQIsW_Ow.mjs")]);
|
|
74
|
+
return o(t, e, n);
|
|
75
75
|
}, cleanup: function() {
|
|
76
76
|
r && (r.terminate(), r = null, s = null);
|
|
77
77
|
} });
|
|
@@ -4,7 +4,7 @@ var t = class {
|
|
|
4
4
|
}
|
|
5
5
|
async getWorkerWrapper() {
|
|
6
6
|
if (this.workerWrapper) return this.workerWrapper;
|
|
7
|
-
const { createCompilerWorker: r } = await import("./
|
|
7
|
+
const { createCompilerWorker: r } = await import("./2OiXgLd8VwO6IeDg.mjs");
|
|
8
8
|
return this.workerWrapper = await r(), this.workerWrapper;
|
|
9
9
|
}
|
|
10
10
|
async compileModule(r) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/scripting",
|
|
3
3
|
"description": "Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild.",
|
|
4
|
-
"version": "0.8.0-beta.
|
|
4
|
+
"version": "0.8.0-beta.13",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"scripting"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@sheetxl/primitives": "^0.8.0-beta.
|
|
43
|
-
"@sheetxl/utils": "^0.8.0-beta.
|
|
42
|
+
"@sheetxl/primitives": "^0.8.0-beta.13",
|
|
43
|
+
"@sheetxl/utils": "^0.8.0-beta.13"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"esbuild-wasm": ">=0.25.7",
|
|
@@ -9,7 +9,7 @@ import { IFunction } from '@sheetxl/primitives';
|
|
|
9
9
|
* as `IModule.JSON` in the SDK. Produced by `ScriptCompiler.compile` (Node, which returns
|
|
10
10
|
* it inside a {@link CompileResult} alongside diagnostics) and executed compiler-free via
|
|
11
11
|
* `loadCompiledModule`. Compile diagnostics are NOT part of this artifact — they live on
|
|
12
|
-
* {@link CompileResult}.
|
|
12
|
+
* {@link CompileResult}.
|
|
13
13
|
*/
|
|
14
14
|
export interface CompiledModule {
|
|
15
15
|
/**
|
|
@@ -70,8 +70,6 @@ export declare const DiagnosticCode: Readonly<{
|
|
|
70
70
|
readonly UntypedArray: "SXL2005";
|
|
71
71
|
/** A generic type must be supplied exactly one type argument. */
|
|
72
72
|
readonly GenericArity: "SXL2006";
|
|
73
|
-
/** A return type cannot combine multiple modifiers (e.g. async + stream). */
|
|
74
|
-
readonly MultipleModifiers: "SXL2007";
|
|
75
73
|
/** A context parameter must be the first parameter. */
|
|
76
74
|
readonly ContextNotFirst: "SXL2010";
|
|
77
75
|
/** More than one `Lambda` parameter. */
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
var i = Object.freeze({ NoBody: "SXL1001", Anonymous: "SXL1002", ParseError: "SXL1003", InvalidParamType: "SXL2001", InvalidReturnType: "SXL2002", UndefinedInput: "SXL2003", MissingType: "SXL2004", UntypedArray: "SXL2005", GenericArity: "SXL2006", MultipleModifiers: "SXL2007", ContextNotFirst: "SXL2010", MultipleLambda: "SXL2020", LambdaNotLast: "SXL2021", LambdaScalarMismatch: "SXL2022", LambdaReturn: "SXL2023", FunctionReturn: "SXL2024", LambdaArity: "SXL2025", ArrayDepth: "SXL2030", RepeatingPosition: "SXL2040", MultipleRepeating: "SXL2041", RepeatingSlots: "SXL2042", RepeatingOptional: "SXL2043", RepeatingMax: "SXL2044", EnumMixed: "SXL2050", EnumMemberNotConstant: "SXL2051", EnumNotLocal: "SXL2052", EnumMissingAlias: "SXL2053", EnumPosition: "SXL2054", EnumOmittedValue: "SXL2055", NoExports: "SXL3001", UnknownParam: "SXL3002", BuiltInName: "SXL3003", UnknownReturnKind: "SXL3005", InvalidName: "SXL3006", DuplicateName: "SXL3007", MissingSummary: "SXL9001", MissingParamDescription: "SXL9002", MissingReturns: "SXL9003", EnumDuplicateValue: "SXL9004", EnumMemberUndocumented: "SXL9005" }), a = [{ name: "param", group: "jsdoc", description: "Document a parameter. A string union type becomes a dropdown of allowed options.", snippet: "param ${1:name} ${2:description}" }, { name: "returns", aliases: ["return"], group: "jsdoc", description: "Describe the return value." }, { name: "category", group: "sheetxl", description: "Group the function under a category in the function list.", snippet: "category ${1:name}" }, { name: "name", group: "sheetxl", description: "A name an identifier cannot spell: the name formulas call a function by (MY.FUNC), or an enum member's label.", snippet: "name ${1:NAME}" }, { name: "description", group: "sheetxl", description: "A longer description of the function." }, { name: "deprecated", group: "sheetxl", standalone: !0, description: "Mark the function as deprecated (optionally with a reason)." }, { name: "hidden", group: "sheetxl", standalone: !0, description: "Hide the function from the function list." }, { name: "returnkind", group: "sheetxl", description: "Declare the value kind of the return (a ValueKind word, e.g. `number`, `array`, `reference`) where the type spelling cannot say it (a union return collapses to any).", snippet: "returnKind ${1:number}" }, { name: "example", group: "jsdoc", description: "Provide a usage example." }, { name: "see", group: "jsdoc", description: "Reference a related function or link." }], r = (() => {
|
|
2
|
-
const n = /* @__PURE__ */ new Map();
|
|
3
|
-
for (const e of a) if (n.set(e.name, e), e.aliases) for (const t of e.aliases) n.set(t, e);
|
|
4
|
-
return n;
|
|
5
|
-
})();
|
|
6
|
-
function o(n) {
|
|
7
|
-
return (function(e) {
|
|
8
|
-
if (!e) return;
|
|
9
|
-
const t = (e.startsWith("@") ? e.slice(1) : e).toLowerCase();
|
|
10
|
-
return r.get(t);
|
|
11
|
-
})(n)?.standalone === !0;
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
o as n,
|
|
15
|
-
i as r,
|
|
16
|
-
a as t
|
|
17
|
-
};
|