Age | Commit message (Collapse) | Author |
|
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
|
|
This adds the `audit` config item to the usage output of `npm ci`, and
also tweaks how usage flags are shown for boolean options that do not
default to false. Their usage is shown as the `--no-x` form of the flag
to better communicate that the flag is needed to turn that normally true
option OFF.
The description of `audit` was also updated to reflect that it runs on
many different npm commands, not just install. Because this flag is
included in the usage of those commands it's best to let the assocation
happen there instead of trying to be comprehensive in the description
itself.
A small fix to make `install-ci-test` not try to redefine its own
usage, but to inherit from `ci` was also included.
PR-URL: https://github.com/npm/cli/pull/3497
Credit: @wraithgar
Close: #3497
Reviewed-by: @nlf
|
|
Also includes a preliminary refactor to consolidate workspace logic now
that every command that supports workspaces has it implemented.
PR-URL: https://github.com/npm/cli/pull/3417
Credit: @wraithgar
Close: #3417
Reviewed-by: @ruyadorno
|
|
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
|
|
Add a script and Makefile rule to build the "Configuration" section for
all command documentation based on the command classes' `params` list.
Also correct several minor problems in the documentation, and add
`params` listings for commands that were lacking them, to match the
existing documentation and/or behavior within the code.
PR-URL: https://github.com/npm/cli/pull/3243
Credit: @isaacs
Close: #3243
Reviewed-by: @wraithgar
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
If the user has specified a silent loglevel, we should pass that intention on
when we call runScript
Also a small cleanup in lib/run-script.js so that the reference to
@npmcli/run-script is named the same as other files.
PR-URL: https://github.com/npm/cli/pull/2719
Credit: @wraithgar
Close: #2719
Reviewed-by: @nlf
|
|
Fix: https://github.com/npm/arborist/issues/207
PR-URL: https://github.com/npm/cli/pull/2573
Credit: @isaacs
Close: #2573
Reviewed-by: @nlf
|
|
Added a test for install too for this specific condition
PR-URL: https://github.com/npm/cli/pull/2455
Credit: @wraithgar
Close: #2455
Reviewed-by: @isaacs
|
|
`npm ci` should run all the same preinstall/install/postinstall/prepare
scripts for the root project just like `npm install`.
Fixes: #1905
PR-URL: https://github.com/npm/cli/pull/2316
Credit: @isaacs
Close: #2316
Reviewed-by: @ruyadorno
|
|
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
|
|
Fixes: #2017
Credit: @darcyclarke
Close: #2159
Reviewed-by: @ruyadorno
|
|
PR-URL: https://github.com/npm/cli/pull/2083
Credit: @nlf
Close: #2083
Reviewed-by: @darcyclarke
|
|
|
|
Via: https://github.com/targos/npm7-cra#issue-1-npm-ci-changes-packagejson
|
|
PR-URL: https://github.com/npm/cli/pull/1523
Credit: @claudiahdz
Close: #1523
Reviewed-by: @ruyadorno
|
|
|
|
|
|
This adds a 'reify-output.js' util, which can be passed any Arborist
object after it reifies a tree. Consistent output is printed in all
cases, showing the number of packages added/removed/changed, packages
needing funding, and a minimal (but always actionable and relevant)
audit summary.
The only code using the Installer class now is in lib/outdated.js, which
is has a pending update coming soon.
Prune and dedupe commands are awaiting top-level Arborist methods, so
that they can be similarly tightened up. (For now, this commit just has
them fail with a 'coming soon' message.)
The last piece holding the 'install/*.js' code in this repo is that it
is used in 'ls', 'fund', 'shrinkwrap', and the error-message util.
|
|
|
|
|
|
|
|
When you set `<cache>` directory in npm config, `npm ci` has been using `<cache>` for storing the cache instead of `<cache>/_cacache`
PR-URL: https://github.com/npm/cli/pull/550
Credit: @zhenyavinogradov
Close: #550
Reviewed-by: @ruyadorno
|
|
PR-URL: https://github.com/npm/cli/pull/252
Credit: @claudiahdz
Close: #252
Reviewed-by: @mikemimik
|
|
Re: https://npm.community/t/6-11-2-npm-ci-installs-package-with-wrong-permissions/9720
Still passing a plain old (non-Figgy Pudding) object into libcipm,
duplicating the extra keys added in figgy-config.js.
This is not a clean or nice or elegant solution, but it works, without
regressing the config env var issue.
Pairing with @claudiahdz
PR-URL: https://github.com/npm/cli/pull/243
Credit: @isaacs
Close: #243
Reviewed-by: @claudiahdz
|
|
Fixes the regression where random config values in a .npmrc file are not
passed to lifecycle scripts, breaking build processes which rely on
them.
Fix: https://github.com/nodejs/node/issues/28987
Fix: https://npm.community/t/npm-ci-doesnt-respect-npmrc-variables/6032
Fix: https://npm.community/t/npm-ci-doesnt-fill-anymore-the-process-env-npm-config-cache-variable-on-post-install-scripts/6658
Fix: https://npm.community/t/npm-ci-does-not-compile-native-dependencies-according-to-npmrc-configuration/6069
Fix: https://npm.community/t/npm-6-9-x-not-passing-environment-to-node-gyp-regression-from-6-4-x/9323/2
|
|
|
|
Fixes: https://npm.community/t/npm-ci-logs-success-to-stderr/2303
PR-URL: https://github.com/npm/cli/pull/79
Credit: @alopezsanchez
Reviewed-By: @zkat
|
|
Fixes: https://npm.community/t/61
PR-URL: https://github.com/npm/npm/pull/20715
Credit: @legodude17
Reviewed-By: @zkat
|
|
|
|
|