From 04f9db5b2217fe06f88e76146aac6362ff0b0b86 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Mon, 15 Jul 2024 12:11:09 -0700 Subject: fix(node): Fix `--allow-scripts` with no `deno.json` (#24533) We would resolve the wrong package.json, resulting in an inability to run CJS (or other node-mode) scripts --- .../npm/@denotest/lifecycle-scripts-cjs/1.0.0/package.json | 11 +++++++++++ .../npm/@denotest/lifecycle-scripts-cjs/1.0.0/preinstall.js | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 tests/registry/npm/@denotest/lifecycle-scripts-cjs/1.0.0/package.json create mode 100644 tests/registry/npm/@denotest/lifecycle-scripts-cjs/1.0.0/preinstall.js (limited to 'tests/registry/npm/@denotest/lifecycle-scripts-cjs/1.0.0') diff --git a/tests/registry/npm/@denotest/lifecycle-scripts-cjs/1.0.0/package.json b/tests/registry/npm/@denotest/lifecycle-scripts-cjs/1.0.0/package.json new file mode 100644 index 000000000..1924ddef8 --- /dev/null +++ b/tests/registry/npm/@denotest/lifecycle-scripts-cjs/1.0.0/package.json @@ -0,0 +1,11 @@ +{ + "name": "@denotest/lifecycle-scripts-cjs", + "version": "1.0.0", + "scripts": { + "preinstall": "echo preinstall && node preinstall.js", + "install": "echo install && cli-cjs 'hello from install script'" + }, + "dependencies": { + "@denotest/bin": "1.0.0" + } +} \ No newline at end of file diff --git a/tests/registry/npm/@denotest/lifecycle-scripts-cjs/1.0.0/preinstall.js b/tests/registry/npm/@denotest/lifecycle-scripts-cjs/1.0.0/preinstall.js new file mode 100644 index 000000000..b5511f990 --- /dev/null +++ b/tests/registry/npm/@denotest/lifecycle-scripts-cjs/1.0.0/preinstall.js @@ -0,0 +1,5 @@ +const inspect = require('util').inspect; + +inspect({ + "preinstall": "script" +}); \ No newline at end of file -- cgit v1.2.3