@jsenv/plugin-supervisor 1.3.7 → 1.3.9

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,6 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
2
  import { fileURLToPath } from "node:url";
3
- import { applyBabelPlugins, parseHtmlString, visitHtmlNodes, analyzeScriptNode, getHtmlNodeAttribute, getHtmlNodeText, injectHtmlNodeAsEarlyAsPossible, createHtmlNode, stringifyHtmlAst, getHtmlNodePosition, getUrlForContentInsideHtml, setHtmlNodeText, setHtmlNodeAttributes } from "@jsenv/ast";
3
+ import { applyBabelPlugins, parseHtml, visitHtmlNodes, analyzeScriptNode, getHtmlNodeAttribute, getHtmlNodeText, injectHtmlNodeAsEarlyAsPossible, createHtmlNode, stringifyHtmlAst, getHtmlNodePosition, getUrlForContentInsideHtml, setHtmlNodeText, setHtmlNodeAttributes } from "@jsenv/ast";
4
4
 
5
5
  const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
6
6
  const intToChar = new Uint8Array(64); // 64 possible chars.
@@ -704,7 +704,10 @@ const injectSupervisorIntoHTML = async ({
704
704
  }) => urlToRelativeUrl(inlineScriptUrl, webServer.rootDirectoryUrl),
705
705
  inlineAsRemote
706
706
  }) => {
707
- const htmlAst = parseHtmlString(content);
707
+ const htmlAst = parseHtml({
708
+ html: content,
709
+ url
710
+ });
708
711
  const mutations = [];
709
712
  const actions = [];
710
713
  const scriptInfos = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-supervisor",
3
- "version": "1.3.7",
3
+ "version": "1.3.9",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "/dist/"
27
27
  ],
28
28
  "dependencies": {
29
- "@jsenv/ast": "5.2.1",
29
+ "@jsenv/ast": "6.0.1",
30
30
  "@jsenv/urls": "2.2.1",
31
31
  "@jsenv/sourcemap": "1.2.4",
32
32
  "launch-editor": "2.6.1"
@@ -960,15 +960,13 @@ window.__supervisor__ = (() => {
960
960
  }
961
961
  const { codeFrame, cause } = errorDetails;
962
962
  if (codeFrame) {
963
- this.root.querySelector(
964
- ".text",
965
- ).innerHTML += `\n\n${codeFrame}`;
963
+ this.root.querySelector(".text").innerHTML +=
964
+ `\n\n${codeFrame}`;
966
965
  }
967
966
  if (cause) {
968
967
  const causeIndented = prefixRemainingLines(cause, " ");
969
- this.root.querySelector(
970
- ".text",
971
- ).innerHTML += `\n [cause]: ${causeIndented}`;
968
+ this.root.querySelector(".text").innerHTML +=
969
+ `\n [cause]: ${causeIndented}`;
972
970
  }
973
971
  });
974
972
  }
@@ -46,7 +46,7 @@
46
46
  */
47
47
 
48
48
  import {
49
- parseHtmlString,
49
+ parseHtml,
50
50
  stringifyHtmlAst,
51
51
  visitHtmlNodes,
52
52
  getHtmlNodeAttribute,
@@ -80,7 +80,7 @@ export const injectSupervisorIntoHTML = async (
80
80
  inlineAsRemote,
81
81
  },
82
82
  ) => {
83
- const htmlAst = parseHtmlString(content);
83
+ const htmlAst = parseHtml({ html: content, url });
84
84
  const mutations = [];
85
85
  const actions = [];
86
86