@jsenv/core 23.8.2 → 23.8.7

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 (133) hide show
  1. package/dist/jsenv_browser_system.js +46 -39
  2. package/dist/jsenv_browser_system.js.map +14 -14
  3. package/dist/jsenv_compile_proxy.js.map +6 -6
  4. package/dist/jsenv_exploring_index.js.map +5 -5
  5. package/dist/jsenv_exploring_redirector.js.map +12 -12
  6. package/dist/jsenv_toolbar.js.map +7 -7
  7. package/dist/jsenv_toolbar_injector.js.map +5 -5
  8. package/helpers/babel/.eslintrc.cjs +24 -24
  9. package/helpers/babel/AsyncGenerator/AsyncGenerator.js +81 -81
  10. package/helpers/babel/AwaitValue/AwaitValue.js +3 -3
  11. package/helpers/babel/applyDecoratorDescriptor/applyDecoratorDescriptor.js +33 -33
  12. package/helpers/babel/arrayLikeToArray/arrayLikeToArray.js +7 -7
  13. package/helpers/babel/arrayWithHoles/arrayWithHoles.js +4 -4
  14. package/helpers/babel/arrayWithoutHoles/arrayWithoutHoles.js +6 -6
  15. package/helpers/babel/assertThisInitialized/assertThisInitialized.js +7 -7
  16. package/helpers/babel/asyncGeneratorDelegate/asyncGeneratorDelegate.js +40 -40
  17. package/helpers/babel/asyncIterator/asyncIterator.js +12 -12
  18. package/helpers/babel/asyncToGenerator/asyncToGenerator.js +34 -34
  19. package/helpers/babel/awaitAsyncGenerator/awaitAsyncGenerator.js +5 -5
  20. package/helpers/babel/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +20 -20
  21. package/helpers/babel/classApplyDescriptorGet/classApplyDescriptorGet.js +6 -6
  22. package/helpers/babel/classApplyDescriptorSet/classApplyDescriptorSet.js +13 -13
  23. package/helpers/babel/classCallCheck/classCallCheck.js +5 -5
  24. package/helpers/babel/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +5 -5
  25. package/helpers/babel/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +6 -6
  26. package/helpers/babel/classExtractFieldDescriptor/classExtractFieldDescriptor.js +7 -7
  27. package/helpers/babel/classNameTDZError/classNameTDZError.js +4 -4
  28. package/helpers/babel/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +7 -7
  29. package/helpers/babel/classPrivateFieldGet/classPrivateFieldGet.js +7 -7
  30. package/helpers/babel/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +6 -6
  31. package/helpers/babel/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +5 -5
  32. package/helpers/babel/classPrivateFieldSet/classPrivateFieldSet.js +8 -8
  33. package/helpers/babel/classPrivateMethodGet/classPrivateMethodGet.js +6 -6
  34. package/helpers/babel/classPrivateMethodSet/classPrivateMethodSet.js +3 -3
  35. package/helpers/babel/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +9 -9
  36. package/helpers/babel/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +15 -15
  37. package/helpers/babel/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +6 -6
  38. package/helpers/babel/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +3 -3
  39. package/helpers/babel/construct/construct.js +16 -16
  40. package/helpers/babel/createClass/createClass.js +15 -15
  41. package/helpers/babel/createForOfIteratorHelper/createForOfIteratorHelper.js +60 -60
  42. package/helpers/babel/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +23 -23
  43. package/helpers/babel/createRawReactElement/createRawReactElement.js +50 -50
  44. package/helpers/babel/createSuper/createSuper.js +22 -22
  45. package/helpers/babel/decorate/decorate.js +403 -403
  46. package/helpers/babel/defaults/defaults.js +11 -11
  47. package/helpers/babel/defineEnumerableProperties/defineEnumerableProperties.js +23 -23
  48. package/helpers/babel/defineProperty/defineProperty.js +18 -18
  49. package/helpers/babel/extends/extends.js +14 -14
  50. package/helpers/babel/get/get.js +13 -13
  51. package/helpers/babel/getPrototypeOf/getPrototypeOf.js +4 -4
  52. package/helpers/babel/inherits/inherits.js +15 -15
  53. package/helpers/babel/inheritsLoose/inheritsLoose.js +7 -7
  54. package/helpers/babel/initializerDefineProperty/initializerDefineProperty.js +10 -10
  55. package/helpers/babel/initializerWarningHelper/initializerWarningHelper.js +6 -6
  56. package/helpers/babel/instanceof/instanceof.js +6 -6
  57. package/helpers/babel/interopRequireDefault/interopRequireDefault.js +3 -3
  58. package/helpers/babel/interopRequireWildcard/interopRequireWildcard.js +37 -37
  59. package/helpers/babel/isNativeFunction/isNativeFunction.js +4 -4
  60. package/helpers/babel/isNativeReflectConstruct/isNativeReflectConstruct.js +21 -21
  61. package/helpers/babel/iterableToArray/iterableToArray.js +7 -7
  62. package/helpers/babel/iterableToArrayLimit/iterableToArrayLimit.js +36 -36
  63. package/helpers/babel/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +10 -10
  64. package/helpers/babel/jsx/jsx.js +45 -45
  65. package/helpers/babel/maybeArrayLike/maybeArrayLike.js +10 -10
  66. package/helpers/babel/newArrowCheck/newArrowCheck.js +5 -5
  67. package/helpers/babel/nonIterableRest/nonIterableRest.js +5 -5
  68. package/helpers/babel/nonIterableSpread/nonIterableSpread.js +5 -5
  69. package/helpers/babel/objectDestructuringEmpty/objectDestructuringEmpty.js +3 -3
  70. package/helpers/babel/objectSpread/objectSpread.js +23 -23
  71. package/helpers/babel/objectSpread2/objectSpread2.js +33 -33
  72. package/helpers/babel/objectWithoutProperties/objectWithoutProperties.js +19 -19
  73. package/helpers/babel/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +13 -13
  74. package/helpers/babel/possibleConstructorReturn/possibleConstructorReturn.js +10 -10
  75. package/helpers/babel/readOnlyError/readOnlyError.js +4 -4
  76. package/helpers/babel/readme.md +9 -9
  77. package/helpers/babel/set/set.js +44 -44
  78. package/helpers/babel/setPrototypeOf/setPrototypeOf.js +6 -6
  79. package/helpers/babel/skipFirstGeneratorNext/skipFirstGeneratorNext.js +8 -8
  80. package/helpers/babel/slicedToArray/slicedToArray.js +10 -10
  81. package/helpers/babel/slicedToArrayLoose/slicedToArrayLoose.js +13 -13
  82. package/helpers/babel/superPropBase/superPropBase.js +10 -10
  83. package/helpers/babel/taggedTemplateLiteral/taggedTemplateLiteral.js +10 -10
  84. package/helpers/babel/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +7 -7
  85. package/helpers/babel/tdz/tdz.js +4 -4
  86. package/helpers/babel/temporalRef/temporalRef.js +6 -6
  87. package/helpers/babel/temporalUndefined/temporalUndefined.js +3 -3
  88. package/helpers/babel/toArray/toArray.js +10 -10
  89. package/helpers/babel/toConsumableArray/toConsumableArray.js +10 -10
  90. package/helpers/babel/toPrimitive/toPrimitive.js +10 -10
  91. package/helpers/babel/toPropertyKey/toPropertyKey.js +6 -6
  92. package/helpers/babel/typeof/typeof.js +14 -14
  93. package/helpers/babel/unsupportedIterableToArray/unsupportedIterableToArray.js +12 -12
  94. package/helpers/babel/wrapAsyncGenerator/wrapAsyncGenerator.js +8 -8
  95. package/helpers/babel/wrapNativeSuper/wrapNativeSuper.js +30 -30
  96. package/helpers/babel/wrapRegExp/wrapRegExp.js +63 -63
  97. package/helpers/babel/writeOnlyError/writeOnlyError.js +4 -4
  98. package/helpers/regenerator-runtime/regenerator-runtime.js +748 -748
  99. package/{LICENSE → license} +21 -21
  100. package/package.json +2 -2
  101. package/src/buildProject.js +300 -300
  102. package/src/execute.js +184 -184
  103. package/src/internal/browser-launcher/jsenv-browser-system.js +203 -199
  104. package/src/internal/building/buildUsingRollup.js +2 -10
  105. package/src/internal/compiling/babel_plugin_import_assertions.js +121 -121
  106. package/src/internal/compiling/babel_plugin_import_metadata.js +22 -22
  107. package/src/internal/compiling/babel_plugin_import_visitor.js +84 -84
  108. package/src/internal/compiling/compile-directory/getOrGenerateCompiledFile.js +268 -268
  109. package/src/internal/compiling/compile-directory/updateMeta.js +154 -154
  110. package/src/internal/compiling/compile-directory/validateCache.js +265 -265
  111. package/src/internal/compiling/compileFile.js +233 -224
  112. package/src/internal/compiling/compileHtml.js +550 -550
  113. package/src/internal/compiling/createCompiledFileService.js +291 -291
  114. package/src/internal/compiling/html_source_file_service.js +403 -404
  115. package/src/internal/compiling/js-compilation-service/jsenvTransform.js +272 -270
  116. package/src/internal/compiling/jsenvCompilerForHtml.js +374 -308
  117. package/src/internal/compiling/jsenvCompilerForJavaScript.js +2 -0
  118. package/src/internal/compiling/startCompileServer.js +1086 -1048
  119. package/src/internal/compiling/transformResultToCompilationResult.js +220 -220
  120. package/src/internal/executing/coverage/babel_plugin_instrument.js +90 -90
  121. package/src/internal/executing/coverage/reportToCoverage.js +193 -187
  122. package/src/internal/executing/executePlan.js +183 -183
  123. package/src/internal/executing/launchAndExecute.js +458 -458
  124. package/src/internal/generateGroupMap/featuresCompatMap.js +29 -0
  125. package/src/internal/generateGroupMap/jsenvBabelPluginCompatMap.js +1 -8
  126. package/src/internal/runtime/createBrowserRuntime/scanBrowserRuntimeFeatures.js +246 -246
  127. package/src/internal/runtime/createNodeRuntime/scanNodeRuntimeFeatures.js +112 -112
  128. package/src/internal/runtime/s.js +727 -727
  129. package/src/internal/toolbar/jsenv-logo.svg +144 -144
  130. package/src/internal/toolbar/toolbar.main.css +196 -196
  131. package/src/internal/toolbar/toolbar.main.js +227 -227
  132. package/src/internal/url_conversion.js +317 -317
  133. package/src/startExploring.js +309 -309
@@ -1,183 +1,183 @@
1
- import { Abort, raceProcessTeardownEvents } from "@jsenv/abort"
2
- import { createDetailedMessage } from "@jsenv/logger"
3
-
4
- import { mergeRuntimeSupport } from "@jsenv/core/src/internal/generateGroupMap/runtime_support.js"
5
- import { startCompileServer } from "../compiling/startCompileServer.js"
6
- import { babelPluginInstrument } from "./coverage/babel_plugin_instrument.js"
7
- import { generateExecutionSteps } from "./generateExecutionSteps.js"
8
- import { executeConcurrently } from "./executeConcurrently.js"
9
-
10
- export const executePlan = async (
11
- plan,
12
- {
13
- signal,
14
- handleSIGINT,
15
-
16
- logger,
17
- compileServerLogLevel,
18
- launchAndExecuteLogLevel,
19
-
20
- projectDirectoryUrl,
21
- jsenvDirectoryRelativeUrl,
22
- jsenvDirectoryClean,
23
-
24
- importResolutionMethod,
25
- importDefaultExtension,
26
-
27
- defaultMsAllocatedPerExecution,
28
- maxExecutionsInParallel,
29
- cooldownBetweenExecutions,
30
- completedExecutionLogMerging,
31
- completedExecutionLogAbbreviation,
32
- logSummary,
33
-
34
- coverage,
35
- coverageConfig,
36
- coverageIncludeMissing,
37
- coverageForceIstanbul,
38
- coverageV8ConflictWarning,
39
- coverageTempDirectoryRelativeUrl,
40
-
41
- compileServerProtocol,
42
- compileServerPrivateKey,
43
- compileServerCertificate,
44
- compileServerIp,
45
- compileServerPort,
46
- compileServerCanReadFromFilesystem,
47
- compileServerCanWriteOnFilesystem,
48
- babelPluginMap,
49
- babelConfigFileUrl,
50
- customCompilers,
51
- } = {},
52
- ) => {
53
- if (coverage) {
54
- babelPluginMap = {
55
- ...babelPluginMap,
56
- "transform-instrument": [
57
- babelPluginInstrument,
58
- { projectDirectoryUrl, coverageConfig },
59
- ],
60
- }
61
- }
62
-
63
- const runtimeSupport = {}
64
- Object.keys(plan).forEach((filePattern) => {
65
- const filePlan = plan[filePattern]
66
- Object.keys(filePlan).forEach((executionName) => {
67
- const executionConfig = filePlan[executionName]
68
- const { runtime } = executionConfig
69
- if (runtime) {
70
- mergeRuntimeSupport(runtimeSupport, {
71
- [runtime.name]: runtime.version,
72
- })
73
- }
74
- })
75
- })
76
-
77
- logger.debug(
78
- createDetailedMessage(`Prepare executing plan`, {
79
- runtimeSupport: JSON.stringify(runtimeSupport, null, " "),
80
- }),
81
- )
82
-
83
- const multipleExecutionsOperation = Abort.startOperation()
84
- multipleExecutionsOperation.addAbortSignal(signal)
85
- if (handleSIGINT) {
86
- multipleExecutionsOperation.addAbortSource((abort) => {
87
- return raceProcessTeardownEvents(
88
- {
89
- SIGINT: true,
90
- },
91
- () => {
92
- logger.debug(`SIGINT abort`)
93
- abort()
94
- },
95
- )
96
- })
97
- }
98
-
99
- try {
100
- const compileServer = await startCompileServer({
101
- signal: multipleExecutionsOperation.signal,
102
- compileServerLogLevel,
103
-
104
- projectDirectoryUrl,
105
- jsenvDirectoryRelativeUrl,
106
- jsenvDirectoryClean,
107
- outDirectoryName: "dev",
108
-
109
- importResolutionMethod,
110
- importDefaultExtension,
111
-
112
- compileServerProtocol,
113
- compileServerPrivateKey,
114
- compileServerCertificate,
115
- compileServerIp,
116
- compileServerPort,
117
- compileServerCanReadFromFilesystem,
118
- compileServerCanWriteOnFilesystem,
119
- keepProcessAlive: true, // to be sure it stays alive
120
- babelPluginMap,
121
- babelConfigFileUrl,
122
- customCompilers,
123
- runtimeSupport,
124
- })
125
-
126
- multipleExecutionsOperation.addEndCallback(async () => {
127
- await compileServer.stop()
128
- })
129
-
130
- logger.debug(`Generate executions`)
131
- const executionSteps = await generateExecutionSteps(
132
- {
133
- ...plan,
134
- [compileServer.outDirectoryRelativeUrl]: null,
135
- },
136
- {
137
- signal: multipleExecutionsOperation.signal,
138
- projectDirectoryUrl,
139
- },
140
- )
141
- logger.debug(`${executionSteps.length} executions planned`)
142
-
143
- const result = await executeConcurrently(executionSteps, {
144
- multipleExecutionsOperation,
145
- logger,
146
- launchAndExecuteLogLevel,
147
-
148
- projectDirectoryUrl,
149
- compileServerOrigin: compileServer.origin,
150
- outDirectoryRelativeUrl: compileServer.outDirectoryRelativeUrl,
151
-
152
- // not sure we actually have to pass import params to executeConcurrently
153
- importResolutionMethod,
154
- importDefaultExtension,
155
-
156
- babelPluginMap: compileServer.babelPluginMap,
157
-
158
- defaultMsAllocatedPerExecution,
159
- maxExecutionsInParallel,
160
- cooldownBetweenExecutions,
161
- completedExecutionLogMerging,
162
- completedExecutionLogAbbreviation,
163
- logSummary,
164
-
165
- coverage,
166
- coverageConfig,
167
- coverageIncludeMissing,
168
- coverageForceIstanbul,
169
- coverageV8ConflictWarning,
170
- coverageTempDirectoryRelativeUrl,
171
- runtimeSupport,
172
- })
173
-
174
- return {
175
- aborted: multipleExecutionsOperation.signal.aborted,
176
- planSummary: result.summary,
177
- planReport: result.report,
178
- planCoverage: result.coverage,
179
- }
180
- } finally {
181
- await multipleExecutionsOperation.end()
182
- }
183
- }
1
+ import { Abort, raceProcessTeardownEvents } from "@jsenv/abort"
2
+ import { createDetailedMessage } from "@jsenv/logger"
3
+
4
+ import { mergeRuntimeSupport } from "@jsenv/core/src/internal/generateGroupMap/runtime_support.js"
5
+ import { startCompileServer } from "../compiling/startCompileServer.js"
6
+ import { babelPluginInstrument } from "./coverage/babel_plugin_instrument.js"
7
+ import { generateExecutionSteps } from "./generateExecutionSteps.js"
8
+ import { executeConcurrently } from "./executeConcurrently.js"
9
+
10
+ export const executePlan = async (
11
+ plan,
12
+ {
13
+ signal,
14
+ handleSIGINT,
15
+
16
+ logger,
17
+ compileServerLogLevel,
18
+ launchAndExecuteLogLevel,
19
+
20
+ projectDirectoryUrl,
21
+ jsenvDirectoryRelativeUrl,
22
+ jsenvDirectoryClean,
23
+
24
+ importResolutionMethod,
25
+ importDefaultExtension,
26
+
27
+ defaultMsAllocatedPerExecution,
28
+ maxExecutionsInParallel,
29
+ cooldownBetweenExecutions,
30
+ completedExecutionLogMerging,
31
+ completedExecutionLogAbbreviation,
32
+ logSummary,
33
+
34
+ coverage,
35
+ coverageConfig,
36
+ coverageIncludeMissing,
37
+ coverageForceIstanbul,
38
+ coverageV8ConflictWarning,
39
+ coverageTempDirectoryRelativeUrl,
40
+
41
+ compileServerProtocol,
42
+ compileServerPrivateKey,
43
+ compileServerCertificate,
44
+ compileServerIp,
45
+ compileServerPort,
46
+ compileServerCanReadFromFilesystem,
47
+ compileServerCanWriteOnFilesystem,
48
+ babelPluginMap,
49
+ babelConfigFileUrl,
50
+ customCompilers,
51
+ } = {},
52
+ ) => {
53
+ if (coverage) {
54
+ babelPluginMap = {
55
+ ...babelPluginMap,
56
+ "transform-instrument": [
57
+ babelPluginInstrument,
58
+ { projectDirectoryUrl, coverageConfig },
59
+ ],
60
+ }
61
+ }
62
+
63
+ const runtimeSupport = {}
64
+ Object.keys(plan).forEach((filePattern) => {
65
+ const filePlan = plan[filePattern]
66
+ Object.keys(filePlan).forEach((executionName) => {
67
+ const executionConfig = filePlan[executionName]
68
+ const { runtime } = executionConfig
69
+ if (runtime) {
70
+ mergeRuntimeSupport(runtimeSupport, {
71
+ [runtime.name]: runtime.version,
72
+ })
73
+ }
74
+ })
75
+ })
76
+
77
+ logger.debug(
78
+ createDetailedMessage(`Prepare executing plan`, {
79
+ runtimeSupport: JSON.stringify(runtimeSupport, null, " "),
80
+ }),
81
+ )
82
+
83
+ const multipleExecutionsOperation = Abort.startOperation()
84
+ multipleExecutionsOperation.addAbortSignal(signal)
85
+ if (handleSIGINT) {
86
+ multipleExecutionsOperation.addAbortSource((abort) => {
87
+ return raceProcessTeardownEvents(
88
+ {
89
+ SIGINT: true,
90
+ },
91
+ () => {
92
+ logger.debug(`SIGINT abort`)
93
+ abort()
94
+ },
95
+ )
96
+ })
97
+ }
98
+
99
+ try {
100
+ const compileServer = await startCompileServer({
101
+ signal: multipleExecutionsOperation.signal,
102
+ compileServerLogLevel,
103
+
104
+ projectDirectoryUrl,
105
+ jsenvDirectoryRelativeUrl,
106
+ jsenvDirectoryClean,
107
+ outDirectoryName: "dev",
108
+
109
+ importResolutionMethod,
110
+ importDefaultExtension,
111
+
112
+ compileServerProtocol,
113
+ compileServerPrivateKey,
114
+ compileServerCertificate,
115
+ compileServerIp,
116
+ compileServerPort,
117
+ compileServerCanReadFromFilesystem,
118
+ compileServerCanWriteOnFilesystem,
119
+ keepProcessAlive: true, // to be sure it stays alive
120
+ babelPluginMap,
121
+ babelConfigFileUrl,
122
+ customCompilers,
123
+ runtimeSupport,
124
+ })
125
+
126
+ multipleExecutionsOperation.addEndCallback(async () => {
127
+ await compileServer.stop()
128
+ })
129
+
130
+ logger.debug(`Generate executions`)
131
+ const executionSteps = await generateExecutionSteps(
132
+ {
133
+ ...plan,
134
+ [compileServer.outDirectoryRelativeUrl]: null,
135
+ },
136
+ {
137
+ signal: multipleExecutionsOperation.signal,
138
+ projectDirectoryUrl,
139
+ },
140
+ )
141
+ logger.debug(`${executionSteps.length} executions planned`)
142
+
143
+ const result = await executeConcurrently(executionSteps, {
144
+ multipleExecutionsOperation,
145
+ logger,
146
+ launchAndExecuteLogLevel,
147
+
148
+ projectDirectoryUrl,
149
+ compileServerOrigin: compileServer.origin,
150
+ outDirectoryRelativeUrl: compileServer.outDirectoryRelativeUrl,
151
+
152
+ // not sure we actually have to pass import params to executeConcurrently
153
+ importResolutionMethod,
154
+ importDefaultExtension,
155
+
156
+ babelPluginMap: compileServer.babelPluginMap,
157
+
158
+ defaultMsAllocatedPerExecution,
159
+ maxExecutionsInParallel,
160
+ cooldownBetweenExecutions,
161
+ completedExecutionLogMerging,
162
+ completedExecutionLogAbbreviation,
163
+ logSummary,
164
+
165
+ coverage,
166
+ coverageConfig,
167
+ coverageIncludeMissing,
168
+ coverageForceIstanbul,
169
+ coverageV8ConflictWarning,
170
+ coverageTempDirectoryRelativeUrl,
171
+ runtimeSupport,
172
+ })
173
+
174
+ return {
175
+ aborted: multipleExecutionsOperation.signal.aborted,
176
+ planSummary: result.summary,
177
+ planReport: result.report,
178
+ planCoverage: result.coverage,
179
+ }
180
+ } finally {
181
+ await multipleExecutionsOperation.end()
182
+ }
183
+ }