@jsenv/core 37.1.0 → 37.1.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.
@@ -9996,17 +9996,21 @@ const babelPluginReplaceTopLevelThis = () => {
9996
9996
 
9997
9997
 
9998
9998
  const jsenvPluginAsJsModule = () => {
9999
+ const markAsJsModuleProxy = (reference) => {
10000
+ reference.expectedType = "js_module";
10001
+ if (!reference.filename) {
10002
+ const filename = urlToFilename$1(reference.url);
10003
+ const [basename] = splitFileExtension$1(filename);
10004
+ reference.filename = `${basename}.mjs`;
10005
+ }
10006
+ };
10007
+
9999
10008
  return {
10000
10009
  name: "jsenv:as_js_module",
10001
10010
  appliesDuring: "*",
10002
10011
  redirectReference: (reference) => {
10003
10012
  if (reference.searchParams.has("as_js_module")) {
10004
- reference.expectedType = "js_module";
10005
- if (!reference.filename) {
10006
- const filename = urlToFilename$1(reference.url);
10007
- const [basename] = splitFileExtension$1(filename);
10008
- reference.filename = `${basename}.mjs`;
10009
- }
10013
+ markAsJsModuleProxy(reference);
10010
10014
  }
10011
10015
  },
10012
10016
  fetchUrlContent: async (urlInfo) => {
@@ -11694,6 +11698,9 @@ const createUrlInfo = (url, context) => {
11694
11698
  }
11695
11699
  return null;
11696
11700
  };
11701
+ urlInfo.findDependent = (callback) => {
11702
+ return GRAPH_VISITOR.findDependent(urlInfo, callback);
11703
+ };
11697
11704
  urlInfo.isSearchParamVariantOf = (otherUrlInfo) => {
11698
11705
  if (urlInfo.searchParams.size === 0) {
11699
11706
  return false;
@@ -17021,6 +17028,10 @@ const jsenvPluginNodeEsmResolution = (resolutionConfig = {}) => {
17021
17028
  if (reference.subtype === "self_import_scripts_arg") {
17022
17029
  return nodeEsmResolverDefault(reference);
17023
17030
  }
17031
+ if (reference.type === "js_import") {
17032
+ // happens for ?as_js_module
17033
+ return nodeEsmResolverDefault(reference);
17034
+ }
17024
17035
  return null;
17025
17036
  };
17026
17037
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "37.1.0",
3
+ "version": "37.1.1",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -7,6 +7,7 @@ import {
7
7
  import { createEventEmitter } from "../../helpers/event_emitter.js";
8
8
  import { urlSpecifierEncoding } from "./url_specifier_encoding.js";
9
9
  import { createDependencies } from "./references.js";
10
+ import { GRAPH_VISITOR } from "./url_graph_visitor.js";
10
11
 
11
12
  export const createUrlGraph = ({
12
13
  rootDirectoryUrl,
@@ -266,6 +267,9 @@ const createUrlInfo = (url, context) => {
266
267
  }
267
268
  return null;
268
269
  };
270
+ urlInfo.findDependent = (callback) => {
271
+ return GRAPH_VISITOR.findDependent(urlInfo, callback);
272
+ };
269
273
  urlInfo.isSearchParamVariantOf = (otherUrlInfo) => {
270
274
  if (urlInfo.searchParams.size === 0) {
271
275
  return false;
@@ -48,6 +48,10 @@ export const jsenvPluginNodeEsmResolution = (resolutionConfig = {}) => {
48
48
  if (reference.subtype === "self_import_scripts_arg") {
49
49
  return nodeEsmResolverDefault(reference);
50
50
  }
51
+ if (reference.type === "js_import") {
52
+ // happens for ?as_js_module
53
+ return nodeEsmResolverDefault(reference);
54
+ }
51
55
  return null;
52
56
  };
53
57
  }