Instead of files randomly requiring the npm singleton,
we pass it where it needs to go so that tests don't need
to do so much require mocking everywhere
PR-URL: https://github.com/npm/cli/pull/2772
Credit: @wraithgar
Close: #2772
Reviewed-by: @ruyadorno
We also removed the "none" script because we handle a missing
script just fine. There is no need to put an empty one in
PR-URL: https://github.com/npm/cli/pull/2759
Credit: @wraithgar
Close: #2759
Reviewed-by: @nlf
Still pending test coverage for most of these, but wanted to give them a
clean sweep to get the "load-all-commands" tests passing.
The following changes are in here:
- All commands now have a `completion()` method and a usage string that
uses the same `usage` util consistently.
- The `silent` argument to many commands has been removed.
- All commands use the `cmd = ${cmd}(args).then(() => cb()).catch(cb)`
pattern consistently.
Full test coverage for all commands is still lacking, and will have to
be done prior to the GA v7 release.