Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-04fix: remove dedupe --saveGar
* 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.
2022-04-04fix: replace deprecated String.prototype.substr() (#4667)CommanderRoot
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
2022-03-30fix: work better with system manpages (#4610)David Walker
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-".
2022-03-30fix: consolidate split-package-namesGar
It was only ever used by `npm edit` so it's inline now. Rewrote `npm edit` tests to be real
2022-03-28fix: consolidate path delimiter logicGar
2022-03-28fix: consolidate is-windows codeGar
2022-03-28fix: consolidate command alias codeGar
2022-03-28fix: really load all commands in tests, add description to birthdayGar
2022-03-28fix: move shellout logic into commandsGar
Each command now signals whether or not it is a shellout
2022-03-24feat: add logs-dir config to set custom logging locationLuke Karrys
This also allows logs-max to be set to 0 to disable log file writing. Closes #4466 Closes #4206
2022-03-24fix(unpublish): properly apply publishConfig (#4601)Gar
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.
2022-03-24fix: remove always true condition (#4590)XhmikosR
2022-03-24feat(version): reify on workspace version change (#4588)Ruy Adorno
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
2022-03-17fix: properly show `npm view ./directory` (#4576)Gar
2022-03-17docs: add foreground-scripts and ignore-scripts to commandsGar
I think this gets them all
2022-03-17fix: remove name from unpublished messageGar
It is no longer returned from the npm registry
2022-03-15fix(owner): bypass cache when fetching packument (#4565)Gar
2022-03-10fix: clean up owner command and otplease (#4528)Gar
2022-03-10fix(doctor): allow for missing local bin and node_modulesGar
2022-03-10fix(doctor): don't retry pingGar
2022-03-10chore: rewrite doctor testsGar
2022-03-03fix: ignore implicit workspace for whoami (#4493)nlf
2022-03-02fix(ls): respect `--include-workspace-root` (#4481)Nathan Fritz
2022-03-02fix: ignore implict workspace for some commands (#4479)Nathan Fritz
Closes #4404 Special thanks to @mshima for submitting a similar PR #4439
2022-03-02fix: publish of tarballs includes README in packument (#4480)Nathan Fritz
2022-02-24chore(cli): remove log option from being passed anywhereLuke Karrys
2022-02-17docs: update usage example for npm pkg (#4424)Wassim Chegham
Add example for setting array values Fixes #4320
2022-02-09fix(publish): pass dryRun: true to libnpmpack so it doesnt write a tarballnlf
2022-02-09fix(pack): let libnpmpack take care of file writesnlf
2022-02-08fix(log): pass in logger to more external modulesGar
We missed two commands in the last PR. This should complete the task
2022-02-03fix(outdated): parse aliased modulesRuy Adorno
Fixes `npm outdated` to properly parse and display info on aliased packages. Fixes: https://github.com/npm/cli/issues/2800
2022-02-03fix(ci): should not use package-lock configRuy Adorno
`npm ci` should never be affected by the `package-lock` config. Fixes: https://github.com/npm/cli/issues/4185
2022-02-03fix(ci): lock file validationRuy Adorno
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
2022-02-03fix(log): pass in logger to external modulesGar
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.
2022-01-26fix(logout): require proper auth.js from npm-registry-fetchGar
2022-01-20fix: npm update --save (#4223)Ruy Adorno
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
2022-01-07fix(unpublish): Show warning on unpublish command when last version (#4191)Emin Buğra Saral
2021-12-09feat: display `publishConfig` during `config list`Luke Karrys
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
2021-12-09fix: output configured registry during publishLuke Karrys
Closes: npm/statusboard#416 PR-URL: https://github.com/npm/cli/pull/4143 Credit: @lukekarrys Close: #4143 Reviewed-by: @wraithgar
2021-12-09fix: redact all private keys from config outputLuke Karrys
PR-URL: https://github.com/npm/cli/pull/4142 Credit: @lukekarrys Close: #4142 Reviewed-by: @wraithgar
2021-12-02chore: update one-time password promptDarcy Clarke
2021-12-02feat: streaming debug logfileLuke Karrys
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
2021-11-11chore: switch to true static attributesGar
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
2021-11-11fix(install): command completion with single matchGar
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
2021-11-11fix: command completionGar
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
2021-11-11fix: clean up birthday commandGar
Clean up tests too PR-URL: https://github.com/npm/cli/pull/4033 Credit: @wraithgar Close: #4033 Reviewed-by: @lukekarrys
2021-11-10fix: explicitly allow `npm help` to open file:/// man pagesGar
PR-URL: https://github.com/npm/cli/pull/4026 Credit: @wraithgar Close: #4026 Reviewed-by: @isaacs
2021-11-05chore: update to latest eslint and linting rulesGar
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
2021-11-04fix: make prefixed usage errors more consistentLuke Karrys
PR-URL: https://github.com/npm/cli/pull/3987 Credit: @lukekarrys Close: #3987 Reviewed-by: @wraithgar
2021-11-04fix(help|edit): use npm.exec, use file:///Gar
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