@jsenv/core 41.5.35 → 41.5.38

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.
@@ -438,7 +438,7 @@ ${reason}`,
438
438
  return createFailedToFetchUrlContentError({
439
439
  code: "NOT_FOUND",
440
440
  reason: "no entry on filesystem",
441
- ...detailsFromInjectionsOnOwner(urlInfo.firstReference),
441
+ ...detailsFromHtmlUrlNotFound(urlInfo.firstReference),
442
442
  });
443
443
  }
444
444
  }
@@ -698,6 +698,31 @@ const detailsFromInjectionsOnOwner = (reference) => {
698
698
  };
699
699
  };
700
700
 
701
+ // An url of an html attribute leading to no file may be meant for a server rather
702
+ // than for jsenv: a route of a backend, which "jsenv-ignore" leaves alone. Only the
703
+ // build is concerned: in dev the browser requests the url whatever jsenv does with it.
704
+ const detailsFromHtmlUrlNotFound = (reference) => {
705
+ const detailsFromInjections = detailsFromInjectionsOnOwner(reference);
706
+ if (detailsFromInjections.suggestion) {
707
+ return detailsFromInjections;
708
+ }
709
+ if (!reference) {
710
+ return {};
711
+ }
712
+ const ownerUrlInfo = reference.ownerUrlInfo;
713
+ if (ownerUrlInfo.type !== "html" || !ownerUrlInfo.context.build) {
714
+ return {};
715
+ }
716
+ const { node, attributeName } = reference.astInfo || {};
717
+ if (!node || !attributeName) {
718
+ return {};
719
+ }
720
+ return {
721
+ suggestion: `when "${reference.specifier}" is answered by a server rather than a file, add "jsenv-ignore" so the build leaves that url alone:
722
+ <${node.nodeName} jsenv-ignore ${attributeName}="${reference.specifier}" />`,
723
+ };
724
+ };
725
+
701
726
  const detailsFromPluginController = (jsenvPluginsController) => {
702
727
  const currentPlugin = jsenvPluginsController.getCurrentPlugin();
703
728
  if (!currentPlugin) {
@@ -9821,7 +9846,7 @@ const STATIC_IMPORT_SUBTYPES = ["import_static", "export_named", "export_all"];
9821
9846
  */
9822
9847
 
9823
9848
 
9824
- const clientFileUrl = import.meta.resolve("../js/dependency_status.js");
9849
+ const clientFileUrl = import.meta.resolve("../client/dependency_status/dependency_status.js");
9825
9850
 
9826
9851
  const jsenvPluginDependencyStatus = ({
9827
9852
  dependencyProblemEventEmitter,