Age | Commit message (Collapse) | Author |
|
* Removed dedupe --save documentation and attempted implementation.
* Remove some unneeded otplease mocks from test
`npm dedupe --save` didn't work in a easy to understand way. It would
only update a top level dependency that was duplicated in the tree.
Found this out rewriting the dedupe tests to be real. This is not very
intuitive and it's best if folks use update or install for saving to
package.json.
|
|
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
|
|
In certain edge cases, the glob could find files that manNumberRegex wouldn't match.
A possible solution would be to try to bring the two closer, but since globs and regexes are different syntaxes, the two will never be exactly the same.
It's always asking for bugs; better to just handle the issue directly.
In addition, when npm is installed globally in a system directory, the
glob can find other manpages with similar names.
For instance "install.1", "init.1", etc. Preferring low-numbered
sections isn't enough in these cases; it's also necessary to prefer
the pages prefixed with "npm-".
|
|
It was only ever used by `npm edit` so it's inline now.
Rewrote `npm edit` tests to be real
|
|
|
|
|
|
|
|
|
|
Each command now signals whether or not it is a shellout
|
|
This also allows logs-max to be set to 0 to disable log file writing.
Closes #4466
Closes #4206
|
|
The tests for unpublish were mocked so heavily they weren't actually
asserting anything. In rewriting them several bugs were found.
- `write=true` was not being consistenly used when fetching packument
data, it is now.
- The decision on when to load the local package.json file was not
working at all, that has been fixed. If the cwd contains a
package.json whose name matches the package you are uninstalling, the
local package.json will be read and its publishConfig applied to your
request.
- dead code inside the `npm unpublish` path was removed. There is no
need to check if you are unpublishing the last version here, you're
already unpublishing the entire project.
- publishConfig is now being applied through the config flatten method,
not a raw object assignment.
|
|
|
|
Adds a minimalistic reify step that updates the installed tree after a
version change within one of the configured workspaces when using any
of the workspaces config options.
It's also possible to use the `--save` config option in order to
auto update semver ranges of dependencies declarations accross dependent
`package.json` files.
Fixes: https://github.com/npm/cli/issues/3403
Relates to: https://github.com/npm/rfcs/issues/556
Relates to: https://github.com/npm/cli/issues/3757
Relates to: https://github.com/npm/cli/issues/4193
|
|
|
|
I think this gets them all
|
|
It is no longer returned from the npm registry
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Closes #4404
Special thanks to @mshima for submitting a similar PR #4439
|
|
|
|
|
|
Add example for setting array values
Fixes #4320
|
|
|
|
|
|
We missed two commands in the last PR. This should complete the task
|
|
Fixes `npm outdated` to properly parse and display info on aliased
packages.
Fixes: https://github.com/npm/cli/issues/2800
|
|
`npm ci` should never be affected by the `package-lock` config.
Fixes: https://github.com/npm/cli/issues/4185
|
|
Make sure to validate any lock file (either package-lock.json or
npm-shrinkwrap.json) against the current install. This will properly
throw an error in case any of the dependencies being installed don't
match the dependencies that are currently listed in the lock file.
Fixes: https://github.com/npm/cli/issues/2701
Fixes: https://github.com/npm/cli/issues/3947
|
|
Most of these module use npm-registry-fetch under the hood, which will
log things like the `npm-notice` header if seen. Currently we aren't
passing in a logger to them, which means that log message is never seen,
among any other logged messages those modules may need to make.
I added tests where I could. Some tests were in a state where the entire
libnpm* module was an empty mocked function, so asserting that it got
passed a `log` attribute was onerous.
|
|
|
|
Previously `npm update` was not respecting the `save` option, it
would be impossible for users to use `npm update` and automatically
update their `package.json` files.
This fixes it by adding extra steps on `Arborist.reify._saveIdealTree`
to read direct dependencies of any `package.json` and update them as
needed when reifying using the `update` and `save` options.
- Uses config.isDefault to set a different value for the `save` config
for both the update and dedupe commands
- Tweaks arborist to make sure saveIdealTree preserves the behavior of
skipping writing to package-lock.json on save=false for install while
still writing the lockfile for `npm update` with its new default value
of save=false.
- Updated and added some new tests on arborist to cover for these tweaks
- Added `npm update --save` smoke test on cli
Fixes: https://github.com/npm/cli/issues/708
Fixes: https://github.com/npm/cli/issues/2704
Relates to: https://github.com/npm/feedback/discussions/270
|
|
|
|
Closes: npm/statusboard#417
If the file at `$NPM_CONFIG_PREFIX/package.json` contains a
`publishConfig`, the key/value pairs will be printed along with the rest
of the output from `npm config ls`.
PR-URL: https://github.com/npm/cli/pull/4146
Credit: @lukekarrys
Close: #4146
Reviewed-by: @nlf
|
|
Closes: npm/statusboard#416
PR-URL: https://github.com/npm/cli/pull/4143
Credit: @lukekarrys
Close: #4143
Reviewed-by: @wraithgar
|
|
PR-URL: https://github.com/npm/cli/pull/4142
Credit: @lukekarrys
Close: #4142
Reviewed-by: @wraithgar
|
|
|
|
This decouples the log file writing from the terminal logging. We now
open an append only file at the start of the process and stream logs to
it. We still only display the log file message in timing mode or if
there is an error, but the file is still written regardless.
All logging now goes through `proc-log` and this is the first step to
removing `npmlog`. For now `npmlog` is still used for the terminal
logging but with a shim in front of it to make it easier to test and
use in conjunction with `proc-log`. Ref: npm/statusboard#366
This also refactors many of the tests to always use an explicit
`t.testdir` for their cache since the file is opened on each `new Npm()`.
Tests are also refactored to use more of `MockNpm` with behavior to
add config items and load `npm` if necessary. A new fixture `mockGlobals`
was also added to make much of this more ergonomic. Ref: npm/statusboard#410
Closes npm/statusboard#411
Closes npm/statusboard#367
PR-URL: https://github.com/npm/cli/pull/4062
Credit: @lukekarrys
Close: #4062
Reviewed-by: @wraithgar
|
|
now that we're off of node10 we can clean this up
PR-URL: https://github.com/npm/cli/pull/3989
Credit: @wraithgar
Close: #3989
Reviewed-by: @lukekarrys
|
|
During a refactoring of the tests a bug was found in the install command
completion that would return nothing if there was a valid match, this
fixes that bug and also makes the tests actually test things.
PR-URL: https://github.com/npm/cli/pull/4023
Credit: @wraithgar
Close: #4023
Reviewed-by: @lukekarrys
|
|
The fake npm object in the tests wasn't returning an async function
Fixes: https://github.com/npm/cli/issues/4020
PR-URL: https://github.com/npm/cli/pull/4032
Credit: @wraithgar
Close: #4032
Reviewed-by: @lukekarrys
|
|
Clean up tests too
PR-URL: https://github.com/npm/cli/pull/4033
Credit: @wraithgar
Close: #4033
Reviewed-by: @lukekarrys
|
|
PR-URL: https://github.com/npm/cli/pull/4026
Credit: @wraithgar
Close: #4026
Reviewed-by: @isaacs
|
|
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
|