@jsenv/core 27.4.0 → 27.5.2
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/js/autoreload.js +359 -0
- package/dist/js/execute_using_dynamic_import.js +1 -1
- package/dist/js/html_supervisor_installer.js +469 -254
- package/dist/js/html_supervisor_setup.js +3 -4
- package/dist/js/new_stylesheet.js +26 -58
- package/dist/js/server_events_client.js +307 -0
- package/dist/main.js +7558 -7311
- package/package.json +12 -10
- package/{README.md → readme.md} +8 -9
- package/src/build/build.js +12 -16
- package/src/build/start_build_server.js +24 -28
- package/src/dev/start_dev_server.js +34 -96
- package/src/execute/execute.js +17 -35
- package/src/omega/errors.js +20 -18
- package/src/omega/kitchen.js +7 -6
- package/src/omega/omega_server.js +96 -127
- package/src/omega/server/file_service.js +247 -46
- package/src/omega/url_graph.js +33 -20
- package/src/plugins/autoreload/client/autoreload.js +201 -0
- package/src/plugins/autoreload/{dev_sse/client → client}/autoreload_preference.js +0 -0
- package/src/plugins/autoreload/{dev_sse/client → client}/reload.js +29 -10
- package/src/plugins/autoreload/{dev_sse/client → client}/url_helpers.js +0 -0
- package/src/plugins/autoreload/jsenv_plugin_autoreload.js +4 -4
- package/src/plugins/autoreload/{dev_sse/jsenv_plugin_dev_sse_client.js → jsenv_plugin_autoreload_client.js} +8 -8
- package/src/plugins/autoreload/jsenv_plugin_autoreload_server.js +196 -0
- package/src/{dev/plugins → plugins}/explorer/client/explorer.html +0 -0
- package/src/{dev/plugins → plugins}/explorer/client/jsenv.png +0 -0
- package/src/{dev/plugins → plugins}/explorer/jsenv_plugin_explorer.js +1 -3
- package/src/plugins/html_supervisor/client/error_formatter.js +300 -0
- package/src/plugins/html_supervisor/client/error_overlay.js +172 -0
- package/src/plugins/html_supervisor/client/html_supervisor_installer.js +124 -54
- package/src/plugins/html_supervisor/client/html_supervisor_setup.js +3 -4
- package/src/plugins/html_supervisor/jsenv_plugin_html_supervisor.js +72 -27
- package/src/plugins/inline/jsenv_plugin_html_inline_content.js +97 -117
- package/src/plugins/node_esm_resolution/jsenv_plugin_node_esm_resolution.js +66 -58
- package/src/plugins/plugin_controller.js +102 -67
- package/src/plugins/plugins.js +10 -8
- package/src/{helpers/event_source/event_source.js → plugins/server_events/client/event_source_connection.js} +102 -31
- package/src/plugins/server_events/client/server_events_client.js +17 -0
- package/src/plugins/server_events/jsenv_plugin_server_events_client_injection.js +48 -0
- package/src/plugins/server_events/server_events_dispatcher.js +69 -0
- package/src/{dev/plugins → plugins}/toolbar/client/animation/toolbar_animation.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/eventsource/eventsource.css +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/eventsource/toolbar_eventsource.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/execution/execution.css +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/execution/toolbar_execution.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/focus/focus.css +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/focus/toolbar_focus.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/jsenv_logo.svg +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/notification/toolbar_notification.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/responsive/overflow_menu.css +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/responsive/toolbar_responsive.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/settings/settings.css +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/settings/toolbar_settings.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/theme/jsenv_theme.css +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/theme/light_theme.css +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/theme/toolbar_theme.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/toolbar.html +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/toolbar_injector.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/toolbar_main.css +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/toolbar_main.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/tooltip/tooltip.css +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/tooltip/tooltip.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/util/animation.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/util/dom.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/util/fetch_using_xhr.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/util/fetching.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/util/iframe_to_parent_href.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/util/jsenv_logger.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/util/preferences.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/util/responsive.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/util/util.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/client/variant/variant.js +0 -0
- package/src/{dev/plugins → plugins}/toolbar/jsenv_plugin_toolbar.js +0 -0
- package/src/plugins/transpilation/as_js_classic/jsenv_plugin_as_js_classic_html.js +4 -3
- package/src/plugins/transpilation/babel/new_stylesheet/client/new_stylesheet.js +25 -55
- package/src/plugins/transpilation/import_assertions/jsenv_plugin_import_assertions.js +44 -24
- package/src/plugins/transpilation/jsenv_plugin_transpilation.js +6 -1
- package/src/plugins/url_analysis/html/html_urls.js +8 -8
- package/src/test/execute_plan.js +36 -54
- package/src/test/execute_test_plan.js +2 -2
- package/dist/js/event_source_client.js +0 -549
- package/src/helpers/event_source/sse_service.js +0 -53
- package/src/plugins/autoreload/dev_sse/client/event_source_client.js +0 -193
- package/src/plugins/autoreload/dev_sse/jsenv_plugin_dev_sse_server.js +0 -192
- package/src/plugins/html_supervisor/client/error_in_document.js +0 -345
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
getHtmlNodePosition,
|
|
12
12
|
setHtmlNodeAttributes,
|
|
13
13
|
setHtmlNodeText,
|
|
14
|
+
analyzeScriptNode,
|
|
14
15
|
injectScriptNodeAsEarlyAsPossible,
|
|
15
16
|
createHtmlNode,
|
|
16
17
|
} from "@jsenv/ast"
|
|
@@ -49,12 +50,12 @@ export const jsenvPluginAsJsClassicHtml = ({
|
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
const visitScriptNodes = (node) => {
|
|
52
|
-
const type =
|
|
53
|
-
if (type === "
|
|
53
|
+
const { type } = analyzeScriptNode(node)
|
|
54
|
+
if (type === "js_module") {
|
|
54
55
|
moduleScriptNodes.push(node)
|
|
55
56
|
return
|
|
56
57
|
}
|
|
57
|
-
if (type ===
|
|
58
|
+
if (type === "js_classic") {
|
|
58
59
|
classicScriptNodes.push(node)
|
|
59
60
|
return
|
|
60
61
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
//
|
|
2
|
+
// construct-style-sheets-polyfill@3.1.0
|
|
3
3
|
// to keep in sync with https://github.com/calebdwilliams/construct-style-sheets
|
|
4
|
+
// copy pasted into jsenv codebase to inject this code with more ease
|
|
4
5
|
;(function () {
|
|
5
6
|
"use strict"
|
|
6
7
|
|
|
@@ -15,29 +16,6 @@
|
|
|
15
16
|
var defineProperty = Object.defineProperty
|
|
16
17
|
var forEach = Array.prototype.forEach
|
|
17
18
|
|
|
18
|
-
var hasBrokenRules = (function () {
|
|
19
|
-
var style = bootstrapper.createElement("style")
|
|
20
|
-
style.textContent = '.x{content:"y"}'
|
|
21
|
-
bootstrapper.body.appendChild(style)
|
|
22
|
-
return style.sheet.cssRules[0].style.content !== '"y"'
|
|
23
|
-
})()
|
|
24
|
-
var brokenRulePatterns = [/content:\s*["']/gm]
|
|
25
|
-
function fixBrokenRules(content) {
|
|
26
|
-
return brokenRulePatterns.reduce(function (acc, pattern) {
|
|
27
|
-
return acc.replace(pattern, "$&%%%")
|
|
28
|
-
}, content)
|
|
29
|
-
}
|
|
30
|
-
var placeholderPatterns = [/(content:\s*["'])%%%/gm]
|
|
31
|
-
var getCssText = hasBrokenRules
|
|
32
|
-
? function (rule) {
|
|
33
|
-
return placeholderPatterns.reduce(function (acc, pattern) {
|
|
34
|
-
return acc.replace(pattern, "$1")
|
|
35
|
-
}, rule.cssText)
|
|
36
|
-
}
|
|
37
|
-
: function (rule) {
|
|
38
|
-
return rule.cssText
|
|
39
|
-
}
|
|
40
|
-
|
|
41
19
|
var importPattern = /@import.+?;?$/gm
|
|
42
20
|
function rejectImports(contents) {
|
|
43
21
|
var _contents = contents.replace(importPattern, "")
|
|
@@ -48,16 +26,6 @@
|
|
|
48
26
|
}
|
|
49
27
|
return _contents.trim()
|
|
50
28
|
}
|
|
51
|
-
function clearRules(sheet) {
|
|
52
|
-
for (var i = 0; i < sheet.cssRules.length; i++) {
|
|
53
|
-
sheet.deleteRule(0)
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function insertAllRules(from, to) {
|
|
57
|
-
forEach.call(from.cssRules, function (rule, i) {
|
|
58
|
-
to.insertRule(getCssText(rule), i)
|
|
59
|
-
})
|
|
60
|
-
}
|
|
61
29
|
function isElementConnected(element) {
|
|
62
30
|
return "isConnected" in element
|
|
63
31
|
? element.isConnected
|
|
@@ -111,9 +79,10 @@
|
|
|
111
79
|
? nonConstructedProto.isPrototypeOf(instance)
|
|
112
80
|
: false
|
|
113
81
|
}
|
|
114
|
-
var $
|
|
82
|
+
var $basicStyleElement = new WeakMap()
|
|
115
83
|
var $locations = new WeakMap()
|
|
116
84
|
var $adoptersByLocation = new WeakMap()
|
|
85
|
+
var $appliedMethods = new WeakMap()
|
|
117
86
|
function addAdopterLocation(sheet, location) {
|
|
118
87
|
var adopter = document.createElement("style")
|
|
119
88
|
$adoptersByLocation.get(sheet).set(location, adopter)
|
|
@@ -134,12 +103,14 @@
|
|
|
134
103
|
}
|
|
135
104
|
function restyleAdopter(sheet, adopter) {
|
|
136
105
|
requestAnimationFrame(function () {
|
|
137
|
-
|
|
138
|
-
|
|
106
|
+
adopter.textContent = $basicStyleElement.get(sheet).textContent
|
|
107
|
+
$appliedMethods.get(sheet).forEach(function (command) {
|
|
108
|
+
return adopter.sheet[command.method].apply(adopter.sheet, command.args)
|
|
109
|
+
})
|
|
139
110
|
})
|
|
140
111
|
}
|
|
141
112
|
function checkInvocationCorrectness(self) {
|
|
142
|
-
if (!$
|
|
113
|
+
if (!$basicStyleElement.has(self)) {
|
|
143
114
|
throw new TypeError("Illegal invocation")
|
|
144
115
|
}
|
|
145
116
|
}
|
|
@@ -147,9 +118,10 @@
|
|
|
147
118
|
var self = this
|
|
148
119
|
var style = document.createElement("style")
|
|
149
120
|
bootstrapper.body.appendChild(style)
|
|
150
|
-
$
|
|
121
|
+
$basicStyleElement.set(self, style)
|
|
151
122
|
$locations.set(self, [])
|
|
152
123
|
$adoptersByLocation.set(self, new WeakMap())
|
|
124
|
+
$appliedMethods.set(self, [])
|
|
153
125
|
}
|
|
154
126
|
var proto$1 = ConstructedStyleSheet.prototype
|
|
155
127
|
proto$1.replace = function replace(contents) {
|
|
@@ -164,11 +136,8 @@
|
|
|
164
136
|
checkInvocationCorrectness(this)
|
|
165
137
|
if (typeof contents === "string") {
|
|
166
138
|
var self_1 = this
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
? fixBrokenRules(rejectImports(contents))
|
|
170
|
-
: rejectImports(contents)
|
|
171
|
-
$basicStyleSheet.set(self_1, style.sheet)
|
|
139
|
+
$basicStyleElement.get(self_1).textContent = rejectImports(contents)
|
|
140
|
+
$appliedMethods.set(self_1, [])
|
|
172
141
|
$locations.get(self_1).forEach(function (location) {
|
|
173
142
|
if (location.isConnected()) {
|
|
174
143
|
restyleAdopter(self_1, getAdopterByLocation(self_1, location))
|
|
@@ -181,7 +150,15 @@
|
|
|
181
150
|
enumerable: true,
|
|
182
151
|
get: function cssRules() {
|
|
183
152
|
checkInvocationCorrectness(this)
|
|
184
|
-
return $
|
|
153
|
+
return $basicStyleElement.get(this).sheet.cssRules
|
|
154
|
+
},
|
|
155
|
+
})
|
|
156
|
+
defineProperty(proto$1, "media", {
|
|
157
|
+
configurable: true,
|
|
158
|
+
enumerable: true,
|
|
159
|
+
get: function media() {
|
|
160
|
+
checkInvocationCorrectness(this)
|
|
161
|
+
return $basicStyleElement.get(this).sheet.media
|
|
185
162
|
},
|
|
186
163
|
})
|
|
187
164
|
cssStyleSheetMethods.forEach(function (method) {
|
|
@@ -189,22 +166,15 @@
|
|
|
189
166
|
var self = this
|
|
190
167
|
checkInvocationCorrectness(self)
|
|
191
168
|
var args = arguments
|
|
169
|
+
$appliedMethods.get(self).push({ method: method, args: args })
|
|
192
170
|
$locations.get(self).forEach(function (location) {
|
|
193
171
|
if (location.isConnected()) {
|
|
194
172
|
var sheet = getAdopterByLocation(self, location).sheet
|
|
195
173
|
sheet[method].apply(sheet, args)
|
|
196
174
|
}
|
|
197
175
|
})
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
args[0] = fixBrokenRules(args[0])
|
|
201
|
-
}
|
|
202
|
-
if (method === "addRule") {
|
|
203
|
-
args[1] = fixBrokenRules(args[1])
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
var basic = $basicStyleSheet.get(self)
|
|
207
|
-
return basic[method].apply(basic, args)
|
|
176
|
+
var basicSheet = $basicStyleElement.get(self).sheet
|
|
177
|
+
return basicSheet[method].apply(basicSheet, args)
|
|
208
178
|
}
|
|
209
179
|
})
|
|
210
180
|
defineProperty(ConstructedStyleSheet, Symbol.hasInstance, {
|
|
@@ -14,7 +14,11 @@ import { urlToFilename, injectQueryParams } from "@jsenv/urls"
|
|
|
14
14
|
|
|
15
15
|
import { JS_QUOTES } from "@jsenv/utils/src/string/js_quotes.js"
|
|
16
16
|
|
|
17
|
-
export const jsenvPluginImportAssertions = (
|
|
17
|
+
export const jsenvPluginImportAssertions = ({
|
|
18
|
+
json = "auto",
|
|
19
|
+
css = "auto",
|
|
20
|
+
text = "auto",
|
|
21
|
+
}) => {
|
|
18
22
|
const updateReference = (reference, searchParam) => {
|
|
19
23
|
reference.expectedType = "js_module"
|
|
20
24
|
reference.filename = `${urlToFilename(reference.url)}.js`
|
|
@@ -33,42 +37,58 @@ export const jsenvPluginImportAssertions = () => {
|
|
|
33
37
|
const importAssertions = {
|
|
34
38
|
name: "jsenv:import_assertions",
|
|
35
39
|
appliesDuring: "*",
|
|
40
|
+
init: (context) => {
|
|
41
|
+
// transpilation is forced during build so that
|
|
42
|
+
// - avoid rollup to see import assertions
|
|
43
|
+
// We would have to tell rollup to ignore import with assertion
|
|
44
|
+
// - means rollup can bundle more js file together
|
|
45
|
+
// - means url versioning can work for css inlined in js
|
|
46
|
+
if (context.scenario === "build") {
|
|
47
|
+
json = true
|
|
48
|
+
css = true
|
|
49
|
+
text = true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
36
52
|
redirectUrl: {
|
|
37
53
|
js_import_export: (reference, context) => {
|
|
38
54
|
if (!reference.assert) {
|
|
39
55
|
return null
|
|
40
56
|
}
|
|
41
|
-
// during build always replace import assertions with the js:
|
|
42
|
-
// - avoid rollup to see import assertions
|
|
43
|
-
// We would have to tell rollup to ignore import with assertion
|
|
44
|
-
// - means rollup can bundle more js file together
|
|
45
|
-
// - means url versioning can work for css inlined in js
|
|
46
57
|
if (reference.assert.type === "json") {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
const shouldTranspileJsonImportAssertion =
|
|
59
|
+
json === true
|
|
60
|
+
? true
|
|
61
|
+
: json === "auto"
|
|
62
|
+
? !context.isSupportedOnCurrentClients("import_type_json")
|
|
63
|
+
: false
|
|
64
|
+
if (shouldTranspileJsonImportAssertion) {
|
|
65
|
+
return updateReference(reference, "as_json_module")
|
|
52
66
|
}
|
|
53
|
-
return
|
|
67
|
+
return null
|
|
54
68
|
}
|
|
55
69
|
if (reference.assert.type === "css") {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
70
|
+
const shouldTranspileCssImportAssertion =
|
|
71
|
+
css === true
|
|
72
|
+
? true
|
|
73
|
+
: css === "auto"
|
|
74
|
+
? !context.isSupportedOnCurrentClients("import_type_css")
|
|
75
|
+
: false
|
|
76
|
+
if (shouldTranspileCssImportAssertion) {
|
|
77
|
+
return updateReference(reference, "as_css_module")
|
|
61
78
|
}
|
|
62
|
-
return
|
|
79
|
+
return null
|
|
63
80
|
}
|
|
64
81
|
if (reference.assert.type === "text") {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
82
|
+
const shouldTranspileTextImportAssertion =
|
|
83
|
+
text === true
|
|
84
|
+
? true
|
|
85
|
+
: text === "auto"
|
|
86
|
+
? !context.isSupportedOnCurrentClients("import_type_text")
|
|
87
|
+
: false
|
|
88
|
+
if (shouldTranspileTextImportAssertion) {
|
|
89
|
+
return updateReference(reference, "as_text_module")
|
|
70
90
|
}
|
|
71
|
-
return
|
|
91
|
+
return null
|
|
72
92
|
}
|
|
73
93
|
return null
|
|
74
94
|
},
|
|
@@ -22,9 +22,14 @@ export const jsenvPluginTranspilation = ({
|
|
|
22
22
|
babelHelpersAsImport = true,
|
|
23
23
|
getCustomBabelPlugins,
|
|
24
24
|
}) => {
|
|
25
|
+
if (importAssertions === true) {
|
|
26
|
+
importAssertions = {}
|
|
27
|
+
}
|
|
25
28
|
return [
|
|
26
29
|
// import assertions we want it all the time
|
|
27
|
-
...(importAssertions
|
|
30
|
+
...(importAssertions
|
|
31
|
+
? [jsenvPluginImportAssertions(importAssertions)]
|
|
32
|
+
: []),
|
|
28
33
|
// babel also so that rollup can bundle babel helpers for instance
|
|
29
34
|
jsenvPluginBabel({
|
|
30
35
|
topLevelAwait,
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
getHtmlNodePosition,
|
|
6
6
|
setHtmlNodeAttributes,
|
|
7
7
|
getHtmlNodeAttributePosition,
|
|
8
|
+
analyzeScriptNode,
|
|
8
9
|
parseSrcSet,
|
|
9
10
|
stringifyHtmlAst,
|
|
10
11
|
} from "@jsenv/ast"
|
|
@@ -188,16 +189,15 @@ const visitHtmlUrls = ({ url, htmlAst, onUrl }) => {
|
|
|
188
189
|
},
|
|
189
190
|
// style: () => {},
|
|
190
191
|
script: (node) => {
|
|
191
|
-
const type =
|
|
192
|
-
|
|
193
|
-
"
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}[type]
|
|
192
|
+
const { type } = analyzeScriptNode(node)
|
|
193
|
+
if (type === "text") {
|
|
194
|
+
// ignore <script type="whatever" src="./file.js">
|
|
195
|
+
// per HTML spec https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-type
|
|
196
|
+
return
|
|
197
|
+
}
|
|
198
198
|
visitAttributeAsUrlSpecifier({
|
|
199
199
|
type: "script_src",
|
|
200
|
-
expectedType,
|
|
200
|
+
expectedType: type,
|
|
201
201
|
node,
|
|
202
202
|
attributeName: "src",
|
|
203
203
|
})
|
package/src/test/execute_plan.js
CHANGED
|
@@ -16,9 +16,6 @@ import { ensureEmptyDirectory, writeFileSync } from "@jsenv/filesystem"
|
|
|
16
16
|
|
|
17
17
|
import { babelPluginInstrument } from "./coverage/babel_plugin_instrument.js"
|
|
18
18
|
import { reportToCoverage } from "./coverage/report_to_coverage.js"
|
|
19
|
-
import { createUrlGraph } from "@jsenv/core/src/omega/url_graph.js"
|
|
20
|
-
import { getCorePlugins } from "@jsenv/core/src/plugins/plugins.js"
|
|
21
|
-
import { createKitchen } from "@jsenv/core/src/omega/kitchen.js"
|
|
22
19
|
import { startOmegaServer } from "@jsenv/core/src/omega/omega_server.js"
|
|
23
20
|
import { run } from "@jsenv/core/src/execute/run.js"
|
|
24
21
|
|
|
@@ -43,6 +40,7 @@ export const executePlan = async (
|
|
|
43
40
|
|
|
44
41
|
rootDirectoryUrl,
|
|
45
42
|
keepRunning,
|
|
43
|
+
services,
|
|
46
44
|
defaultMsAllocatedPerExecution,
|
|
47
45
|
maxExecutionsInParallel,
|
|
48
46
|
failFast,
|
|
@@ -68,7 +66,7 @@ export const executePlan = async (
|
|
|
68
66
|
protocol,
|
|
69
67
|
privateKey,
|
|
70
68
|
certificate,
|
|
71
|
-
|
|
69
|
+
host,
|
|
72
70
|
port,
|
|
73
71
|
|
|
74
72
|
beforeExecutionCallback = () => {},
|
|
@@ -198,64 +196,48 @@ export const executePlan = async (
|
|
|
198
196
|
stopAfterAllSignal,
|
|
199
197
|
}
|
|
200
198
|
if (someNeedsServer) {
|
|
201
|
-
const urlGraph = createUrlGraph()
|
|
202
|
-
const kitchen = createKitchen({
|
|
203
|
-
signal,
|
|
204
|
-
logger,
|
|
205
|
-
rootDirectoryUrl,
|
|
206
|
-
urlGraph,
|
|
207
|
-
scenario,
|
|
208
|
-
sourcemaps,
|
|
209
|
-
runtimeCompat: runtimes,
|
|
210
|
-
writeGeneratedFiles,
|
|
211
|
-
plugins: [
|
|
212
|
-
...plugins,
|
|
213
|
-
...getCorePlugins({
|
|
214
|
-
rootDirectoryUrl,
|
|
215
|
-
urlGraph,
|
|
216
|
-
scenario,
|
|
217
|
-
runtimeCompat: runtimes,
|
|
218
|
-
|
|
219
|
-
htmlSupervisor: true,
|
|
220
|
-
nodeEsmResolution,
|
|
221
|
-
fileSystemMagicResolution,
|
|
222
|
-
transpilation: {
|
|
223
|
-
...transpilation,
|
|
224
|
-
getCustomBabelPlugins: ({ clientRuntimeCompat }) => {
|
|
225
|
-
if (
|
|
226
|
-
coverageEnabled &&
|
|
227
|
-
(coverageMethodForBrowsers !== "playwright_api" ||
|
|
228
|
-
Object.keys(clientRuntimeCompat)[0] !== "chrome")
|
|
229
|
-
) {
|
|
230
|
-
return {
|
|
231
|
-
"transform-instrument": [
|
|
232
|
-
babelPluginInstrument,
|
|
233
|
-
{
|
|
234
|
-
rootDirectoryUrl,
|
|
235
|
-
coverageConfig,
|
|
236
|
-
},
|
|
237
|
-
],
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
return {}
|
|
241
|
-
},
|
|
242
|
-
},
|
|
243
|
-
}),
|
|
244
|
-
],
|
|
245
|
-
})
|
|
246
199
|
const server = await startOmegaServer({
|
|
247
200
|
signal: multipleExecutionsOperation.signal,
|
|
248
201
|
logLevel: "warn",
|
|
249
|
-
rootDirectoryUrl,
|
|
250
|
-
urlGraph,
|
|
251
|
-
kitchen,
|
|
252
|
-
scenario,
|
|
253
202
|
keepProcessAlive: false,
|
|
254
203
|
port,
|
|
255
|
-
|
|
204
|
+
host,
|
|
256
205
|
protocol,
|
|
257
206
|
certificate,
|
|
258
207
|
privateKey,
|
|
208
|
+
services,
|
|
209
|
+
|
|
210
|
+
rootDirectoryUrl,
|
|
211
|
+
scenario,
|
|
212
|
+
runtimeCompat: runtimes,
|
|
213
|
+
|
|
214
|
+
plugins,
|
|
215
|
+
htmlSupervisor: true,
|
|
216
|
+
nodeEsmResolution,
|
|
217
|
+
fileSystemMagicResolution,
|
|
218
|
+
transpilation: {
|
|
219
|
+
...transpilation,
|
|
220
|
+
getCustomBabelPlugins: ({ clientRuntimeCompat }) => {
|
|
221
|
+
if (
|
|
222
|
+
coverageEnabled &&
|
|
223
|
+
(coverageMethodForBrowsers !== "playwright_api" ||
|
|
224
|
+
Object.keys(clientRuntimeCompat)[0] !== "chrome")
|
|
225
|
+
) {
|
|
226
|
+
return {
|
|
227
|
+
"transform-instrument": [
|
|
228
|
+
babelPluginInstrument,
|
|
229
|
+
{
|
|
230
|
+
rootDirectoryUrl,
|
|
231
|
+
coverageConfig,
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return {}
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
sourcemaps,
|
|
240
|
+
writeGeneratedFiles,
|
|
259
241
|
})
|
|
260
242
|
multipleExecutionsOperation.addEndCallback(async () => {
|
|
261
243
|
await server.stop()
|
|
@@ -90,7 +90,7 @@ export const executeTestPlan = async ({
|
|
|
90
90
|
protocol,
|
|
91
91
|
privateKey,
|
|
92
92
|
certificate,
|
|
93
|
-
|
|
93
|
+
host,
|
|
94
94
|
port,
|
|
95
95
|
}) => {
|
|
96
96
|
const logger = createLogger({ logLevel })
|
|
@@ -177,7 +177,7 @@ export const executeTestPlan = async ({
|
|
|
177
177
|
protocol,
|
|
178
178
|
privateKey,
|
|
179
179
|
certificate,
|
|
180
|
-
|
|
180
|
+
host,
|
|
181
181
|
port,
|
|
182
182
|
})
|
|
183
183
|
if (
|