Skip to content

Commit

Permalink
add foreground-scripts option
Browse files Browse the repository at this point in the history
PR-URL: #2456
Credit: @isaacs
Close: #2456
Reviewed-by: @ruyadorno
  • Loading branch information
isaacs committed Jan 7, 2021
1 parent 54a7bd1 commit 47ed2df
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/content/using-npm/config.md
Expand Up @@ -419,6 +419,18 @@ mistakes, unnecessary performance degradation, and malicious input.
If you don't have a clear idea of what you want to do, it is strongly
recommended that you do not use this option!

#### 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.

#### format-package-lock

* Default: true
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/config.js
Expand Up @@ -83,6 +83,7 @@ const defaults = {
'fetch-retry-mintimeout': 10000,
'fetch-timeout': 5 * 60 * 1000,
force: false,
'foreground-script': false,
'format-package-lock': true,
fund: true,
git: 'git',
Expand Down Expand Up @@ -224,6 +225,7 @@ const types = {
'fetch-retry-mintimeout': Number,
'fetch-timeout': Number,
force: Boolean,
'foreground-script': Boolean,
'format-package-lock': Boolean,
fund: Boolean,
git: String,
Expand Down
1 change: 1 addition & 0 deletions lib/utils/flat-options.js
Expand Up @@ -133,6 +133,7 @@ const flatten = obj => ({
packageLockOnly: obj['package-lock-only'],
globalStyle: obj['global-style'],
legacyBundling: obj['legacy-bundling'],
foregroundScripts: !!obj['foreground-scripts'],
scriptShell: obj['script-shell'] || undefined,
shell: obj.shell,
omit: buildOmitList(obj),
Expand Down
4 changes: 4 additions & 0 deletions tap-snapshots/test-lib-utils-config.js-TAP.test.js
Expand Up @@ -46,6 +46,7 @@ Object {
"fetch-retry-mintimeout": 10000,
"fetch-timeout": 300000,
"force": false,
"foreground-script": false,
"format-package-lock": true,
"fund": true,
"git": "git",
Expand Down Expand Up @@ -354,6 +355,7 @@ Object {
"fetch-retry-mintimeout": "{Number TYPE}",
"fetch-timeout": "{Number TYPE}",
"force": "{Boolean TYPE}",
"foreground-script": "{Boolean TYPE}",
"format-package-lock": "{Boolean TYPE}",
"fund": "{Boolean TYPE}",
"git": "{String TYPE}",
Expand Down Expand Up @@ -573,6 +575,7 @@ Object {
"fetch-retry-mintimeout": 10000,
"fetch-timeout": 300000,
"force": false,
"foreground-script": false,
"format-package-lock": true,
"fund": true,
"git": "git",
Expand Down Expand Up @@ -881,6 +884,7 @@ Object {
"fetch-retry-mintimeout": "{Number TYPE}",
"fetch-timeout": "{Number TYPE}",
"force": "{Boolean TYPE}",
"foreground-script": "{Boolean TYPE}",
"format-package-lock": "{Boolean TYPE}",
"fund": "{Boolean TYPE}",
"git": "{String TYPE}",
Expand Down
1 change: 1 addition & 0 deletions tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js
Expand Up @@ -36,6 +36,7 @@ Object {
"engineStrict": "engine-strict",
"fmode": 438,
"force": "force",
"foregroundScripts": false,
"formatPackageLock": "format-package-lock",
"fund": "fund",
"git": "git",
Expand Down

0 comments on commit 47ed2df

Please sign in to comment.