@jsenv/core 23.9.0 → 24.0.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.
- package/dist/jsenv_exploring_redirector.js +57 -185
- package/dist/jsenv_exploring_redirector.js.map +23 -59
- package/helpers/babel/AwaitValue/AwaitValue.js +1 -1
- package/helpers/babel/get/get.js +16 -10
- package/helpers/babel/readme.md +5 -1
- package/main.js +1 -1
- package/package.json +36 -37
- package/readme.md +8 -8
- package/src/buildProject.js +12 -12
- package/src/{startExploring.js → dev_server.js} +62 -43
- package/src/execute.js +11 -11
- package/src/executeTestPlan.js +11 -10
- package/src/internal/compiling/compile-directory/getOrGenerateCompiledFile.js +4 -37
- package/src/internal/compiling/compileFile.js +0 -2
- package/src/internal/compiling/createCompiledFileService.js +3 -4
- package/src/internal/compiling/startCompileServer.js +25 -25
- package/src/internal/executing/executePlan.js +11 -11
- package/src/internal/exploring/exploring.redirector.js +20 -14
- package/src/launchBrowser.js +23 -3
|
@@ -38,11 +38,11 @@ export const executePlan = async (
|
|
|
38
38
|
coverageV8ConflictWarning,
|
|
39
39
|
coverageTempDirectoryRelativeUrl,
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
protocol,
|
|
42
|
+
privateKey,
|
|
43
|
+
certificate,
|
|
44
|
+
ip,
|
|
45
|
+
port,
|
|
46
46
|
compileServerCanReadFromFilesystem,
|
|
47
47
|
compileServerCanWriteOnFilesystem,
|
|
48
48
|
babelPluginMap,
|
|
@@ -99,7 +99,7 @@ export const executePlan = async (
|
|
|
99
99
|
try {
|
|
100
100
|
const compileServer = await startCompileServer({
|
|
101
101
|
signal: multipleExecutionsOperation.signal,
|
|
102
|
-
compileServerLogLevel,
|
|
102
|
+
logLevel: compileServerLogLevel,
|
|
103
103
|
|
|
104
104
|
projectDirectoryUrl,
|
|
105
105
|
jsenvDirectoryRelativeUrl,
|
|
@@ -109,11 +109,11 @@ export const executePlan = async (
|
|
|
109
109
|
importResolutionMethod,
|
|
110
110
|
importDefaultExtension,
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
protocol,
|
|
113
|
+
privateKey,
|
|
114
|
+
certificate,
|
|
115
|
+
ip,
|
|
116
|
+
port,
|
|
117
117
|
compileServerCanReadFromFilesystem,
|
|
118
118
|
compileServerCanWriteOnFilesystem,
|
|
119
119
|
keepProcessAlive: true, // to be sure it stays alive
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { scanBrowserRuntimeFeatures } from "../runtime/createBrowserRuntime/scanBrowserRuntimeFeatures.js"
|
|
2
|
-
import { fetchExploringJson } from "./fetchExploringJson.js"
|
|
3
2
|
|
|
4
3
|
const redirect = async () => {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
])
|
|
4
|
+
const redirectTarget = new URLSearchParams(window.location.search).get(
|
|
5
|
+
"redirect",
|
|
6
|
+
)
|
|
7
|
+
const browserRuntimeFeaturesReport = await scanBrowserRuntimeFeatures({
|
|
8
|
+
failFastOnFeatureDetection: true,
|
|
9
|
+
})
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const href = `${getDirectoryUrl(
|
|
12
|
+
browserRuntimeFeaturesReport,
|
|
13
|
+
)}${redirectTarget}`
|
|
14
|
+
window.location.href = href
|
|
15
|
+
}
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const getDirectoryUrl = ({
|
|
18
|
+
canAvoidCompilation,
|
|
19
|
+
outDirectoryRelativeUrl,
|
|
20
|
+
compileId,
|
|
21
|
+
}) => {
|
|
22
|
+
if (canAvoidCompilation) {
|
|
23
|
+
return `/`
|
|
24
|
+
}
|
|
25
|
+
return `/${outDirectoryRelativeUrl}${compileId}/`
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
redirect()
|
package/src/launchBrowser.js
CHANGED
|
@@ -59,7 +59,7 @@ chromiumRuntime.launch = async ({
|
|
|
59
59
|
})
|
|
60
60
|
: chromiumSharing.getUniqueSharingToken()
|
|
61
61
|
if (!sharingToken.isUsed()) {
|
|
62
|
-
const { chromium } = await
|
|
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
|
|
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
|
|
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) => {
|