summaryrefslogtreecommitdiff
path: root/tests/registry/npm/@denotest
diff options
context:
space:
mode:
Diffstat (limited to 'tests/registry/npm/@denotest')
-rw-r--r--tests/registry/npm/@denotest/bin-created-by-lifecycle/1.0.0/install.mjs3
-rw-r--r--tests/registry/npm/@denotest/bin-created-by-lifecycle/1.0.0/package.json10
-rw-r--r--tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/package.json8
-rw-r--r--tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/add.js3
-rw-r--r--tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/index.js3
-rw-r--r--tests/registry/npm/@denotest/install-launch-cjs-temp-dir/1.0.0/install.js12
-rw-r--r--tests/registry/npm/@denotest/install-launch-cjs-temp-dir/1.0.0/package.json7
-rw-r--r--tests/registry/npm/@denotest/install-no-ext/1.0.0/install/check.js1
-rw-r--r--tests/registry/npm/@denotest/install-no-ext/1.0.0/install/index.js1
-rw-r--r--tests/registry/npm/@denotest/install-no-ext/1.0.0/install/output.js1
-rw-r--r--tests/registry/npm/@denotest/install-no-ext/1.0.0/package.json7
-rw-r--r--tests/registry/npm/@denotest/node-addon/1.0.0/package.json2
-rw-r--r--tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/index.js2
-rw-r--r--tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/package.json10
-rw-r--r--tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/index.js2
-rw-r--r--tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/other.js3
-rw-r--r--tests/registry/npm/@denotest/specifier-two-slashes/1.0.0/package.json6
-rw-r--r--tests/registry/npm/@denotest/type-commonjs/1.0.0/index.js6
18 files changed, 85 insertions, 2 deletions
diff --git a/tests/registry/npm/@denotest/bin-created-by-lifecycle/1.0.0/install.mjs b/tests/registry/npm/@denotest/bin-created-by-lifecycle/1.0.0/install.mjs
new file mode 100644
index 000000000..31020fcdf
--- /dev/null
+++ b/tests/registry/npm/@denotest/bin-created-by-lifecycle/1.0.0/install.mjs
@@ -0,0 +1,3 @@
+import * as fs from "node:fs";
+
+fs.writeFileSync("./testbin.js", "#!/usr/bin/env node\nconsole.log('run testbin');"); \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/bin-created-by-lifecycle/1.0.0/package.json b/tests/registry/npm/@denotest/bin-created-by-lifecycle/1.0.0/package.json
new file mode 100644
index 000000000..ad8dea002
--- /dev/null
+++ b/tests/registry/npm/@denotest/bin-created-by-lifecycle/1.0.0/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "@denotest/bin-created-by-lifecycle",
+ "version": "1.0.0",
+ "scripts": {
+ "install": "node install.mjs"
+ },
+ "bin": {
+ "testbin": "testbin.js"
+ }
+} \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/package.json b/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/package.json
new file mode 100644
index 000000000..43f07a235
--- /dev/null
+++ b/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@denotest/cjs-multiple-exports",
+ "version": "1.0.0",
+ "exports": {
+ ".": "./src/index.js",
+ "./add": "./src/add.js"
+ }
+} \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/add.js b/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/add.js
new file mode 100644
index 000000000..42c8a7c60
--- /dev/null
+++ b/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/add.js
@@ -0,0 +1,3 @@
+module.exports = function add(a, b) {
+ return a + b;
+}; \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/index.js b/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/index.js
new file mode 100644
index 000000000..432ed652e
--- /dev/null
+++ b/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/index.js
@@ -0,0 +1,3 @@
+module.exports = {
+ hello: "world"
+}; \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/install-launch-cjs-temp-dir/1.0.0/install.js b/tests/registry/npm/@denotest/install-launch-cjs-temp-dir/1.0.0/install.js
new file mode 100644
index 000000000..61aadeb83
--- /dev/null
+++ b/tests/registry/npm/@denotest/install-launch-cjs-temp-dir/1.0.0/install.js
@@ -0,0 +1,12 @@
+const tempDir = Deno.makeTempDirSync();
+try {
+ // should work requiring these because this was launched via a node binary entrypoint
+ Deno.writeTextFileSync(`${tempDir}/index.js`, "module.exports = require('./other');");
+ Deno.writeTextFileSync(`${tempDir}/other.js`, "module.exports = (a, b) => a + b;");
+ const add = require(`${tempDir}/index.js`);
+ if (add(1, 2) !== 3) {
+ throw new Error("FAILED");
+ }
+} finally {
+ Deno.removeSync(tempDir, { recursive: true });
+}
diff --git a/tests/registry/npm/@denotest/install-launch-cjs-temp-dir/1.0.0/package.json b/tests/registry/npm/@denotest/install-launch-cjs-temp-dir/1.0.0/package.json
new file mode 100644
index 000000000..c3cf8dc4c
--- /dev/null
+++ b/tests/registry/npm/@denotest/install-launch-cjs-temp-dir/1.0.0/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "@denotest/install-launch-cjs-temp-dir",
+ "version": "1.0.0",
+ "scripts": {
+ "install": "node install.js"
+ }
+} \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/install-no-ext/1.0.0/install/check.js b/tests/registry/npm/@denotest/install-no-ext/1.0.0/install/check.js
new file mode 100644
index 000000000..7d55c2481
--- /dev/null
+++ b/tests/registry/npm/@denotest/install-no-ext/1.0.0/install/check.js
@@ -0,0 +1 @@
+require("./output");
diff --git a/tests/registry/npm/@denotest/install-no-ext/1.0.0/install/index.js b/tests/registry/npm/@denotest/install-no-ext/1.0.0/install/index.js
new file mode 100644
index 000000000..7d55c2481
--- /dev/null
+++ b/tests/registry/npm/@denotest/install-no-ext/1.0.0/install/index.js
@@ -0,0 +1 @@
+require("./output");
diff --git a/tests/registry/npm/@denotest/install-no-ext/1.0.0/install/output.js b/tests/registry/npm/@denotest/install-no-ext/1.0.0/install/output.js
new file mode 100644
index 000000000..69668cd62
--- /dev/null
+++ b/tests/registry/npm/@denotest/install-no-ext/1.0.0/install/output.js
@@ -0,0 +1 @@
+console.log("SUCCESS");
diff --git a/tests/registry/npm/@denotest/install-no-ext/1.0.0/package.json b/tests/registry/npm/@denotest/install-no-ext/1.0.0/package.json
new file mode 100644
index 000000000..b9abed1f6
--- /dev/null
+++ b/tests/registry/npm/@denotest/install-no-ext/1.0.0/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "@denotest/install-no-ext",
+ "version": "1.0.0",
+ "scripts": {
+ "install": "node install/check && node install"
+ }
+} \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/node-addon/1.0.0/package.json b/tests/registry/npm/@denotest/node-addon/1.0.0/package.json
index 5d50aa119..d730e3dd0 100644
--- a/tests/registry/npm/@denotest/node-addon/1.0.0/package.json
+++ b/tests/registry/npm/@denotest/node-addon/1.0.0/package.json
@@ -2,7 +2,7 @@
"name": "@denotest/node-addon",
"version": "1.0.0",
"scripts": {
- "install": "node-gyp configure build"
+ "install": "node-gyp configure --verbose build"
},
"dependencies": {
"node-gyp": "10.1.0"
diff --git a/tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/index.js b/tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/index.js
new file mode 100644
index 000000000..b835b8e25
--- /dev/null
+++ b/tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/index.js
@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+console.log(`npm_config_user_agent: ${process.env["npm_config_user_agent"]}`); \ No newline at end of file
diff --git a/tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/package.json b/tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/package.json
new file mode 100644
index 000000000..907117346
--- /dev/null
+++ b/tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "@denotest/print-npm-user-agent",
+ "version": "1.0.0",
+ "bin": {
+ "print-npm-user-agent": "index.js"
+ },
+ "scripts": {
+ "postinstall": "echo postinstall && node index.js && exit 1"
+ }
+} \ No newline at end of file
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
diff --git a/tests/registry/npm/@denotest/type-commonjs/1.0.0/index.js b/tests/registry/npm/@denotest/type-commonjs/1.0.0/index.js
index cb0ff5c3b..d3f80a049 100644
--- a/tests/registry/npm/@denotest/type-commonjs/1.0.0/index.js
+++ b/tests/registry/npm/@denotest/type-commonjs/1.0.0/index.js
@@ -1 +1,5 @@
-export {};
+// this module is declared as CommonJS, but during loading we'll
+// discover it's ESM and load it fine
+export function add(a, b) {
+ return a + b;
+}