Age | Commit message (Collapse) | Author |
|
* fix: 100% coverage in tests
* Removed dead code in `lib/utils/usage.js`.
* Removed dead code in `lib/base-command.js`.
* Removed "load-all" test, we currently have 100% coverage and new PRs
without tests will be rejected if they don't add coverage for new
files.
* Removed `check-coverage` script as a separate command.
* Removed separate coverage test in ci.yml.
* Removed `coverage` flag from tap config, the default is already to
enforce 100% coverage.
Removed a tiny bit of dead code resulting from this
* fix: clean up usage output
Removed usage lib, rolled logic into base-command.js
Cleaned up usage output to be less redundant
|
|
Closes #4404
Special thanks to @mshima for submitting a similar PR #4439
|
|
|
|
This brings us in line with the rest of the linting rules we are wanting
to use on the npm cli repos.
There were several hundred over-length lines and instead of editing them
all by hand I piped the failing file through `prettier` and back through
`eslint` just to save some time and energy. This means there may be
some quirks in the linting those files have, but we can fix those if we
see them and they bother us.
Other than that there were about 50 lines that are legitimately
over-length, all are now explicitly overridden. Many are tests that
could be snapshots.
PR-URL: https://github.com/npm/cli/pull/3995
Credit: @wraithgar
Close: #3995
Reviewed-by: @lukekarrys
|
|
PR-URL: https://github.com/npm/cli/pull/3987
Credit: @lukekarrys
Close: #3987
Reviewed-by: @wraithgar
|
|
Windows no longer allows `file://`, but instead requires `file:///` for
local file urls.
Also after the command refactor things shifted and the tests didn't
catch that the help pages didn't work at all anymore, and that the
post-edit rebuild didn't work. This cleans up those two issues.
PR-URL: https://github.com/npm/cli/pull/3994
Credit: @wraithgar
Close: #3994
Reviewed-by: @lukekarrys
|
|
This is the first phase of refactoring the internal structure of the npm
commands to set us up for future changes. This iteration changes the
function signature of `exec` for all the commands to be a async (no more
callbacks), and also groups all the commands into their own
subdirectory.
It also removes the Proxy `npm.commands` object, in favor of an
`npm.cmd` and `npm.exec` function that breaks up the two things that
proxy was doing. Namely, getting to the attributes of a given command
(`npm.cmd` now does this), and actually running the command `npm.exec`
does this.
PR-URL: https://github.com/npm/cli/pull/3959
Credit: @wraithgar
Close: #3959
Reviewed-by: @lukekarrys
|
|
Adds a new config item that includes the workspace root. This also changes
--workspaces to a trinary, so that setting it to false will explicitly exclude
workspaces altogether.
PR-URL: https://github.com/npm/cli/pull/3890
Credit: @fritzy
Close: #3890
Reviewed-by: @wraithgar
|
|
This reverts commit f17dfa0ced7d8df9bb7baf378bb20d33175c8e8b.
|
|
Adds a new config item that includes the workspace root when running
non-arborist commands (i.e. repo, version, publish). Arborist will need
to be udpated to look for this flag to change its behavior to include
the workspace root for its functions.
This also changes --workspaces to a trinary, so that setting it to false
will explicitly exclude workspaces altogether. This is also going to
require an arborist change so that it ignores workspaces altogether.
Co-author: @fritzy
PR-URL: https://github.com/npm/cli/pull/3816
Credit: @isaacs
Close: #3816
Reviewed-by: @wraithgar
|
|
It will be helpful to us when debugging the "exit handler never called"
bugs to know which timings were started but not ended.
Tests moved to use real npm.
PR-URL: https://github.com/npm/cli/pull/3479
Credit: @wraithgar
Close: #3479
Reviewed-by: @ruyadorno
|
|
Also includes a preliminary refactor to consolidate workspace logic now
that every command that supports workspaces has it implemented.
PR-URL: https://github.com/npm/cli/pull/3417
Credit: @wraithgar
Close: #3417
Reviewed-by: @ruyadorno
|
|
PR-URL: https://github.com/npm/cli/pull/3312
Credit: @isaacs
Close: #3312
Reviewed-by: @wraithgar
|
|
This adds `--workspace` support to:
- audit (including audit fix)
- ci
- dedupe
- find-dupes
- install
- install-ci-test
- install-test
- prune
- rebuild
- uninstall
- update
Also addresses missing error handling case, identified by @timoxley.
https://github.com/npm/cli/pull/3227#discussion_r631024491
PR-URL: https://github.com/npm/cli/pull/3227
Credit: @isaacs
Close: #3227
Reviewed-by: @ruyadorno
|
|
PR-URL: https://github.com/npm/cli/pull/3055
Credit: @wraithgar
Close: #3055
Reviewed-by: @darcyclarke
|
|
This adds workspaces support to `npm repo` and `npm docs`.
It also updates the usage output to support the -w and -ws parameters
output, and cleans up some unneccessary functions in `run-script` and
`exec`.
PR-URL: https://github.com/npm/cli/pull/2972
Credit: @wraithgar
Close: #2972
Reviewed-by: @nlf
|
|
This starts us down the path of tying the params our commands accept to
their config items. For now it is optional, and not every current
config item would cleanly render if we added them today.
The ones that are added here DO render nicely, and we can iterate from
here. We can also at a later date do the same kind of appraoch with our
positional args.
PR-URL: https://github.com/npm/cli/pull/2908
Credit: @wraithgar
Close: #2908
Reviewed-by: @nlf, @isaacs
|
|
- Add workspaces-related configs:
- workspace: list of workspaces names/dir to filter for
- workspaces: boolean value to enable/disable workspaces awareness
- adds the proposed note in the docs of each of the commands
that are not affected by these configs.
- Add workspaces support to `npm run-script`
- add ability to serially run lifecycle scripts in workspaces
- add ability to list scripts for all workspaces
- add colors to `npm run` (no args) output
Relates to: https://github.com/npm/rfcs/pull/117
Fixes: https://github.com/npm/statusboard/issues/276
Fixes: https://github.com/npm/statusboard/issues/283
Fixes: https://github.com/npm/statusboard/issues/284
Fixes: https://github.com/npm/statusboard/issues/285
Fixes: https://github.com/npm/statusboard/issues/286
PR-URL: https://github.com/npm/cli/pull/2864
Credit: @ruyadorno
Close: #2864
Reviewed-by: @wraithgar
|
|
Lots of dead code removed thanks to streamlining of logic.
`npm help` `npm <command>` and `npm help-search` are all now separated
concerns, handling their own use cases. `help` calls `help-search` as a
last resort, but `npm <command>` no longer tries to wind its way through
to `help-search` just to get the basic npm usage displayed.
The `did you mean` output has been expanded. It now always suggests top
level commands, scripts, and bins, and suggests them in the way they
should be called.
PR-URL: https://github.com/npm/cli/pull/2859
Credit: @wraithgar
Close: #2859
Reviewed-by: @ruyadorno
|
|
PR-URL: https://github.com/npm/cli/pull/2855
Credit: @dwardu
Close: #2855
Reviewed-by: @ruyadorno, @darcyclarke
|
|
Small refactor of commands to allow usage to be more programmatically
generated, leading us in the direction of more tighly coupling each
command to the params it accepts.
PR-URL: https://github.com/npm/cli/pull/2821
Credit: @wraithgar
Close: #2821
Reviewed-by: @isaacs
|