@jsenv/core 24.6.1 → 24.6.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "24.6.
|
|
3
|
+
"version": "24.6.2",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
"node": ">=14.9.0"
|
|
12
12
|
},
|
|
13
13
|
"publishConfig": {
|
|
14
|
-
"access": "public"
|
|
15
|
-
"registry": "https://registry.npmjs.org"
|
|
14
|
+
"access": "public"
|
|
16
15
|
},
|
|
17
16
|
"type": "module",
|
|
18
17
|
"exports": {
|
|
@@ -46,55 +45,55 @@
|
|
|
46
45
|
"playwright": "1.x"
|
|
47
46
|
},
|
|
48
47
|
"dependencies": {
|
|
49
|
-
"@babel/core": "7.16.
|
|
48
|
+
"@babel/core": "7.16.5",
|
|
50
49
|
"@babel/helper-module-imports": "7.16.0",
|
|
51
|
-
"@babel/helpers": "7.16.
|
|
52
|
-
"@babel/parser": "7.16.
|
|
53
|
-
"@babel/plugin-proposal-dynamic-import": "7.16.
|
|
50
|
+
"@babel/helpers": "7.16.5",
|
|
51
|
+
"@babel/parser": "7.16.6",
|
|
52
|
+
"@babel/plugin-proposal-dynamic-import": "7.16.5",
|
|
54
53
|
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
|
55
|
-
"@babel/plugin-syntax-import-assertions": "7.16.
|
|
54
|
+
"@babel/plugin-syntax-import-assertions": "7.16.5",
|
|
56
55
|
"@babel/plugin-syntax-import-meta": "7.10.4",
|
|
57
56
|
"@babel/plugin-syntax-numeric-separator": "7.10.4",
|
|
58
|
-
"@babel/plugin-transform-modules-systemjs": "7.16.
|
|
57
|
+
"@babel/plugin-transform-modules-systemjs": "7.16.5",
|
|
59
58
|
"@c88/v8-coverage": "0.1.1",
|
|
60
59
|
"@jsenv/abort": "4.1.2",
|
|
61
|
-
"@jsenv/filesystem": "2.
|
|
60
|
+
"@jsenv/filesystem": "2.6.0",
|
|
62
61
|
"@jsenv/importmap": "1.2.0",
|
|
63
62
|
"@jsenv/log": "1.5.0",
|
|
64
63
|
"@jsenv/logger": "4.0.1",
|
|
65
|
-
"@jsenv/server": "12.2.
|
|
64
|
+
"@jsenv/server": "12.2.1",
|
|
66
65
|
"@jsenv/uneval": "1.6.0",
|
|
67
66
|
"@rollup/plugin-commonjs": "21.0.1",
|
|
68
67
|
"@rollup/plugin-json": "4.1.0",
|
|
69
|
-
"@rollup/plugin-node-resolve": "13.
|
|
68
|
+
"@rollup/plugin-node-resolve": "13.1.1",
|
|
70
69
|
"@rollup/plugin-replace": "3.0.0",
|
|
71
70
|
"acorn-import-assertions": "1.8.0",
|
|
72
71
|
"ansi-to-html": "0.7.2",
|
|
73
72
|
"bytes": "3.1.1",
|
|
74
73
|
"cjs-module-lexer": "1.2.2",
|
|
75
|
-
"construct-style-sheets-polyfill": "3.0.
|
|
76
|
-
"cssnano": "5.0.
|
|
77
|
-
"cssnano-preset-default": "5.1.
|
|
74
|
+
"construct-style-sheets-polyfill": "3.0.5",
|
|
75
|
+
"cssnano": "5.0.14",
|
|
76
|
+
"cssnano-preset-default": "5.1.9",
|
|
78
77
|
"cuid": "2.1.8",
|
|
79
|
-
"estree-walker": "3.0.
|
|
78
|
+
"estree-walker": "3.0.1",
|
|
80
79
|
"html-minifier": "4.0.0",
|
|
81
|
-
"humanize-duration": "3.27.
|
|
80
|
+
"humanize-duration": "3.27.1",
|
|
82
81
|
"is-valid-identifier": "2.0.2",
|
|
83
82
|
"istanbul-lib-coverage": "3.2.0",
|
|
84
83
|
"istanbul-lib-instrument": "5.1.0",
|
|
85
84
|
"istanbul-lib-report": "3.0.0",
|
|
86
|
-
"istanbul-reports": "3.
|
|
85
|
+
"istanbul-reports": "3.1.1",
|
|
87
86
|
"magic-string": "0.25.7",
|
|
88
87
|
"parse5": "6.0.1",
|
|
89
88
|
"pidtree": "0.5.0",
|
|
90
|
-
"postcss": "8.
|
|
91
|
-
"postcss-value-parser": "4.
|
|
89
|
+
"postcss": "8.4.5",
|
|
90
|
+
"postcss-value-parser": "4.2.0",
|
|
92
91
|
"regenerator-runtime": "0.13.9",
|
|
93
92
|
"resolve": "1.20.0",
|
|
94
|
-
"rollup": "2.
|
|
93
|
+
"rollup": "2.61.1",
|
|
95
94
|
"rollup-plugin-node-builtins-brofs": "2.1.3",
|
|
96
95
|
"rollup-plugin-node-globals": "1.4.0",
|
|
97
|
-
"rollup-plugin-polyfill-node": "0.
|
|
96
|
+
"rollup-plugin-polyfill-node": "0.8.0",
|
|
98
97
|
"source-map": "0.7.3",
|
|
99
98
|
"systemjs": "6.11.0",
|
|
100
99
|
"terser": "5.10.0",
|
|
@@ -104,20 +103,20 @@
|
|
|
104
103
|
"wrap-ansi": "8.0.1"
|
|
105
104
|
},
|
|
106
105
|
"devDependencies": {
|
|
107
|
-
"@babel/eslint-parser": "7.16.
|
|
108
|
-
"@babel/plugin-syntax-jsx": "7.16.
|
|
109
|
-
"@babel/plugin-transform-block-scoping": "7.16.
|
|
110
|
-
"@babel/plugin-transform-react-jsx": "7.16.
|
|
106
|
+
"@babel/eslint-parser": "7.16.5",
|
|
107
|
+
"@babel/plugin-syntax-jsx": "7.16.5",
|
|
108
|
+
"@babel/plugin-transform-block-scoping": "7.16.5",
|
|
109
|
+
"@babel/plugin-transform-react-jsx": "7.16.5",
|
|
111
110
|
"@babel/plugin-transform-typescript": "7.16.1",
|
|
112
|
-
"@babel/preset-env": "7.16.
|
|
113
|
-
"@jsenv/assert": "2.
|
|
111
|
+
"@babel/preset-env": "7.16.5",
|
|
112
|
+
"@jsenv/assert": "2.4.0",
|
|
114
113
|
"@jsenv/babel-preset": "./packages/jsenv-babel-preset",
|
|
115
114
|
"@jsenv/eslint-config": "16.0.9",
|
|
116
115
|
"@jsenv/file-size-impact": "12.1.1",
|
|
117
116
|
"@jsenv/github-release-package": "1.2.3",
|
|
118
117
|
"@jsenv/https-local": "1.0.3",
|
|
119
118
|
"@jsenv/importmap-eslint-resolver": "5.2.1",
|
|
120
|
-
"@jsenv/importmap-node-module": "
|
|
119
|
+
"@jsenv/importmap-node-module": "5.0.0",
|
|
121
120
|
"@jsenv/package-publish": "1.6.2",
|
|
122
121
|
"@jsenv/performance-impact": "2.2.1",
|
|
123
122
|
"@jsenv/pwa": "4.0.0",
|
|
@@ -127,13 +126,13 @@
|
|
|
127
126
|
"eslint-plugin-import": "2.25.3",
|
|
128
127
|
"eslint-plugin-react": "7.27.1",
|
|
129
128
|
"node-notifier": "10.0.0",
|
|
130
|
-
"playwright": "1.
|
|
129
|
+
"playwright": "1.17.1",
|
|
131
130
|
"postcss-import": "14.0.2",
|
|
132
|
-
"preact": "10.
|
|
133
|
-
"prettier": "2.
|
|
131
|
+
"preact": "10.6.4",
|
|
132
|
+
"prettier": "2.5.1",
|
|
134
133
|
"react": "17.0.2",
|
|
135
134
|
"react-dom": "17.0.2",
|
|
136
135
|
"redux": "4.1.2",
|
|
137
136
|
"rollup-plugin-import-assert": "1.1.1"
|
|
138
137
|
}
|
|
139
|
-
}
|
|
138
|
+
}
|
package/readme.md
CHANGED
|
@@ -61,7 +61,7 @@ export const countDogs = (animals) => {
|
|
|
61
61
|
</html>
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
2 - Create
|
|
64
|
+
2 - Create _test.mjs_
|
|
65
65
|
|
|
66
66
|
```js
|
|
67
67
|
import {
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
firefoxTabRuntime,
|
|
71
71
|
} from "@jsenv/core"
|
|
72
72
|
|
|
73
|
-
executeTestPlan({
|
|
73
|
+
await executeTestPlan({
|
|
74
74
|
projectDirectoryUrl: new URL("./", import.meta.url),
|
|
75
75
|
testPlan: {
|
|
76
76
|
"./animals.test.html": {
|
|
@@ -94,24 +94,24 @@ npx playwright install-deps
|
|
|
94
94
|
npx playwright install
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
4 - Run
|
|
97
|
+
4 - Run _test.mjs_ with Node.js
|
|
98
98
|
|
|
99
99
|
```console
|
|
100
|
-
> node ./
|
|
100
|
+
> node ./test.mjs
|
|
101
101
|
|
|
102
102
|
✔ execution 1 of 2 completed (all completed)
|
|
103
103
|
file: animals.test.html
|
|
104
|
-
runtime: chromium/
|
|
105
|
-
duration:
|
|
104
|
+
runtime: chromium/97.0.4666.0
|
|
105
|
+
duration: 0.45 seconds
|
|
106
106
|
|
|
107
107
|
✔ execution 2 of 2 completed (all completed)
|
|
108
108
|
file: animals.test.html
|
|
109
|
-
runtime: firefox/
|
|
110
|
-
duration:
|
|
109
|
+
runtime: firefox/93.0
|
|
110
|
+
duration: 0.81 seconds
|
|
111
111
|
|
|
112
112
|
-------------- summary -----------------
|
|
113
113
|
2 executions: all completed
|
|
114
|
-
total duration:
|
|
114
|
+
total duration: 1.2 seconds
|
|
115
115
|
----------------------------------------
|
|
116
116
|
```
|
|
117
117
|
|
|
@@ -119,7 +119,7 @@ To read more about testing in jsenv, check [jsenv test runner documentation](./d
|
|
|
119
119
|
|
|
120
120
|
# Dev server overview
|
|
121
121
|
|
|
122
|
-
You
|
|
122
|
+
You want to execute the following _main.html_ file in a browser.
|
|
123
123
|
|
|
124
124
|
```html
|
|
125
125
|
<!DOCTYPE html>
|
|
@@ -145,11 +145,11 @@ npm install --save-dev @jsenv/core
|
|
|
145
145
|
```js
|
|
146
146
|
import { startDevServer } from "@jsenv/core"
|
|
147
147
|
|
|
148
|
-
startDevServer({
|
|
148
|
+
await startDevServer({
|
|
149
149
|
projectDirectoryUrl: new URL("./", import.meta.url),
|
|
150
150
|
explorableConfig: {
|
|
151
151
|
source: {
|
|
152
|
-
"
|
|
152
|
+
"./*.html": true,
|
|
153
153
|
},
|
|
154
154
|
},
|
|
155
155
|
port: 3456,
|
|
@@ -336,9 +336,7 @@ Jsenv configuration is done in [jsenv.config.mjs](#jsenvconfigmjs) and [babel.co
|
|
|
336
336
|
|
|
337
337
|
## jsenv.config.mjs
|
|
338
338
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
It's recommended to use the following _jsenv.config.mjs_
|
|
339
|
+
We recommend to put configuration in a top level file named _jsenv.config.mjs_ like the one below:
|
|
342
340
|
|
|
343
341
|
```js
|
|
344
342
|
/*
|
|
@@ -30,6 +30,7 @@ export const executeHtmlFile = async (
|
|
|
30
30
|
coverageForceIstanbul,
|
|
31
31
|
coveragePlaywrightAPIAvailable,
|
|
32
32
|
transformErrorHook,
|
|
33
|
+
forceCompilation,
|
|
33
34
|
},
|
|
34
35
|
) => {
|
|
35
36
|
const fileUrl = resolveUrl(fileRelativeUrl, projectDirectoryUrl)
|
|
@@ -66,7 +67,7 @@ export const executeHtmlFile = async (
|
|
|
66
67
|
let executionResult
|
|
67
68
|
const { canAvoidCompilation, compileId } = browserRuntimeFeaturesReport
|
|
68
69
|
executeOperation.throwIfAborted()
|
|
69
|
-
if (canAvoidCompilation) {
|
|
70
|
+
if (canAvoidCompilation && !forceCompilation) {
|
|
70
71
|
executionResult = await executeSource({
|
|
71
72
|
projectDirectoryUrl,
|
|
72
73
|
compileServerOrigin,
|
|
@@ -45,6 +45,7 @@ export const createRuntimeFromPlaywright = ({
|
|
|
45
45
|
stopOnExit = true,
|
|
46
46
|
ignoreHTTPSErrors = true,
|
|
47
47
|
stopAfterAllExecutionCallbackList,
|
|
48
|
+
forceCompilation,
|
|
48
49
|
}) => {
|
|
49
50
|
const stopCallbackList = createCallbackListNotifiedOnce()
|
|
50
51
|
const stoppedCallbackList = createCallbackListNotifiedOnce()
|
|
@@ -139,6 +140,7 @@ export const createRuntimeFromPlaywright = ({
|
|
|
139
140
|
|
|
140
141
|
coveragePlaywrightAPIAvailable,
|
|
141
142
|
transformErrorHook,
|
|
143
|
+
forceCompilation,
|
|
142
144
|
})
|
|
143
145
|
|
|
144
146
|
return {
|
|
@@ -272,6 +274,7 @@ const createExecuteHook = ({
|
|
|
272
274
|
|
|
273
275
|
coveragePlaywrightAPIAvailable,
|
|
274
276
|
transformErrorHook,
|
|
277
|
+
forceCompilation,
|
|
275
278
|
}) => {
|
|
276
279
|
const execute = async ({ signal, fileRelativeUrl }) => {
|
|
277
280
|
const executeOperation = Abort.startOperation()
|
|
@@ -294,6 +297,7 @@ const createExecuteHook = ({
|
|
|
294
297
|
coveragePlaywrightAPIAvailable,
|
|
295
298
|
coverageIgnorePredicate,
|
|
296
299
|
transformErrorHook,
|
|
300
|
+
forceCompilation,
|
|
297
301
|
})
|
|
298
302
|
return result
|
|
299
303
|
}
|