@jsenv/plugin-supervisor 1.0.1 → 1.1.1
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/README.md +4 -0
- package/dist/js/supervisor.js +1088 -0
- package/dist/jsenv_plugin_supervisor.js +1181 -0
- package/package.json +7 -5
- package/src/{html_supervisor_injection.js → html_supervisor.js} +1 -1
- package/src/{js_supervisor_injection.js → js_supervisor.js} +3 -5
- package/src/jsenv_plugin_supervisor.js +6 -7
- package/src/main.js +5 -0
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/plugin-supervisor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/jsenv/core",
|
|
8
|
-
"directory": "packages/internal/
|
|
8
|
+
"directory": "packages/internal/plugin-supervisor"
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
16
|
"import": {
|
|
17
|
-
"development": "./src/
|
|
17
|
+
"development": "./src/main.js",
|
|
18
18
|
"default": "./dist/jsenv_plugin_supervisor.js"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
@@ -22,10 +22,11 @@
|
|
|
22
22
|
},
|
|
23
23
|
"main": "./src/main.js",
|
|
24
24
|
"files": [
|
|
25
|
-
"/src/"
|
|
25
|
+
"/src/",
|
|
26
|
+
"/dist/"
|
|
26
27
|
],
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@jsenv/ast": "4.0
|
|
29
|
+
"@jsenv/ast": "4.1.0",
|
|
29
30
|
"@jsenv/urls": "2.0.0",
|
|
30
31
|
"@jsenv/sourcemap": "1.0.10",
|
|
31
32
|
"launch-editor": "2.6.0"
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"scripts": {
|
|
34
35
|
"eslint": "npx eslint . --ext=.js,.mjs,.cjs,.html",
|
|
35
36
|
"build": "node ./scripts/build.mjs",
|
|
37
|
+
"test": "node ./scripts/test.mjs",
|
|
36
38
|
"prepublishOnly": "npm run build"
|
|
37
39
|
}
|
|
38
40
|
}
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
} from "@jsenv/ast";
|
|
61
61
|
import { generateInlineContentUrl, urlToRelativeUrl } from "@jsenv/urls";
|
|
62
62
|
|
|
63
|
-
import { injectSupervisorIntoJs } from "./
|
|
63
|
+
import { injectSupervisorIntoJs } from "./js_supervisor.js";
|
|
64
64
|
|
|
65
65
|
export const supervisorFileUrl = new URL(
|
|
66
66
|
"./client/supervisor.js",
|
|
@@ -52,12 +52,10 @@ export const injectSupervisorIntoJs = async ({
|
|
|
52
52
|
? babelPluginJsModuleSupervisor
|
|
53
53
|
: babelPluginJsClassicSupervisor;
|
|
54
54
|
const result = await applyBabelPlugins({
|
|
55
|
-
urlInfo: {
|
|
56
|
-
content,
|
|
57
|
-
originalUrl: url,
|
|
58
|
-
type,
|
|
59
|
-
},
|
|
60
55
|
babelPlugins: [[babelPluginJsSupervisor, { inlineSrc }]],
|
|
56
|
+
input: content,
|
|
57
|
+
inputIsJsModule: type === "js_module",
|
|
58
|
+
inputUrl: url,
|
|
61
59
|
});
|
|
62
60
|
let code = result.code;
|
|
63
61
|
let map = result.map;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This plugin provides a way for jsenv to
|
|
2
|
+
* This plugin provides a way for jsenv to supervisor js execution:
|
|
3
|
+
* - Know how many js are executed, when they are done, collect errors, etc...
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
6
|
import { createRequire } from "node:module";
|
|
@@ -7,12 +8,10 @@ import { fileURLToPath } from "node:url";
|
|
|
7
8
|
import { getOriginalPosition } from "@jsenv/sourcemap";
|
|
8
9
|
import { stringifyUrlSite } from "@jsenv/urls";
|
|
9
10
|
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import.meta.url,
|
|
15
|
-
).href;
|
|
11
|
+
import {
|
|
12
|
+
supervisorFileUrl,
|
|
13
|
+
injectSupervisorIntoHTML,
|
|
14
|
+
} from "./html_supervisor.js";
|
|
16
15
|
|
|
17
16
|
export const jsenvPluginSupervisor = ({
|
|
18
17
|
logs = false,
|