@jsenv/core 24.5.8 → 24.6.4

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 (39) hide show
  1. package/dist/browser_runtime/asset-manifest.json +1 -1
  2. package/dist/browser_runtime/{browser_runtime-c7288751.js → browser_runtime-bb0e3aa4.js} +37 -27
  3. package/dist/browser_runtime/{browser_runtime-c7288751.js.map → browser_runtime-bb0e3aa4.js.map} +3 -3
  4. package/dist/build_manifest.js +5 -5
  5. package/dist/compile_proxy/asset-manifest.json +1 -1
  6. package/dist/compile_proxy/{compile_proxy-a3969633.html → compile_proxy-6eb67db4.html} +39 -34
  7. package/dist/compile_proxy/{compile_proxy.html__inline__20-9c92c170.js.map → compile_proxy.html__inline__20-9e168143.js.map} +3 -2
  8. package/dist/redirector/asset-manifest.json +1 -1
  9. package/dist/redirector/{redirector-a6b8d640.html → redirector-b6ad84bf.html} +39 -34
  10. package/dist/redirector/{redirector.html__inline__15-58430672.js.map → redirector.html__inline__15-3a34a156.js.map} +3 -2
  11. package/dist/toolbar/asset-manifest.json +1 -1
  12. package/dist/toolbar/{toolbar-84985f43.html → toolbar-1fbf8dcb.html} +86 -61
  13. package/dist/toolbar/{toolbar.main-7aa01366.js.map → toolbar.main-a5ef2c60.js.map} +3 -2
  14. package/dist/toolbar_injector/asset-manifest.json +1 -1
  15. package/dist/toolbar_injector/{toolbar_injector-8edcae04.js → toolbar_injector-997dbaa0.js} +16 -16
  16. package/dist/toolbar_injector/{toolbar_injector-8edcae04.js.map → toolbar_injector-997dbaa0.js.map} +4 -4
  17. package/package.json +34 -33
  18. package/readme.md +23 -35
  19. package/src/buildProject.js +4 -7
  20. package/src/dev_server.js +6 -2
  21. package/src/executeTestPlan.js +12 -6
  22. package/src/internal/browser_launcher/executeHtmlFile.js +2 -1
  23. package/src/internal/browser_launcher/from_playwright.js +4 -0
  24. package/src/internal/building/buildUsingRollup.js +15 -11
  25. package/src/internal/building/rollup_plugin_jsenv.js +65 -53
  26. package/src/internal/building/url_loader.js +3 -0
  27. package/src/internal/compiling/createCompiledFileService.js +7 -7
  28. package/src/internal/compiling/js-compilation-service/jsenvTransform.js +12 -55
  29. package/src/internal/compiling/js-compilation-service/transformJs.js +8 -5
  30. package/src/internal/compiling/jsenvCompilerForHtml.js +4 -4
  31. package/src/internal/compiling/jsenvCompilerForJavaScript.js +2 -2
  32. package/src/internal/compiling/startCompileServer.js +2 -2
  33. package/src/internal/executing/createSummaryLog.js +30 -4
  34. package/src/internal/executing/executeConcurrently.js +22 -8
  35. package/src/internal/executing/executePlan.js +12 -6
  36. package/src/internal/executing/executionLogs.js +14 -4
  37. package/src/internal/executing/gc.js +9 -0
  38. package/src/internal/logs/byte.js +10 -0
  39. package/src/internal/compiling/js-compilation-service/findAsyncPluginNameInBabelPluginMap.js +0 -9
@@ -24,13 +24,16 @@ export const executePlan = async (
24
24
  importResolutionMethod,
25
25
  importDefaultExtension,
26
26
 
27
+ logSummary,
28
+ logMemoryHeapUsage,
29
+ completedExecutionLogMerging,
30
+ completedExecutionLogAbbreviation,
31
+
27
32
  defaultMsAllocatedPerExecution,
28
33
  maxExecutionsInParallel,
34
+ gcBetweenExecutions,
29
35
  stopAfterExecute,
30
36
  cooldownBetweenExecutions,
31
- completedExecutionLogMerging,
32
- completedExecutionLogAbbreviation,
33
- logSummary,
34
37
 
35
38
  coverage,
36
39
  coverageConfig,
@@ -169,13 +172,16 @@ export const executePlan = async (
169
172
 
170
173
  babelPluginMap: compileServer.babelPluginMap,
171
174
 
175
+ logSummary,
176
+ logMemoryHeapUsage,
177
+ completedExecutionLogMerging,
178
+ completedExecutionLogAbbreviation,
179
+
172
180
  defaultMsAllocatedPerExecution,
173
181
  maxExecutionsInParallel,
174
182
  stopAfterExecute,
183
+ gcBetweenExecutions,
175
184
  cooldownBetweenExecutions,
176
- completedExecutionLogMerging,
177
- completedExecutionLogAbbreviation,
178
- logSummary,
179
185
 
180
186
  coverage,
181
187
  coverageConfig,
@@ -2,11 +2,18 @@ import { ANSI, UNICODE } from "@jsenv/log"
2
2
 
3
3
  import { msAsDuration } from "../logs/msAsDuration.js"
4
4
  import { EXECUTION_COLORS } from "./execution_colors.js"
5
- import { createSummaryDetails } from "./createSummaryLog.js"
5
+ import { createIntermediateSummary } from "./createSummaryLog.js"
6
6
 
7
7
  export const formatExecuting = (
8
8
  { executionIndex },
9
- { executionCount, abortedCount, timedoutCount, erroredCount, completedCount },
9
+ {
10
+ executionCount,
11
+ abortedCount,
12
+ timedoutCount,
13
+ erroredCount,
14
+ completedCount,
15
+ memoryHeap,
16
+ },
10
17
  ) => {
11
18
  const executionNumber = executionIndex + 1
12
19
  const description = ANSI.color(
@@ -16,12 +23,13 @@ export const formatExecuting = (
16
23
  const summary =
17
24
  executionIndex === 0
18
25
  ? ""
19
- : `(${createSummaryDetails({
26
+ : `(${createIntermediateSummary({
20
27
  executionCount: executionIndex,
21
28
  abortedCount,
22
29
  timedoutCount,
23
30
  erroredCount,
24
31
  completedCount,
32
+ memoryHeap,
25
33
  })})`
26
34
 
27
35
  return formatExecution({
@@ -45,6 +53,7 @@ export const formatExecutionResult = (
45
53
  timedoutCount,
46
54
  erroredCount,
47
55
  completedCount,
56
+ memoryHeap,
48
57
  },
49
58
  ) => {
50
59
  const executionNumber = executionIndex + 1
@@ -57,12 +66,13 @@ export const formatExecutionResult = (
57
66
  allocatedMs,
58
67
  })
59
68
 
60
- const summary = `(${createSummaryDetails({
69
+ const summary = `(${createIntermediateSummary({
61
70
  executionCount: executionNumber,
62
71
  abortedCount,
63
72
  timedoutCount,
64
73
  erroredCount,
65
74
  completedCount,
75
+ memoryHeap,
66
76
  })})`
67
77
 
68
78
  if (completedExecutionLogAbbreviation && status === "completed") {
@@ -0,0 +1,9 @@
1
+ import v8 from "node:v8"
2
+ import { runInNewContext } from "node:vm"
3
+
4
+ export const ensureGlobalGc = () => {
5
+ if (!global.gc) {
6
+ v8.setFlagsFromString("--expose_gc")
7
+ global.gc = runInNewContext("gc")
8
+ }
9
+ }
@@ -0,0 +1,10 @@
1
+ import { createRequire } from "module"
2
+
3
+ const require = createRequire(import.meta.url)
4
+
5
+ // https://github.com/visionmedia/bytes.js/
6
+ const bytes = require("bytes")
7
+
8
+ export const formatByte = (metricValue) => {
9
+ return bytes(metricValue, { decimalPlaces: 2, unitSeparator: " " })
10
+ }
@@ -1,9 +0,0 @@
1
- export const findAsyncPluginNameInBabelPluginMap = (babelPluginMap) => {
2
- if ("transform-async-to-promises" in babelPluginMap) {
3
- return "transform-async-to-promises"
4
- }
5
- if ("transform-async-to-generator" in babelPluginMap) {
6
- return "transform-async-to-generator"
7
- }
8
- return ""
9
- }