@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.
Files changed (54) hide show
  1. package/dist/browser_runtime/asset-manifest.json +2 -2
  2. package/dist/browser_runtime/browser_runtime_27a156f1.js +5297 -0
  3. package/dist/browser_runtime/browser_runtime_27a156f1.js.map +1089 -0
  4. package/dist/build_manifest.js +6 -6
  5. package/dist/compile_proxy/asset-manifest.json +1 -1
  6. package/dist/compile_proxy/{compile_proxy_ab528227.html → compile_proxy_f2f16cc6.html} +3 -2
  7. package/dist/event_source_client/asset-manifest.json +2 -2
  8. package/dist/event_source_client/event_source_client_69f48287.js +354 -0
  9. package/dist/event_source_client/{event_source_client_80644aee.js.map → event_source_client_69f48287.js.map} +2 -2
  10. package/dist/redirector/asset-manifest.json +1 -1
  11. package/dist/redirector/{redirector_6df2620a.html → redirector_eef2bb25.html} +3 -2
  12. package/dist/toolbar/asset-manifest.json +5 -5
  13. package/dist/toolbar/assets/{compilation.css_e37c747b.map → compilation.css_7421bd55.map} +3 -3
  14. package/dist/toolbar/assets/settings.css_942b5a9e.map +12 -0
  15. package/dist/toolbar/assets/{toolbar.main.css_269d7ce2.map → toolbar.main.css_b7d8bec1.map} +4 -4
  16. package/dist/toolbar/{toolbar.main_279b3a68.js.map → toolbar.main_2c56a4e0.js.map} +24 -12
  17. package/dist/toolbar/{toolbar_0a91ca3b.html → toolbar_7447de59.html} +100 -65
  18. package/dist/toolbar_injector/asset-manifest.json +2 -2
  19. package/dist/toolbar_injector/toolbar_injector_524c2404.js +974 -0
  20. package/dist/toolbar_injector/{toolbar_injector_34f6ad8e.js.map → toolbar_injector_524c2404.js.map} +3 -3
  21. package/package.json +6 -3
  22. package/readme.md +20 -17
  23. package/src/buildProject.js +12 -20
  24. package/src/executeTestPlan.js +20 -19
  25. package/src/internal/building/buildUsingRollup.js +5 -20
  26. package/src/internal/building/build_logs.js +33 -37
  27. package/src/internal/building/build_stats.js +2 -1
  28. package/src/internal/building/es_to_system.js +34 -0
  29. package/src/internal/building/import_references.js +0 -1
  30. package/src/internal/building/rollup_plugin_jsenv.js +146 -43
  31. package/src/internal/compiling/createCompiledFileService.js +0 -4
  32. package/src/internal/compiling/jsenvCompilerForJavaScript.js +2 -3
  33. package/src/internal/compiling/jsenv_directory/compile_context.js +1 -10
  34. package/src/internal/compiling/jsenv_directory/compile_profile.js +1 -2
  35. package/src/internal/compiling/jsenv_directory/jsenv_directory.js +1 -1
  36. package/src/internal/compiling/startCompileServer.js +0 -14
  37. package/src/internal/dev_server/toolbar/compilation/compilation.css +3 -2
  38. package/src/internal/dev_server/toolbar/compilation/toolbar.compilation.js +19 -19
  39. package/src/internal/dev_server/toolbar/notification/toolbar.notification.js +66 -37
  40. package/src/internal/dev_server/toolbar/settings/settings.css +1 -2
  41. package/src/internal/dev_server/toolbar/toolbar.html +9 -5
  42. package/src/internal/dev_server/toolbar/toolbar.main.js +5 -3
  43. package/src/internal/dev_server/toolbar/util/iframe_to_parent_href.js +10 -0
  44. package/src/internal/executing/coverage/reportToCoverage.js +1 -0
  45. package/src/internal/executing/coverage_utils/v8_coverage_from_directory.js +2 -1
  46. package/src/internal/executing/executePlan.js +450 -60
  47. package/src/internal/runtime/s.js +3 -2
  48. package/src/internal/runtime_support/runtime_support.js +1 -1
  49. package/dist/browser_runtime/browser_runtime_0e3396a1.js +0 -5298
  50. package/dist/browser_runtime/browser_runtime_0e3396a1.js.map +0 -1089
  51. package/dist/event_source_client/event_source_client_80644aee.js +0 -356
  52. package/dist/toolbar/assets/settings.css_61548139.map +0 -12
  53. package/dist/toolbar_injector/toolbar_injector_34f6ad8e.js +0 -976
  54. 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
- const notifSetting = document.querySelector(".settings-notification")
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
- const updatePermission = () => {
22
- if (Notification.permission === "denied") {
23
- const notifSetting = document.querySelector(".settings-notification")
24
- notifSetting.setAttribute("data-disabled", "true")
25
- notifSetting.setAttribute("title", `Notification denied`)
26
- notifCheckbox.disabled = true
27
- return
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
- notifCheckbox.checked = getNotificationPreference()
31
- notifCheckbox.onchange = () => {
32
- setNotificationPreference(notifCheckbox.checked)
33
- if (!notifCheckbox.checked) {
34
- // slice because arrayOfOpenedNotifications can be mutated while looping
35
- arrayOfOpenedNotifications.slice().forEach((notification) => {
36
- notification.close()
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
- const notifPermission = Notification.permission
41
- enableVariant(document.querySelector(".notification-text"), {
42
- notif_permission: notifPermission === "granted" ? "yes" : "no",
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 = (
@@ -3,8 +3,7 @@
3
3
  }
4
4
 
5
5
  #settings-button[data-warning] svg {
6
- fill: orange;
7
- stroke: darkorange;
6
+ fill: #cb5909;
8
7
  }
9
8
 
10
9
  #settings-button[data-warning] svg:hover {
@@ -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="notif_permission:no"
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 511.999 511.999"
479
- width="24px"
480
- height="24px"
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="M506.43 421.536 291.573 49.394c-15.814-27.391-55.327-27.401-71.147 0L5.568 421.536c-15.814 27.391 3.934 61.616 35.574 61.616h429.714c31.629.001 51.394-34.214 35.574-61.616zm-231.609-36.502c0 10.394-8.427 18.821-18.821 18.821s-18.821-8.427-18.821-18.821v-11.239c0-10.394 8.427-18.821 18.821-18.821s18.821 8.427 18.821 18.821v11.239zm0-73.332c0 10.394-8.427 18.821-18.821 18.821s-18.821-8.427-18.821-18.821v-107.89c0-10.394 8.427-18.821 18.821-18.821s18.821 8.427 18.821 18.821v107.89z"
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
- document.querySelector(".toolbar-icon-wrapper").onclick = () => {
56
- window.parent.location.href = "/"
57
- }
56
+ setLinkHrefForParentWindow(
57
+ document.querySelector(".toolbar-icon-wrapper"),
58
+ "/",
59
+ )
58
60
 
59
61
  renderToolbarNotification()
60
62
  makeToolbarResponsive()
@@ -0,0 +1,10 @@
1
+ export const setLinkHrefForParentWindow = (a, href) => {
2
+ a.href = href
3
+ a.onclick = (e) => {
4
+ if (e.ctrlKey || e.metaKey) {
5
+ return
6
+ }
7
+ e.preventDefault()
8
+ window.parent.location.href = href
9
+ }
10
+ }
@@ -62,6 +62,7 @@ export const reportToCoverage = async (
62
62
 
63
63
  if (!coverageForceIstanbul && process.env.NODE_V8_COVERAGE) {
64
64
  await visitNodeV8Directory({
65
+ logger,
65
66
  signal,
66
67
  NODE_V8_COVERAGE: process.env.NODE_V8_COVERAGE,
67
68
  onV8Coverage: (nodeV8Coverage) => {
@@ -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
- console.warn(`v8 coverage directory is empty at ${NODE_V8_COVERAGE}`)
24
+ logger.warn(`v8 coverage directory is empty at ${NODE_V8_COVERAGE}`)
24
25
  return dirContent
25
26
  }
26
27