@jsenv/core 39.5.17 → 39.5.19

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.
@@ -11591,6 +11591,7 @@ const createResolveUrlError = ({
11591
11591
  error,
11592
11592
  }) => {
11593
11593
  const createFailedToResolveUrlError = ({
11594
+ name = "RESOLVE_URL_ERROR",
11594
11595
  code = error.code || "RESOLVE_URL_ERROR",
11595
11596
  reason,
11596
11597
  ...details
@@ -11609,10 +11610,11 @@ ${reason}`,
11609
11610
  );
11610
11611
  defineNonEnumerableProperties(resolveError, {
11611
11612
  isJsenvCookingError: true,
11612
- name: "RESOLVE_URL_ERROR",
11613
+ name,
11613
11614
  code,
11614
11615
  reason,
11615
11616
  asResponse: error.asResponse,
11617
+ trace: error.trace || reference.trace,
11616
11618
  });
11617
11619
  return resolveError;
11618
11620
  };
@@ -11621,6 +11623,12 @@ ${reason}`,
11621
11623
  reason: `no plugin has handled the specifier during "resolveUrl" hook`,
11622
11624
  });
11623
11625
  }
11626
+ if (error.code === "MODULE_NOT_FOUND") {
11627
+ const bareSpecifierError = createFailedToResolveUrlError({
11628
+ reason: `"${reference.specifier}" is a bare specifier but cannot be remapped to a package`,
11629
+ });
11630
+ return bareSpecifierError;
11631
+ }
11624
11632
  if (error.code === "DIRECTORY_REFERENCE_NOT_ALLOWED") {
11625
11633
  error.message = createDetailedMessage$1(error.message, {
11626
11634
  "reference trace": reference.trace.message,
@@ -16294,9 +16302,13 @@ const jsenvPluginHtmlReferenceAnalysis = ({
16294
16302
  return (importmapUrlInfo) => {
16295
16303
  const htmlUrl = htmlUrlInfo.url;
16296
16304
  if (importmapUrlInfo) {
16297
- // importmap was found in this HTML file and is known
16298
- const importmap = JSON.parse(importmapUrlInfo.content);
16299
- importmaps[htmlUrl] = normalizeImportMap(importmap, htmlUrl);
16305
+ if (importmapUrlInfo.error) {
16306
+ importmaps[htmlUrl] = null;
16307
+ } else {
16308
+ // importmap was found in this HTML file and is known
16309
+ const importmap = JSON.parse(importmapUrlInfo.content);
16310
+ importmaps[htmlUrl] = normalizeImportMap(importmap, htmlUrl);
16311
+ }
16300
16312
  } else {
16301
16313
  // no importmap in this HTML file
16302
16314
  importmaps[htmlUrl] = null;
@@ -16635,6 +16647,9 @@ const jsenvPluginHtmlReferenceAnalysis = ({
16635
16647
  importmapLoaded(importmapInlineUrlInfo);
16636
16648
  }
16637
16649
  mutations.push(() => {
16650
+ if (importmapInlineUrlInfo.error) {
16651
+ return;
16652
+ }
16638
16653
  setHtmlNodeText(
16639
16654
  scriptNode,
16640
16655
  importmapInlineUrlInfo.content,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "39.5.17",
3
+ "version": "39.5.19",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -69,17 +69,17 @@
69
69
  "dependencies": {
70
70
  "@financial-times/polyfill-useragent-normaliser": "1.10.2",
71
71
  "@jsenv/abort": "4.3.0",
72
- "@jsenv/ast": "6.3.4",
72
+ "@jsenv/ast": "6.3.5",
73
73
  "@jsenv/filesystem": "4.10.11",
74
74
  "@jsenv/humanize": "1.2.8",
75
75
  "@jsenv/importmap": "1.2.1",
76
76
  "@jsenv/integrity": "0.0.2",
77
- "@jsenv/js-module-fallback": "1.3.48",
77
+ "@jsenv/js-module-fallback": "1.3.49",
78
78
  "@jsenv/node-esm-resolution": "1.0.6",
79
79
  "@jsenv/plugin-bundling": "2.7.16",
80
80
  "@jsenv/plugin-minification": "1.5.10",
81
- "@jsenv/plugin-supervisor": "1.5.23",
82
- "@jsenv/plugin-transpilation": "1.4.83",
81
+ "@jsenv/plugin-supervisor": "1.5.25",
82
+ "@jsenv/plugin-transpilation": "1.4.84",
83
83
  "@jsenv/runtime-compat": "1.3.1",
84
84
  "@jsenv/server": "15.3.1",
85
85
  "@jsenv/sourcemap": "1.2.25",
@@ -102,14 +102,13 @@
102
102
  "@jsenv/performance-impact": "workspace:*",
103
103
  "@jsenv/plugin-as-js-classic": "workspace:*",
104
104
  "@jsenv/snapshot": "workspace:*",
105
+ "@jsenv/md-up": "workspace:*",
105
106
  "@jsenv/test": "workspace:*",
106
107
  "@playwright/browser-chromium": "1.48.2",
107
108
  "@playwright/browser-firefox": "1.48.2",
108
109
  "@playwright/browser-webkit": "1.48.2",
109
- "anchor-markdown-header": "0.7.0",
110
110
  "babel-plugin-transform-async-to-promises": "0.8.18",
111
111
  "eslint": "9.14.0",
112
- "marked": "14.1.3",
113
112
  "open": "10.1.0",
114
113
  "playwright": "1.48.2",
115
114
  "prettier": "3.3.3",
@@ -8,6 +8,7 @@ export const createResolveUrlError = ({
8
8
  error,
9
9
  }) => {
10
10
  const createFailedToResolveUrlError = ({
11
+ name = "RESOLVE_URL_ERROR",
11
12
  code = error.code || "RESOLVE_URL_ERROR",
12
13
  reason,
13
14
  ...details
@@ -26,10 +27,11 @@ ${reason}`,
26
27
  );
27
28
  defineNonEnumerableProperties(resolveError, {
28
29
  isJsenvCookingError: true,
29
- name: "RESOLVE_URL_ERROR",
30
+ name,
30
31
  code,
31
32
  reason,
32
33
  asResponse: error.asResponse,
34
+ trace: error.trace || reference.trace,
33
35
  });
34
36
  return resolveError;
35
37
  };
@@ -38,6 +40,12 @@ ${reason}`,
38
40
  reason: `no plugin has handled the specifier during "resolveUrl" hook`,
39
41
  });
40
42
  }
43
+ if (error.code === "MODULE_NOT_FOUND") {
44
+ const bareSpecifierError = createFailedToResolveUrlError({
45
+ reason: `"${reference.specifier}" is a bare specifier but cannot be remapped to a package`,
46
+ });
47
+ return bareSpecifierError;
48
+ }
41
49
  if (error.code === "DIRECTORY_REFERENCE_NOT_ALLOWED") {
42
50
  error.message = createDetailedMessage(error.message, {
43
51
  "reference trace": reference.trace.message,
@@ -52,9 +52,13 @@ export const jsenvPluginHtmlReferenceAnalysis = ({
52
52
  return (importmapUrlInfo) => {
53
53
  const htmlUrl = htmlUrlInfo.url;
54
54
  if (importmapUrlInfo) {
55
- // importmap was found in this HTML file and is known
56
- const importmap = JSON.parse(importmapUrlInfo.content);
57
- importmaps[htmlUrl] = normalizeImportMap(importmap, htmlUrl);
55
+ if (importmapUrlInfo.error) {
56
+ importmaps[htmlUrl] = null;
57
+ } else {
58
+ // importmap was found in this HTML file and is known
59
+ const importmap = JSON.parse(importmapUrlInfo.content);
60
+ importmaps[htmlUrl] = normalizeImportMap(importmap, htmlUrl);
61
+ }
58
62
  } else {
59
63
  // no importmap in this HTML file
60
64
  importmaps[htmlUrl] = null;
@@ -393,6 +397,9 @@ export const jsenvPluginHtmlReferenceAnalysis = ({
393
397
  importmapLoaded(importmapInlineUrlInfo);
394
398
  }
395
399
  mutations.push(() => {
400
+ if (importmapInlineUrlInfo.error) {
401
+ return;
402
+ }
396
403
  setHtmlNodeText(
397
404
  scriptNode,
398
405
  importmapInlineUrlInfo.content,