Skip to content

Commit 47ed2df

Browse files
committed
add foreground-scripts option
PR-URL: #2456 Credit: @isaacs Close: #2456 Reviewed-by: @ruyadorno
1 parent 54a7bd1 commit 47ed2df

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

docs/content/using-npm/config.md

+12
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,18 @@ mistakes, unnecessary performance degradation, and malicious input.
419419
If you don't have a clear idea of what you want to do, it is strongly
420420
recommended that you do not use this option!
421421

422+
#### foreground-scripts
423+
424+
* Default: false
425+
* Type: Boolean
426+
427+
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)
428+
scripts for installed packages in the foreground process, sharing standard
429+
input, output, and error with the main npm process.
430+
431+
Note that this will generally make installs run slower, and be much
432+
noisier, but can be useful for debugging.
433+
422434
#### format-package-lock
423435

424436
* Default: true

lib/utils/config.js

+2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const defaults = {
8383
'fetch-retry-mintimeout': 10000,
8484
'fetch-timeout': 5 * 60 * 1000,
8585
force: false,
86+
'foreground-script': false,
8687
'format-package-lock': true,
8788
fund: true,
8889
git: 'git',
@@ -224,6 +225,7 @@ const types = {
224225
'fetch-retry-mintimeout': Number,
225226
'fetch-timeout': Number,
226227
force: Boolean,
228+
'foreground-script': Boolean,
227229
'format-package-lock': Boolean,
228230
fund: Boolean,
229231
git: String,

lib/utils/flat-options.js

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ const flatten = obj => ({
133133
packageLockOnly: obj['package-lock-only'],
134134
globalStyle: obj['global-style'],
135135
legacyBundling: obj['legacy-bundling'],
136+
foregroundScripts: !!obj['foreground-scripts'],
136137
scriptShell: obj['script-shell'] || undefined,
137138
shell: obj.shell,
138139
omit: buildOmitList(obj),

tap-snapshots/test-lib-utils-config.js-TAP.test.js

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Object {
4646
"fetch-retry-mintimeout": 10000,
4747
"fetch-timeout": 300000,
4848
"force": false,
49+
"foreground-script": false,
4950
"format-package-lock": true,
5051
"fund": true,
5152
"git": "git",
@@ -354,6 +355,7 @@ Object {
354355
"fetch-retry-mintimeout": "{Number TYPE}",
355356
"fetch-timeout": "{Number TYPE}",
356357
"force": "{Boolean TYPE}",
358+
"foreground-script": "{Boolean TYPE}",
357359
"format-package-lock": "{Boolean TYPE}",
358360
"fund": "{Boolean TYPE}",
359361
"git": "{String TYPE}",
@@ -573,6 +575,7 @@ Object {
573575
"fetch-retry-mintimeout": 10000,
574576
"fetch-timeout": 300000,
575577
"force": false,
578+
"foreground-script": false,
576579
"format-package-lock": true,
577580
"fund": true,
578581
"git": "git",
@@ -881,6 +884,7 @@ Object {
881884
"fetch-retry-mintimeout": "{Number TYPE}",
882885
"fetch-timeout": "{Number TYPE}",
883886
"force": "{Boolean TYPE}",
887+
"foreground-script": "{Boolean TYPE}",
884888
"format-package-lock": "{Boolean TYPE}",
885889
"fund": "{Boolean TYPE}",
886890
"git": "{String TYPE}",

tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Object {
3636
"engineStrict": "engine-strict",
3737
"fmode": 438,
3838
"force": "force",
39+
"foregroundScripts": false,
3940
"formatPackageLock": "format-package-lock",
4041
"fund": "fund",
4142
"git": "git",

0 commit comments

Comments
 (0)