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-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
2021-03-25fix: npm config warn on workspacesRuy Adorno
When a workspace/workspaces config option is defined, we should log a warning message to be explicit about not supporting workspaces in the context of the `npm config` command. PR-URL: https://github.com/npm/cli/pull/2950 Credit: @ruyadorno Close: #2950 Reviewed-by: @wraithgar
2021-03-24fix(set-script): add completionYash Singh
PR-URL: https://github.com/npm/cli/pull/2925 Credit: @Yash-Singh1 Close: #2925 Reviewed-by: @ruyadorno
2021-03-24fix(progress): re-add progress bar to reifyGar
The logger was no longer in flatOptions, we pass it in explicitly now PR-URL: https://github.com/npm/cli/pull/2944 Credit: @wraithgar Close: #2944 Reviewed-by: @nlf
2021-03-24fix: config should not error when workspaces are configurednlf
PR-URL: https://github.com/npm/cli/pull/2945 Credit: @nlf Close: #2945 Reviewed-by: @wraithgar
2021-03-24fix(install): ignore auditLevelGar
`npm install` should not be affected by the `auditLevel` config, as the results of audit do not change its exit status. PR-URL: https://github.com/npm/cli/pull/2929 Credit: @wraithgar Close: #2929 Reviewed-by: @ljharb, @ruyadorno
2021-03-24config: Restore --dev flag, unify --omit flattenersisaacs
This consolidates all the various --include and --omit configuration flatteners into a single function, since they have to be interdependent in order to function properly. Fix: #2936 PR-URL: https://github.com/npm/cli/pull/2942 Credit: @isaacs Close: #2942 Reviewed-by: @wraithgar
2021-03-24fix(config): flatten savePrefix properlyGar
It needs to take save-exact into consideration Closes: https://github.com/npm/cli/issues/2932 PR-URL: https://github.com/npm/cli/pull/2937 Credit: @wraithgar Close: #2937 Reviewed-by: @ruyadorno
2021-03-24fix(uninstall): use correct local prefixJames Chen-Smith
Corrects non-global prefix path by using this.npm.localPrefix. A location already used throughout the repository. Later, this will be taken from the unified config library. Signed-off-by: James Chen-Smith <jameschensmith@gmail.com> PR-URL: https://github.com/npm/cli/pull/2930 Credit: @jameschensmith Close: #2930 Reviewed-by: @ruyadorno
2021-03-23pacote@11.3.1Ruy Adorno
2021-03-23fix: npm birthdayRuy Adorno
Replaces usage of flatOptions with npm.config.
2021-03-23fix: which configRuy Adorno
The default value for the `which` config option used in the `npm fund` command is now `null` instead of the previously used `undefined`.
2021-03-23fix: yes configRuy Adorno
`npm exec <pkg>` was failing for packages not available in the local or global scope due to the default value of the `yes` config having been changed to `false` during the latest config refactor. That caused `npm exec` to throw with a `canceled` error message since the current implementation expects the default value to be falsy but not `false`. This change reinstates the previous default config value for `yes` and changes the implementation to throw with a proper error object in order to get a stack trace when running with `--loglevel=verbose`.
2021-03-22fix(usage): add action items to error outputGar
PR-URL: https://github.com/npm/cli/pull/2917 Credit: @wraithgar Close: #2917 Reviewed-by: @ruyadorno
2021-03-22feat: add exec workspacesRuy Adorno
Add workspaces support to `npm exec` - Refactored logic to read and filter workspaces into `lib/workspaces/get-workspaces.js` - Added location context message when entering interactive shell using `npm exec` (with no args) - Add ability to execute a package in the context of each configured workspace Fixes: https://github.com/npm/statusboard/issues/288 PR-URL: https://github.com/npm/cli/pull/2886 Credit: @ruyadorno Close: #2886 Reviewed-by: @wraithgar
2021-03-22fix(usage): tie usage to configGar
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
2021-03-19fix(suggestions): clarify Unknown command outputGar
Base commands and `npm run` need different outputs PR-URL: https://github.com/npm/cli/pull/2906 Credit: @wraithgar Close: #2906 Reviewed-by: @ruyadorno
2021-03-19restore npm.flatOptions.npmCommandisaacs/restore-npm-command-flat-optionisaacs
This is used by npm-registry-fetch to set the 'npm-command' HTTP header. Will be cleaned up in a less ugly way in config refactor part 2. PR-URL: https://github.com/npm/cli/pull/2903 Credit: @isaacs Close: #2903 Reviewed-by: @wraithgar
2021-03-19feat: add run-script workspacesRuy Adorno
- 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
2021-03-18fix(tests): go back to mockNpm in testGar
This was erroneously removed during a merge conflict
2021-03-18chore: fix rebuild win testsRuy Adorno
2021-03-18feat(help): refactor npm help/help-searchGar
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
2021-03-18Remove old config definitions and flattening logicisaacs/config-refactorisaacs
PR-URL: https://github.com/npm/cli/pull/2878 Credit: @isaacs Close: #2878 Reviewed-by: @isaacs
2021-03-18update lib/*.js to use new config structuresisaacs
2021-03-18New consolidated config definitionsisaacs
This replaces the multiple separate sets of objects and documentation, some of which had defaults and/or types, some of which didn't, and cleans up a lot of configs that are no longer used. Deprecated configs are now marked, and the approach used to create these config definitions ensures that it is impossible to create a new config option that lacks the appropriate data for it.
2021-03-18fix(publish): handle case where multiple config list is presentKenrick
When not handled, when there are multiple entries in this.npm.config.list, it causes crash as described in #2834 The change here merge everything in this.npm.config.list, because as I observed, the default config is present only at the last entry. Fix: #2834 Co-authored-by: @wraithgar PR-URL: https://github.com/npm/cli/pull/2865 Credit: @kenrick95 Close: #2865 Reviewed-by: @isaacs, @wraithgar
2021-03-18chore(config): remove flatOptions referencesGar
Iterative change moving us towards a more unified config. No longer pulling config from flatOptions where we don't have to. PR-URL: https://github.com/npm/cli/pull/2892 Credit: @wraithgar Close: #2892 Reviewed-by: @ruyadorno
2021-03-09Fix cb() never called in search with --json optionFraqe
PR-URL: https://github.com/npm/cli/pull/2831 Credit: @fraqe Close: #2831 Reviewed-by: @isaacs
2021-03-09fix(usage): clean up usage declarationsGar
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
2021-03-09fix(npm.output): make output go through npm.outputGar
All output that anything wants to make now goes through `npm.output()`. This is an incremental change getting us closer to where we want to be with testing. PR-URL: https://github.com/npm/cli/pull/2795 Credit: @wraithgar Close: #2795 Reviewed-by: @ruyadorno, @isaacs
2021-03-05fix(repo, auth.sso): don't promisify open-urlGar
This causes a `cb() not called` error as the promisified function explodes silently. PR-URL: https://github.com/npm/cli/pull/2824 Credit: @wraithgar Close: #2824 Reviewed-by: @ruyadorno
2021-03-05fix(diff): set option where for pacoteRuy Adorno
pacote expects a **where** option that sets the cwd for all its operations, ref: https://github.com/npm/pacote#options This change properly sets that option in libnpmdiff options that will then properly forward it to pacote, this is specially important for when reading local file system specs. PR-URL: https://github.com/npm/cli/pull/2822 Credit: @ruyadorno Close: #2822 Reviewed-by: @wraithgar
2021-03-05feat/explain: show when an edge is a bundled edgekumavis
PR-URL: https://github.com/npm/cli/pull/2807 Credit: @kumavis Close: #2807 Reviewed-by: @ruyadorno
2021-03-05Get correct npm prefix on all Windows unix shellsisaacs/fix-windows-shell-binsisaacs
1. Set the shebang to /usr/bin/env bash instead of /bin/sh (which might be dash or some other shell) 2. Use Unix-style line endings, not Windows-style (Cygwin accepts either, but mingw bash sometimes objects, and WSL bash always does) 3. Test against paths using wslpath if available, but still pass win32 paths to node.exe, since it is a Windows binary that only knows how to handle Windows paths. This makes npm as installed by the Node.js Windows MSI installer behave properly under WSL, Cygwin, MINGW Git Bash, and the internal MINGW Git Bash when posix CLI utilities are exposed to the cmd.exe shell. The test is not quite as comprehensive as I'd like. It runs on the various Windows bash implementations if they are found in their expected locations, skipping any that are not installed. Short of shipping mingw, cygwin, and wsl as test fixtures, I'm not sure how we could do much better, however. At least, we can use this test to assist debug and catch issues on Windows machines (ours or users who report problems). PR-URL: https://github.com/npm/cli/pull/2789 Credit: @isaacs Close: #2789 Reviewed-by: @nlf
2021-03-05fix(npm) pass npm context everywhereGar
Instead of files randomly requiring the npm singleton, we pass it where it needs to go so that tests don't need to do so much require mocking everywhere PR-URL: https://github.com/npm/cli/pull/2772 Credit: @wraithgar Close: #2772 Reviewed-by: @ruyadorno
2021-02-25fix(test): update hidden package-lock mtime in lsisaacs
That file must be newer than the others for the code to do what we are expecting PR-URL: https://github.com/npm/cli/pull/2782 Credit: @isaacs Close: #2782 Reviewed-by: @wraithgar
2021-02-25chore(refactor): promisify completion scriptsGar
We also removed the "none" script because we handle a missing script just fine. There is no need to put an empty one in PR-URL: https://github.com/npm/cli/pull/2759 Credit: @wraithgar Close: #2759 Reviewed-by: @nlf
2021-02-25feat(explain): mark when dependency is bundledkumavis
When using `npm explain <package>` it's useful to see if the package has been bundled. This is especially useful when trying to understand the provenance of a package's content PR-URL: https://github.com/npm/cli/pull/2750 Credit: @kumavis Close: #2750 Reviewed-by: @nlf
2021-02-22update tests for new @npmcli/arborist behaviorisaacs
2021-02-22Move implementation to separate packageisaacs/hide-easter-egg-betterisaacs
PR-URL: https://github.com/npm/cli/pull/2743 Credit: @isaacs Close: #2743 Reviewed-by: @nlf
2021-02-22chore(refactor): clean up lifecycle-cmdsGar
This is a small incremental step in removing some of the complexity surrounding the `npm` object in our code. It moves that object one level up the chain of code, with the end goal being that we will only require it once in the codebase, ultimately allowing us to improve our tests. I also changed the command that it calls to `run-script` because that is the base command. `run` was an alias, and that is one more layer of hoops a developer would have to jump through to find what file in `./lib` is even being referenced here. PR-URL: https://github.com/npm/cli/pull/2753 Credit: @wraithgar Close: #2753 Reviewed-by: @isaacs