@vizhub/runtime 0.3.5 → 0.3.7
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/cjs/index.js +3 -1
- package/dist/cjs/utils/vizContentToFileCollection.js +1 -0
- package/dist/cjs/v2/computeBundleJSV2.js +6 -6
- package/dist/esm/index.js +1 -0
- package/dist/esm/utils/vizContentToFileCollection.js +1 -0
- package/dist/esm/v2/computeBundleJSV2.js +3 -3
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/vizContentToFileCollection.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.createSlugCache = exports.createVizCache = exports.buildHTML = void 0;
|
3
|
+
exports.vizContentToFileCollection = exports.createSlugCache = exports.createVizCache = exports.buildHTML = void 0;
|
4
4
|
var buildHTML_js_1 = require("./buildHTML.js");
|
5
5
|
Object.defineProperty(exports, "buildHTML", { enumerable: true, get: function () { return buildHTML_js_1.buildHTML; } });
|
6
6
|
var vizCache_js_1 = require("./v3/vizCache.js");
|
7
7
|
Object.defineProperty(exports, "createVizCache", { enumerable: true, get: function () { return vizCache_js_1.createVizCache; } });
|
8
8
|
var slugCache_js_1 = require("./v3/slugCache.js");
|
9
9
|
Object.defineProperty(exports, "createSlugCache", { enumerable: true, get: function () { return slugCache_js_1.createSlugCache; } });
|
10
|
+
var vizContentToFileCollection_js_1 = require("./utils/vizContentToFileCollection.js");
|
11
|
+
Object.defineProperty(exports, "vizContentToFileCollection", { enumerable: true, get: function () { return vizContentToFileCollection_js_1.vizContentToFileCollection; } });
|
@@ -5,6 +5,7 @@ exports.vizContentToFileCollection = void 0;
|
|
5
5
|
* Converts VizContent format to FileCollection format
|
6
6
|
* VizContent has files as {id: {name, text}} structure
|
7
7
|
* FileCollection is a simple {name: text} structure
|
8
|
+
* TODO move to viz-utils
|
8
9
|
*/
|
9
10
|
const vizContentToFileCollection = (vizContent) => {
|
10
11
|
const fileCollection = {};
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.computeBundleJSV2 = void 0;
|
4
|
-
const
|
5
|
-
const
|
6
|
-
const
|
4
|
+
const virtualFileSystem_js_1 = require("../common/virtualFileSystem.js");
|
5
|
+
const sucrasePlugin_js_1 = require("../common/sucrasePlugin.js");
|
6
|
+
const packageJson_js_1 = require("../common/packageJson.js");
|
7
7
|
const computeBundleJSV2 = async ({ files, rollup, enableSourcemap = true, }) => {
|
8
8
|
const indexJSContent = files["index.js"];
|
9
9
|
if (!indexJSContent) {
|
@@ -11,7 +11,7 @@ const computeBundleJSV2 = async ({ files, rollup, enableSourcemap = true, }) =>
|
|
11
11
|
}
|
12
12
|
const inputOptions = {
|
13
13
|
input: "./index.js",
|
14
|
-
plugins: [(0,
|
14
|
+
plugins: [(0, virtualFileSystem_js_1.virtualFileSystem)(files), (0, sucrasePlugin_js_1.sucrasePlugin)()],
|
15
15
|
onwarn(warning, warn) {
|
16
16
|
// Suppress "treating module as external dependency" warnings
|
17
17
|
if (warning.code === "UNRESOLVED_IMPORT")
|
@@ -20,8 +20,8 @@ const computeBundleJSV2 = async ({ files, rollup, enableSourcemap = true, }) =>
|
|
20
20
|
},
|
21
21
|
};
|
22
22
|
const bundle = await rollup(inputOptions);
|
23
|
-
const pkg = (0,
|
24
|
-
const globals = (0,
|
23
|
+
const pkg = (0, packageJson_js_1.packageJSON)(files);
|
24
|
+
const globals = (0, packageJson_js_1.getGlobals)(pkg);
|
25
25
|
const outputOptions = {
|
26
26
|
format: "iife",
|
27
27
|
globals,
|
package/dist/esm/index.js
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
* Converts VizContent format to FileCollection format
|
3
3
|
* VizContent has files as {id: {name, text}} structure
|
4
4
|
* FileCollection is a simple {name: text} structure
|
5
|
+
* TODO move to viz-utils
|
5
6
|
*/
|
6
7
|
export const vizContentToFileCollection = (vizContent) => {
|
7
8
|
const fileCollection = {};
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { virtualFileSystem } from "../common/virtualFileSystem";
|
2
|
-
import { sucrasePlugin } from "../common/sucrasePlugin";
|
3
|
-
import { getGlobals, packageJSON, } from "../common/packageJson";
|
1
|
+
import { virtualFileSystem } from "../common/virtualFileSystem.js";
|
2
|
+
import { sucrasePlugin } from "../common/sucrasePlugin.js";
|
3
|
+
import { getGlobals, packageJSON, } from "../common/packageJson.js";
|
4
4
|
export const computeBundleJSV2 = async ({ files, rollup, enableSourcemap = true, }) => {
|
5
5
|
const indexJSContent = files["index.js"];
|
6
6
|
if (!indexJSContent) {
|
package/dist/types/index.d.ts
CHANGED
@@ -3,5 +3,6 @@ import type { FileCollection, VizContent } from "@vizhub/viz-types";
|
|
3
3
|
* Converts VizContent format to FileCollection format
|
4
4
|
* VizContent has files as {id: {name, text}} structure
|
5
5
|
* FileCollection is a simple {name: text} structure
|
6
|
+
* TODO move to viz-utils
|
6
7
|
*/
|
7
8
|
export declare const vizContentToFileCollection: (vizContent: VizContent) => FileCollection;
|