@jsenv/core 35.0.3 → 35.0.5

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 (117) hide show
  1. package/dist/html/explorer.html +107 -107
  2. package/dist/js/new_stylesheet.js +3 -0
  3. package/dist/js/s.js.map +3 -3
  4. package/package.json +2 -2
  5. package/src/build/build.js +589 -587
  6. package/src/build/build_urls_generator.js +44 -44
  7. package/src/build/graph_utils.js +14 -14
  8. package/src/build/jsenv_plugin_line_break_normalization.js +6 -6
  9. package/src/build/line_break_unix.js +11 -11
  10. package/src/build/start_build_server.js +37 -37
  11. package/src/build/version_generator.js +7 -7
  12. package/src/build/version_mappings_injection.js +23 -23
  13. package/src/dev/file_service.js +132 -132
  14. package/src/dev/start_dev_server.js +56 -56
  15. package/src/dev/user_agent.js +8 -8
  16. package/src/helpers/basic_fetch.js +24 -24
  17. package/src/helpers/command/command.js +28 -28
  18. package/src/helpers/lookup_package_directory.js +19 -16
  19. package/src/helpers/ping_server.js +17 -17
  20. package/src/helpers/require_from_jsenv.js +2 -2
  21. package/src/helpers/watch_source_files.js +9 -9
  22. package/src/helpers/web_url_converter.js +10 -10
  23. package/src/helpers/worker_reload.js +27 -27
  24. package/src/kitchen/compat/features_compatibility.js +1 -1
  25. package/src/kitchen/compat/runtime_compat.js +26 -24
  26. package/src/kitchen/errors.js +75 -75
  27. package/src/kitchen/fetched_content_compliance.js +8 -8
  28. package/src/kitchen/kitchen.js +251 -250
  29. package/src/kitchen/url_graph/sort_by_dependencies.js +17 -17
  30. package/src/kitchen/url_graph/url_graph_loader.js +30 -30
  31. package/src/kitchen/url_graph/url_graph_report.js +57 -57
  32. package/src/kitchen/url_graph/url_info_transformations.js +77 -77
  33. package/src/kitchen/url_graph.js +121 -121
  34. package/src/kitchen/url_specifier_encoding.js +21 -21
  35. package/src/kitchen/web_workers.js +5 -5
  36. package/src/main.js +3 -3
  37. package/src/plugins/autoreload/client/autoreload.js +96 -96
  38. package/src/plugins/autoreload/client/reload.js +56 -56
  39. package/src/plugins/autoreload/client/url_helpers.js +13 -13
  40. package/src/plugins/autoreload/jsenv_plugin_autoreload.js +5 -5
  41. package/src/plugins/autoreload/jsenv_plugin_autoreload_client.js +9 -9
  42. package/src/plugins/autoreload/jsenv_plugin_autoreload_server.js +61 -60
  43. package/src/plugins/autoreload/jsenv_plugin_hmr.js +15 -15
  44. package/src/plugins/cache_control/jsenv_plugin_cache_control.js +5 -5
  45. package/src/plugins/commonjs_globals/jsenv_plugin_commonjs_globals.js +57 -57
  46. package/src/plugins/explorer/client/explorer.html +107 -107
  47. package/src/plugins/explorer/jsenv_plugin_explorer.js +20 -20
  48. package/src/plugins/file_urls/jsenv_plugin_file_urls.js +60 -60
  49. package/src/plugins/global_scenarios/jsenv_plugin_global_scenarios.js +5 -5
  50. package/src/plugins/http_urls/jsenv_plugin_http_urls.js +3 -3
  51. package/src/plugins/import_meta_hot/babel_plugin_metadata_import_meta_hot.js +35 -35
  52. package/src/plugins/import_meta_hot/client/import_meta_hot.js +26 -26
  53. package/src/plugins/import_meta_hot/html_hot_dependencies.js +43 -43
  54. package/src/plugins/import_meta_hot/jsenv_plugin_import_meta_hot.js +44 -40
  55. package/src/plugins/import_meta_scenarios/jsenv_plugin_import_meta_scenarios.js +35 -35
  56. package/src/plugins/import_meta_url/client/import_meta_url_browser.js +21 -21
  57. package/src/plugins/import_meta_url/client/import_meta_url_commonjs.mjs +3 -3
  58. package/src/plugins/importmap/jsenv_plugin_importmap.js +54 -54
  59. package/src/plugins/inline_content_analysis/client/inline_content.js +3 -3
  60. package/src/plugins/inline_content_analysis/jsenv_plugin_data_urls.js +26 -26
  61. package/src/plugins/inline_content_analysis/jsenv_plugin_html_inline_content_analysis.js +47 -47
  62. package/src/plugins/inline_content_analysis/jsenv_plugin_inline_content_analysis.js +9 -9
  63. package/src/plugins/inline_content_analysis/jsenv_plugin_js_inline_content_analysis.js +101 -101
  64. package/src/plugins/inlining/jsenv_plugin_inlining.js +9 -9
  65. package/src/plugins/inlining/jsenv_plugin_inlining_as_data_url.js +11 -11
  66. package/src/plugins/inlining/jsenv_plugin_inlining_into_html.js +48 -46
  67. package/src/plugins/node_runtime/jsenv_plugin_node_runtime.js +4 -4
  68. package/src/plugins/plugin_controller.js +124 -124
  69. package/src/plugins/plugins.js +27 -27
  70. package/src/plugins/ribbon/client/ribbon.js +6 -6
  71. package/src/plugins/ribbon/jsenv_plugin_ribbon.js +15 -15
  72. package/src/plugins/server_events/client/connection_manager.js +52 -52
  73. package/src/plugins/server_events/client/event_source_connection.js +36 -36
  74. package/src/plugins/server_events/client/events_manager.js +37 -37
  75. package/src/plugins/server_events/client/server_events_client.js +7 -7
  76. package/src/plugins/server_events/client/web_socket_connection.js +39 -39
  77. package/src/plugins/server_events/jsenv_plugin_server_events_client_injection.js +9 -9
  78. package/src/plugins/server_events/server_events_dispatcher.js +43 -43
  79. package/src/plugins/supervisor/client/supervisor.js +455 -450
  80. package/src/plugins/supervisor/html_supervisor_injection.js +64 -62
  81. package/src/plugins/supervisor/js_supervisor_injection.js +67 -67
  82. package/src/plugins/supervisor/jsenv_plugin_supervisor.js +54 -51
  83. package/src/plugins/transpilation/as_js_module/convert_js_classic_to_js_module.js +13 -13
  84. package/src/plugins/transpilation/as_js_module/jsenv_plugin_as_js_module.js +19 -19
  85. package/src/plugins/transpilation/babel/global_this/babel_plugin_global_this_as_jsenv_import.js +10 -10
  86. package/src/plugins/transpilation/babel/global_this/client/global_this.js +8 -8
  87. package/src/plugins/transpilation/babel/helpers/babel_plugin_babel_helpers_as_jsenv_imports.js +16 -16
  88. package/src/plugins/transpilation/babel/helpers/babel_plugin_structure.js +36 -36
  89. package/src/plugins/transpilation/babel/helpers/babel_plugins_compatibility.js +3 -3
  90. package/src/plugins/transpilation/babel/jsenv_plugin_babel.js +24 -24
  91. package/src/plugins/transpilation/babel/new_stylesheet/babel_plugin_new_stylesheet_as_jsenv_import.js +44 -44
  92. package/src/plugins/transpilation/babel/new_stylesheet/client/new_stylesheet.js +166 -166
  93. package/src/plugins/transpilation/babel/regenerator_runtime/babel_plugin_regenerator_runtime_as_jsenv_import.js +10 -10
  94. package/src/plugins/transpilation/babel/require_babel_plugin.js +6 -6
  95. package/src/plugins/transpilation/css/jsenv_plugin_css_transpilation.js +20 -20
  96. package/src/plugins/transpilation/import_assertions/jsenv_plugin_import_assertions.js +62 -62
  97. package/src/plugins/transpilation/js_module_fallback/client/s.js +214 -209
  98. package/src/plugins/transpilation/js_module_fallback/convert_js_module_to_js_classic.js +45 -45
  99. package/src/plugins/transpilation/js_module_fallback/helpers/babel_plugin_transform_import_meta_resolve.js +6 -6
  100. package/src/plugins/transpilation/js_module_fallback/helpers/babel_plugin_transform_import_meta_url.js +17 -17
  101. package/src/plugins/transpilation/js_module_fallback/helpers-string.js +1 -1
  102. package/src/plugins/transpilation/js_module_fallback/jsenv_plugin_js_module_conversion.js +32 -32
  103. package/src/plugins/transpilation/js_module_fallback/jsenv_plugin_js_module_fallback.js +17 -17
  104. package/src/plugins/transpilation/js_module_fallback/jsenv_plugin_js_module_fallback_inside_html.js +63 -63
  105. package/src/plugins/transpilation/js_module_fallback/jsenv_plugin_js_module_fallback_on_workers.js +15 -15
  106. package/src/plugins/transpilation/jsenv_plugin_import_meta_resolve.js +20 -20
  107. package/src/plugins/transpilation/jsenv_plugin_top_level_await.js +23 -23
  108. package/src/plugins/transpilation/jsenv_plugin_transpilation.js +11 -11
  109. package/src/plugins/url_analysis/css/css_urls.js +12 -12
  110. package/src/plugins/url_analysis/html/html_urls.js +85 -85
  111. package/src/plugins/url_analysis/js/js_urls.js +16 -16
  112. package/src/plugins/url_analysis/jsenv_plugin_reference_expected_types.js +16 -16
  113. package/src/plugins/url_analysis/jsenv_plugin_url_analysis.js +40 -40
  114. package/src/plugins/url_analysis/webmanifest/webmanifest_urls.js +12 -12
  115. package/src/plugins/url_resolution/jsenv_plugin_url_resolution.js +35 -35
  116. package/src/plugins/url_resolution/node_esm_resolver.js +26 -26
  117. package/src/plugins/url_version/jsenv_plugin_url_version.js +11 -11
@@ -5,23 +5,23 @@ import {
5
5
  stringifyUrlSite,
6
6
  normalizeUrl,
7
7
  setUrlFilename,
8
- } from "@jsenv/urls"
9
- import { writeFileSync, ensureWindowsDriveLetter } from "@jsenv/filesystem"
10
- import { createLogger, createDetailedMessage, ANSI } from "@jsenv/log"
11
- import { CONTENT_TYPE } from "@jsenv/utils/src/content_type/content_type.js"
12
-
13
- import { createPluginController } from "../plugins/plugin_controller.js"
14
- import { urlSpecifierEncoding } from "./url_specifier_encoding.js"
15
- import { createUrlInfoTransformer } from "./url_graph/url_info_transformations.js"
16
- import { RUNTIME_COMPAT } from "./compat/runtime_compat.js"
8
+ } from "@jsenv/urls";
9
+ import { writeFileSync, ensureWindowsDriveLetter } from "@jsenv/filesystem";
10
+ import { createLogger, createDetailedMessage, ANSI } from "@jsenv/log";
11
+ import { CONTENT_TYPE } from "@jsenv/utils/src/content_type/content_type.js";
12
+
13
+ import { createPluginController } from "../plugins/plugin_controller.js";
14
+ import { urlSpecifierEncoding } from "./url_specifier_encoding.js";
15
+ import { createUrlInfoTransformer } from "./url_graph/url_info_transformations.js";
16
+ import { RUNTIME_COMPAT } from "./compat/runtime_compat.js";
17
17
  import {
18
18
  createResolveUrlError,
19
19
  createFetchUrlContentError,
20
20
  createTransformUrlContentError,
21
21
  createFinalizeUrlContentError,
22
- } from "./errors.js"
23
- import { assertFetchedContentCompliance } from "./fetched_content_compliance.js"
24
- import { isWebWorkerEntryPointReference } from "./web_workers.js"
22
+ } from "./errors.js";
23
+ import { assertFetchedContentCompliance } from "./fetched_content_compliance.js";
24
+ import { isWebWorkerEntryPointReference } from "./web_workers.js";
25
25
 
26
26
  export const createKitchen = ({
27
27
  signal,
@@ -44,7 +44,7 @@ export const createKitchen = ({
44
44
  sourcemapsSourcesRelative,
45
45
  outDirectoryUrl,
46
46
  }) => {
47
- const logger = createLogger({ logLevel })
47
+ const logger = createLogger({ logLevel });
48
48
  const kitchenContext = {
49
49
  signal,
50
50
  logger,
@@ -56,26 +56,26 @@ export const createKitchen = ({
56
56
  clientRuntimeCompat,
57
57
  systemJsTranspilation,
58
58
  isSupportedOnCurrentClients: (feature) => {
59
- return RUNTIME_COMPAT.isSupported(clientRuntimeCompat, feature)
59
+ return RUNTIME_COMPAT.isSupported(clientRuntimeCompat, feature);
60
60
  },
61
61
  isSupportedOnFutureClients: (feature) => {
62
- return RUNTIME_COMPAT.isSupported(runtimeCompat, feature)
62
+ return RUNTIME_COMPAT.isSupported(runtimeCompat, feature);
63
63
  },
64
64
  minification,
65
65
  sourcemaps,
66
66
  outDirectoryUrl,
67
- }
68
- const pluginController = createPluginController(kitchenContext)
67
+ };
68
+ const pluginController = createPluginController(kitchenContext);
69
69
  const pushPlugins = (plugins) => {
70
70
  plugins.forEach((pluginEntry) => {
71
71
  if (Array.isArray(pluginEntry)) {
72
- pushPlugins(pluginEntry)
72
+ pushPlugins(pluginEntry);
73
73
  } else {
74
- pluginController.pushPlugin(pluginEntry)
74
+ pluginController.pushPlugin(pluginEntry);
75
75
  }
76
- })
77
- }
78
- pushPlugins(plugins)
76
+ });
77
+ };
78
+ pushPlugins(plugins);
79
79
 
80
80
  const createReference = ({
81
81
  data = {},
@@ -114,9 +114,9 @@ export const createKitchen = ({
114
114
  }) => {
115
115
  if (typeof specifier !== "string") {
116
116
  if (specifier instanceof URL) {
117
- specifier = specifier.href
117
+ specifier = specifier.href;
118
118
  } else {
119
- throw new TypeError(`"specifier" must be a string, got ${specifier}`)
119
+ throw new TypeError(`"specifier" must be a string, got ${specifier}`);
120
120
  }
121
121
  }
122
122
  const reference = {
@@ -166,44 +166,44 @@ export const createKitchen = ({
166
166
  leadsToADirectory,
167
167
  mutation: null,
168
168
  debug,
169
- }
169
+ };
170
170
  // Object.preventExtensions(reference) // useful to ensure all properties are declared here
171
- return reference
172
- }
171
+ return reference;
172
+ };
173
173
  const updateReference = (reference, newReference) => {
174
- reference.next = newReference
175
- newReference.original = reference.original || reference
174
+ reference.next = newReference;
175
+ newReference.original = reference.original || reference;
176
176
 
177
- newReference.prev = reference
178
- }
177
+ newReference.prev = reference;
178
+ };
179
179
  const resolveReference = (reference, context = kitchenContext) => {
180
180
  const referenceContext = {
181
181
  ...context,
182
182
  resolveReference: (reference, context = referenceContext) =>
183
183
  resolveReference(reference, context),
184
- }
184
+ };
185
185
  try {
186
186
  let resolvedUrl = pluginController.callHooksUntil(
187
187
  "resolveUrl",
188
188
  reference,
189
189
  referenceContext,
190
- )
190
+ );
191
191
  if (!resolvedUrl) {
192
- throw new Error(`NO_RESOLVE`)
192
+ throw new Error(`NO_RESOLVE`);
193
193
  }
194
194
  if (resolvedUrl.includes("?debug")) {
195
- reference.debug = true
195
+ reference.debug = true;
196
196
  }
197
- resolvedUrl = normalizeUrl(resolvedUrl)
198
- let referencedUrlObject
199
- let searchParams
197
+ resolvedUrl = normalizeUrl(resolvedUrl);
198
+ let referencedUrlObject;
199
+ let searchParams;
200
200
  const onReferenceUrlChange = (referenceUrl) => {
201
- referencedUrlObject = new URL(referenceUrl)
202
- searchParams = referencedUrlObject.searchParams
203
- reference.url = referenceUrl
204
- reference.searchParams = searchParams
205
- }
206
- onReferenceUrlChange(resolvedUrl)
201
+ referencedUrlObject = new URL(referenceUrl);
202
+ searchParams = referencedUrlObject.searchParams;
203
+ reference.url = referenceUrl;
204
+ reference.searchParams = searchParams;
205
+ };
206
+ onReferenceUrlChange(resolvedUrl);
207
207
 
208
208
  if (reference.debug) {
209
209
  logger.debug(`url resolved by "${
@@ -211,16 +211,16 @@ export const createKitchen = ({
211
211
  }"
212
212
  ${ANSI.color(reference.specifier, ANSI.GREY)} ->
213
213
  ${ANSI.color(reference.url, ANSI.YELLOW)}
214
- `)
214
+ `);
215
215
  }
216
216
  pluginController.callHooks(
217
217
  "redirectUrl",
218
218
  reference,
219
219
  referenceContext,
220
220
  (returnValue, plugin) => {
221
- const normalizedReturnValue = normalizeUrl(returnValue)
221
+ const normalizedReturnValue = normalizeUrl(returnValue);
222
222
  if (normalizedReturnValue === reference.url) {
223
- return
223
+ return;
224
224
  }
225
225
  if (reference.debug) {
226
226
  logger.debug(
@@ -228,17 +228,17 @@ ${ANSI.color(reference.url, ANSI.YELLOW)}
228
228
  ${ANSI.color(reference.url, ANSI.GREY)} ->
229
229
  ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
230
230
  `,
231
- )
231
+ );
232
232
  }
233
- const prevReference = { ...reference }
234
- updateReference(prevReference, reference)
235
- onReferenceUrlChange(normalizedReturnValue)
233
+ const prevReference = { ...reference };
234
+ updateReference(prevReference, reference);
235
+ onReferenceUrlChange(normalizedReturnValue);
236
236
  },
237
- )
238
- reference.generatedUrl = reference.url
237
+ );
238
+ reference.generatedUrl = reference.url;
239
239
 
240
- const urlInfo = urlGraph.reuseOrCreateUrlInfo(reference.url)
241
- applyReferenceEffectsOnUrlInfo(reference, urlInfo, context)
240
+ const urlInfo = urlGraph.reuseOrCreateUrlInfo(reference.url);
241
+ applyReferenceEffectsOnUrlInfo(reference, urlInfo, context);
242
242
 
243
243
  // This hook must touch reference.generatedUrl, NOT reference.url
244
244
  // And this is because this hook inject query params used to:
@@ -252,28 +252,28 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
252
252
  referenceContext,
253
253
  (returnValue) => {
254
254
  Object.keys(returnValue).forEach((key) => {
255
- searchParams.set(key, returnValue[key])
256
- })
257
- reference.generatedUrl = normalizeUrl(referencedUrlObject.href)
255
+ searchParams.set(key, returnValue[key]);
256
+ });
257
+ reference.generatedUrl = normalizeUrl(referencedUrlObject.href);
258
258
  },
259
- )
259
+ );
260
260
  const returnValue = pluginController.callHooksUntil(
261
261
  "formatUrl",
262
262
  reference,
263
263
  referenceContext,
264
- )
265
- reference.generatedSpecifier = returnValue || reference.generatedUrl
266
- reference.generatedSpecifier = urlSpecifierEncoding.encode(reference)
267
- return [reference, urlInfo]
264
+ );
265
+ reference.generatedSpecifier = returnValue || reference.generatedUrl;
266
+ reference.generatedSpecifier = urlSpecifierEncoding.encode(reference);
267
+ return [reference, urlInfo];
268
268
  } catch (error) {
269
269
  throw createResolveUrlError({
270
270
  pluginController,
271
271
  reference,
272
272
  error,
273
- })
273
+ });
274
274
  }
275
- }
276
- kitchenContext.resolveReference = resolveReference
275
+ };
276
+ kitchenContext.resolveReference = resolveReference;
277
277
 
278
278
  const urlInfoTransformer = createUrlInfoTransformer({
279
279
  logger,
@@ -296,9 +296,9 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
296
296
  parentUrl: urlInfo.url,
297
297
  specifier,
298
298
  }),
299
- )
300
- sourcemapUrlInfo.type = "sourcemap"
301
- return [sourcemapReference, sourcemapUrlInfo]
299
+ );
300
+ sourcemapUrlInfo.type = "sourcemap";
301
+ return [sourcemapReference, sourcemapUrlInfo];
302
302
  },
303
303
  foundSourcemap: ({
304
304
  urlInfo,
@@ -312,7 +312,7 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
312
312
  url: urlInfo.url,
313
313
  line: specifierLine,
314
314
  column: specifierColumn,
315
- })
315
+ });
316
316
  const [sourcemapReference, sourcemapUrlInfo] = resolveReference(
317
317
  createReference({
318
318
  trace: traceFromUrlSite(sourcemapUrlSite),
@@ -323,14 +323,14 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
323
323
  specifierLine,
324
324
  specifierColumn,
325
325
  }),
326
- )
326
+ );
327
327
  if (sourcemapReference.isInline) {
328
- sourcemapUrlInfo.isInline = true
328
+ sourcemapUrlInfo.isInline = true;
329
329
  }
330
- sourcemapUrlInfo.type = "sourcemap"
331
- return [sourcemapReference, sourcemapUrlInfo]
330
+ sourcemapUrlInfo.type = "sourcemap";
331
+ return [sourcemapReference, sourcemapUrlInfo];
332
332
  },
333
- })
333
+ });
334
334
 
335
335
  const fetchUrlContent = async (
336
336
  urlInfo,
@@ -342,7 +342,7 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
342
342
  "fetchUrlContent",
343
343
  urlInfo,
344
344
  contextDuringFetch,
345
- )
345
+ );
346
346
  if (!fetchUrlContentReturnValue) {
347
347
  logger.warn(
348
348
  createDetailedMessage(
@@ -352,8 +352,8 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
352
352
  "url reference trace": reference.trace.message,
353
353
  },
354
354
  ),
355
- )
356
- return
355
+ );
356
+ return;
357
357
  }
358
358
  let {
359
359
  content,
@@ -370,83 +370,84 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
370
370
  headers = {},
371
371
  body,
372
372
  isEntryPoint,
373
- } = fetchUrlContentReturnValue
373
+ } = fetchUrlContentReturnValue;
374
374
  if (status !== 200) {
375
- throw new Error(`unexpected status, ${status}`)
375
+ throw new Error(`unexpected status, ${status}`);
376
376
  }
377
377
  if (content === undefined) {
378
- content = body
378
+ content = body;
379
379
  }
380
380
  if (contentType === undefined) {
381
- contentType = headers["content-type"] || "application/octet-stream"
381
+ contentType = headers["content-type"] || "application/octet-stream";
382
382
  }
383
- urlInfo.contentType = contentType
384
- urlInfo.headers = headers
385
- urlInfo.type = type || reference.expectedType || inferUrlInfoType(urlInfo)
383
+ urlInfo.contentType = contentType;
384
+ urlInfo.headers = headers;
385
+ urlInfo.type =
386
+ type || reference.expectedType || inferUrlInfoType(urlInfo);
386
387
  urlInfo.subtype =
387
- subtype || reference.expectedSubtype || urlInfo.subtypeHint || ""
388
+ subtype || reference.expectedSubtype || urlInfo.subtypeHint || "";
388
389
  // during build urls info are reused and load returns originalUrl/originalContent
389
- urlInfo.originalUrl = originalUrl || urlInfo.originalUrl
390
+ urlInfo.originalUrl = originalUrl || urlInfo.originalUrl;
390
391
  if (originalContent !== urlInfo.originalContent) {
391
- urlInfo.originalContentEtag = undefined // set by "initTransformations"
392
+ urlInfo.originalContentEtag = undefined; // set by "initTransformations"
392
393
  }
393
394
  if (content !== urlInfo.content) {
394
- urlInfo.contentEtag = undefined // set by "applyFinalTransformations"
395
+ urlInfo.contentEtag = undefined; // set by "applyFinalTransformations"
395
396
  }
396
- urlInfo.originalContent = originalContent
397
- urlInfo.content = content
398
- urlInfo.sourcemap = sourcemap
397
+ urlInfo.originalContent = originalContent;
398
+ urlInfo.content = content;
399
+ urlInfo.sourcemap = sourcemap;
399
400
  if (data) {
400
- Object.assign(urlInfo.data, data)
401
+ Object.assign(urlInfo.data, data);
401
402
  }
402
403
  if (typeof isEntryPoint === "boolean") {
403
- urlInfo.isEntryPoint = isEntryPoint
404
+ urlInfo.isEntryPoint = isEntryPoint;
404
405
  }
405
406
  if (filename) {
406
- urlInfo.filename = filename
407
+ urlInfo.filename = filename;
407
408
  }
408
409
  assertFetchedContentCompliance({
409
410
  reference,
410
411
  urlInfo,
411
- })
412
+ });
412
413
  } catch (error) {
413
414
  throw createFetchUrlContentError({
414
415
  pluginController,
415
416
  urlInfo,
416
417
  reference,
417
418
  error,
418
- })
419
+ });
419
420
  }
420
421
  urlInfo.generatedUrl = determineFileUrlForOutDirectory({
421
422
  urlInfo,
422
423
  context: contextDuringFetch,
423
- })
424
- await urlInfoTransformer.initTransformations(urlInfo, contextDuringFetch)
425
- }
426
- kitchenContext.fetchUrlContent = fetchUrlContent
424
+ });
425
+ await urlInfoTransformer.initTransformations(urlInfo, contextDuringFetch);
426
+ };
427
+ kitchenContext.fetchUrlContent = fetchUrlContent;
427
428
 
428
429
  const _cook = async (urlInfo, dishContext) => {
429
430
  const context = {
430
431
  ...kitchenContext,
431
432
  ...dishContext,
432
- }
433
- const { cookDuringCook = cook } = dishContext
433
+ };
434
+ const { cookDuringCook = cook } = dishContext;
434
435
  context.cook = (urlInfo, nestedDishContext) => {
435
436
  return cookDuringCook(urlInfo, {
436
437
  ...dishContext,
437
438
  ...nestedDishContext,
438
- })
439
- }
439
+ });
440
+ };
440
441
  context.fetchUrlContent = (urlInfo, { reference }) => {
441
442
  return fetchUrlContent(urlInfo, {
442
443
  reference,
443
444
  contextDuringFetch: context,
444
- })
445
- }
445
+ });
446
+ };
446
447
 
447
448
  if (urlInfo.shouldHandle) {
448
449
  // references
449
- const references = []
450
+ const references = [];
450
451
  context.referenceUtils = {
451
452
  _references: references,
452
453
  find: (predicate) => references.find(predicate),
@@ -458,9 +459,9 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
458
459
  ...props,
459
460
  }),
460
461
  context,
461
- )
462
- references.push(reference)
463
- return [reference, referencedUrlInfo]
462
+ );
463
+ references.push(reference);
464
+ return [reference, referencedUrlInfo];
464
465
  },
465
466
  found: ({ trace, ...rest }) => {
466
467
  if (trace === undefined) {
@@ -471,13 +472,13 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
471
472
  line: rest.specifierLine,
472
473
  column: rest.specifierColumn,
473
474
  }),
474
- )
475
+ );
475
476
  }
476
477
  // console.log(trace.message)
477
478
  return context.referenceUtils.add({
478
479
  trace,
479
480
  ...rest,
480
- })
481
+ });
481
482
  },
482
483
  foundInline: ({
483
484
  isOriginalPosition,
@@ -487,10 +488,10 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
487
488
  }) => {
488
489
  const parentUrl = isOriginalPosition
489
490
  ? urlInfo.url
490
- : urlInfo.generatedUrl
491
+ : urlInfo.generatedUrl;
491
492
  const parentContent = isOriginalPosition
492
493
  ? urlInfo.originalContent
493
- : urlInfo.content
494
+ : urlInfo.content;
494
495
  return context.referenceUtils.add({
495
496
  trace: traceFromUrlSite({
496
497
  url: parentUrl,
@@ -503,12 +504,12 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
503
504
  specifierColumn,
504
505
  isInline: true,
505
506
  ...rest,
506
- })
507
+ });
507
508
  },
508
509
  update: (currentReference, newReferenceParams) => {
509
- const index = references.indexOf(currentReference)
510
+ const index = references.indexOf(currentReference);
510
511
  if (index === -1) {
511
- throw new Error(`reference do not exists`)
512
+ throw new Error(`reference do not exists`);
512
513
  }
513
514
  const [newReference, newUrlInfo] = resolveReference(
514
515
  createReference({
@@ -516,35 +517,35 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
516
517
  ...newReferenceParams,
517
518
  }),
518
519
  context,
519
- )
520
- updateReference(currentReference, newReference)
521
- references[index] = newReference
520
+ );
521
+ updateReference(currentReference, newReference);
522
+ references[index] = newReference;
522
523
  const currentUrlInfo = context.urlGraph.getUrlInfo(
523
524
  currentReference.url,
524
- )
525
+ );
525
526
  if (
526
527
  currentUrlInfo &&
527
528
  currentUrlInfo !== newUrlInfo &&
528
529
  currentUrlInfo.dependents.size === 0
529
530
  ) {
530
- context.urlGraph.deleteUrlInfo(currentReference.url)
531
+ context.urlGraph.deleteUrlInfo(currentReference.url);
531
532
  }
532
- return [newReference, newUrlInfo]
533
+ return [newReference, newUrlInfo];
533
534
  },
534
535
  inject: ({ trace, ...rest }) => {
535
536
  if (trace === undefined) {
536
- const { url, line, column } = getCallerPosition()
537
+ const { url, line, column } = getCallerPosition();
537
538
  trace = traceFromUrlSite({
538
539
  url,
539
540
  line,
540
541
  column,
541
- })
542
+ });
542
543
  }
543
544
  return context.referenceUtils.add({
544
545
  trace,
545
546
  injected: true,
546
547
  ...rest,
547
- })
548
+ });
548
549
  },
549
550
  becomesInline: (
550
551
  reference,
@@ -559,10 +560,10 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
559
560
  ) => {
560
561
  const parentUrl = isOriginalPosition
561
562
  ? urlInfo.url
562
- : urlInfo.generatedUrl
563
+ : urlInfo.generatedUrl;
563
564
  const parentContent = isOriginalPosition
564
565
  ? urlInfo.originalContent
565
- : urlInfo.content
566
+ : urlInfo.content;
566
567
  return context.referenceUtils.update(reference, {
567
568
  trace: traceFromUrlSite({
568
569
  url: parentUrl,
@@ -577,18 +578,18 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
577
578
  specifierColumn,
578
579
  contentType,
579
580
  content,
580
- })
581
+ });
581
582
  },
582
583
  becomesExternal: () => {
583
- throw new Error("not implemented yet")
584
+ throw new Error("not implemented yet");
584
585
  },
585
- }
586
+ };
586
587
 
587
588
  // "fetchUrlContent" hook
588
589
  await fetchUrlContent(urlInfo, {
589
590
  reference: context.reference,
590
591
  contextDuringFetch: context,
591
- })
592
+ });
592
593
 
593
594
  // "transform" hook
594
595
  try {
@@ -600,23 +601,23 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
600
601
  await urlInfoTransformer.applyIntermediateTransformations(
601
602
  urlInfo,
602
603
  transformReturnValue,
603
- )
604
+ );
604
605
  },
605
- )
606
+ );
606
607
  } catch (error) {
607
- urlGraph.updateReferences(urlInfo, references) // ensure reference are updated even in case of error
608
+ urlGraph.updateReferences(urlInfo, references); // ensure reference are updated even in case of error
608
609
  const transformError = createTransformUrlContentError({
609
610
  pluginController,
610
611
  reference: context.reference,
611
612
  urlInfo,
612
613
  error,
613
- })
614
- urlInfo.error = transformError
615
- throw transformError
614
+ });
615
+ urlInfo.error = transformError;
616
+ throw transformError;
616
617
  }
617
618
  // after "transform" all references from originalContent
618
619
  // and the one injected by plugin are known
619
- urlGraph.updateReferences(urlInfo, references)
620
+ urlGraph.updateReferences(urlInfo, references);
620
621
 
621
622
  // "finalize" hook
622
623
  try {
@@ -624,18 +625,18 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
624
625
  "finalizeUrlContent",
625
626
  urlInfo,
626
627
  context,
627
- )
628
+ );
628
629
  await urlInfoTransformer.applyFinalTransformations(
629
630
  urlInfo,
630
631
  finalizeReturnValue,
631
- )
632
+ );
632
633
  } catch (error) {
633
634
  throw createFinalizeUrlContentError({
634
635
  pluginController,
635
636
  reference: context.reference,
636
637
  urlInfo,
637
638
  error,
638
- })
639
+ });
639
640
  }
640
641
  }
641
642
 
@@ -650,27 +651,27 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
650
651
  ({ prunedUrlInfos, firstUrlInfo }) => {
651
652
  const pruned = prunedUrlInfos.find(
652
653
  (prunedUrlInfo) => prunedUrlInfo.url === urlInfo.url,
653
- )
654
+ );
654
655
  if (pruned) {
655
- removePrunedCallback()
656
- cookedReturnValue(firstUrlInfo)
656
+ removePrunedCallback();
657
+ cookedReturnValue(firstUrlInfo);
657
658
  }
658
659
  },
659
- )
660
+ );
660
661
  }
661
662
  },
662
- )
663
- }
663
+ );
664
+ };
664
665
  const cook = memoizeCook(async (urlInfo, context) => {
665
666
  if (!outDirectoryUrl) {
666
- await _cook(urlInfo, context)
667
- return
667
+ await _cook(urlInfo, context);
668
+ return;
668
669
  }
669
670
  // writing result inside ".jsenv" directory (debug purposes)
670
671
  try {
671
- await _cook(urlInfo, context)
672
+ await _cook(urlInfo, context);
672
673
  } finally {
673
- const { generatedUrl } = urlInfo
674
+ const { generatedUrl } = urlInfo;
674
675
  if (generatedUrl && generatedUrl.startsWith("file:")) {
675
676
  if (urlInfo.type === "directory") {
676
677
  // no need to write the directory
@@ -679,29 +680,29 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
679
680
  // (error hapenning before urlInfo.content can be set, or 404 for instance)
680
681
  // in that case we can't write anything
681
682
  } else {
682
- let contentIsInlined = urlInfo.isInline
683
+ let contentIsInlined = urlInfo.isInline;
683
684
  if (
684
685
  contentIsInlined &&
685
686
  context.supervisor &&
686
687
  urlGraph.getUrlInfo(urlInfo.inlineUrlSite.url).type === "html"
687
688
  ) {
688
- contentIsInlined = false
689
+ contentIsInlined = false;
689
690
  }
690
691
  if (!contentIsInlined) {
691
- writeFileSync(new URL(generatedUrl), urlInfo.content)
692
+ writeFileSync(new URL(generatedUrl), urlInfo.content);
692
693
  }
693
- const { sourcemapGeneratedUrl, sourcemap } = urlInfo
694
+ const { sourcemapGeneratedUrl, sourcemap } = urlInfo;
694
695
  if (sourcemapGeneratedUrl && sourcemap) {
695
696
  writeFileSync(
696
697
  new URL(sourcemapGeneratedUrl),
697
698
  JSON.stringify(sourcemap, null, " "),
698
- )
699
+ );
699
700
  }
700
701
  }
701
702
  }
702
703
  }
703
- })
704
- kitchenContext.cook = cook
704
+ });
705
+ kitchenContext.cook = cook;
705
706
 
706
707
  const prepareEntryPoint = (params) => {
707
708
  return resolveReference(
@@ -709,14 +710,14 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
709
710
  ...params,
710
711
  isEntryPoint: true,
711
712
  }),
712
- )
713
- }
714
- kitchenContext.prepareEntryPoint = prepareEntryPoint
713
+ );
714
+ };
715
+ kitchenContext.prepareEntryPoint = prepareEntryPoint;
715
716
 
716
717
  const injectReference = (params) => {
717
- return resolveReference(createReference(params))
718
- }
719
- kitchenContext.injectReference = injectReference
718
+ return resolveReference(createReference(params));
719
+ };
720
+ kitchenContext.injectReference = injectReference;
720
721
 
721
722
  const getWithoutSearchParam = ({
722
723
  urlInfo,
@@ -725,14 +726,14 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
725
726
  searchParam,
726
727
  expectedType,
727
728
  }) => {
728
- const urlObject = new URL(urlInfo.url)
729
- const { searchParams } = urlObject
729
+ const urlObject = new URL(urlInfo.url);
730
+ const { searchParams } = urlObject;
730
731
  if (!searchParams.has(searchParam)) {
731
- return [null, null]
732
+ return [null, null];
732
733
  }
733
- searchParams.delete(searchParam)
734
+ searchParams.delete(searchParam);
734
735
  const originalRef =
735
- reference || context.reference.original || context.reference
736
+ reference || context.reference.original || context.reference;
736
737
  const referenceWithoutSearchParam = {
737
738
  ...originalRef,
738
739
  original: originalRef,
@@ -746,20 +747,20 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
746
747
  generatedSpecifier: null,
747
748
  generatedUrl: null,
748
749
  filename: null,
749
- }
750
+ };
750
751
  const urlInfoWithoutSearchParam = context.urlGraph.reuseOrCreateUrlInfo(
751
752
  referenceWithoutSearchParam.url,
752
- )
753
+ );
753
754
  if (urlInfoWithoutSearchParam.originalUrl === undefined) {
754
755
  applyReferenceEffectsOnUrlInfo(
755
756
  referenceWithoutSearchParam,
756
757
  urlInfoWithoutSearchParam,
757
758
  context,
758
- )
759
+ );
759
760
  }
760
- return [referenceWithoutSearchParam, urlInfoWithoutSearchParam]
761
- }
762
- kitchenContext.getWithoutSearchParam = getWithoutSearchParam
761
+ return [referenceWithoutSearchParam, urlInfoWithoutSearchParam];
762
+ };
763
+ kitchenContext.getWithoutSearchParam = getWithoutSearchParam;
763
764
 
764
765
  return {
765
766
  pluginController,
@@ -769,8 +770,8 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
769
770
  cook,
770
771
  createReference,
771
772
  injectReference,
772
- }
773
- }
773
+ };
774
+ };
774
775
 
775
776
  // "formatReferencedUrl" can be async BUT this is an exception
776
777
  // for most cases it will be sync. We want to favor the sync signature to keep things simpler
@@ -782,42 +783,42 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
782
783
  const readGeneratedSpecifier = (reference) => {
783
784
  if (reference.generatedSpecifier.then) {
784
785
  return reference.generatedSpecifier.then((value) => {
785
- reference.generatedSpecifier = value
786
- return value
787
- })
786
+ reference.generatedSpecifier = value;
787
+ return value;
788
+ });
788
789
  }
789
- return reference.generatedSpecifier
790
- }
790
+ return reference.generatedSpecifier;
791
+ };
791
792
 
792
793
  const memoizeCook = (cook) => {
793
- const pendingDishes = new Map()
794
+ const pendingDishes = new Map();
794
795
  return async (urlInfo, context) => {
795
- const { url, modifiedTimestamp } = urlInfo
796
- const pendingDish = pendingDishes.get(url)
796
+ const { url, modifiedTimestamp } = urlInfo;
797
+ const pendingDish = pendingDishes.get(url);
797
798
  if (pendingDish) {
798
799
  if (!modifiedTimestamp) {
799
- await pendingDish.promise
800
- return
800
+ await pendingDish.promise;
801
+ return;
801
802
  }
802
803
  if (pendingDish.timestamp > modifiedTimestamp) {
803
- await pendingDish.promise
804
- return
804
+ await pendingDish.promise;
805
+ return;
805
806
  }
806
- pendingDishes.delete(url)
807
+ pendingDishes.delete(url);
807
808
  }
808
- const timestamp = Date.now()
809
- const promise = cook(urlInfo, context)
809
+ const timestamp = Date.now();
810
+ const promise = cook(urlInfo, context);
810
811
  pendingDishes.set(url, {
811
812
  timestamp,
812
813
  promise,
813
- })
814
+ });
814
815
  try {
815
- await promise
816
+ await promise;
816
817
  } finally {
817
- pendingDishes.delete(url)
818
+ pendingDishes.delete(url);
818
819
  }
819
- }
820
- }
820
+ };
821
+ };
821
822
 
822
823
  const traceFromUrlSite = (urlSite) => {
823
824
  return {
@@ -825,32 +826,32 @@ const traceFromUrlSite = (urlSite) => {
825
826
  url: urlSite.url,
826
827
  line: urlSite.line,
827
828
  column: urlSite.column,
828
- }
829
- }
829
+ };
830
+ };
830
831
 
831
832
  const applyReferenceEffectsOnUrlInfo = (reference, urlInfo, context) => {
832
833
  if (reference.shouldHandle) {
833
- urlInfo.shouldHandle = true
834
+ urlInfo.shouldHandle = true;
834
835
  } else {
835
- urlInfo.shouldHandle = false
836
+ urlInfo.shouldHandle = false;
836
837
  }
837
- urlInfo.originalUrl = urlInfo.originalUrl || reference.url
838
+ urlInfo.originalUrl = urlInfo.originalUrl || reference.url;
838
839
 
839
840
  if (reference.isEntryPoint || isWebWorkerEntryPointReference(reference)) {
840
- urlInfo.isEntryPoint = true
841
+ urlInfo.isEntryPoint = true;
841
842
  }
842
843
 
843
- Object.assign(urlInfo.data, reference.data)
844
- Object.assign(urlInfo.timing, reference.timing)
844
+ Object.assign(urlInfo.data, reference.data);
845
+ Object.assign(urlInfo.timing, reference.timing);
845
846
  if (reference.injected) {
846
- urlInfo.injected = true
847
+ urlInfo.injected = true;
847
848
  }
848
849
  if (reference.filename && !urlInfo.filename) {
849
- urlInfo.filename = reference.filename
850
+ urlInfo.filename = reference.filename;
850
851
  }
851
852
  if (reference.isInline) {
852
- urlInfo.isInline = true
853
- const parentUrlInfo = context.urlGraph.getUrlInfo(reference.parentUrl)
853
+ urlInfo.isInline = true;
854
+ const parentUrlInfo = context.urlGraph.getUrlInfo(reference.parentUrl);
854
855
  urlInfo.inlineUrlSite = {
855
856
  url: parentUrlInfo.url,
856
857
  content: reference.isOriginalPosition
@@ -858,38 +859,38 @@ const applyReferenceEffectsOnUrlInfo = (reference, urlInfo, context) => {
858
859
  : parentUrlInfo.content,
859
860
  line: reference.specifierLine,
860
861
  column: reference.specifierColumn,
861
- }
862
- urlInfo.contentType = reference.contentType
862
+ };
863
+ urlInfo.contentType = reference.contentType;
863
864
  urlInfo.originalContent = context.build
864
865
  ? urlInfo.originalContent === undefined
865
866
  ? reference.content
866
867
  : urlInfo.originalContent
867
- : reference.content
868
- urlInfo.content = reference.content
868
+ : reference.content;
869
+ urlInfo.content = reference.content;
869
870
  }
870
871
 
871
872
  if (reference.debug) {
872
- urlInfo.debug = true
873
+ urlInfo.debug = true;
873
874
  }
874
875
  if (reference.expectedType) {
875
- urlInfo.typeHint = reference.expectedType
876
+ urlInfo.typeHint = reference.expectedType;
876
877
  }
877
878
  if (reference.expectedSubtype) {
878
- urlInfo.subtypeHint = reference.expectedSubtype
879
+ urlInfo.subtypeHint = reference.expectedSubtype;
879
880
  }
880
- }
881
+ };
881
882
 
882
883
  const adjustUrlSite = (urlInfo, { urlGraph, url, line, column }) => {
883
- const isOriginal = url === urlInfo.url
884
+ const isOriginal = url === urlInfo.url;
884
885
  const adjust = (urlSite, urlInfo) => {
885
886
  if (!urlSite.isOriginal) {
886
- return urlSite
887
+ return urlSite;
887
888
  }
888
- const inlineUrlSite = urlInfo.inlineUrlSite
889
+ const inlineUrlSite = urlInfo.inlineUrlSite;
889
890
  if (!inlineUrlSite) {
890
- return urlSite
891
+ return urlSite;
891
892
  }
892
- const parentUrlInfo = urlGraph.getUrlInfo(inlineUrlSite.url)
893
+ const parentUrlInfo = urlGraph.getUrlInfo(inlineUrlSite.url);
893
894
  return adjust(
894
895
  {
895
896
  isOriginal: true,
@@ -905,8 +906,8 @@ const adjustUrlSite = (urlInfo, { urlGraph, url, line, column }) => {
905
906
  : inlineUrlSite.column + urlSite.column,
906
907
  },
907
908
  parentUrlInfo,
908
- )
909
- }
909
+ );
910
+ };
910
911
  return adjust(
911
912
  {
912
913
  isOriginal,
@@ -916,61 +917,61 @@ const adjustUrlSite = (urlInfo, { urlGraph, url, line, column }) => {
916
917
  column,
917
918
  },
918
919
  urlInfo,
919
- )
920
- }
920
+ );
921
+ };
921
922
 
922
923
  const inferUrlInfoType = (urlInfo) => {
923
- const { type } = urlInfo
924
+ const { type } = urlInfo;
924
925
  if (type === "sourcemap") {
925
- return "sourcemap"
926
+ return "sourcemap";
926
927
  }
927
- const { contentType } = urlInfo
928
+ const { contentType } = urlInfo;
928
929
  if (contentType === "text/html") {
929
- return "html"
930
+ return "html";
930
931
  }
931
932
  if (contentType === "text/css") {
932
- return "css"
933
+ return "css";
933
934
  }
934
935
  if (contentType === "text/javascript") {
935
- if (urlInfo.typeHint === "js_classic") return "js_classic"
936
- return "js_module"
936
+ if (urlInfo.typeHint === "js_classic") return "js_classic";
937
+ return "js_module";
937
938
  }
938
939
  if (contentType === "application/importmap+json") {
939
- return "importmap"
940
+ return "importmap";
940
941
  }
941
942
  if (contentType === "application/manifest+json") {
942
- return "webmanifest"
943
+ return "webmanifest";
943
944
  }
944
945
  if (contentType === "image/svg+xml") {
945
- return "svg"
946
+ return "svg";
946
947
  }
947
948
  if (CONTENT_TYPE.isJson(contentType)) {
948
- return "json"
949
+ return "json";
949
950
  }
950
951
  if (CONTENT_TYPE.isTextual(contentType)) {
951
- return "text"
952
+ return "text";
952
953
  }
953
- return "other"
954
- }
954
+ return "other";
955
+ };
955
956
 
956
957
  const determineFileUrlForOutDirectory = ({ urlInfo, context }) => {
957
958
  if (!context.outDirectoryUrl) {
958
- return urlInfo.url
959
+ return urlInfo.url;
959
960
  }
960
961
  if (!urlInfo.url.startsWith("file:")) {
961
- return urlInfo.url
962
+ return urlInfo.url;
962
963
  }
963
- let url = urlInfo.url
964
+ let url = urlInfo.url;
964
965
  if (!urlIsInsideOf(urlInfo.url, context.rootDirectoryUrl)) {
965
- const fsRootUrl = ensureWindowsDriveLetter("file:///", urlInfo.url)
966
- url = `${context.rootDirectoryUrl}@fs/${url.slice(fsRootUrl.length)}`
966
+ const fsRootUrl = ensureWindowsDriveLetter("file:///", urlInfo.url);
967
+ url = `${context.rootDirectoryUrl}@fs/${url.slice(fsRootUrl.length)}`;
967
968
  }
968
969
  if (urlInfo.filename) {
969
- url = setUrlFilename(url, urlInfo.filename)
970
+ url = setUrlFilename(url, urlInfo.filename);
970
971
  }
971
972
  return moveUrl({
972
973
  url,
973
974
  from: context.rootDirectoryUrl,
974
975
  to: context.outDirectoryUrl,
975
- })
976
- }
976
+ });
977
+ };