@jsenv/core 25.4.5 → 25.6.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/dist/browser_runtime/asset-manifest.json +2 -2
- package/dist/browser_runtime/browser_runtime_27a156f1.js +5297 -0
- package/dist/browser_runtime/browser_runtime_27a156f1.js.map +1089 -0
- package/dist/build_manifest.js +6 -6
- package/dist/compile_proxy/asset-manifest.json +1 -1
- package/dist/compile_proxy/{compile_proxy_ab528227.html → compile_proxy_f2f16cc6.html} +3 -2
- package/dist/event_source_client/asset-manifest.json +2 -2
- package/dist/event_source_client/event_source_client_69f48287.js +354 -0
- package/dist/event_source_client/{event_source_client_80644aee.js.map → event_source_client_69f48287.js.map} +2 -2
- package/dist/redirector/asset-manifest.json +1 -1
- package/dist/redirector/{redirector_6df2620a.html → redirector_eef2bb25.html} +3 -2
- package/dist/toolbar/asset-manifest.json +5 -5
- package/dist/toolbar/assets/{compilation.css_e37c747b.map → compilation.css_7421bd55.map} +3 -3
- package/dist/toolbar/assets/settings.css_942b5a9e.map +12 -0
- package/dist/toolbar/assets/{toolbar.main.css_269d7ce2.map → toolbar.main.css_b7d8bec1.map} +4 -4
- package/dist/toolbar/{toolbar.main_279b3a68.js.map → toolbar.main_2c56a4e0.js.map} +24 -12
- package/dist/toolbar/{toolbar_0a91ca3b.html → toolbar_7447de59.html} +100 -65
- package/dist/toolbar_injector/asset-manifest.json +2 -2
- package/dist/toolbar_injector/toolbar_injector_524c2404.js +974 -0
- package/dist/toolbar_injector/{toolbar_injector_34f6ad8e.js.map → toolbar_injector_524c2404.js.map} +3 -3
- package/package.json +6 -3
- package/readme.md +20 -17
- package/src/buildProject.js +12 -20
- package/src/executeTestPlan.js +20 -19
- package/src/internal/building/buildUsingRollup.js +5 -20
- package/src/internal/building/build_logs.js +33 -37
- package/src/internal/building/build_stats.js +2 -1
- package/src/internal/building/es_to_system.js +34 -0
- package/src/internal/building/import_references.js +0 -1
- package/src/internal/building/rollup_plugin_jsenv.js +146 -43
- package/src/internal/compiling/createCompiledFileService.js +0 -4
- package/src/internal/compiling/jsenvCompilerForJavaScript.js +2 -3
- package/src/internal/compiling/jsenv_directory/compile_context.js +1 -10
- package/src/internal/compiling/jsenv_directory/compile_profile.js +1 -2
- package/src/internal/compiling/jsenv_directory/jsenv_directory.js +1 -1
- package/src/internal/compiling/startCompileServer.js +0 -14
- package/src/internal/dev_server/toolbar/compilation/compilation.css +3 -2
- package/src/internal/dev_server/toolbar/compilation/toolbar.compilation.js +19 -19
- package/src/internal/dev_server/toolbar/notification/toolbar.notification.js +66 -37
- package/src/internal/dev_server/toolbar/settings/settings.css +1 -2
- package/src/internal/dev_server/toolbar/toolbar.html +9 -5
- package/src/internal/dev_server/toolbar/toolbar.main.js +5 -3
- package/src/internal/dev_server/toolbar/util/iframe_to_parent_href.js +10 -0
- package/src/internal/executing/coverage/reportToCoverage.js +1 -0
- package/src/internal/executing/coverage_utils/v8_coverage_from_directory.js +2 -1
- package/src/internal/executing/executePlan.js +450 -60
- package/src/internal/runtime/s.js +3 -2
- package/src/internal/runtime_support/runtime_support.js +1 -1
- package/dist/browser_runtime/browser_runtime_0e3396a1.js +0 -5298
- package/dist/browser_runtime/browser_runtime_0e3396a1.js.map +0 -1089
- package/dist/event_source_client/event_source_client_80644aee.js +0 -356
- package/dist/toolbar/assets/settings.css_61548139.map +0 -12
- package/dist/toolbar_injector/toolbar_injector_34f6ad8e.js +0 -976
- package/src/internal/executing/executeConcurrently.js +0 -440
|
@@ -6,51 +6,80 @@ const notificationPreference = createPreference("notification")
|
|
|
6
6
|
|
|
7
7
|
const arrayOfOpenedNotifications = []
|
|
8
8
|
export const renderToolbarNotification = () => {
|
|
9
|
-
const notifCheckbox = document.querySelector("#toggle-notifs")
|
|
10
9
|
if (!notificationAvailable) {
|
|
11
|
-
|
|
12
|
-
notifSetting.setAttribute("data-disabled", "true")
|
|
13
|
-
notifSetting.setAttribute(
|
|
14
|
-
"title",
|
|
15
|
-
`Notification not available in the browser`,
|
|
16
|
-
)
|
|
17
|
-
notifCheckbox.disabled = true
|
|
10
|
+
applyNotificationNotAvailableEffects()
|
|
18
11
|
return
|
|
19
12
|
}
|
|
13
|
+
updatePermission()
|
|
14
|
+
}
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
const updatePermission = () => {
|
|
17
|
+
const notifPermission = Notification.permission
|
|
18
|
+
if (notifPermission === "default") {
|
|
19
|
+
applyNotificationDefaultEffects()
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
if (notifPermission === "denied") {
|
|
23
|
+
applyNotificationDeniedEffects()
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
if (notifPermission === "granted") {
|
|
27
|
+
applyNotificationGrantedEffects()
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
}
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
const notifCheckbox = document.querySelector("#toggle-notifs")
|
|
33
|
+
|
|
34
|
+
const applyNotificationNotAvailableEffects = () => {
|
|
35
|
+
const notifSetting = document.querySelector(".settings-notification")
|
|
36
|
+
notifSetting.setAttribute("data-disabled", "true")
|
|
37
|
+
notifSetting.setAttribute(
|
|
38
|
+
"title",
|
|
39
|
+
`Notification not available in the browser`,
|
|
40
|
+
)
|
|
41
|
+
notifCheckbox.disabled = true
|
|
42
|
+
}
|
|
43
|
+
const applyNotificationDefaultEffects = () => {
|
|
44
|
+
applyNotificationNOTGrantedEffects()
|
|
45
|
+
const notifSetting = document.querySelector(".settings-notification")
|
|
46
|
+
notifSetting.removeAttribute("data-disabled")
|
|
47
|
+
notifSetting.removeAttribute("title")
|
|
48
|
+
}
|
|
49
|
+
const applyNotificationDeniedEffects = () => {
|
|
50
|
+
applyNotificationNOTGrantedEffects()
|
|
51
|
+
const notifSetting = document.querySelector(".settings-notification")
|
|
52
|
+
notifSetting.setAttribute("data-disabled", "true")
|
|
53
|
+
notifSetting.setAttribute("title", `Notification denied`)
|
|
54
|
+
}
|
|
55
|
+
const applyNotificationGrantedEffects = () => {
|
|
56
|
+
enableVariant(document.querySelector(".notification-text"), {
|
|
57
|
+
notif_granted: "yes",
|
|
58
|
+
})
|
|
59
|
+
notifCheckbox.disabled = false
|
|
60
|
+
notifCheckbox.checked = getNotificationPreference()
|
|
61
|
+
notifCheckbox.onchange = () => {
|
|
62
|
+
setNotificationPreference(notifCheckbox.checked)
|
|
63
|
+
if (!notifCheckbox.checked) {
|
|
64
|
+
// slice because arrayOfOpenedNotifications can be mutated while looping
|
|
65
|
+
arrayOfOpenedNotifications.slice().forEach((notification) => {
|
|
66
|
+
notification.close()
|
|
67
|
+
})
|
|
39
68
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const applyNotificationNOTGrantedEffects = () => {
|
|
72
|
+
enableVariant(document.querySelector(".notification-text"), {
|
|
73
|
+
notif_granted: "no",
|
|
74
|
+
})
|
|
75
|
+
notifCheckbox.disabled = true
|
|
76
|
+
notifCheckbox.checked = false
|
|
77
|
+
document.querySelector("a.request_notification_permission").onclick = () => {
|
|
78
|
+
requestPermission().then(() => {
|
|
79
|
+
setNotificationPreference(true)
|
|
80
|
+
updatePermission()
|
|
43
81
|
})
|
|
44
|
-
if (notifPermission === "default") {
|
|
45
|
-
document.querySelector("a.request_notification_permission").onclick =
|
|
46
|
-
() => {
|
|
47
|
-
requestPermission().then(() => {
|
|
48
|
-
updatePermission()
|
|
49
|
-
})
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
82
|
}
|
|
53
|
-
updatePermission()
|
|
54
83
|
}
|
|
55
84
|
|
|
56
85
|
export const notifyExecutionResult = (
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
Send system notification when execution fails or is fixed.
|
|
282
282
|
<div class="notification-text">
|
|
283
283
|
<a
|
|
284
|
-
data-when="
|
|
284
|
+
data-when="notif_granted:no"
|
|
285
285
|
class="request_notification_permission"
|
|
286
286
|
href="javascript:void(0);"
|
|
287
287
|
>Enable notification</a
|
|
@@ -475,13 +475,17 @@
|
|
|
475
475
|
<div data-when="has_warning:yes">
|
|
476
476
|
<svg
|
|
477
477
|
xmlns="http://www.w3.org/2000/svg"
|
|
478
|
-
viewBox="0 0
|
|
479
|
-
width="
|
|
480
|
-
height="
|
|
478
|
+
viewBox="0 0 45.818 45.818"
|
|
479
|
+
width="20px"
|
|
480
|
+
height="20px"
|
|
481
481
|
class="iconToolbar"
|
|
482
|
+
style="transform: rotate(180deg)"
|
|
482
483
|
>
|
|
483
484
|
<path
|
|
484
|
-
d="
|
|
485
|
+
d="M22.909,0C10.258,0,0,10.257,0,22.908c0,12.652,10.258,22.91,22.909,22.91s22.909-10.258,22.909-22.91
|
|
486
|
+
C45.818,10.257,35.561,0,22.909,0z M26.411,35.417c0,1.921-1.573,3.478-3.492,3.478c-1.92,0-3.492-1.557-3.492-3.478V20.201
|
|
487
|
+
c0-1.92,1.572-3.477,3.492-3.477c1.919,0,3.492,1.556,3.492,3.477V35.417z M22.909,13.851c-2.119,0-3.837-1.718-3.837-3.836
|
|
488
|
+
c0-2.12,1.718-3.836,3.837-3.836c2.118,0,3.837,1.716,3.837,3.836C26.746,12.133,25.027,13.851,22.909,13.851z"
|
|
485
489
|
/>
|
|
486
490
|
</svg>
|
|
487
491
|
</div>
|
|
@@ -3,6 +3,7 @@ import { urlToRelativeUrl } from "@jsenv/filesystem/src/urlToRelativeUrl.js"
|
|
|
3
3
|
|
|
4
4
|
import { startJavaScriptAnimation } from "../toolbar/util/animation.js"
|
|
5
5
|
import "./focus/toolbar.focus.js"
|
|
6
|
+
import { setLinkHrefForParentWindow } from "./util/iframe_to_parent_href.js"
|
|
6
7
|
import {
|
|
7
8
|
getToolbarIframe,
|
|
8
9
|
deactivateToolbarSection,
|
|
@@ -52,9 +53,10 @@ const renderToolbar = async ({ exploringJSON }) => {
|
|
|
52
53
|
hideToolbar({ animate: false })
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
setLinkHrefForParentWindow(
|
|
57
|
+
document.querySelector(".toolbar-icon-wrapper"),
|
|
58
|
+
"/",
|
|
59
|
+
)
|
|
58
60
|
|
|
59
61
|
renderToolbarNotification()
|
|
60
62
|
makeToolbarResponsive()
|
|
@@ -8,6 +8,7 @@ import { createDetailedMessage } from "@jsenv/logger"
|
|
|
8
8
|
import { Abort } from "@jsenv/abort"
|
|
9
9
|
|
|
10
10
|
export const visitNodeV8Directory = async ({
|
|
11
|
+
logger,
|
|
11
12
|
signal,
|
|
12
13
|
NODE_V8_COVERAGE,
|
|
13
14
|
onV8Coverage,
|
|
@@ -20,7 +21,7 @@ export const visitNodeV8Directory = async ({
|
|
|
20
21
|
if (dirContent.length > 0) {
|
|
21
22
|
return dirContent
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
+
logger.warn(`v8 coverage directory is empty at ${NODE_V8_COVERAGE}`)
|
|
24
25
|
return dirContent
|
|
25
26
|
}
|
|
26
27
|
|