Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add foreground-scripts option #2456

Merged
merged 1 commit into from Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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