@hpcc-js/observablehq-compiler 1.2.4 → 1.2.6
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 +29 -30
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.js +29 -30
- 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 +4 -4
- package/src/__package__.ts +2 -2
- package/src/util.ts +11 -17
- package/types/__package__.d.ts +2 -2
- package/types/compiler.d.ts +3 -3
- package/types/compiler.d.ts.map +1 -1
- package/types/util.d.ts +1 -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 +3 -3
- package/types-3.4/util.d.ts +1 -1
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.6",
|
|
4
4
|
"description": "hpcc-js - ObservableHQ Compiler (unoffical)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"observablehq",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@hpcc-js/observable-shim": "^2.5.0",
|
|
60
|
-
"node-fetch": "3.3.
|
|
61
|
-
"yargs": "17.
|
|
60
|
+
"node-fetch": "3.3.1",
|
|
61
|
+
"yargs": "17.7.2"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@hpcc-js/bundle": "^2.11.3",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
77
77
|
},
|
|
78
78
|
"homepage": "https://github.com/hpcc-systems/Visualization/tree/trunk/packages/observablehq-compiler",
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "1047cde078892c7bdab933df61fb8862f8dff597"
|
|
80
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.6";
|
|
3
|
+
export const BUILD_VERSION = "2.104.20";
|
package/src/util.ts
CHANGED
|
@@ -157,26 +157,20 @@ export function omd2notebook(omd: string): ohq.Notebook {
|
|
|
157
157
|
} as ohq.Notebook;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
export function fetchEx(url: string, proxyPrefix = "https://
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
headers: {
|
|
170
|
-
origin: matches[0],
|
|
171
|
-
referer: url
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
});
|
|
160
|
+
export function fetchEx(url: string, proxyPrefix = "https://api.codetabs.com/v1/proxy/?quest=", proxyPostfix = "") {
|
|
161
|
+
const matches = url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n?]+)/img);
|
|
162
|
+
return fetch(url, { headers: { origin: matches[0], referer: url } }).then(response => {
|
|
163
|
+
if (response.ok) return response;
|
|
164
|
+
throw new Error("CORS?");
|
|
165
|
+
}).catch(e => {
|
|
166
|
+
url = `${proxyPrefix}${url}${proxyPostfix}`;
|
|
167
|
+
return fetch(url, { headers: { origin: matches[0], referer: url } });
|
|
168
|
+
});
|
|
175
169
|
}
|
|
176
170
|
|
|
177
|
-
export function download(impUrl: string): Promise<ohq.Notebook> {
|
|
171
|
+
export function download(impUrl: string, proxyPrefix?: string, proxyPostfix?: string): Promise<ohq.Notebook> {
|
|
178
172
|
const isShared = impUrl.indexOf("https://observablehq.com/d") === 0;
|
|
179
|
-
return fetchEx(impUrl.replace(`https://observablehq.com/${isShared ? "d/" : ""}`, "https://api.observablehq.com/document/"))
|
|
173
|
+
return fetchEx(impUrl.replace(`https://observablehq.com/${isShared ? "d/" : ""}`, "https://api.observablehq.com/document/"), proxyPrefix, proxyPostfix)
|
|
180
174
|
.then(r => r.json())
|
|
181
175
|
;
|
|
182
176
|
}
|
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.6";
|
|
3
|
+
export declare const BUILD_VERSION = "2.104.20";
|
|
4
4
|
//# sourceMappingURL=__package__.d.ts.map
|
package/types/compiler.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ohq } from "@hpcc-js/observable-shim";
|
|
2
2
|
import { Writer } from "./writer";
|
|
3
|
-
export
|
|
3
|
+
export type InspectorFactoryEx = (name: string | undefined, id: string | number) => Inspector;
|
|
4
4
|
export interface Inspector {
|
|
5
5
|
_node?: HTMLDivElement;
|
|
6
6
|
pending(): any;
|
|
@@ -32,7 +32,7 @@ declare function createCell(node: ohq.Node, options: CompileOptions): Promise<{
|
|
|
32
32
|
delete(): void;
|
|
33
33
|
write(w: Writer): void;
|
|
34
34
|
}>;
|
|
35
|
-
export
|
|
35
|
+
export type CellFunc = Awaited<ReturnType<typeof createCell>>;
|
|
36
36
|
export interface CompileOptions {
|
|
37
37
|
baseUrl?: string;
|
|
38
38
|
importMode?: "recursive" | "precompiled";
|
|
@@ -155,6 +155,6 @@ export declare function compile(notebookOrOjs: ohq.Notebook | string, { baseUrl,
|
|
|
155
155
|
write(w: Writer): void;
|
|
156
156
|
toString(w?: Writer): string;
|
|
157
157
|
}>;
|
|
158
|
-
export
|
|
158
|
+
export type compileFunc = Awaited<ReturnType<typeof compile>>;
|
|
159
159
|
export {};
|
|
160
160
|
//# sourceMappingURL=compiler.d.ts.map
|
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;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,
|
|
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,MAAM,MAAM,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,MAAM,MAAM,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,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC"}
|
package/types/util.d.ts
CHANGED
|
@@ -25,6 +25,6 @@ export declare function notebook2ojs(_: string): ParsedOJS[];
|
|
|
25
25
|
export declare function ojs2notebook(ojs: string): ohq.Notebook;
|
|
26
26
|
export declare function omd2notebook(omd: string): ohq.Notebook;
|
|
27
27
|
export declare function fetchEx(url: string, proxyPrefix?: string, proxyPostfix?: string): Promise<Response>;
|
|
28
|
-
export declare function download(impUrl: string): Promise<ohq.Notebook>;
|
|
28
|
+
export declare function download(impUrl: string, proxyPrefix?: string, proxyPostfix?: string): Promise<ohq.Notebook>;
|
|
29
29
|
export {};
|
|
30
30
|
//# sourceMappingURL=util.d.ts.map
|
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,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= "1.2.
|
|
3
|
-
export declare const BUILD_VERSION = "2.104.
|
|
2
|
+
export declare const PKG_VERSION = "1.2.6";
|
|
3
|
+
export declare const BUILD_VERSION = "2.104.20";
|
|
4
4
|
//# sourceMappingURL=__package__.d.ts.map
|
package/types-3.4/compiler.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ohq } from "@hpcc-js/observable-shim";
|
|
2
2
|
import { Writer } from "./writer";
|
|
3
|
-
export
|
|
3
|
+
export type InspectorFactoryEx = (name: string | undefined, id: string | number) => Inspector;
|
|
4
4
|
export interface Inspector {
|
|
5
5
|
_node?: HTMLDivElement;
|
|
6
6
|
pending(): any;
|
|
@@ -32,7 +32,7 @@ declare function createCell(node: ohq.Node, options: CompileOptions): Promise<{
|
|
|
32
32
|
delete(): void;
|
|
33
33
|
write(w: Writer): void;
|
|
34
34
|
}>;
|
|
35
|
-
export
|
|
35
|
+
export type CellFunc = Awaited<ReturnType<typeof createCell>>;
|
|
36
36
|
export interface CompileOptions {
|
|
37
37
|
baseUrl?: string;
|
|
38
38
|
importMode?: "recursive" | "precompiled";
|
|
@@ -155,6 +155,6 @@ export declare function compile(notebookOrOjs: ohq.Notebook | string, { baseUrl,
|
|
|
155
155
|
write(w: Writer): void;
|
|
156
156
|
toString(w?: Writer): string;
|
|
157
157
|
}>;
|
|
158
|
-
export
|
|
158
|
+
export type compileFunc = Awaited<ReturnType<typeof compile>>;
|
|
159
159
|
export {};
|
|
160
160
|
//# sourceMappingURL=compiler.d.ts.map
|
package/types-3.4/util.d.ts
CHANGED
|
@@ -25,6 +25,6 @@ export declare function notebook2ojs(_: string): ParsedOJS[];
|
|
|
25
25
|
export declare function ojs2notebook(ojs: string): ohq.Notebook;
|
|
26
26
|
export declare function omd2notebook(omd: string): ohq.Notebook;
|
|
27
27
|
export declare function fetchEx(url: string, proxyPrefix?: string, proxyPostfix?: string): Promise<Response>;
|
|
28
|
-
export declare function download(impUrl: string): Promise<ohq.Notebook>;
|
|
28
|
+
export declare function download(impUrl: string, proxyPrefix?: string, proxyPostfix?: string): Promise<ohq.Notebook>;
|
|
29
29
|
export {};
|
|
30
30
|
//# sourceMappingURL=util.d.ts.map
|