summaryrefslogtreecommitdiff
path: root/tests/registry
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2024-06-08 18:36:13 +0200
committerGitHub <noreply@github.com>2024-06-08 18:36:13 +0200
commitc1f23c578881b85ae79b524a60160d8f4fb7151b (patch)
treec6c945fb4b42cd4ac6fae7135c7ad1039630a34e /tests/registry
parent22d34f7012c48a25435b38c0c306085c614bbea7 (diff)
fix(ext/node): lossy UTF-8 read node_modules files (#24140)
Previously various reads of files in `node_modules` would error on invalid UTF-8. These were cases involving: - reading package.json from Rust - reading package.json from JS - reading CommonJS files from JS - reading CommonJS files from Rust (for ESM translation) - reading ESM files from Rust
Diffstat (limited to 'tests/registry')
-rw-r--r--tests/registry/npm/@denotest/lossy-utf8-module/1.0.0/index.js1
-rw-r--r--tests/registry/npm/@denotest/lossy-utf8-module/1.0.0/package.json6
-rw-r--r--tests/registry/npm/@denotest/lossy-utf8-package-json/1.0.0/index.js1
-rw-r--r--tests/registry/npm/@denotest/lossy-utf8-package-json/1.0.0/package.json7
-rw-r--r--tests/registry/npm/@denotest/lossy-utf8-script/1.0.0/index.js1
-rw-r--r--tests/registry/npm/@denotest/lossy-utf8-script/1.0.0/package.json6
6 files changed, 22 insertions, 0 deletions
diff --git a/tests/registry/npm/@denotest/lossy-utf8-module/1.0.0/index.js b/tests/registry/npm/@denotest/lossy-utf8-module/1.0.0/index.js
new file mode 100644
index 000000000..411f3c372
--- /dev/null
+++ b/tests/registry/npm/@denotest/lossy-utf8-module/1.0.0/index.js
@@ -0,0 +1 @@
+export default 'þþÿÿ'; \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/lossy-utf8-module/1.0.0/package.json b/tests/registry/npm/@denotest/lossy-utf8-module/1.0.0/package.json
new file mode 100644
index 000000000..1260655fb
--- /dev/null
+++ b/tests/registry/npm/@denotest/lossy-utf8-module/1.0.0/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "@denotest/lossy-utf8-script",
+ "version": "1.0.0",
+ "type": "module",
+ "dependencies": {}
+}
diff --git a/tests/registry/npm/@denotest/lossy-utf8-package-json/1.0.0/index.js b/tests/registry/npm/@denotest/lossy-utf8-package-json/1.0.0/index.js
new file mode 100644
index 000000000..34b58e6e1
--- /dev/null
+++ b/tests/registry/npm/@denotest/lossy-utf8-package-json/1.0.0/index.js
@@ -0,0 +1 @@
+export default "hello";
diff --git a/tests/registry/npm/@denotest/lossy-utf8-package-json/1.0.0/package.json b/tests/registry/npm/@denotest/lossy-utf8-package-json/1.0.0/package.json
new file mode 100644
index 000000000..5ca42d0d1
--- /dev/null
+++ b/tests/registry/npm/@denotest/lossy-utf8-package-json/1.0.0/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "@denotest/lossy-utf8-package-json",
+ "version": "1.0.0",
+ "type": "module",
+ "dependencies": {},
+ "files": ["þþÿÿ"]
+} \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/lossy-utf8-script/1.0.0/index.js b/tests/registry/npm/@denotest/lossy-utf8-script/1.0.0/index.js
new file mode 100644
index 000000000..adbfd382a
--- /dev/null
+++ b/tests/registry/npm/@denotest/lossy-utf8-script/1.0.0/index.js
@@ -0,0 +1 @@
+module.exports = 'þþÿÿ'; \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/lossy-utf8-script/1.0.0/package.json b/tests/registry/npm/@denotest/lossy-utf8-script/1.0.0/package.json
new file mode 100644
index 000000000..e23605945
--- /dev/null
+++ b/tests/registry/npm/@denotest/lossy-utf8-script/1.0.0/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "@denotest/lossy-utf8-script",
+ "version": "1.0.0",
+ "type": "commonjs",
+ "dependencies": {}
+}