Age | Commit message (Collapse) | Author |
|
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
|
|
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.
|
|
PR-URL: https://github.com/npm/cli/pull/3126
Credit: @wraithgar
Close: #3126
Reviewed-by: @darcyclarke
|
|
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
|
|
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
|
|
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
|
|
PR-URL: https://github.com/npm/cli/pull/3086
Credit: @nlf
Close: #3086
Reviewed-by: @wraithgar, @ruyadorno
|
|
PR-URL: https://github.com/npm/cli/pull/3055
Credit: @wraithgar
Close: #3055
Reviewed-by: @darcyclarke
|
|
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
|
|
PR-URL: https://github.com/npm/cli/pull/3033
Credit: @wraithgar
Close: #3033
Reviewed-by: @darcyclarke
|
|
PR-URL: https://github.com/npm/cli/pull/3032
Credit: @nlf
Close: #3032
Reviewed-by: @wraithgar
|
|
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
|
|
Adds workspaces configuration to `docs`, `repo`, and `set-script`.
PR-URL: https://github.com/npm/cli/pull/3013
Credit: @wraithgar
Close: #3013
Reviewed-by: @darcyclarke
|
|
If a user runs 'npm install -w foo bar baz', that won't set 'bar' and
'baz' as workspace names. The correct incantation is 'npm install -w
foo -w bar -w baz'.
PR-URL: https://github.com/npm/cli/pull/3016
Credit: @isaacs
Close: #3016
Reviewed-by: @wraithgar
|
|
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
|
|
PR-URL: https://github.com/npm/cli/pull/3001
Credit: @wraithgar
Close: #3001
Reviewed-by: @nlf
|
|
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
|
|
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
|
|
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>
|
|
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>
|
|
Each affects the other
PR-URL: https://github.com/npm/cli/pull/2965
Credit: @wraithgar
Close: #2965
Reviewed-by: @nlf
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
PR-URL: https://github.com/npm/cli/pull/2925
Credit: @Yash-Singh1
Close: #2925
Reviewed-by: @ruyadorno
|
|
This was not being added to flatOptions, and things like
`npm-registry-fetch` are looking for it.
PR-URL: https://github.com/npm/cli/pull/2946
Credit: @wraithgar
Close: #2946
Reviewed-by: @nlf
|
|
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
|
|
PR-URL: https://github.com/npm/cli/pull/2945
Credit: @nlf
Close: #2945
Reviewed-by: @wraithgar
|
|
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
|
|
`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
|
|
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
|
|
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
|
|
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
|
|
This was causing the progress bar to be flashing in between lifecycle
script runs.
|
|
Replaces usage of flatOptions with npm.config.
|
|
The default value for the `which` config option used in the `npm fund`
command is now `null` instead of the previously used `undefined`.
|
|
`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`.
|
|
PR-URL: https://github.com/npm/cli/pull/2917
Credit: @wraithgar
Close: #2917
Reviewed-by: @ruyadorno
|
|
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
|
|
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
|
|
Base commands and `npm run` need different outputs
PR-URL: https://github.com/npm/cli/pull/2906
Credit: @wraithgar
Close: #2906
Reviewed-by: @ruyadorno
|
|
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
|
|
- 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
|
|
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
|
|
PR-URL: https://github.com/npm/cli/pull/2878
Credit: @isaacs
Close: #2878
Reviewed-by: @isaacs
|
|
|
|
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.
|
|
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
|