@jsenv/core 24.6.2 → 25.0.0-alpha.0

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 (57) hide show
  1. package/dist/browser_runtime/asset-manifest.json +2 -1
  2. package/dist/browser_runtime/{browser_runtime-c7288751.js → browser_runtime_a8097085.js} +37 -27
  3. package/dist/browser_runtime/{browser_runtime-c7288751.js.map → browser_runtime_a8097085.js.map} +3 -3
  4. package/dist/build_manifest.js +6 -6
  5. package/dist/compile_proxy/asset-manifest.json +2 -1
  6. package/dist/compile_proxy/{compile_proxy-a3969633.html → compile_proxy_e16d7de8.html} +39 -34
  7. package/dist/compile_proxy/{compile_proxy.html__inline__20-9c92c170.js.map → compile_proxy_e3b0c442_9e168143.js.map} +3 -2
  8. package/dist/event_source_client/asset-manifest.json +2 -1
  9. package/dist/event_source_client/{event_source_client-9f14c8b9.js → event_source_client_620fbc2c.js} +1 -1
  10. package/dist/event_source_client/{event_source_client-9f14c8b9.js.map → event_source_client_620fbc2c.js.map} +1 -1
  11. package/dist/redirector/asset-manifest.json +2 -1
  12. package/dist/redirector/{redirector-a6b8d640.html → redirector_2e0c8abe.html} +39 -34
  13. package/dist/redirector/{redirector.html__inline__15-58430672.js.map → redirector_e3b0c442_3a34a156.js.map} +3 -2
  14. package/dist/toolbar/asset-manifest.json +11 -10
  15. package/dist/toolbar/assets/{compilation.css-209d68b4.map → compilation.css_e37c747b.map} +1 -1
  16. package/dist/toolbar/assets/{eventsource.css-38cd0a36.map → eventsource.css_c0c71e7b.map} +1 -1
  17. package/dist/toolbar/assets/{execution.css-0ebe522f.map → execution.css_f3377c10.map} +1 -1
  18. package/dist/toolbar/assets/{focus.css-3f9c156d.map → focus.css_896f3e45.map} +1 -1
  19. package/dist/toolbar/assets/{light-theme.css-78b19a80.map → light-theme.css_72a60fa3.map} +1 -1
  20. package/dist/toolbar/assets/{overflow-menu.css-d9688a1c.map → overflow-menu.css_2859d519.map} +1 -1
  21. package/dist/toolbar/assets/{settings.css-2b81b245.map → settings.css_61548139.map} +1 -1
  22. package/dist/toolbar/assets/{toolbar.main.css-846920e9.map → toolbar.main.css_269d7ce2.map} +9 -9
  23. package/dist/toolbar/assets/{tooltip.css-03395ee6.map → tooltip.css_a94a8bdd.map} +1 -1
  24. package/dist/toolbar/{toolbar.main-7aa01366.js.map → toolbar.main_a5ef2c60.js.map} +3 -2
  25. package/dist/toolbar/{toolbar-84985f43.html → toolbar_412abb83.html} +87 -64
  26. package/dist/toolbar_injector/asset-manifest.json +3 -2
  27. package/dist/toolbar_injector/assets/{jsenv-logo-188b9ca6.svg → jsenv-logo_188b9ca6.svg} +0 -0
  28. package/dist/toolbar_injector/{toolbar_injector-8edcae04.js → toolbar_injector_4f9c19e5.js} +17 -17
  29. package/dist/toolbar_injector/{toolbar_injector-8edcae04.js.map → toolbar_injector_4f9c19e5.js.map} +4 -4
  30. package/package.json +5 -4
  31. package/readme.md +12 -22
  32. package/src/buildProject.js +21 -21
  33. package/src/dev_server.js +6 -2
  34. package/src/internal/building/buildUsingRollup.js +24 -18
  35. package/src/internal/building/build_logs.js +2 -2
  36. package/src/internal/building/build_stats.js +11 -1
  37. package/src/internal/building/html/parseHtmlRessource.js +2 -26
  38. package/src/internal/building/js/parseJsRessource.js +3 -2
  39. package/src/internal/building/json_module.js +11 -0
  40. package/src/internal/building/parseRessource.js +1 -1
  41. package/src/internal/building/ressource_builder.js +216 -215
  42. package/src/internal/building/rollup_plugin_jsenv.js +522 -354
  43. package/src/internal/building/url_loader.js +8 -142
  44. package/src/internal/building/url_versioning.js +226 -0
  45. package/src/internal/compiling/compileHtml.js +8 -1
  46. package/src/internal/compiling/createCompiledFileService.js +7 -7
  47. package/src/internal/compiling/js-compilation-service/jsenvTransform.js +9 -55
  48. package/src/internal/compiling/js-compilation-service/transformJs.js +8 -5
  49. package/src/internal/compiling/jsenvCompilerForHtml.js +4 -4
  50. package/src/internal/compiling/jsenvCompilerForJavaScript.js +2 -2
  51. package/src/internal/compiling/startCompileServer.js +2 -2
  52. package/src/jsenvServiceWorkerFinalizer.js +7 -8
  53. package/src/internal/building/asset_url_versioning.js +0 -50
  54. package/src/internal/building/rollup_build_sourcemap.js +0 -54
  55. package/src/internal/building/url-versioning.js +0 -96
  56. package/src/internal/compiling/js-compilation-service/findAsyncPluginNameInBabelPluginMap.js +0 -9
  57. package/src/internal/renderNamePattern.js +0 -6
@@ -16,12 +16,7 @@ Or be sure to also reference this url somewhere in the html file like
16
16
 
17
17
  */
18
18
 
19
- import {
20
- urlToFilename,
21
- urlToRelativeUrl,
22
- resolveUrl,
23
- urlToParentUrl,
24
- } from "@jsenv/filesystem"
19
+ import { urlToFilename, urlToRelativeUrl, resolveUrl } from "@jsenv/filesystem"
25
20
 
26
21
  import {
27
22
  parseHtmlString,
@@ -255,7 +250,7 @@ const regularScriptTextNodeVisitor = (
255
250
  })
256
251
  return () => {
257
252
  const { bufferAfterBuild } = jsReference.ressource
258
- textNode.value = bufferAfterBuild
253
+ textNode.value = String(bufferAfterBuild)
259
254
  }
260
255
  }
261
256
 
@@ -359,8 +354,6 @@ const moduleScriptTextNodeVisitor = (
359
354
  }
360
355
  const { bufferAfterBuild } = jsReference.ressource
361
356
  const jsText = String(bufferAfterBuild)
362
- // ici on voudrait pouvoir ajouter le commentaire de la sourcemap
363
- // sauf que cela se produit un poil plus tard je crois?
364
357
  textNode.value = jsText
365
358
  }
366
359
  }
@@ -386,23 +379,6 @@ const importmapScriptSrcVisitor = (
386
379
  contentTypeExpected: "application/importmap+json",
387
380
  ressourceSpecifier: srcAttribute.value,
388
381
  ...referenceLocationFromHtmlNode(script, "src"),
389
- // here we want to force the fileName for the importmap
390
- // so that we don't have to rewrite its content
391
- // the goal is to put the importmap at the same relative path
392
- // than in the project
393
- fileNamePattern: () => {
394
- const importmapReferenceUrl = importmapReference.referenceUrl
395
- const importmapRessourceUrl = importmapReference.ressource.url
396
- const importmapUrlRelativeToImporter = urlToRelativeUrl(
397
- importmapRessourceUrl,
398
- importmapReferenceUrl,
399
- )
400
- const importmapParentRelativeUrl = urlToRelativeUrl(
401
- urlToParentUrl(resolveUrl(importmapUrlRelativeToImporter, "file://")),
402
- "file://",
403
- )
404
- return `${importmapParentRelativeUrl}[name]-[hash][extname]`
405
- },
406
382
  })
407
383
  return ({ getUrlRelativeToImporter }) => {
408
384
  const { ressource } = importmapReference
@@ -103,9 +103,10 @@ export const parseJsRessource = async (
103
103
  map.file = urlToFilename(jsBuildUrl)
104
104
  if (map.sources) {
105
105
  map.sources = map.sources.map((source) => {
106
- const sourceUrl = resolveUrl(source, jsOriginalUrl)
106
+ const sourceUrl = resolveUrl(source, jsUrl)
107
+ const sourceOriginalUrl = asOriginalUrl(sourceUrl)
107
108
  const sourceUrlRelativeToSourceMap = urlToRelativeUrl(
108
- sourceUrl,
109
+ sourceOriginalUrl,
109
110
  sourcemapPrecomputedBuildUrl,
110
111
  )
111
112
  return sourceUrlRelativeToSourceMap
@@ -0,0 +1,11 @@
1
+ export const convertJsonTextToJavascriptModule = ({ code }) => {
2
+ // here we could do the following
3
+ // return export default jsonText
4
+ // This would return valid js, that would be minified later
5
+ // however we will prefer using JSON.parse because it's faster
6
+ // for js engine to parse JSON than JS
7
+
8
+ return {
9
+ code: `export default JSON.parse(${JSON.stringify(code.trim())})`,
10
+ }
11
+ }
@@ -22,7 +22,7 @@ import { parseJsRessource } from "./js/parseJsRessource.js"
22
22
  import { parseJsonRessource } from "./json/parseJsonRessource.js"
23
23
  import { parseWebmanifestRessource } from "./webmanifest/parseWebmanifestRessource.js"
24
24
 
25
- export const parseRessource = (
25
+ export const parseRessource = async (
26
26
  ressource,
27
27
  notifiers,
28
28
  {