@vizhub/runtime 0.3.4 → 0.3.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.
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.computeBundleJSV2 = void 0;
4
- const virtualFileSystem_1 = require("../common/virtualFileSystem");
5
- const sucrasePlugin_1 = require("../common/sucrasePlugin");
6
- const packageJson_1 = require("../common/packageJson");
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, virtualFileSystem_1.virtualFileSystem)(files), (0, sucrasePlugin_1.sucrasePlugin)()],
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, packageJson_1.packageJSON)(files);
24
- const globals = (0, packageJson_1.getGlobals)(pkg);
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,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getComputedIndexHtml = exports.setJSDOM = void 0;
4
- const packageJson_1 = require("../common/packageJson");
4
+ const packageJson_js_1 = require("../common/packageJson.js");
5
5
  let parser;
6
6
  const DEBUG = false;
7
7
  // Expose a way to inject a DOMParser implementation
@@ -31,9 +31,9 @@ const injectScripts = (htmlTemplate, files) => {
31
31
  doc.documentElement.appendChild(body);
32
32
  }
33
33
  // Handle dependencies first (in head)
34
- const deps = Object.entries((0, packageJson_1.dependencies)(files));
34
+ const deps = Object.entries((0, packageJson_js_1.dependencies)(files));
35
35
  if (deps.length > 0) {
36
- const libraries = (0, packageJson_1.getConfiguredLibraries)(files);
36
+ const libraries = (0, packageJson_js_1.getConfiguredLibraries)(files);
37
37
  // Remove any existing dependency scripts
38
38
  deps.forEach(([name]) => {
39
39
  const selector = `script[src*="${name}@"]`;
@@ -42,7 +42,7 @@ const injectScripts = (htmlTemplate, files) => {
42
42
  });
43
43
  // Add dependency scripts in order
44
44
  deps
45
- .map(([name, version]) => (0, packageJson_1.dependencySource)({ name, version }, libraries))
45
+ .map(([name, version]) => (0, packageJson_js_1.dependencySource)({ name, version }, libraries))
46
46
  .forEach((url) => {
47
47
  const scriptTag = doc.createElement("script");
48
48
  scriptTag.src = url;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.vizLoad = void 0;
4
- const parseId_1 = require("./parseId");
5
4
  const viz_utils_1 = require("@vizhub/viz-utils");
5
+ const parseId_js_1 = require("./parseId.js");
6
6
  const debug = false;
7
7
  // Responsible for loading all imports and
8
8
  // tracking which CSS files are imported.
@@ -15,7 +15,7 @@ const vizLoad = ({ vizCache, trackCSSImport, }) => ({
15
15
  if (debug) {
16
16
  console.log("[vizLoadCSS]: load() " + id);
17
17
  }
18
- const { vizId, fileName } = (0, parseId_1.parseId)(id);
18
+ const { vizId, fileName } = (0, parseId_js_1.parseId)(id);
19
19
  if (debug) {
20
20
  console.log(" [vizLoadCSS] vizId: " + vizId);
21
21
  console.log(" [vizLoadCSS] fileName: " + fileName);
@@ -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) {
@@ -1,4 +1,4 @@
1
- import { dependencies, getConfiguredLibraries, dependencySource, } from "../common/packageJson";
1
+ import { dependencies, getConfiguredLibraries, dependencySource, } from "../common/packageJson.js";
2
2
  let parser;
3
3
  const DEBUG = false;
4
4
  // Expose a way to inject a DOMParser implementation
@@ -1,5 +1,5 @@
1
- import { parseId } from "./parseId";
2
1
  import { getFileText } from "@vizhub/viz-utils";
2
+ import { parseId } from "./parseId.js";
3
3
  const debug = false;
4
4
  // Responsible for loading all imports and
5
5
  // tracking which CSS files are imported.
@@ -1,6 +1,6 @@
1
1
  import { InputPluginOption } from "rollup";
2
- import { ResolvedVizFileId } from "./types";
3
- import { VizCache } from "./vizCache";
2
+ import type { ResolvedVizFileId } from "./types";
3
+ import { VizCache } from "./vizCache.js";
4
4
  export declare const vizLoad: ({ vizCache, trackCSSImport, }: {
5
5
  vizCache: VizCache;
6
6
  trackCSSImport: (cssFile: ResolvedVizFileId) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizhub/runtime",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "Flexible runtime environment for data visualization sandboxes",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",