From 5be7d6ea555bc25acaae1bfd309d64ce6693b084 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 29 Jun 2022 14:45:34 -0400 Subject: [PATCH] docs: add foreground-scripts to run-script page (#5087) --- docs/content/commands/npm-run-script.md | 15 +++++++++++++++ lib/commands/run-script.js | 1 + .../test/lib/load-all-commands.js.test.cjs | 2 +- tap-snapshots/test/lib/npm.js.test.cjs | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/content/commands/npm-run-script.md b/docs/content/commands/npm-run-script.md index d94040f1a215..f606ec6bf59e 100644 --- a/docs/content/commands/npm-run-script.md +++ b/docs/content/commands/npm-run-script.md @@ -240,6 +240,21 @@ will *not* run any pre- or post-scripts. +#### `foreground-scripts` + +* Default: false +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + + #### `script-shell` * Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows diff --git a/lib/commands/run-script.js b/lib/commands/run-script.js index a1591c7900b4..8507dbe79a90 100644 --- a/lib/commands/run-script.js +++ b/lib/commands/run-script.js @@ -35,6 +35,7 @@ class RunScript extends BaseCommand { 'include-workspace-root', 'if-present', 'ignore-scripts', + 'foreground-scripts', 'script-shell', ] diff --git a/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/tap-snapshots/test/lib/load-all-commands.js.test.cjs index 13a3b06fe33d..57dd6126660c 100644 --- a/tap-snapshots/test/lib/load-all-commands.js.test.cjs +++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs @@ -746,7 +746,7 @@ npm run-script [-- ] Options: [-w|--workspace [-w|--workspace ...]] [-ws|--workspaces] [--include-workspace-root] [--if-present] [--ignore-scripts] -[--script-shell ] +[--foreground-scripts] [--script-shell ] aliases: run, rum, urn diff --git a/tap-snapshots/test/lib/npm.js.test.cjs b/tap-snapshots/test/lib/npm.js.test.cjs index 2cf4f53ecab8..b287e73f7f7f 100644 --- a/tap-snapshots/test/lib/npm.js.test.cjs +++ b/tap-snapshots/test/lib/npm.js.test.cjs @@ -790,7 +790,7 @@ All commands: Options: [-w|--workspace [-w|--workspace ...]] [-ws|--workspaces] [--include-workspace-root] [--if-present] [--ignore-scripts] - [--script-shell ] + [--foreground-scripts] [--script-shell ] aliases: run, rum, urn