@jsenv/core 27.3.4 → 27.5.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 (88) hide show
  1. package/dist/js/autoreload.js +359 -0
  2. package/dist/js/execute_using_dynamic_import.js +1 -1
  3. package/dist/js/html_supervisor_installer.js +524 -147
  4. package/dist/js/html_supervisor_setup.js +3 -4
  5. package/dist/js/new_stylesheet.js +26 -58
  6. package/dist/js/server_events_client.js +307 -0
  7. package/dist/main.js +7709 -7324
  8. package/package.json +15 -15
  9. package/{README.md → readme.md} +18 -7
  10. package/src/build/build.js +16 -18
  11. package/src/build/start_build_server.js +24 -28
  12. package/src/dev/start_dev_server.js +34 -96
  13. package/src/execute/execute.js +17 -35
  14. package/src/omega/errors.js +43 -9
  15. package/src/omega/kitchen.js +42 -25
  16. package/src/omega/omega_server.js +96 -74
  17. package/src/omega/server/file_service.js +256 -28
  18. package/src/omega/url_graph.js +33 -20
  19. package/src/plugins/autoreload/client/autoreload.js +201 -0
  20. package/src/plugins/autoreload/{dev_sse/client → client}/autoreload_preference.js +0 -0
  21. package/src/plugins/autoreload/{dev_sse/client → client}/reload.js +29 -10
  22. package/src/plugins/autoreload/{dev_sse/client → client}/url_helpers.js +0 -0
  23. package/src/plugins/autoreload/jsenv_plugin_autoreload.js +4 -8
  24. package/src/plugins/autoreload/{dev_sse/jsenv_plugin_dev_sse_client.js → jsenv_plugin_autoreload_client.js} +8 -8
  25. package/src/plugins/autoreload/jsenv_plugin_autoreload_server.js +196 -0
  26. package/src/{dev/plugins → plugins}/explorer/client/explorer.html +0 -0
  27. package/src/{dev/plugins → plugins}/explorer/client/jsenv.png +0 -0
  28. package/src/{dev/plugins → plugins}/explorer/jsenv_plugin_explorer.js +1 -3
  29. package/src/plugins/html_supervisor/client/error_overlay.js +401 -0
  30. package/src/plugins/html_supervisor/client/html_supervisor_installer.js +138 -23
  31. package/src/plugins/html_supervisor/client/html_supervisor_setup.js +3 -4
  32. package/src/plugins/html_supervisor/jsenv_plugin_html_supervisor.js +55 -23
  33. package/src/plugins/inline/jsenv_plugin_html_inline_content.js +97 -117
  34. package/src/plugins/node_esm_resolution/jsenv_plugin_node_esm_resolution.js +66 -58
  35. package/src/plugins/plugin_controller.js +102 -67
  36. package/src/plugins/plugins.js +10 -10
  37. package/src/{helpers/event_source/event_source.js → plugins/server_events/client/event_source_connection.js} +125 -33
  38. package/src/plugins/server_events/client/server_events_client.js +17 -0
  39. package/src/plugins/server_events/jsenv_plugin_server_events_client_injection.js +48 -0
  40. package/src/plugins/server_events/server_events_dispatcher.js +69 -0
  41. package/src/{dev/plugins → plugins}/toolbar/client/animation/toolbar_animation.js +0 -0
  42. package/src/{dev/plugins → plugins}/toolbar/client/eventsource/eventsource.css +0 -0
  43. package/src/{dev/plugins → plugins}/toolbar/client/eventsource/toolbar_eventsource.js +0 -0
  44. package/src/{dev/plugins → plugins}/toolbar/client/execution/execution.css +0 -0
  45. package/src/{dev/plugins → plugins}/toolbar/client/execution/toolbar_execution.js +0 -0
  46. package/src/{dev/plugins → plugins}/toolbar/client/focus/focus.css +0 -0
  47. package/src/{dev/plugins → plugins}/toolbar/client/focus/toolbar_focus.js +0 -0
  48. package/src/{dev/plugins → plugins}/toolbar/client/jsenv_logo.svg +0 -0
  49. package/src/{dev/plugins → plugins}/toolbar/client/notification/toolbar_notification.js +0 -0
  50. package/src/{dev/plugins → plugins}/toolbar/client/responsive/overflow_menu.css +0 -0
  51. package/src/{dev/plugins → plugins}/toolbar/client/responsive/toolbar_responsive.js +0 -0
  52. package/src/{dev/plugins → plugins}/toolbar/client/settings/settings.css +0 -0
  53. package/src/{dev/plugins → plugins}/toolbar/client/settings/toolbar_settings.js +0 -0
  54. package/src/{dev/plugins → plugins}/toolbar/client/theme/jsenv_theme.css +0 -0
  55. package/src/{dev/plugins → plugins}/toolbar/client/theme/light_theme.css +0 -0
  56. package/src/{dev/plugins → plugins}/toolbar/client/theme/toolbar_theme.js +0 -0
  57. package/src/{dev/plugins → plugins}/toolbar/client/toolbar.html +0 -0
  58. package/src/{dev/plugins → plugins}/toolbar/client/toolbar_injector.js +0 -0
  59. package/src/{dev/plugins → plugins}/toolbar/client/toolbar_main.css +0 -0
  60. package/src/{dev/plugins → plugins}/toolbar/client/toolbar_main.js +0 -0
  61. package/src/{dev/plugins → plugins}/toolbar/client/tooltip/tooltip.css +0 -0
  62. package/src/{dev/plugins → plugins}/toolbar/client/tooltip/tooltip.js +0 -0
  63. package/src/{dev/plugins → plugins}/toolbar/client/util/animation.js +0 -0
  64. package/src/{dev/plugins → plugins}/toolbar/client/util/dom.js +0 -0
  65. package/src/{dev/plugins → plugins}/toolbar/client/util/fetch_using_xhr.js +0 -0
  66. package/src/{dev/plugins → plugins}/toolbar/client/util/fetching.js +0 -0
  67. package/src/{dev/plugins → plugins}/toolbar/client/util/iframe_to_parent_href.js +0 -0
  68. package/src/{dev/plugins → plugins}/toolbar/client/util/jsenv_logger.js +0 -0
  69. package/src/{dev/plugins → plugins}/toolbar/client/util/preferences.js +0 -0
  70. package/src/{dev/plugins → plugins}/toolbar/client/util/responsive.js +0 -0
  71. package/src/{dev/plugins → plugins}/toolbar/client/util/util.js +0 -0
  72. package/src/{dev/plugins → plugins}/toolbar/client/variant/variant.js +0 -0
  73. package/src/{dev/plugins → plugins}/toolbar/jsenv_plugin_toolbar.js +0 -0
  74. package/src/plugins/transpilation/as_js_classic/jsenv_plugin_as_js_classic_html.js +4 -3
  75. package/src/plugins/transpilation/babel/new_stylesheet/client/new_stylesheet.js +25 -55
  76. package/src/plugins/transpilation/import_assertions/jsenv_plugin_import_assertions.js +44 -24
  77. package/src/plugins/transpilation/jsenv_plugin_transpilation.js +6 -1
  78. package/src/plugins/url_analysis/html/html_urls.js +8 -8
  79. package/src/plugins/url_analysis/jsenv_plugin_url_analysis.js +3 -1
  80. package/src/test/execute_plan.js +36 -54
  81. package/src/test/execute_test_plan.js +2 -2
  82. package/src/test/logs_file_execution.js +60 -27
  83. package/src/test/logs_file_execution.test.mjs +41 -0
  84. package/dist/js/event_source_client.js +0 -528
  85. package/src/helpers/event_source/sse_service.js +0 -53
  86. package/src/plugins/autoreload/dev_sse/client/event_source_client.js +0 -193
  87. package/src/plugins/autoreload/dev_sse/jsenv_plugin_dev_sse_server.js +0 -203
  88. package/src/plugins/html_supervisor/client/error_in_document.js +0 -198
@@ -0,0 +1,69 @@
1
+ import { createSSERoom } from "@jsenv/server"
2
+ import { createCallbackListNotifiedOnce } from "@jsenv/abort"
3
+
4
+ export const createServerEventsDispatcher = () => {
5
+ const destroyCallbackList = createCallbackListNotifiedOnce()
6
+ const rooms = []
7
+ const sseRoomLimit = 100
8
+
9
+ destroyCallbackList.add(() => {
10
+ rooms.forEach((room) => {
11
+ room.close()
12
+ })
13
+ })
14
+
15
+ return {
16
+ addRoom: (request) => {
17
+ const existingRoom = rooms.find(
18
+ (roomCandidate) =>
19
+ roomCandidate.request.ressource === request.ressource,
20
+ )
21
+ if (existingRoom) {
22
+ return existingRoom
23
+ }
24
+ const room = createSSERoom({
25
+ retryDuration: 2000,
26
+ historyLength: 100,
27
+ welcomeEventEnabled: true,
28
+ effect: () => {
29
+ rooms.push(room)
30
+ if (rooms.length >= sseRoomLimit) {
31
+ const firstRoom = rooms.shift()
32
+ firstRoom.close()
33
+ }
34
+ return () => {
35
+ // when the last client leaves the room it is closed and removed from the list
36
+ room.close()
37
+ const index = rooms.indexOf(room)
38
+ if (index > -1) {
39
+ rooms.splice(index, 1)
40
+ }
41
+ }
42
+ },
43
+ })
44
+ room.request = request
45
+ return room
46
+ },
47
+ dispatch: ({ type, data }) => {
48
+ rooms.forEach((room) =>
49
+ room.sendEventToAllClients({
50
+ type,
51
+ data: JSON.stringify(data),
52
+ }),
53
+ )
54
+ },
55
+ dispatchToRoomsMatching: ({ type, data }, predicate) => {
56
+ rooms.forEach((room) => {
57
+ if (predicate(room)) {
58
+ room.sendEventToAllClients({
59
+ type,
60
+ data: JSON.stringify(data),
61
+ })
62
+ }
63
+ })
64
+ },
65
+ destroy: () => {
66
+ destroyCallbackList.notify()
67
+ },
68
+ }
69
+ }
@@ -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 = getHtmlNodeAttribute(node, "type")
53
- if (type === "module") {
53
+ const { type } = analyzeScriptNode(node)
54
+ if (type === "js_module") {
54
55
  moduleScriptNodes.push(node)
55
56
  return
56
57
  }
57
- if (type === undefined || type === "text/javascript") {
58
+ if (type === "js_classic") {
58
59
  classicScriptNodes.push(node)
59
60
  return
60
61
  }
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable */
2
- // copy paste to help finding the file (npm and node modules would make it complex)
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 $basicStyleSheet = new WeakMap()
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
- clearRules(adopter.sheet)
138
- insertAllRules($basicStyleSheet.get(sheet), adopter.sheet)
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 (!$basicStyleSheet.has(self)) {
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
- $basicStyleSheet.set(self, style.sheet)
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
- var style = $basicStyleSheet.get(self_1).ownerNode
168
- style.textContent = hasBrokenRules
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 $basicStyleSheet.get(this).cssRules
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
- if (hasBrokenRules) {
199
- if (method === "insertRule") {
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
- if (
48
- context.scenario !== "build" &&
49
- context.isSupportedOnCurrentClients("import_type_json")
50
- ) {
51
- return null
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 updateReference(reference, "as_json_module")
67
+ return null
54
68
  }
55
69
  if (reference.assert.type === "css") {
56
- if (
57
- context.scenario !== "build" &&
58
- context.isSupportedOnCurrentClients("import_type_css")
59
- ) {
60
- return null
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 updateReference(reference, "as_css_module")
79
+ return null
63
80
  }
64
81
  if (reference.assert.type === "text") {
65
- if (
66
- context.scenario !== "build" &&
67
- context.isSupportedOnCurrentClients("import_type_text")
68
- ) {
69
- return null
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 updateReference(reference, "as_text_module")
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 ? [jsenvPluginImportAssertions()] : []),
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 = getHtmlNodeAttribute(node, "type")
192
- const expectedType = {
193
- "undefined": "js_classic",
194
- "text/javascript": "js_classic",
195
- "module": "js_module",
196
- "importmap": "importmap",
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
  })
@@ -79,7 +79,9 @@ export const jsenvPluginUrlAnalysis = ({
79
79
  type: "filesystem",
80
80
  subtype: "directory_entry",
81
81
  specifier: directoryEntryName,
82
- trace: `"${directoryRelativeUrl}${directoryEntryName}" entry in directory referenced by ${originalDirectoryReference.trace}`,
82
+ trace: {
83
+ message: `"${directoryRelativeUrl}${directoryEntryName}" entry in directory referenced by ${originalDirectoryReference.trace.message}`,
84
+ },
83
85
  })
84
86
  })
85
87
  },
@@ -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
- ip,
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
- ip,
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
- ip,
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
- ip,
180
+ host,
181
181
  port,
182
182
  })
183
183
  if (