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
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-01fix(tests): update snapshotsGar
This got left out of the npm view workspaces PR
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-29chore: fix smoke-tests snapshotsRuy Adorno
2021-03-29change 'maxsockets' default value back to 15Andreas
The default value for 'maxsockets' was changed during the refactoring in #2878 from 50 to 'Inifinity', this PR changes it to the more accurate value of 15, which was the default used in: https://github.com/npm/make-fetch-happen/blob/785af652ec0c8f108a43004903afd2183af93904/agent.js#L15 Fixes #2978 PR-URL: https://github.com/npm/cli/pull/2979 Credit: @wallrat Close: #2979 Reviewed-by: @ruyadorno Co-authored-by: Gar <gar+gh@danger.computer>
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-26add smoke testsRuy Adorno
Lightweight smoke test suite that runs common commands so that we can also have a holistic check during CI. PR-URL: https://github.com/npm/cli/pull/2959 Credit: @ruyadorno Close: #2959 Reviewed-by: @nlf
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-24fix(audit-level): add `info` audit levelGar
This is a valid level but wasn't configured to be allowed. Also added this param to the usage output for `npm audit` PR-URL: https://github.com/npm/cli/pull/2923 Credit: @wraithgar Close: #2923 Reviewed-by: @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-23pacote@11.3.1Ruy Adorno
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): 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-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-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-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-12usage: Correct "npm COMMAND help" to "npm help COMMAND"Edward Grech
PR-URL: https://github.com/npm/cli/pull/2855 Credit: @dwardu Close: #2855 Reviewed-by: @ruyadorno, @darcyclarke
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-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-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-03-04Remove unused arguments on various function callsNathan Shively-Sanders
I checked cli's code with Typescript using the tsconfig below. The compiler found a few arguments that are not used, so I removed them. In the case of `npm whoami`, it is clearer that it ignores its `args` and instead relies on `npm.flatOptions`. ```json { "compilerOptions": { "moduleResolution": "node", "module": "commonjs", "resolveJsonModule": true, "target": "es2019", "noImplicitAny": false, "noImplicitThis": true, "strict": true, "maxNodeModuleJsDepth": 0, "noEmit": true, "allowJs": true, "checkJs": true, "types": ["node"], "lib": ["esnext"] }, "include": ["lib"] } ``` PR-URL: https://github.com/npm/cli/pull/2766 Credit: @sandersn Close: #2766 Reviewed-by: @nlf, @ruyadorno, @Matausi29
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-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-22Do not print error banner for shell proxy commandsisaacs
There are a few commands (exec, run-script, and the run-script proxies) where essentially npm is acting like a very fancy shell. It is peculiar and noisy for npm to print a verbose error banner at the end of these commands, since presumably the command itself already did whatever it had to do to report the error appropriately. For example, `npm test` runs a test script, usually outputting test results. Having npm then tell me that my tests failed with exit status 1 and print a debug log, is unnecessary and unwanted. When the error encountered for these commands does not have a non-zero numeric 'code', then we still print the standard npm error reporting messages, because presumably something went wrong OTHER than a process exiting with a non-zero status code. PR-URL: https://github.com/npm/cli/pull/2742 Credit: @isaacs Close: #2742 Reviewed-by: @nlf
2021-02-05chore: utils cleanup and testsnlf
- remove spawn util, refactor help command - add tests for read-user-info, minor refactor - add tests for pulse-till-done util, refactor - add tests for otplease util - add tests for open-url util - remove unused no-progress-while-running util PR-URL: https://github.com/npm/cli/pull/2601 Credit: @nlf Close: #2601 Reviewed-by: @ruyadorno, @wraithgar
2021-02-01test: do not depend on npm.version in usage testisaacs
2021-02-01test: Add test for npm-usage.js, and fix 'npm --long' outputisaacs
2021-01-28feat: add npm diffruyadorno/npm-diffRuy Adorno
- As proposed in RFC: https://github.com/npm/rfcs/pull/144 PR-URL: https://github.com/npm/cli/pull/1319 Credit: @ruyadorno Close: #1319 Reviewed-by: @isaacs
2021-01-15fix(link): already linked packages w/ global prefixnlf
correctly identify already linked packages when global prefix is a symlink PR-URL: https://github.com/npm/cli/pull/2486 Credit: @nlf Close: #2486 Reviewed-by: @wraithgar
2021-01-07add foreground-scripts optionisaacs/foreground-scriptsisaacs
PR-URL: https://github.com/npm/cli/pull/2456 Credit: @isaacs Close: #2456 Reviewed-by: @ruyadorno
2021-01-07Remove process.umask() call from config defaultisaacs/remove-process-umaskisaacs
Since we now are using pacote/tar in a way that will rely on the default process umask setting, and we set file/directory modes explicitly anyway, there's no need to have a default umask setting that calls process.umask() As this method is not worker-thread safe, and is deprecated, it's best for us to stop using it. Fix: #1103 PR-URL: https://github.com/npm/cli/pull/2444 Credit: @isaacs Close: #2444 Reviewed-by: @nlf
2020-12-18remove the metrics sendernlf/remove-metricsnlf
PR-URL: https://github.com/npm/cli/pull/2382 Credit: @nlf Close: #2382 Reviewed-by: @isaacs
2020-12-18(docs,test): assorted typo fixesXhmikosR
PR-URL: https://github.com/npm/cli/pull/2381 Credit: @XhmikosR Close: #2381 Reviewed-by: @isaacs
2020-12-18fix: npm profile refactorRuy Adorno
- Fixes using `--otp` config option in `npm profile enable-2fa` - Prevents trying to enable 2fa if no user is logged in - Setting email should not require password - Add `test/lib/profile.js` tests - Async/await `lib/profile.js` refactor and more - Fixes: https://github.com/npm/statusboard/issues/164 PR-URL: https://github.com/npm/cli/pull/2373 Credit: @ruyadorno Close: #2373 Reviewed-by: @isaacs
2020-12-11fix: lib/team.js tweaks and testsRuy Adorno
- Removes unnecessary colon when listing 0 users/teams - Removes unimplemented `npm team edit` placeholder - Adds `test/lib/team.js` tests - Fixes: https://github.com/npm/statusboard/issues/176 PR-URL: https://github.com/npm/cli/pull/2314 Credit: @ruyadorno Close: #2314 Reviewed-by: @isaacs
2020-12-11fix: npm search include/excludeRuy Adorno
- Fixes `npm search --searchexclude=<value>` option - Tweaks `--searchopt` logic - Refactor and cleanup `lib/search.js` - Add `test/lib/search.js` tests - Fixes: https://github.com/npm/statusboard/issues/171 PR-URL: https://github.com/npm/cli/pull/2325 Credit: @ruyadorno Close: #2325 Reviewed-by: @isaacs
2020-12-09allow for passing object keys to searchopts to allow paginationnlf/search-optsnlf
PR-URL: https://github.com/npm/cli/pull/2303 Credit: @nlf Close: #2303 Reviewed-by: @isaacs
2020-12-04feat: add npm set-scriptYash-Singh1
Introduces the set-script command. It accepts two arguments, the script name and the command ref: https://github.com/npm/rfcs/blob/latest/accepted/0016-set-script-command.md PR-URL: https://github.com/npm/cli/pull/2237 Credit: @Yash-Singh1 Close: #2237 Reviewed-by: @ruyadorno
2020-11-27test: add tests to lib/stars.jsRuy Adorno
PR-URL: https://github.com/npm/cli/pull/2240 Credit: @ruyadorno Close: #2240 Reviewed-by: @darcyclarke
2020-11-20fix: npm unstarRuy Adorno
- Refactored lib/star.js - Fixes `npm unstar` by adding a lib/unstar.js alias/cmd - Add tests for lib/star.js and lib/unstar.js Fixes: https://github.com/npm/statusboard/issues/174 PR-URL: https://github.com/npm/cli/pull/2204 Credit: @ruyadorno Close: #2204 Reviewed-by: @nlf
2020-11-17Preserve builtin conf when installing npm globallyisaacs
When a file named 'npmrc' is in the root of the npm module that is currently running, it adds config values that override the defaults (but not the global or user configs). This is a way for a system package installer to tell the npm that it installs to put its globals somewhere other than the default. In order to keep these configs around when users self-update npm with `npm i -g npm`, these config values must be "sticky", and ride along into the newly globally installed npm. This commit restores this behavior, fixing self-updating npm for Windows users, and any other systems that may make use of this functionality. Fixes: #2002 PR-URL: https://github.com/npm/cli/pull/2184 Credit: @isaacs Close: #2184 Reviewed-by: @ruyadorno
2020-11-17test: add tests for lib/init.jsRuy Adorno
fix: https://github.com/npm/statusboard/issues/155 PR-URL: https://github.com/npm/cli/pull/2185 Credit: @ruyadorno Close: #2185 Reviewed-by: @nlf
2020-11-13explain-dep: handle shortening edge from root projectisaacs
Fixes: #2134 Credit: @isaacs Close: #2156 Reviewed-by: @ruyadorno
2020-11-13fix: legacy auth tokensRuy Adorno
Add legacy `_auth` token to flatOptions in order to support it when reaching out to registries. Fixes: #2008 Credit: @ruyadorno Close: #2153 Reviewed-by: @isaacs
2020-11-03Support *all* conf keys in publishConfigisaacs
This adds a flatOptions.flatten() method, which takes an object full of config keys, and turns it into an options object. This method expects an object that already inherits from npm's defaults, and is thus expected to be internal only. This commit also removes some config keys which were used by npm dependencies at the start of the v7 beta process, but are no longer: - all lockfile configs (since we don't use lockfiles any more! for anything! and good riddance, they're a rats' nest of race conditions) - cacheMax/cacheMin (we only use preferOffline/offline/online now, so these are strictly legacy support as input and never shared with deps) Once this lands in cli, we can remove the publishConfig handling logic in npm-registry-fetch, as it will be redundant.
2020-10-30test: add tests for test/lib/utils/replace-info.jsRuy Adorno