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
path: root/test
AgeCommit message (Collapse)Author
2021-06-10fix(tests): mock writeFile in pack tests so we dont create 0 byte files in ↵nlf
the repo PR-URL: https://github.com/npm/cli/pull/3364 Credit: @nlf Close: #3364 Reviewed-by: @wraithgar
2021-06-03fix(update-notifier): parallelize check for updatesisaacs
This prevents npm from hanging for an update notification if the server is slow to respond or the cache file is slow to write. Failure mode is just that we notify more often than needed, which is not so bad. PR-URL: https://github.com/npm/cli/pull/3348 Credit: @isaacs Close: #3348 Reviewed-by: @wraithgar
2021-06-02fix: do not update notify when installing npm@specisaacs/no-notifier-for-installing-npm-at-latestisaacs
PR-URL: https://github.com/npm/cli/pull/3345 Credit: @isaacs Close: #3345 Reviewed-by: @wraithgar
2021-06-01libnpmexec@1.2.0Ruy Adorno
2021-06-01fix: refactor get package nameGar
renames read-local-package to read-package-name The global check needed to be moved outside this function, because it was handled differently (and will be even moreso when we implement diff workspaces) in each function. This allowed us to now pass in the prefix itself instead of the npm object, so we can reuse this function to look up package names when we refactor npm diff for workspaces. PR-URL: https://github.com/npm/cli/pull/3331 Credit: @wraithgar Close: #3331 Reviewed-by: @ruyadorno
2021-06-01fix(libnpmexec): don't detach output from npmGar
The npm output function refers to this.log. libnpmexec has that passed in, which decoupled the function from the npm object. This fixes it, and sets the tests up in a way where if the output function ever becomes detached from this.npm in the same way, tests will fail. PR-URL: https://github.com/npm/cli/pull/3329 Credit: @wraithgar Close: #3329 Reviewed-by: @ruyadorno
2021-05-27fix(publish): skip private workspacesRuy Adorno
Allow users to publish all workspaces with `npm publish --ws` while also skipping any workspace that might have been intentionally marked as private, using `"private": true` in its package.json file. Fixes: https://github.com/npm/cli/issues/3268 PR-URL: https://github.com/npm/cli/pull/3285 Credit: @ruyadorno Close: #3285 Reviewed-by: @wraithgar
2021-05-27feat(link): add workspace supportisaacs
PR-URL: https://github.com/npm/cli/pull/3312 Credit: @isaacs Close: #3312 Reviewed-by: @wraithgar
2021-05-26fix: set audit exit code properlyisaacs
When running 'npm audit', we properly exited correctly with the appropriate exitCode based on the audit level config and the report results. However, when going through the reifyFinish() function (as we do for 'npm audit fix'), we were not setting that properly if the auditLevel was not set. Furthermore, if the auditLevel WAS set, we were setting the exit code to non-zero for *other* reify commands (install, update, etc.), where the audit information should be strictly advisory. When --json and --loglevel=silent were set, the exitCode was never being set properly. This fixes all these problems. PR-URL: https://github.com/npm/cli/pull/3311 Credit: @isaacs Close: #3311 Reviewed-by: @wraithgar
2021-05-24fix(ls): show relative paths from rootisaacs
Change the output in `npm ls` for symlink dependencies (including workspaces) to show the relative path from the project root, rather than the absolute path of the link target. This makes the output much less noisy and more ergonomic when many workspaces and link dependencies are in use, especially when paths are long. It is arguable that this output might be slightly misleading, since the _actual_ workspace symlink from `${root}/node_modules/b` to `${root}/packages/b` has a link value of `../packages/b`, not just `packages/b`. (Or on Windows, always the full absolute path, because junctions.) Thus, `npm ls b` will not show the same output as `ls -l node_modules/b`. However, `npm ls` shows the logical tree, not the physical tree, so presenting the user with a path that they can use and interpret is more important than presenting them with the strictly accurate details of their filesystem. PR-URL: https://github.com/npm/cli/pull/3272 Credit: @isaacs Close: #3272 Reviewed-by: @darcyclarke
2021-05-20feat: add ls workspacesRuy Adorno
- Add listing workspaces deps by default in `npm ls` - Add ability to filter the result tree by workspace using the -w config - Added tests and docs Fixes: https://github.com/npm/statusboard/issues/302 PR-URL: https://github.com/npm/cli/pull/3250 Credit: @ruyadorno Close: #3250 Reviewed-by: @isaacs
2021-05-20fix: restore '--json' argument to 'npm pack' commandmrmlnc
PR-URL: https://github.com/npm/cli/pull/3217 Credit: @mrmlnc Close: #3217 Reviewed-by: @isaacs, @wraithgar, @ruyadorno
2021-05-20feat(outdated): add workspaces supportRuy Adorno
- Add listing outdated direct deps of a workspace in `npm outdated` - Add ability to filter the results of `npm outdated` using `-w` config - Added tests and docs Fixes: https://github.com/npm/statusboard/issues/303 PR-URL: https://github.com/npm/cli/pull/3260 Credit: @ruyadorno Close: #3260 Reviewed-by: @isaacs
2021-05-20feat(unpublish): add workspace/dry-run supportGar
PR-URL: https://github.com/npm/cli/pull/3251 Credit: @wraithgar Close: #3251 Reviewed-by: @ruyadorno, @isaacs
2021-05-20chore(tests): tie usage output to snapshotsGar
We have another PR in flight that will start auto-generating some content in `docs/content/commands`, and will run `postsnap`, which means that if we tie the usage output to a snapshot, the docs will also be updated when the snapshots change. PR-URL: https://github.com/npm/cli/pull/3246 Credit: @wraithgar Close: #3246 Reviewed-by: @isaacs
2021-05-20Add workspaces support to reify/rebuild commandsisaacs
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
2021-05-20feat(explain): add workspaces supportRuy Adorno
- Add highlight style for workspaces items in human output - Add ability to filter results by workspace using `-w` config - Added tests and docs Fixes: https://github.com/npm/statusboard/issues/300 PR-URL: https://github.com/npm/cli/pull/3265 Credit: @ruyadorno Close: #3265 Reviewed-by: @isaacs
2021-05-13feat: add fund workspacesRuy Adorno
Add workspaces support to `npm fund` - Add lib/workspaces/arborist-cmd.js base class - Add ability to filter fund results to a specific set of workspaces - Added tests and docs Fixes: https://github.com/npm/statusboard/issues/301 PR-URL: https://github.com/npm/cli/pull/3241 Credit: @ruyadorno Close: #3241 Reviewed-by: @isaacs
2021-05-13feat(publish): add workspace supportGar
Errors will make things stop altogether, dunno if we want to bikeshed that here or not PR-URL: https://github.com/npm/cli/pull/3231 Credit: @wraithgar Close: #3231 Reviewed-by: @ruyadorno
2021-05-11fix(view): fix non-registry specsGar
This was working by coincidence in 7.7.6 and before, and broken in the 7.8.0 refactor. Before, it would see there was no "name" in the spec, and then read your local package.json, and from that get a latest tag. So, if you didn't have a package.json in your CWD it would fail with an ENOENT trying to read it. This fixes it for real, so that if you are asking for info from a git spec, it goes ahead and looks for the `latest` tag (or whatever tag you have configured as your default). PR-URL: https://github.com/npm/cli/pull/3209 Credit: @wraithgar Close: #3209 Reviewed-by: @ruyadorno
2021-05-10fix(tests): use config defaultsGar
The mocked npm now uses all config defaults, ensuring we don't have bugs from the disconnect between our currently heavily mocked tests and reality. Eventually the npm mock will be closer to reality, this moves the needle. PR-URL: https://github.com/npm/cli/pull/3211 Credit: @wraithgar Close: #3211 Reviewed-by: @ruyadorno
2021-05-10fix(packages): locale-agnostic string sortingisaacs
This adds the 'en' locale to all instances of String.localeCompare within the CLI codebase. Tests added for the cases where we're sorting arbitrary user-generated data. The tests rely on the fact that 'ch' sorts after 'd' in the `'sk'` locale, but ahead of `'d'` in the `'en'` locale. To ensure that this is the default behavior if no locale is specified, `LC_ALL=sk` is set in the test environment. Other instances of `localeCompare` sort data that the cli controls, so no tests were added. Re: https://github.com/npm/cli/issues/2829 PR-URL: https://github.com/npm/cli/pull/3203 Credit: @isaacs Close: #3203 Reviewed-by: @ruyadorno
2021-05-07fix(tests): increase test fuzzinessGar
These tests periodically fail in CI, 10 milliseconds is very much not enough time to account for fuzziness, and 5 minutes is more than enough precision given the scales of time involved in each test. PR-URL: https://github.com/npm/cli/pull/3201 Credit: @wraithgar Close: #3201 Reviewed-by: @nlf
2021-05-06fix(tests): reflect new libnpmexec logicGar
PR-URL: https://github.com/npm/cli/pull/3198 Credit: @wraithgar Close: #3198 Reviewed-by: @nlf, @darcyclarke
2021-05-06feat(config): add workspaces boolean to user-agentnlf
PR-URL: https://github.com/npm/cli/pull/3187 Credit: @nlf Close: #3187 Reviewed-by: @wraithgar
2021-05-06feat(cache): Allow `add` to accept multiple specsMarco Sirabella
This is a backwards incompatible change to the undocumented `cache add pkg version`, but Motivations for this can be found here: https://github.com/npm/cli/pull/2976#issuecomment-811511134 Signed-off-by: Marco Sirabella <marco@sirabella.org> PR-URL: https://github.com/npm/cli/pull/3098 Credit: @mjsir911 Close: #3098 Reviewed-by: @wraithgar
2021-04-29ls: do not warn on missing optional depsisaacs
There was code checking node[_type], but we didn't include that field on the object that is actually checked when we are looking for problems. Fix: #3137 PR-URL: https://github.com/npm/cli/pull/3140 Credit: @isaacs Close: #3140 Reviewed-by: @ruyadorno
2021-04-24Remove --always-auth config definitionisaacs
As of the recent updates to npm-registry-fetch and @npmcli/config, this config field is no longer used anywhere. Prior to those changes, it was used, but not in the manner documented.
2021-04-24@npmcli/config@2.2.0isaacs
Partially fixes https://github.com/npm/cli/issues/3130
2021-04-23fix(logout): use isBasicAuth attributeRuy Adorno
PR-URL: https://github.com/npm/cli/pull/3126 Credit: @wraithgar Close: #3126 Reviewed-by: @darcyclarke
2021-04-22fix(pack): refuse to pack invalid packumentGar
If name and version are missing, the filename won't make sense. This also slightly reorders operations so that it will bail early on multiple packages, not potentially packing some before hitting an invalid package and bailing. PR-URL: https://github.com/npm/cli/pull/3115 Credit: @wraithgar Close: #3115 Reviewed-by: @nlf
2021-04-22feat: add init workspacesRuy Adorno
Add workspaces support to `npm init` - Fixes `npm exec` respecting `script-shell` option value - Refactored `lib/exec.js` into `libnpmexec` - Updates init-package-json@2.0.3 - Added ability to create a new workspace using the -w config PR-URL: https://github.com/npm/cli/pull/3095 Credit: @ruyadorno Close: #3095 Reviewed-by: @wraithgar
2021-04-22fix: npm ls --long missing depsRuy Adorno
Running `npm ls --json --long --all` was broken for any project containing a missing dependency from the node_modules folder. This fixes it by avoiding trying to read the extra data required by the --long option in case a dependency is missing. Fixes: https://github.com/npm/cli/issues/2724 PR-URL: https://github.com/npm/cli/pull/3119 Credit: @ruyadorno Close: #3119 Reviewed-by: @wraithgar
2021-04-22fix(ls): do not exit with error when all problems are extraneous depsnlf
PR-URL: https://github.com/npm/cli/pull/3086 Credit: @nlf Close: #3086 Reviewed-by: @wraithgar, @ruyadorno
2021-04-15feat(version): add workspace supportGar
PR-URL: https://github.com/npm/cli/pull/3055 Credit: @wraithgar Close: #3055 Reviewed-by: @darcyclarke
2021-04-14feat(bugs): fall back to email if providedYash Singh
If a bugs url is not provided, but a `mailto` is, then that is used. PR-URL: https://github.com/npm/cli/pull/3052 Credit: @Yash-Singh1 Close: #3052 Reviewed-by: @wraithgar
2021-04-14tap@15.0.2Gar
PR-URL: https://github.com/npm/cli/pull/3069 Credit: @isaacs Close: #3069 Reviewed-by: @ruyadorno, @nlf
2021-04-08feat(pack): add workspace supportGar
PR-URL: https://github.com/npm/cli/pull/3033 Credit: @wraithgar Close: #3033 Reviewed-by: @darcyclarke
2021-04-08feat(workspaces): implement workspace support for dist-tagnlf
PR-URL: https://github.com/npm/cli/pull/3032 Credit: @nlf Close: #3032 Reviewed-by: @wraithgar
2021-04-01Support reporting on ERESOLVE errors when current is missingisaacs
While it is somewhat helpful to get reports on this, since it indicates an underlying problem in Arborist, it's also very disruptive and unhelpful for users. As of 2.3.0, Arborist gives us the currentEdge if available, so we _can_ report on that at least. If there is no node _or_ edge, then we just don't say what the current state is, which isn't useful, but at least is less annoying than a 'property of null' exception. PR-URL: https://github.com/npm/cli/pull/3015 Credit: @isaacs Close: #3015 Reviewed-by: @wraithgar
2021-04-01Add a 'envExport' flag for config definitionsisaacs/add-env-export-false-flag-for-config-defsisaacs
It defaults to true, but setting it to any falsey value will tell `@npmcli/config` not to export it into the environment, and will also put a remark in the documentation that it is not exported. PR-URL: https://github.com/npm/cli/pull/3014 Credit: @isaacs Close: #3014 Reviewed-by: @nlf
2021-04-01feat(view): add workspace supportGar
PR-URL: https://github.com/npm/cli/pull/3001 Credit: @wraithgar Close: #3001 Reviewed-by: @nlf
2021-04-01feat(set-script): implement workspacesnlf
Implements workspaces for set-script, also refactors tests to mock as little as possible. PR-URL: https://github.com/npm/cli/pull/2998 Credit: @nlf Close: #2998 Reviewed-by: @wraithgar
2021-03-31feat(workspaces): add repo and docsGar
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
2021-03-29fix: empty newline printed to stderrRuy Adorno
Starting in v7.7.0 running `npm` (no args) is printing an empty newline to stderr. This fixes that by correctly exiting via errorHandler and avoiding hitting the cb() never called error and adds a test to make sure we avoid that regression moving forward. Fixes: https://github.com/nodejs/node/pull/37678#issuecomment-808734374 Co-authored-by: Gar <gar+gh@danger.computer>
2021-03-26fix(config): tie save-exact/save-prefix togetherGar
Each affects the other PR-URL: https://github.com/npm/cli/pull/2965 Credit: @wraithgar Close: #2965 Reviewed-by: @nlf
2021-03-26fix(config): properly translate user-agentGar
This config item is a bit of a unique one, as it can be set as a template, but then gets translated and also populated to process.env.npm_config_user_agent. This adds that logic back in during the flattening. PR-URL: https://github.com/npm/cli/pull/2964 Credit: @wraithgar Close: #2964 Reviewed-by: @nlf
2021-03-26Always set npm.command to canonical command nameisaacs/set-npm-command-to-canonical-commandisaacs
This ensures that we get a npm_command env set to, eg 'run-script' instead of the shorthand 'run'. PR-URL: https://github.com/npm/cli/pull/2958 Credit: @isaacs Close: #2958 Reviewed-by: @wraithgar
2021-03-26Fix manNumberRegex in help.jsDanielle Church
The current regex will match any .[0-9]. pattern anywhere in the path, which will give incorrect results if npm is installed to a path like .../node-v14.5.5/... This change restricts it to only the last path element. PR-URL: https://github.com/npm/cli/pull/2949 Credit: @dmchurch Close: #2949 Reviewed-by: @wraithgar
2021-03-25fix(config): accept explicit production=falseGar
This allows for overriding the implicit omit value based on if NODE_ENV=production PR-URL: https://github.com/npm/cli/pull/2951 Credit: @wraithgar Close: #2951 Reviewed-by: @ruyadorno