@jsenv/core 23.10.0 → 23.11.0

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,3 +1,3 @@
1
- export default function (value) {
1
+ export default function _AwaitValue (value) {
2
2
  this.wrapped = value
3
3
  }
@@ -1,13 +1,19 @@
1
1
  import superPropBase from "../superPropBase/superPropBase.js"
2
2
 
3
- function reflectGet(target, property, receiver) {
4
- var base = superPropBase(target, property)
5
- if (!base) return undefined
6
- var desc = Object.getOwnPropertyDescriptor(base, property)
7
- if (desc.get) {
8
- return desc.get.call(receiver)
3
+ export default function _get() {
4
+ if (typeof Reflect !== "undefined" && Reflect.get) {
5
+ _get = Reflect.get;
6
+ } else {
7
+ _get = function _get(target, property, receiver) {
8
+ var base = superPropBase(target, property);
9
+ if (!base) return;
10
+ var desc = Object.getOwnPropertyDescriptor(base, property);
11
+ if (desc.get) {
12
+ // STEP 3. If receiver is not present, then set receiver to target.
13
+ return desc.get.call(arguments.length < 3 ? target : receiver);
14
+ }
15
+ return desc.value;
16
+ };
9
17
  }
10
- return desc.value
11
- }
12
-
13
- export default typeof Reflect !== "undefined" && Reflect.get ? Reflect.get : reflectGet
18
+ return _get.apply(this, arguments);
19
+ }
@@ -2,8 +2,12 @@
2
2
 
3
3
  Babel helpers are copied in there to properly appear in sourcemap.
4
4
 
5
- - All thoose file are inlines versions of babel helpers declared in: https://github.com/babel/babel/blob/main/packages/babel-helpers/src/helpers.js
5
+ - Last sync date: 21 November 2021
6
6
 
7
7
  - History of the file: https://github.com/babel/babel/commits/main/packages/babel-helpers/src/helpers.js
8
8
 
9
+
9
10
  - History of individual helpers: https://github.com/babel/babel/commits/main/packages/babel-helpers/src/helpers
11
+
12
+
13
+ - All thoose file are inlines versions of babel helpers declared in: https://github.com/babel/babel/blob/main/packages/babel-helpers/src/helpers.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "23.10.0",
3
+ "version": "23.11.0",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -29,11 +29,11 @@
29
29
  ],
30
30
  "scripts": {
31
31
  "eslint-check": "node ./node_modules/eslint/bin/eslint.js . --ext=.js,.mjs,.cjs,.html",
32
- "generate-importmap": "node ./script/importmap/generate_importmap.js",
32
+ "importmap-generate": "node ./script/importmap/generate_importmap.js",
33
33
  "build": "node ./script/build/build.js",
34
34
  "dist": "npm run build",
35
35
  "test": "node --experimental-import-meta-resolve ./script/test/test.js",
36
- "start-exploring": "node ./script/start-exploring/start-exploring.js",
36
+ "dev": "node ./script/dev/start_dev_server.js",
37
37
  "test-with-coverage": "npm run test -- --coverage",
38
38
  "test-js-transform": "node ./script/test/test-js-transform.js",
39
39
  "test-compile-server": "node ./script/test/test-compile-server.js",
@@ -42,81 +42,80 @@
42
42
  "test-launch-browser": "node ./script/test/test-launch-browser.js",
43
43
  "test-launch-node": "node ./script/test/test-launch-node.js",
44
44
  "measure-performances": "node --expose-gc ./script/performance/generate_performance_report.js --log --once",
45
- "prettier-format": "node ./script/prettier/prettier_format.mjs",
46
- "prettier-format-stage": "npm run prettier-format -- --staged",
47
- "prettier-check": "npm run prettier-format -- --dry-run",
45
+ "prettier-check": "prettier --check .",
46
+ "prettier-write": "prettier --write .",
48
47
  "playwright-install": "npx playwright install-deps && npx playwright install",
49
48
  "packages-install": "node ./script/packages/packages_install.js",
50
49
  "prepublishOnly": "node ./script/publish/remove_postinstall.mjs && npm run dist",
51
50
  "postpublish": "node ./script/publish/restore_postinstall.mjs"
52
51
  },
53
- "peerDependencies": {
52
+ "optionalDependencies": {
54
53
  "playwright": "1.x"
55
54
  },
56
55
  "dependencies": {
57
56
  "@babel/core": "7.16.0",
58
- "@babel/helper-module-imports": "7.15.4",
59
- "@babel/helpers": "7.15.4",
60
- "@babel/parser": "7.15.8",
61
- "@babel/plugin-proposal-dynamic-import": "7.14.5",
57
+ "@babel/helper-module-imports": "7.16.0",
58
+ "@babel/helpers": "7.16.3",
59
+ "@babel/parser": "7.16.4",
60
+ "@babel/plugin-proposal-dynamic-import": "7.16.0",
62
61
  "@babel/plugin-syntax-dynamic-import": "7.8.3",
63
- "@babel/plugin-syntax-import-assertions": "7.14.5",
62
+ "@babel/plugin-syntax-import-assertions": "7.16.0",
64
63
  "@babel/plugin-syntax-import-meta": "7.10.4",
65
64
  "@babel/plugin-syntax-numeric-separator": "7.10.4",
66
- "@babel/plugin-transform-modules-systemjs": "7.15.4",
65
+ "@babel/plugin-transform-modules-systemjs": "7.16.0",
67
66
  "@c88/v8-coverage": "0.1.1",
68
67
  "@jsenv/abort": "4.1.1",
69
68
  "@jsenv/filesystem": "2.5.1",
70
69
  "@jsenv/importmap": "1.2.0",
71
70
  "@jsenv/log": "1.4.0",
72
71
  "@jsenv/logger": "4.0.1",
73
- "@jsenv/server": "11.0.0",
72
+ "@jsenv/server": "12.0.0",
74
73
  "@jsenv/uneval": "1.6.0",
75
- "@rollup/plugin-commonjs": "21.0.0",
74
+ "@rollup/plugin-commonjs": "21.0.1",
76
75
  "@rollup/plugin-json": "4.1.0",
77
- "@rollup/plugin-node-resolve": "13.0.5",
76
+ "@rollup/plugin-node-resolve": "13.0.6",
78
77
  "@rollup/plugin-replace": "3.0.0",
79
78
  "acorn-import-assertions": "1.8.0",
80
79
  "ansi-to-html": "0.7.2",
81
- "bytes": "3.1.0",
80
+ "bytes": "3.1.1",
82
81
  "cjs-module-lexer": "1.2.2",
83
82
  "construct-style-sheets-polyfill": "3.0.4",
84
- "cssnano": "5.0.9",
85
- "cssnano-preset-default": "5.1.5",
83
+ "cssnano": "5.0.11",
84
+ "cssnano-preset-default": "5.1.7",
86
85
  "cuid": "2.1.8",
87
86
  "estree-walker": "3.0.0",
88
87
  "html-minifier": "4.0.0",
89
88
  "humanize-duration": "3.27.0",
90
89
  "is-valid-identifier": "2.0.2",
91
- "istanbul-lib-coverage": "3.0.2",
92
- "istanbul-lib-instrument": "5.0.3",
90
+ "istanbul-lib-coverage": "3.2.0",
91
+ "istanbul-lib-instrument": "5.1.0",
93
92
  "istanbul-lib-report": "3.0.0",
94
93
  "istanbul-reports": "3.0.5",
95
94
  "magic-string": "0.25.7",
96
95
  "parse5": "6.0.1",
97
96
  "pidtree": "0.5.0",
98
- "postcss": "8.3.9",
97
+ "postcss": "8.3.11",
99
98
  "postcss-value-parser": "4.1.0",
100
99
  "regenerator-runtime": "0.13.9",
101
100
  "resolve": "1.20.0",
102
- "rollup": "2.58.0",
101
+ "rollup": "2.60.0",
103
102
  "rollup-plugin-node-builtins-brofs": "2.1.3",
104
103
  "rollup-plugin-node-globals": "1.4.0",
105
104
  "rollup-plugin-polyfill-node": "0.7.0",
106
105
  "source-map": "0.7.3",
107
106
  "systemjs": "6.11.0",
108
- "terser": "5.9.0",
107
+ "terser": "5.10.0",
109
108
  "v8-to-istanbul": "8.1.0",
110
- "vm2": "3.9.4",
109
+ "vm2": "3.9.5",
111
110
  "wrap-ansi": "8.0.1"
112
111
  },
113
112
  "devDependencies": {
114
- "@babel/eslint-parser": "7.16.0",
115
- "@babel/plugin-syntax-jsx": "7.14.5",
116
- "@babel/plugin-transform-block-scoping": "7.15.3",
117
- "@babel/plugin-transform-react-jsx": "7.14.9",
118
- "@babel/plugin-transform-typescript": "7.15.8",
119
- "@babel/preset-env": "7.15.8",
113
+ "@babel/eslint-parser": "7.16.3",
114
+ "@babel/plugin-syntax-jsx": "7.16.0",
115
+ "@babel/plugin-transform-block-scoping": "7.16.0",
116
+ "@babel/plugin-transform-react-jsx": "7.16.0",
117
+ "@babel/plugin-transform-typescript": "7.16.1",
118
+ "@babel/preset-env": "7.16.4",
120
119
  "@jsenv/assert": "2.3.2",
121
120
  "@jsenv/babel-preset": "./packages/jsenv-babel-preset",
122
121
  "@jsenv/eslint-config": "16.0.9",
@@ -126,14 +125,14 @@
126
125
  "@jsenv/importmap-node-module": "2.7.1",
127
126
  "@jsenv/package-publish": "1.6.2",
128
127
  "@jsenv/performance-impact": "2.2.1",
129
- "@jsenv/prettier-check-project": "5.6.1",
130
128
  "@jsenv/pwa": "4.0.0",
131
129
  "babel-plugin-transform-async-to-promises": "0.8.15",
132
130
  "eslint": "7.32.0",
133
131
  "eslint-plugin-html": "6.2.0",
134
- "eslint-plugin-import": "2.25.2",
135
- "eslint-plugin-react": "7.26.1",
132
+ "eslint-plugin-import": "2.25.3",
133
+ "eslint-plugin-react": "7.27.1",
136
134
  "node-notifier": "10.0.0",
135
+ "playwright": "1.16.3",
137
136
  "preact": "10.5.15",
138
137
  "prettier": "2.4.1",
139
138
  "react": "17.0.2",
@@ -4,7 +4,7 @@ import {
4
4
  startServer,
5
5
  fetchFileSystem,
6
6
  createSSERoom,
7
- composeServicesWithTiming,
7
+ composeServices,
8
8
  urlToContentType,
9
9
  pluginServerTiming,
10
10
  pluginRequestWaitingCheck,
@@ -370,12 +370,12 @@ export const startCompileServer = async ({
370
370
  ],
371
371
  accessControlAllowCredentials: true,
372
372
  }),
373
- ...pluginServerTiming,
373
+ ...pluginServerTiming(),
374
374
  ...pluginRequestWaitingCheck({
375
375
  requestWaitingMs: 60 * 1000,
376
376
  }),
377
377
  },
378
- requestToResponse: composeServicesWithTiming({
378
+ requestToResponse: composeServices({
379
379
  ...customServices,
380
380
  ...jsenvServices,
381
381
  }),
@@ -59,7 +59,7 @@ chromiumRuntime.launch = async ({
59
59
  })
60
60
  : chromiumSharing.getUniqueSharingToken()
61
61
  if (!sharingToken.isUsed()) {
62
- const { chromium } = await import("playwright")
62
+ const { chromium } = await importPlaywright({ browserName: "chromium" })
63
63
  const launchOperation = launchBrowser("chromium", {
64
64
  browserClass: chromium,
65
65
  launchBrowserOperation,
@@ -165,7 +165,7 @@ firefoxRuntime.launch = async ({
165
165
  ? firefoxSharing.getSharingToken({ firefoxExecutablePath, headless })
166
166
  : firefoxSharing.getUniqueSharingToken()
167
167
  if (!sharingToken.isUsed()) {
168
- const { firefox } = await import("playwright")
168
+ const { firefox } = await importPlaywright({ browserName: "firefox" })
169
169
  const launchOperation = launchBrowser("firefox", {
170
170
  browserClass: firefox,
171
171
 
@@ -244,7 +244,7 @@ webkitRuntime.launch = async ({
244
244
  : webkitSharing.getUniqueSharingToken()
245
245
 
246
246
  if (!sharingToken.isUsed()) {
247
- const { webkit } = await import("playwright")
247
+ const { webkit } = await await importPlaywright({ browserName: "webkit" })
248
248
  const launchOperation = launchBrowser("webkit", {
249
249
  browserClass: webkit,
250
250
  launchBrowserOperation,
@@ -349,6 +349,26 @@ const launchBrowser = async (
349
349
  }
350
350
  }
351
351
 
352
+ const importPlaywright = async ({ browserName }) => {
353
+ try {
354
+ const namespace = await import("playwright")
355
+ return namespace
356
+ } catch (e) {
357
+ if (e.code === "ERR_MODULE_NOT_FOUND") {
358
+ throw new Error(
359
+ createDetailedMessage(
360
+ `"playwright" not found. You need playwright in your dependencies when using "${browserName}Runtime"`,
361
+ {
362
+ suggestion: `npm install --save-dev playwright`,
363
+ },
364
+ ),
365
+ { cause: e },
366
+ )
367
+ }
368
+ throw e
369
+ }
370
+ }
371
+
352
372
  const stopBrowser = async (browser) => {
353
373
  const disconnected = browser.isConnected()
354
374
  ? new Promise((resolve) => {