From 7a990d9d42b633ca70eca235df0f9ba09f876720 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Sat, 12 Oct 2024 12:14:32 -0700 Subject: feat(npm): support `--allow-scripts` on `deno run` (and `deno add`, `deno test`, etc) (#26075) Fixes https://github.com/denoland/deno/issues/25533. Fixes https://github.com/denoland/deno/issues/25396. Previously we only supported it on `deno install` and `deno cache`, which is annoying if you're using `nodeModulesDir: auto`. Also changes from printing output of lifecycle scripts directly to capturing the output and only printing it on error. --- tests/registry/npm/@denotest/node-lifecycle-scripts/1.0.0/index.js | 4 +--- .../registry/npm/@denotest/node-lifecycle-scripts/1.0.0/package.json | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/registry/npm/@denotest/node-lifecycle-scripts') diff --git a/tests/registry/npm/@denotest/node-lifecycle-scripts/1.0.0/index.js b/tests/registry/npm/@denotest/node-lifecycle-scripts/1.0.0/index.js index 4eb9b107a..242fe92f5 100644 --- a/tests/registry/npm/@denotest/node-lifecycle-scripts/1.0.0/index.js +++ b/tests/registry/npm/@denotest/node-lifecycle-scripts/1.0.0/index.js @@ -1,5 +1,3 @@ -modules.export = { +module.exports = { value: 42 }; - -console.log('index.js', modules.export.value); \ No newline at end of file diff --git a/tests/registry/npm/@denotest/node-lifecycle-scripts/1.0.0/package.json b/tests/registry/npm/@denotest/node-lifecycle-scripts/1.0.0/package.json index 3c6fa005f..085ab6414 100644 --- a/tests/registry/npm/@denotest/node-lifecycle-scripts/1.0.0/package.json +++ b/tests/registry/npm/@denotest/node-lifecycle-scripts/1.0.0/package.json @@ -6,6 +6,7 @@ "install": "echo install && cli-esm 'hello from install script'", "postinstall": "echo postinstall && npx cowsay postinstall" }, + "exports": "./index.js", "dependencies": { "@denotest/bin": "1.0.0" } -- cgit v1.2.3