From 186b52731c6bb326c4d32905c5e732d082e83465 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 19 Nov 2024 09:57:12 -0500 Subject: fix(node): handle resolving ".//" in npm packages (#26920) The issue was this package had an import like: `".//index.js"` and we resolved that as specified, but node normalizes it to `"./index.js"` so we have to copy node. --- tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/index.js | 2 ++ tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/other.js | 3 +++ .../registry/npm/@denotest/specifier-two-slashes/1.0.0/package.json | 6 ++++++ 3 files changed, 11 insertions(+) create mode 100644 tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/index.js create mode 100644 tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/other.js create mode 100644 tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/package.json (limited to 'tests/registry') diff --git a/tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/index.js b/tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/index.js new file mode 100644 index 000000000..aca5ca1b8 --- /dev/null +++ b/tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/index.js @@ -0,0 +1,2 @@ +// node.js will resolve this as ./other.js +export * from ".//other.js"; \ No newline at end of file diff --git a/tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/other.js b/tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/other.js new file mode 100644 index 000000000..7d658310b --- /dev/null +++ b/tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/other.js @@ -0,0 +1,3 @@ +export function add(a, b) { + return a + b; +} diff --git a/tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/package.json b/tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/package.json new file mode 100644 index 000000000..55e46b2fd --- /dev/null +++ b/tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/package.json @@ -0,0 +1,6 @@ +{ + "name": "@denotest/specifier-two-slashes", + "version": "1.0.0", + "type": "module", + "main": "index.js" +} \ No newline at end of file -- cgit v1.2.3