@hpcc-js/observablehq-compiler 1.2.0 → 1.2.2
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/dist/index.esm.js +27 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +2 -2
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.js +31 -19
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/package.json +3 -4
- package/src/__package__.ts +2 -2
- package/src/__tests__/m1.mjs +3 -0
- package/src/__tests__/node.ts +23 -1
- package/src/compiler.ts +8 -12
- package/src/cst.ts +9 -6
- package/src/util.ts +14 -0
- package/types/__package__.d.ts +2 -2
- package/types/__package__.d.ts.map +1 -1
- package/types/compiler.d.ts.map +1 -1
- package/types/cst.d.ts +1 -1
- package/types/cst.d.ts.map +1 -1
- package/types/util.d.ts +2 -0
- package/types/util.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
- package/types-3.4/cst.d.ts +1 -1
- package/types-3.4/util.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/observablehq-compiler",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "hpcc-js - ObservableHQ Compiler (unoffical)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"observablehq",
|
|
@@ -56,13 +56,12 @@
|
|
|
56
56
|
"update": "npx --yes npm-check-updates -u -t minor"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@hpcc-js/observable-shim": "^2.
|
|
59
|
+
"@hpcc-js/observable-shim": "^2.5.0",
|
|
60
60
|
"node-fetch": "3.2.10",
|
|
61
61
|
"yargs": "17.5.1"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@hpcc-js/bundle": "^2.11.3",
|
|
65
|
-
"@hpcc-js/util": "^2.50.0",
|
|
66
65
|
"@observablehq/runtime": "4.25.0",
|
|
67
66
|
"tslib": "2.4.0"
|
|
68
67
|
},
|
|
@@ -77,5 +76,5 @@
|
|
|
77
76
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
78
77
|
},
|
|
79
78
|
"homepage": "https://github.com/hpcc-systems/Visualization/tree/trunk/packages/observablehq-compiler",
|
|
80
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "948e1c95957e3cc4f00d49bfaf0938fcf4481302"
|
|
81
80
|
}
|
package/src/__package__.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const PKG_NAME = "@hpcc-js/observablehq-compiler";
|
|
2
|
-
export const PKG_VERSION = "1.2.
|
|
3
|
-
export const BUILD_VERSION = "2.104.
|
|
2
|
+
export const PKG_VERSION = "1.2.2";
|
|
3
|
+
export const BUILD_VERSION = "2.104.12";
|
package/src/__tests__/node.ts
CHANGED
|
@@ -59,7 +59,7 @@ describe("ojs", function () {
|
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
it
|
|
62
|
+
it("simple", async function () {
|
|
63
63
|
this.timeout(10000);
|
|
64
64
|
|
|
65
65
|
const notebook = ojs2notebook(ojs);
|
|
@@ -132,6 +132,28 @@ describe("ojs", function () {
|
|
|
132
132
|
|
|
133
133
|
});
|
|
134
134
|
|
|
135
|
+
it("esm imports", async function () {
|
|
136
|
+
this.timeout(10000);
|
|
137
|
+
|
|
138
|
+
const define = await compile(`\
|
|
139
|
+
m1 = import("../src/__tests__/m1.mjs");
|
|
140
|
+
x = m1.f(5, 7);
|
|
141
|
+
`);
|
|
142
|
+
|
|
143
|
+
const library = new Library();
|
|
144
|
+
const runtime = new Runtime(library);
|
|
145
|
+
const main: ohq.Module = define(runtime, name => {
|
|
146
|
+
return {
|
|
147
|
+
pending() { },
|
|
148
|
+
fulfilled(value) { console.info("fulfilled", name, value); },
|
|
149
|
+
rejected(error) { console.error("rejected", name, error); },
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
expect(await main.value("x")).to.equal(35);
|
|
154
|
+
|
|
155
|
+
});
|
|
156
|
+
|
|
135
157
|
it("Introduction to Imports", async function () {
|
|
136
158
|
|
|
137
159
|
const define = await compile(imports as any);
|
package/src/compiler.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ohq, splitModule } from "@hpcc-js/observable-shim";
|
|
2
|
-
import { endsWith, join } from "@hpcc-js/util";
|
|
3
2
|
import { parseCell, ParsedImportCell } from "./cst";
|
|
4
3
|
import { Writer } from "./writer";
|
|
5
|
-
import { encodeBacktick, fetchEx, obfuscatedImport, ojs2notebook, omd2notebook } from "./util";
|
|
4
|
+
import { fixRelativeUrl, isRelativePath, encodeBacktick, fetchEx, obfuscatedImport, ojs2notebook, omd2notebook } from "./util";
|
|
6
5
|
|
|
7
6
|
// Inspector Factory ---
|
|
8
7
|
export type InspectorFactoryEx = (name: string | undefined, id: string | number) => Inspector;
|
|
@@ -16,9 +15,6 @@ export interface Inspector {
|
|
|
16
15
|
|
|
17
16
|
// Module ---
|
|
18
17
|
|
|
19
|
-
const isRelativePath = (path: string) => path[0] === ".";
|
|
20
|
-
const fullUrl = (path: string, basePath: string) => isRelativePath(path) ? join(basePath, path) : path;
|
|
21
|
-
|
|
22
18
|
interface ImportDefine {
|
|
23
19
|
(runtime: ohq.Runtime, inspector?: InspectorFactoryEx): ohq.Module;
|
|
24
20
|
delete: () => void;
|
|
@@ -26,14 +22,14 @@ interface ImportDefine {
|
|
|
26
22
|
}
|
|
27
23
|
|
|
28
24
|
async function importFile(relativePath: string, baseUrl: string) {
|
|
29
|
-
const path =
|
|
25
|
+
const path = fixRelativeUrl(relativePath, baseUrl);
|
|
30
26
|
const content = await fetchEx(path).then(r => r.text());
|
|
31
27
|
let notebook: ohq.Notebook;
|
|
32
|
-
if (endsWith(
|
|
28
|
+
if (relativePath.endsWith(".ojsnb")) {
|
|
33
29
|
notebook = JSON.parse(content);
|
|
34
|
-
} else if (endsWith(
|
|
30
|
+
} else if (relativePath.endsWith(".ojs")) {
|
|
35
31
|
notebook = ojs2notebook(content);
|
|
36
|
-
} else if (endsWith(
|
|
32
|
+
} else if (relativePath.endsWith(".omd")) {
|
|
37
33
|
notebook = omd2notebook(content);
|
|
38
34
|
}
|
|
39
35
|
const retVal: ImportDefine = compile(notebook, { baseUrl }) as any;
|
|
@@ -202,7 +198,7 @@ async function createCell(node: ohq.Node, options: CompileOptions) {
|
|
|
202
198
|
const text = node.mode && node.mode !== "js" ? `${node.mode}\`${encodeBacktick(node.value)}\`` : node.value;
|
|
203
199
|
const parsedModule = splitModule(text);
|
|
204
200
|
for (const cell of parsedModule) {
|
|
205
|
-
const parsed = parseCell(cell.text);
|
|
201
|
+
const parsed = parseCell(cell.text, options.baseUrl);
|
|
206
202
|
switch (parsed.type) {
|
|
207
203
|
case "import":
|
|
208
204
|
modules.push(await createModule(node, parsed, cell.text, options));
|
|
@@ -247,7 +243,7 @@ export type CellFunc = Awaited<ReturnType<typeof createCell>>;
|
|
|
247
243
|
// File ---
|
|
248
244
|
function createFile(file: ohq.File, options: CompileOptions): [string, any] {
|
|
249
245
|
function toString() { return globalThis.url; }
|
|
250
|
-
return [file.name, { url: new URL(
|
|
246
|
+
return [file.name, { url: new URL(fixRelativeUrl(file.url, options.baseUrl)), mimeType: file.mime_type, toString }];
|
|
251
247
|
}
|
|
252
248
|
type FileFunc = ReturnType<typeof createFile>;
|
|
253
249
|
|
|
@@ -264,7 +260,7 @@ export function notebook(_files: ohq.File[] = [], _cells: CellFunc[] = [], { bas
|
|
|
264
260
|
const retVal = (runtime: ohq.Runtime, inspector?: InspectorFactoryEx): ohq.Module => {
|
|
265
261
|
const main = runtime.module();
|
|
266
262
|
main.builtin("FileAttachment", runtime.fileAttachments(name => {
|
|
267
|
-
return fileAttachments.get(name) ?? { url: new URL(
|
|
263
|
+
return fileAttachments.get(name) ?? { url: new URL(fixRelativeUrl(name, baseUrl)), mimeType: null };
|
|
268
264
|
}));
|
|
269
265
|
main.builtin("fetchEx", fetchEx);
|
|
270
266
|
|
package/src/cst.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseCell as ohqParseCell, ancestor, walk } from "@hpcc-js/observable-shim";
|
|
2
|
-
import { createFunction, Refs } from "./util";
|
|
2
|
+
import { fixRelativeUrl, createFunction, Refs } from "./util";
|
|
3
3
|
|
|
4
4
|
function calcRefs(cellAst, cellStr): Refs {
|
|
5
5
|
if (cellAst.references === undefined) return { inputs: [], args: [], patches: [] };
|
|
@@ -51,7 +51,7 @@ export interface ParsedImportCell extends ParsedCell {
|
|
|
51
51
|
injections: { name: string, alias: string }[];
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
function
|
|
54
|
+
function parseImportDeclaration(cellAst): ParsedImportCell {
|
|
55
55
|
return {
|
|
56
56
|
type: "import",
|
|
57
57
|
src: cellAst.body.source.value,
|
|
@@ -153,14 +153,17 @@ function parseVariableExpression(cellStr: string, cellAst, refs: Refs, bodyStr?:
|
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
export function parseCell(cellStr: string): ParsedImportCell | ParsedViewCell | ParsedMutableCell | ParsedVariableCell {
|
|
156
|
+
export function parseCell(cellStr: string, baseUrl: string): ParsedImportCell | ParsedViewCell | ParsedMutableCell | ParsedVariableCell {
|
|
157
157
|
const cellAst = ohqParseCell(cellStr);
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
let bodyStr = cellAst.body && cellStr.substring(cellAst.body.start, cellAst.body.end);
|
|
159
|
+
switch ((cellAst.body)?.type) {
|
|
160
|
+
case "ImportDeclaration":
|
|
161
|
+
return parseImportDeclaration(cellAst);
|
|
162
|
+
case "ImportExpression":
|
|
163
|
+
bodyStr = `import("${fixRelativeUrl(cellAst.body.source.value, baseUrl)}")`;
|
|
160
164
|
}
|
|
161
165
|
const refs = calcRefs(cellAst, cellStr);
|
|
162
166
|
|
|
163
|
-
const bodyStr = cellAst.body && cellStr.substring(cellAst.body.start, cellAst.body.end);
|
|
164
167
|
switch (cellAst.id?.type) {
|
|
165
168
|
case "ViewExpression":
|
|
166
169
|
return parseViewExpression(cellStr, cellAst, refs, bodyStr);
|
package/src/util.ts
CHANGED
|
@@ -41,6 +41,20 @@ export function createFunction(refs: Refs, async = false, generator = false, blo
|
|
|
41
41
|
`return (\n${body}\n);`);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
function join(baseURL, relativeURL) {
|
|
45
|
+
return relativeURL
|
|
46
|
+
? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "")
|
|
47
|
+
: baseURL;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const isRelativePath = (path: string) => path[0] === ".";
|
|
51
|
+
export const fixRelativeUrl = (path: string, basePath: string) => {
|
|
52
|
+
if (isRelativePath(path)) {
|
|
53
|
+
return join(basePath, path);
|
|
54
|
+
}
|
|
55
|
+
return path;
|
|
56
|
+
};
|
|
57
|
+
|
|
44
58
|
// Hide "import" from bundlers as they have a habit of replacing "import" with "require"
|
|
45
59
|
export async function obfuscatedImport(url: string) {
|
|
46
60
|
return new FuncTypes.asyncFunctionType("url", "return import(url)")(url);
|
package/types/__package__.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const PKG_NAME = "@hpcc-js/observablehq-compiler";
|
|
2
|
-
export declare const PKG_VERSION = "1.2.
|
|
3
|
-
export declare const BUILD_VERSION = "2.104.
|
|
2
|
+
export declare const PKG_VERSION = "1.2.2";
|
|
3
|
+
export declare const BUILD_VERSION = "2.104.12";
|
|
4
4
|
//# sourceMappingURL=__package__.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__package__.d.ts","sourceRoot":"","sources":["../src/__package__.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AACzD,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"__package__.d.ts","sourceRoot":"","sources":["../src/__package__.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AACzD,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,aAAa,aAAa,CAAC"}
|
package/types/compiler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../src/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAe,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../src/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAe,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,oBAAY,kBAAkB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,SAAS,CAAC;AAE9F,MAAM,WAAW,SAAS;IACtB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,OAAO,QAAG;IACV,SAAS,CAAC,KAAK,KAAA,OAAE;IACjB,QAAQ,CAAC,KAAK,KAAA,OAAE;CACnB;AAoLD,iBAAe,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,cAAc;cA8BpC,IAAI,OAAO,QAAQ,IAAI,MAAM,cAAc,kBAAkB;;;;;;;;;;;;;;;;;;;;;;aAWnE,MAAM;GAK5B;AACD,oBAAY,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AAU9D,MAAM,WAAW,cAAc;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,WAAW,GAAG,aAAa,CAAC;CAC5C;AACD,wBAAgB,QAAQ,CAAC,MAAM,GAAE,GAAG,CAAC,IAAI,EAAO,EAAE,MAAM,GAAE,QAAQ,EAAO,EAAE,EAAE,OAAa,EAAE,UAA0B,EAAE,GAAE,cAAmB;cAKhH,IAAI,OAAO,cAAc,kBAAkB,GAAG,IAAI,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;WAc1D,QAAQ,GAAG,QAAQ,QAAQ,CAAC;YAMjC,MAAM,GAAG,MAAM,GAAG,QAAQ;eAGvB,MAAM,GAAG,MAAM,GAAG,OAAO;;aAY3B,MAAM;;EAS5B;AAED,wBAAsB,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,QAAQ,GAAG,MAAM,EAAE,EAAE,OAAa,EAAE,UAA0B,EAAE,GAAE,cAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIrI;AACD,oBAAY,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC"}
|
package/types/cst.d.ts
CHANGED
|
@@ -37,6 +37,6 @@ interface ParsedVariableCell extends ParsedCell {
|
|
|
37
37
|
inputs: string[];
|
|
38
38
|
func: any;
|
|
39
39
|
}
|
|
40
|
-
export declare function parseCell(cellStr: string): ParsedImportCell | ParsedViewCell | ParsedMutableCell | ParsedVariableCell;
|
|
40
|
+
export declare function parseCell(cellStr: string, baseUrl: string): ParsedImportCell | ParsedViewCell | ParsedMutableCell | ParsedVariableCell;
|
|
41
41
|
export {};
|
|
42
42
|
//# sourceMappingURL=cst.d.ts.map
|
package/types/cst.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cst.d.ts","sourceRoot":"","sources":["../src/cst.ts"],"names":[],"mappings":"AA0CA,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,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Refs {
|
|
|
10
10
|
patches: Ref[];
|
|
11
11
|
}
|
|
12
12
|
export declare function createFunction(refs: Refs, async?: boolean, generator?: boolean, blockStatement?: boolean, body?: string): any;
|
|
13
|
+
export declare const isRelativePath: (path: string) => boolean;
|
|
14
|
+
export declare const fixRelativeUrl: (path: string, basePath: string) => any;
|
|
13
15
|
export declare function obfuscatedImport(url: string): Promise<any>;
|
|
14
16
|
interface ParsedOJS {
|
|
15
17
|
ojs: string;
|
package/types/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAiBpD,UAAU,GAAG;IACT,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,IAAI;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,GAAG,EAAE,CAAC;CAClB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,UAAQ,EAAE,SAAS,UAAQ,EAAE,cAAc,UAAQ,EAAE,IAAI,CAAC,EAAE,MAAM,OAYjH;
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAiBpD,UAAU,GAAG;IACT,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,IAAI;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,GAAG,EAAE,CAAC;CAClB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,UAAQ,EAAE,SAAS,UAAQ,EAAE,cAAc,UAAQ,EAAE,IAAI,CAAC,EAAE,MAAM,OAYjH;AAQD,eAAO,MAAM,cAAc,SAAU,MAAM,YAAoB,CAAC;AAChE,eAAO,MAAM,cAAc,SAAU,MAAM,YAAY,MAAM,QAK5D,CAAC;AAGF,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,gBAEjD;AAED,UAAU,SAAS;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,GAAG,CAAC;CACd;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,UAIzC;AAgDD,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,CAGnD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,QAAQ,CActD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,QAAQ,CActD;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,SAAuC,EAAE,YAAY,SAAK,qBAezG;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAK9D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const PKG_NAME = "@hpcc-js/observablehq-compiler";
|
|
2
|
-
export declare const PKG_VERSION = "1.2.
|
|
3
|
-
export declare const BUILD_VERSION = "2.104.
|
|
2
|
+
export declare const PKG_VERSION = "1.2.2";
|
|
3
|
+
export declare const BUILD_VERSION = "2.104.12";
|
|
4
4
|
//# sourceMappingURL=__package__.d.ts.map
|
package/types-3.4/cst.d.ts
CHANGED
|
@@ -37,6 +37,6 @@ interface ParsedVariableCell extends ParsedCell {
|
|
|
37
37
|
inputs: string[];
|
|
38
38
|
func: any;
|
|
39
39
|
}
|
|
40
|
-
export declare function parseCell(cellStr: string): ParsedImportCell | ParsedViewCell | ParsedMutableCell | ParsedVariableCell;
|
|
40
|
+
export declare function parseCell(cellStr: string, baseUrl: string): ParsedImportCell | ParsedViewCell | ParsedMutableCell | ParsedVariableCell;
|
|
41
41
|
export {};
|
|
42
42
|
//# sourceMappingURL=cst.d.ts.map
|
package/types-3.4/util.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export interface Refs {
|
|
|
10
10
|
patches: Ref[];
|
|
11
11
|
}
|
|
12
12
|
export declare function createFunction(refs: Refs, async?: boolean, generator?: boolean, blockStatement?: boolean, body?: string): any;
|
|
13
|
+
export declare const isRelativePath: (path: string) => boolean;
|
|
14
|
+
export declare const fixRelativeUrl: (path: string, basePath: string) => any;
|
|
13
15
|
export declare function obfuscatedImport(url: string): Promise<any>;
|
|
14
16
|
interface ParsedOJS {
|
|
15
17
|
ojs: string;
|