@hpcc-js/observablehq-compiler 1.1.3 → 1.2.0
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/bin/ojscc.mjs +4 -5
- package/dist/index.esm.js +132 -84
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +3 -3
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.js +132 -84
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/package.json +4 -4
- package/src/__package__.ts +2 -2
- package/src/__tests__/node.ts +1 -1
- package/src/compiler.ts +130 -94
- package/src/index.ts +1 -1
- package/src/util.ts +8 -4
- package/types/__package__.d.ts +2 -2
- package/types/compiler.d.ts +108 -39
- package/types/compiler.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/util.d.ts +0 -1
- package/types/util.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
- package/types-3.4/compiler.d.ts +108 -42
- package/types-3.4/index.d.ts +1 -1
- package/types-3.4/util.d.ts +0 -1
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;AAG5D,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;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
|
|
2
2
|
export * from "./compiler";
|
|
3
|
-
export { ojs2notebook, omd2notebook,
|
|
3
|
+
export { ojs2notebook, omd2notebook, download } from "./util";
|
|
4
4
|
import "../src/index.css";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAEpD,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAEpD,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE9D,OAAO,kBAAkB,CAAC"}
|
package/types/util.d.ts
CHANGED
|
@@ -19,7 +19,6 @@ interface ParsedOJS {
|
|
|
19
19
|
error: any;
|
|
20
20
|
}
|
|
21
21
|
export declare function encodeBacktick(str: string): string;
|
|
22
|
-
export declare function parseOmd(_: string): ParsedOJS[];
|
|
23
22
|
export declare function notebook2ojs(_: string): ParsedOJS[];
|
|
24
23
|
export declare function ojs2notebook(ojs: string): ohq.Notebook;
|
|
25
24
|
export declare function omd2notebook(omd: string): ohq.Notebook;
|
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,EA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,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.
|
|
3
|
-
export declare const BUILD_VERSION = "2.104.
|
|
2
|
+
export declare const PKG_VERSION = "1.2.0";
|
|
3
|
+
export declare const BUILD_VERSION = "2.104.9";
|
|
4
4
|
//# sourceMappingURL=__package__.d.ts.map
|
package/types-3.4/compiler.d.ts
CHANGED
|
@@ -1,91 +1,157 @@
|
|
|
1
1
|
import { ohq } from "@hpcc-js/observable-shim";
|
|
2
2
|
import { Writer } from "./writer";
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export declare type InspectorFactoryEx = (name: string | undefined, id: string | number) => Inspector;
|
|
4
|
+
export interface Inspector {
|
|
5
|
+
_node?: HTMLDivElement;
|
|
6
|
+
pending(): any;
|
|
7
|
+
fulfilled(value: any): any;
|
|
8
|
+
rejected(error: any): any;
|
|
9
|
+
}
|
|
10
|
+
declare function createCell(node: ohq.Node, options: CompileOptions): Promise<{
|
|
11
|
+
(runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): void;
|
|
12
|
+
id: string | number;
|
|
6
13
|
modules: {
|
|
7
|
-
(runtime: ohq.Runtime, main: ohq.Module, inspector?:
|
|
14
|
+
(runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): ohq.Module;
|
|
8
15
|
importVariables: {
|
|
9
16
|
(main: ohq.Module, otherModule: ohq.Module): void;
|
|
10
|
-
|
|
17
|
+
delete(): void;
|
|
11
18
|
}[];
|
|
12
19
|
variables: {
|
|
13
|
-
(module: ohq.Module, inspector?:
|
|
14
|
-
|
|
20
|
+
(module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
|
|
21
|
+
delete(): void;
|
|
15
22
|
write(w: Writer): void;
|
|
16
23
|
}[];
|
|
17
|
-
|
|
24
|
+
delete(): void;
|
|
18
25
|
write(w: Writer): void;
|
|
19
26
|
}[];
|
|
20
27
|
variables: {
|
|
21
|
-
(module: ohq.Module, inspector?:
|
|
22
|
-
|
|
28
|
+
(module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
|
|
29
|
+
delete(): void;
|
|
23
30
|
write(w: Writer): void;
|
|
24
31
|
}[];
|
|
25
|
-
|
|
32
|
+
delete(): void;
|
|
26
33
|
write(w: Writer): void;
|
|
27
34
|
}>;
|
|
28
35
|
export declare type CellFunc = Awaited<ReturnType<typeof createCell>>;
|
|
29
|
-
|
|
30
|
-
string
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export declare
|
|
34
|
-
|
|
35
|
-
(runtime: ohq.Runtime, inspector?: ohq.InspectorFactory): ohq.Module;
|
|
36
|
+
export interface CompileOptions {
|
|
37
|
+
baseUrl?: string;
|
|
38
|
+
importMode?: "recursive" | "precompiled";
|
|
39
|
+
}
|
|
40
|
+
export declare function notebook(_files?: ohq.File[], _cells?: CellFunc[], { baseUrl, importMode }?: CompileOptions): {
|
|
41
|
+
(runtime: ohq.Runtime, inspector?: InspectorFactoryEx): ohq.Module;
|
|
36
42
|
fileAttachments: Map<string, any>;
|
|
37
|
-
cells: Map<string, {
|
|
38
|
-
(runtime: ohq.Runtime, main: ohq.Module, inspector?:
|
|
39
|
-
id: string;
|
|
43
|
+
cells: Map<string | number, {
|
|
44
|
+
(runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): void;
|
|
45
|
+
id: string | number;
|
|
40
46
|
modules: {
|
|
41
|
-
(runtime: ohq.Runtime, main: ohq.Module, inspector?:
|
|
47
|
+
(runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): ohq.Module;
|
|
42
48
|
importVariables: {
|
|
43
49
|
(main: ohq.Module, otherModule: ohq.Module): void;
|
|
44
|
-
|
|
50
|
+
delete(): void;
|
|
45
51
|
}[];
|
|
46
52
|
variables: {
|
|
47
|
-
(module: ohq.Module, inspector?:
|
|
48
|
-
|
|
53
|
+
(module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
|
|
54
|
+
delete(): void;
|
|
49
55
|
write(w: Writer): void;
|
|
50
56
|
}[];
|
|
51
|
-
|
|
57
|
+
delete(): void;
|
|
52
58
|
write(w: Writer): void;
|
|
53
59
|
}[];
|
|
54
60
|
variables: {
|
|
55
|
-
(module: ohq.Module, inspector?:
|
|
56
|
-
|
|
61
|
+
(module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
|
|
62
|
+
delete(): void;
|
|
57
63
|
write(w: Writer): void;
|
|
58
64
|
}[];
|
|
59
|
-
|
|
65
|
+
delete(): void;
|
|
60
66
|
write(w: Writer): void;
|
|
61
67
|
}>;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
set(n: ohq.Node): Promise<CellFunc>;
|
|
69
|
+
get(id: string | number): CellFunc;
|
|
70
|
+
delete(id: string | number): boolean;
|
|
71
|
+
clear(): void;
|
|
72
|
+
write(w: Writer): void;
|
|
73
|
+
toString(w?: Writer): string;
|
|
74
|
+
};
|
|
75
|
+
export declare function compile(notebookOrOjs: ohq.Notebook | string, { baseUrl, importMode }?: CompileOptions): Promise<{
|
|
76
|
+
(runtime: ohq.Runtime, inspector?: InspectorFactoryEx): ohq.Module;
|
|
77
|
+
fileAttachments: Map<string, any>;
|
|
78
|
+
cells: Map<string | number, {
|
|
79
|
+
(runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): void;
|
|
80
|
+
id: string | number;
|
|
81
|
+
modules: {
|
|
82
|
+
(runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): ohq.Module;
|
|
83
|
+
importVariables: {
|
|
84
|
+
(main: ohq.Module, otherModule: ohq.Module): void;
|
|
85
|
+
delete(): void;
|
|
86
|
+
}[];
|
|
87
|
+
variables: {
|
|
88
|
+
(module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
|
|
89
|
+
delete(): void;
|
|
90
|
+
write(w: Writer): void;
|
|
91
|
+
}[];
|
|
92
|
+
delete(): void;
|
|
93
|
+
write(w: Writer): void;
|
|
94
|
+
}[];
|
|
95
|
+
variables: {
|
|
96
|
+
(module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
|
|
97
|
+
delete(): void;
|
|
98
|
+
write(w: Writer): void;
|
|
99
|
+
}[];
|
|
100
|
+
delete(): void;
|
|
101
|
+
write(w: Writer): void;
|
|
102
|
+
}>;
|
|
103
|
+
set(n: ohq.Node): Promise<{
|
|
104
|
+
(runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): void;
|
|
105
|
+
id: string | number;
|
|
65
106
|
modules: {
|
|
66
|
-
(runtime: ohq.Runtime, main: ohq.Module, inspector?:
|
|
107
|
+
(runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): ohq.Module;
|
|
67
108
|
importVariables: {
|
|
68
109
|
(main: ohq.Module, otherModule: ohq.Module): void;
|
|
69
|
-
|
|
110
|
+
delete(): void;
|
|
70
111
|
}[];
|
|
71
112
|
variables: {
|
|
72
|
-
(module: ohq.Module, inspector?:
|
|
73
|
-
|
|
113
|
+
(module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
|
|
114
|
+
delete(): void;
|
|
74
115
|
write(w: Writer): void;
|
|
75
116
|
}[];
|
|
76
|
-
|
|
117
|
+
delete(): void;
|
|
77
118
|
write(w: Writer): void;
|
|
78
119
|
}[];
|
|
79
120
|
variables: {
|
|
80
|
-
(module: ohq.Module, inspector?:
|
|
81
|
-
|
|
121
|
+
(module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
|
|
122
|
+
delete(): void;
|
|
82
123
|
write(w: Writer): void;
|
|
83
124
|
}[];
|
|
84
|
-
|
|
125
|
+
delete(): void;
|
|
85
126
|
write(w: Writer): void;
|
|
86
127
|
}>;
|
|
87
|
-
|
|
88
|
-
|
|
128
|
+
get(id: string | number): {
|
|
129
|
+
(runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): void;
|
|
130
|
+
id: string | number;
|
|
131
|
+
modules: {
|
|
132
|
+
(runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): ohq.Module;
|
|
133
|
+
importVariables: {
|
|
134
|
+
(main: ohq.Module, otherModule: ohq.Module): void;
|
|
135
|
+
delete(): void;
|
|
136
|
+
}[];
|
|
137
|
+
variables: {
|
|
138
|
+
(module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
|
|
139
|
+
delete(): void;
|
|
140
|
+
write(w: Writer): void;
|
|
141
|
+
}[];
|
|
142
|
+
delete(): void;
|
|
143
|
+
write(w: Writer): void;
|
|
144
|
+
}[];
|
|
145
|
+
variables: {
|
|
146
|
+
(module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
|
|
147
|
+
delete(): void;
|
|
148
|
+
write(w: Writer): void;
|
|
149
|
+
}[];
|
|
150
|
+
delete(): void;
|
|
151
|
+
write(w: Writer): void;
|
|
152
|
+
};
|
|
153
|
+
delete(id: string | number): boolean;
|
|
154
|
+
clear(): void;
|
|
89
155
|
write(w: Writer): void;
|
|
90
156
|
toString(w?: Writer): string;
|
|
91
157
|
}>;
|
package/types-3.4/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ohq } from "@hpcc-js/observable-shim";
|
|
2
2
|
export * from "./compiler";
|
|
3
|
-
export { ojs2notebook, omd2notebook,
|
|
3
|
+
export { ojs2notebook, omd2notebook, download } from "./util";
|
|
4
4
|
import "../src/index.css";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/types-3.4/util.d.ts
CHANGED
|
@@ -19,7 +19,6 @@ interface ParsedOJS {
|
|
|
19
19
|
error: any;
|
|
20
20
|
}
|
|
21
21
|
export declare function encodeBacktick(str: string): string;
|
|
22
|
-
export declare function parseOmd(_: string): ParsedOJS[];
|
|
23
22
|
export declare function notebook2ojs(_: string): ParsedOJS[];
|
|
24
23
|
export declare function ojs2notebook(ojs: string): ohq.Notebook;
|
|
25
24
|
export declare function omd2notebook(omd: string): ohq.Notebook;
|