Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
111e284
[email protected]
ruyadorno Mar 18, 2021
33c8536
[email protected]
ruyadorno Mar 18, 2021
af7eaac
[email protected]
ruyadorno Mar 18, 2021
9166230
@npmcli/[email protected]
ruyadorno Mar 18, 2021
f06c12e
[email protected]
ruyadorno Mar 18, 2021
966057c
[email protected]
ruyadorno Mar 18, 2021
b395763
[email protected]
ruyadorno Mar 18, 2021
46e14bd
chore(config): remove flatOptions references
wraithgar Mar 9, 2021
8cce428
fix(publish): handle case where multiple config list is present
kenrick95 Mar 15, 2021
6598bfe
New consolidated config definitions
isaacs Mar 15, 2021
68db124
Auto-generate 'npm help 7 config' from actual definitions
isaacs Mar 15, 2021
f52c51d
@npmcli/[email protected]
isaacs Mar 15, 2021
7c89e74
update lib/*.js to use new config structures
isaacs Mar 15, 2021
aaafab8
Remove old config definitions and flattening logic
isaacs Mar 16, 2021
a8d0751
[email protected]
isaacs Mar 18, 2021
41facf6
feat(help): refactor npm help/help-search
wraithgar Mar 11, 2021
ad65bd9
docs(configuring-npm): Fix broken link
Mar 13, 2021
0a331ac
bump version in v7 bug template
jansepke Mar 15, 2021
78cb830
docs: add asdf-nodejs as a viable version manager
augustobmoura Mar 15, 2021
7e99515
chore: fix rebuild win tests
ruyadorno Mar 18, 2021
fc8a1ff
fix(tests): go back to mockNpm in test
wraithgar Mar 18, 2021
b419bfb
Update test-coverage command
chowkapow Mar 15, 2021
8a38afe
docs(package-json): document default main behavior
klausbayrhammer Mar 16, 2021
33c4189
feat: add run-script workspaces
ruyadorno Mar 7, 2021
d98edd1
restore npm.flatOptions.npmCommand
isaacs Mar 18, 2021
e94a458
fix(suggestions): clarify Unknown command output
wraithgar Mar 19, 2021
629aaf3
[email protected]
wraithgar Mar 22, 2021
b876442
fix(usage): tie usage to config
wraithgar Mar 19, 2021
e1b3b31
feat: add exec workspaces
ruyadorno Mar 7, 2021
93a061d
fix(usage): add action items to error output
wraithgar Mar 22, 2021
15ee1ae
fix: yes config
ruyadorno Mar 22, 2021
b7b4491
fix: which config
ruyadorno Mar 22, 2021
4fb6e2f
fix: npm birthday
ruyadorno Mar 22, 2021
1924eb4
[email protected]
wraithgar Mar 23, 2021
8e4621d
fix(run-script): remove log.disableProgress
ruyadorno Mar 23, 2021
f76e7c2
[email protected]
ruyadorno Mar 23, 2021
4928512
[email protected]
ruyadorno Mar 23, 2021
7b5606b
@npmcli/[email protected]
ruyadorno Mar 23, 2021
b043bf9
fix docs generation for yes config
ruyadorno Mar 23, 2021
7706557
docs: changelog for v7.7.0
ruyadorno Mar 23, 2021
0364be0
update AUTHORS
ruyadorno Mar 23, 2021
581b60b
7.7.0
ruyadorno Mar 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: yes config
`npm exec <pkg>` was failing for packages not available in the local or
global scope due to the default value of the `yes` config having been
changed to `false` during the latest config refactor. That caused
`npm exec` to throw with a `canceled` error message since the current
implementation expects the default value to be falsy but not `false`.

This change reinstates the previous default config value for `yes` and
changes the implementation to throw with a proper error object in order
to get a stack trace when running with `--loglevel=verbose`.
  • Loading branch information
ruyadorno committed Mar 22, 2021
commit 15ee1aec3675bc026fc360f81b04bae4db84d942
4 changes: 2 additions & 2 deletions lib/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class Exec extends BaseCommand {
if (!this.npm.config.get('yes')) {
// set -n to always say no
if (this.npm.config.get('yes') === false)
throw 'canceled'
throw new Error('canceled')

if (!process.stdin.isTTY || ciDetect()) {
this.npm.log.warn('exec', `The following package${
Expand All @@ -209,7 +209,7 @@ class Exec extends BaseCommand {
}Ok to proceed? `
const confirm = await read({ prompt, default: 'y' })
if (confirm.trim().toLowerCase().charAt(0) !== 'y')
throw 'canceled'
throw new Error('canceled')
}
}
await arb.reify({ ...this.npm.flatOptions, add })
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/config/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2044,8 +2044,8 @@ define('workspaces', {
})

define('yes', {
default: false,
type: Boolean,
default: null,
type: [null, Boolean],
short: 'y',
description: `
Automatically answer "yes" to any prompts that npm might print on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1222,8 +1222,8 @@ workspaces.
#### \`yes\`
* Default: false
* Type: Boolean
* Default: null
* Type: null or Boolean
Automatically answer "yes" to any prompts that npm might print on the
command line.
Expand Down
4 changes: 2 additions & 2 deletions test/lib/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ t.test('abort if prompt rejected', t => {
_from: 'bar@',
}
exec.exec(['foobar'], er => {
t.equal(er, 'canceled', 'should be canceled')
t.match(er, /canceled/, 'should be canceled')
t.strictSame(MKDIRPS, [installDir], 'need to make install dir')
t.match(ARB_CTOR, [{ path }])
t.strictSame(ARB_REIFY, [], 'no install performed')
Expand Down Expand Up @@ -1060,7 +1060,7 @@ t.test('abort if -n provided', t => {
_from: 'bar@',
}
exec.exec(['foobar'], er => {
t.equal(er, 'canceled', 'should be canceled')
t.match(er, /canceled/, 'should be canceled')
t.strictSame(MKDIRPS, [installDir], 'need to make install dir')
t.match(ARB_CTOR, [{ path }])
t.strictSame(ARB_REIFY, [], 'no install performed')
Expand Down