@esmx/import 3.0.0-rc.35 → 3.0.0-rc.37

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.
@@ -1,6 +1,7 @@
1
1
  import fs from "node:fs";
2
2
  import { isBuiltin } from "node:module";
3
3
  import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
4
5
  import vm from "node:vm";
5
6
  import IM from "@import-maps/resolve";
6
7
  import { CircularDependencyError, FileReadError } from "./error.mjs";
@@ -36,10 +37,11 @@ export function createVmImport(baseURL, importMap = {}) {
36
37
  filename = import.meta.resolve(specifier, parent);
37
38
  }
38
39
  const url = new URL(filename);
40
+ const pathname = fileURLToPath(url);
39
41
  return {
40
42
  filename,
41
43
  url,
42
- pathname: url.pathname
44
+ pathname
43
45
  };
44
46
  };
45
47
  async function moduleLinker(specifier, parent, context, cache, moduleIds) {
package/package.json CHANGED
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "devDependencies": {
35
35
  "@biomejs/biome": "1.9.4",
36
- "@esmx/lint": "3.0.0-rc.35",
36
+ "@esmx/lint": "3.0.0-rc.37",
37
37
  "@types/node": "^24.0.0",
38
38
  "@vitest/coverage-v8": "3.2.4",
39
39
  "stylelint": "16.21.0",
@@ -41,7 +41,7 @@
41
41
  "unbuild": "3.5.0",
42
42
  "vitest": "3.2.4"
43
43
  },
44
- "version": "3.0.0-rc.35",
44
+ "version": "3.0.0-rc.37",
45
45
  "type": "module",
46
46
  "private": false,
47
47
  "exports": {
@@ -60,5 +60,5 @@
60
60
  "template",
61
61
  "public"
62
62
  ],
63
- "gitHead": "88f710dfd3a54943e0c893af7daf2f42f83e08e6"
63
+ "gitHead": "ca2747fe29a9a48b942dfd9bf5a99742211afd3f"
64
64
  }
@@ -49,7 +49,6 @@ export function resolve(
49
49
  ) {
50
50
  const scriptURL = new URL(context.parentURL);
51
51
  const result = IM.resolve(specifier, loaderParsedImportMap, scriptURL);
52
-
53
52
  if (result.matched && result.resolvedImport) {
54
53
  return nextResolve(result.resolvedImport.href);
55
54
  }
package/src/import-vm.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import fs from 'node:fs';
2
2
  import { isBuiltin } from 'node:module';
3
3
  import path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
4
5
  import vm from 'node:vm';
5
6
  import IM from '@import-maps/resolve';
6
7
  import { CircularDependencyError, FileReadError } from './error';
@@ -40,10 +41,11 @@ export function createVmImport(baseURL: URL, importMap: ImportMap = {}) {
40
41
  filename = import.meta.resolve(specifier, parent);
41
42
  }
42
43
  const url = new URL(filename);
44
+ const pathname = fileURLToPath(url);
43
45
  return {
44
46
  filename,
45
47
  url,
46
- pathname: url.pathname
48
+ pathname
47
49
  };
48
50
  };
49
51
  async function moduleLinker(