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-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
2020-10-27pack: do not show individual files of bundled depsisaacs
We show a list of bundled dependencies, there's no need to ALSO show the individual files in each one. PR-URL: https://github.com/npm/cli/pull/2050 Credit: @isaacs Close: #2050 Reviewed-by: @nlf
2020-10-27test: fix flat-options snapshotisaacs
We now force the 'packageLock' config to be a boolean true unless either the 'package-lock' or 'shrinkwrap' configs are boolean false.
2020-10-23fix: npm owner refactorRuy Adorno
- Fixed npm owner completion - Refactored lib/owner.js - Added error codes to lib/owner.js errors - Added tests for lib/owner.js PR-URL: https://github.com/npm/cli/pull/2026 Credit: @ruyadorno Close: #2026 Reviewed-by: @isaacs
2020-10-23test: add lib/config.js testsRuy Adorno
2020-10-13Integration code for @npmcli/arborist@1.0.0isaacs
Updates to ERESOLVE explanation code
2020-10-13fix: init config aliasesRuy Adorno
The `init-*` family of config properties should also support dot-separated aliases defined in a npmrc ini file. relates to: https://github.com/npm/init-package-json/commit/c0ace81ade25077eb60260dc87ec58875583f81b
2020-10-07update config related testsnlf
2020-10-02Support --omit options in npm outdatedisaacs
PR-URL: https://github.com/npm/cli/pull/1892 Credit: @isaacs Close: #1892 Reviewed-by: @nlf
2020-09-30add proxyzhaoxuxu
PR-URL: https://github.com/npm/cli/pull/1859 Credit: @badeggg Close: #1859 Reviewed-by: @isaacs EDIT: changed flatOptions.noproxy to flatOptions.noProxy, since make-fetch-happen reads it from the camel-cased property.
2020-09-29fix: listing deps of a linked depRuy Adorno
npm ls was failing to properly follow symlink targets in order to find its dependencies to get printed output. PR-URL: https://github.com/npm/cli/pull/1871 Credit: @ruyadorno Close: #1871 Reviewed-by: @nlf
2020-09-29Add 'fetch-timeout' configisaacs
This gets passed down to dependencies as 'timeout', so that the HTTP request libraries will all get the right value. Fix: https://github.com/npm/cli/issues/1780 PR-URL: https://github.com/npm/cli/pull/1870 Credit: @isaacs Close: #1870 Reviewed-by: @nlf
2020-09-29fix: npm ls <pkg> with depth cli configRuy Adorno
Using the cli option --depth is currently not resulting in the expected behavior of filtering depth level when running npm ls <pkg> - that's due the special behavior of printing all results when using a filter arg. This commit fixes it by adding support to limiting depth if a config value is set by the user. Fixes #1861 PR-URL: https://github.com/npm/cli/pull/1862 Credit: @ruyadorno Close: #1862 Reviewed-by: @nlf
2020-09-29fix: added count on reify-outputRuy Adorno
The added count on lib/utils/reify-output.js only looks up resulting keys from arb.diff and does not take into account the fact that some of these pkgs signaled as diff=ADD might in fact not have been installed, most common scenario are optional deps that could have failed their install in a given system or opt-out from configs. This fixes the counting number by looking up at arb.inventory and confirming it has the node that has been marked as added on diff result. Fix: #1813 PR-URL: https://github.com/npm/cli/pull/1858 Credit: @ruyadorno Close: #1858 Reviewed-by: @nlf
2020-09-29Fix EBADPLATFORM error message (#1876)Brian Jenkins
* Fix EBADPLATFORM error message Error format evolved out from under message generation's expectations. * Fix formatting
2020-09-22Add `--strict-peer-deps` optionisaacs
This is the CLI portion of https://github.com/npm/arborist/pull/136 PR-URL: https://github.com/npm/cli/pull/1819 Credit: @isaacs Close: #1819 Reviewed-by: @ruyadorno
2020-09-16fix: reenable npm link from registryRuy Adorno
Being able to npm link a package that is not currently available in the global space should still be a supported feature, this change puts that functionality back in place but also improves it by avoiding reify any package that may already be found in the global directory.
2020-09-16test: add lib/link.js testsRuy Adorno
- Added ELINKGLOBAL error code for when using --global - Added tests for lib/link.js - Do not reify, only load globals when linking a pkg to a local prefix - Fixes: #1777