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-03-31fix: do not export npm_config_include_workspace_rootgar/test-mocksGar
2022-03-31fix: 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-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-24fix: 100% coverage in tests (#4607)Gar
* 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
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-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-17docs: fix unpublish docs to auto generate usage (#4584)Gar
Also add explanation of what `--force` does for unpublish
2022-03-17docs: explain that git-tag-version=false does not commit (#4574)Gar
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: add isntall alias to install (#4573)Gar
Without this, the isntall-clean alias is matched and ran
2022-03-17fix: remove "bug the author" message from package 404Gar
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-10chore: mocknpm improvementsGar
make tests pass in prefixDir instead of testdir allow for cache and globalPrefix dirs
2022-03-02fix(ls): respect `--include-workspace-root` (#4481)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-08docs: add --save-bundle to --save usage outputGar
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-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
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-03docs: update description about where/when debug log is writtenLuke Karrys
PR-URL: https://github.com/npm/cli/pull/4114 Credit: @lukekarrys Close: #4114 Reviewed-by: @wraithgar
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-22docs: fix typo in `save-peer` descriptionTakuya Fukuju
PR-URL: https://github.com/npm/cli/pull/4072 Credit: @chalkygames123 Close: #4072 Reviewed-by: @wraithgar
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-11chore: clean up snapshotsGar
Looks like tests were removed but the snapshots still have them. PR-URL: https://github.com/npm/cli/pull/4019 Credit: @wraithgar Close: #4019 Reviewed-by: @lukekarrys
2021-11-09chore: refactor pack testsGar
Uses the real npm object and doesn't mock anything. PR-URL: https://github.com/npm/cli/pull/4018 Credit: @wraithgar Close: #4018 Reviewed-by: @lukekarrys
2021-11-04fix: shrinkwrap setting incorrect lockfileVersionLuke Karrys
Fix: #3962 When created from a hidden lockfile, shrinkwrap was always setting the lockfileVersion to 3. The shrinkwrap command also needed to be updated to log the correct message based on the lockfileVersion config instead of the static lockfileVersion. With these fixes, it was possible to log a better message whenever we are changing the lockfileVersion, either from a config or any existing lockfile. Lastly, the tests for shrinkwrap were completely refactored to use the real npm and test all conceivable scenarios, as well as removing usage of `util.promisify` in favor of `fs.promises` now that we've dropped support for Node 10. PR-URL: https://github.com/npm/cli/pull/3978 Credit: @lukekarrys Close: #3978 Reviewed-by: @wraithgar
2021-11-04chore: refactor commandsGar
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
2021-10-27fix: allow `--lockfile-version` config to be string and coerce to numberPelle Wessman
As all CLI input is considered to be string, eg. a "npm install --lockfile-version 3" would fail with the error messages: ``` npm WARN invalid config lockfile-version="3" set in command line options npm WARN invalid config Must be one of: null, 1, 2, 3 ``` Until we have a config system that supports setting type and possible values of configs, we have to specify all string and number values for the `lockfile-version`, but we coerce all values to numbers in the flattener. Co-authored-by: @voxpelli Co-authored-by: @isaacs PR-URL: https://github.com/npm/cli/pull/3949 Credit: @lukekarrys Close: #3949 Reviewed-by: @isaacs
2021-10-15feat(workspaces): add --include-workspace-root and explicit --no-workspacesfritzy/workspace-rootGar
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
2021-10-12feat(config): Add --lockfile-version config optionisaacs
Depends on @npmcli/arborist@4.0.0 Re: https://github.com/npm/rfcs/pull/434 PR-URL: https://github.com/npm/cli/pull/3880 Credit: @isaacs Close: #3880 Reviewed-by: @wraithgar
2021-10-07chore: fix publish testsGar
When the tests are run but the code is not inside a git repo, the results are different. This removes the `gitHead` altogether from the publish results so it works in all environments PR-URL: https://github.com/npm/cli/pull/3845 Credit: @wraithgar Close: #3845 Reviewed-by: @fritzy
2021-09-30Revert "feat(workspaces): --include-workspace-root"Luke Karrys
This reverts commit f17dfa0ced7d8df9bb7baf378bb20d33175c8e8b.
2021-09-30feat(workspaces): --include-workspace-rootGar
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
2021-09-16fix(logs): clean args for failed commandsGar
PR-URL: https://github.com/npm/cli/pull/3761 Credit: @wraithgar Close: #3761 Reviewed-by: @lukekarrys
2021-09-14fix(config): user-agent properly shows ciGar
The way we were flattening user-agent back into itself meant that any values that were dependent on other config items would never be seen, since we have to re-flatten the item for each one it depends on. We also weren't re-flattening the user-agent when setting workspaces or workspace, which were things that affected the final result. This does change the main config value of `user-agent` but not the flattened one. We are not using the main config value anywhere (which is correct). PR-URL: https://github.com/npm/cli/pull/3754 Credit: @wraithgar Close: #3754 Reviewed-by: @nlf
2021-09-13fix(view): Show the correct publish date for versions selected by rangeAnders Kaseorg
Before, `npm view npm@^6` would incorrectly report “published over a year from now” for every entry. Now it reports the correct dates. PR-URL: https://github.com/npm/cli/pull/3739 Credit: @andersk Close: #3739 Reviewed-by: @wraithgar
2021-09-09fix(error-message): clean urls from 404 errorGar
If the package being installed is a url it needs to be cleaned before logging so passwords aren't potentially logged. PR-URL: https://github.com/npm/cli/pull/3732 Credit: @wraithgar Close: #3732 Reviewed-by: @nlf
2021-08-26fix(config): respect --global, --package-lock-onlynlf
This corrects two things, `--global` implies `--location=global` and `--package-lock-only` implies `--package-lock` It also introduces a new sandbox runner for testing purposes. it's not the prettiest thing i've ever written, but it seems to do the job pretty nicely and doesn't require keeping track of wild shenanigans everywhere. Fixes #2747 Fixes #3572 PR-URL: https://github.com/npm/cli/pull/3684 Credit: @nlf Close: #3684 Reviewed-by: @wraithgar
2021-08-26chore: fix gitHead snapshots againGar
Somehow the last one didn't take?
2021-08-26chore: fix gitHead snapshotsGar
2021-08-26read-package-json@4.0.1Gar
* fix: Add gitHead in subdirectories too * fix(man): don't resolve paths to man files