-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(install-node-modules): allow controlling legacy-peer-deps for npm (
#72) Most people should not being using legacy peer deps anymore, but we understand the compat needs and could be a breaking change to just change this from under people. This PR introduces a new input to the install-node-modules step to enable/disable the usage of `--legacy-peer-deps` arg for `npm ci` install command. Since it's a lot of overhead to ask people to create a launch template just to control 1 input, this also introduces the `NX_CLOUD_NPM_LEGACY_INSTALL` env var that can be sent via the main agent to controll this behavior as well.
- Loading branch information
1 parent
8953db2
commit a27937f
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
```yaml | ||
- name: Install Node Nodules | ||
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' | ||
inputs: | ||
npm_legacy_install: 'true' | ||
``` | ||
### Options | ||
#### npm_legacy_install | ||
This input is optional and defaults to `true` if not specified. | ||
|
||
If set to `true`, the step will install the node modules using `npm ci --legacy-peer-deps` when the npm package manager is used. | ||
|
||
If set to `false`, the step will install the node modules using `npm ci` when the npm package manager is used. | ||
|
||
If you do not already have a [custom launch template](https://nx.dev/ci/reference/launch-templates), you can also control this behavior by setting the `NX_CLOUD_NPM_LEGACY_INSTALL` environment variable to `true` or `false` in your main agent and [pass the variable via `--with-env-vars="NX_CLOUD_NPM_LEGACY_INSTALL"`](https://nx.dev/ci/reference/launch-templates#pass-environment-variables-to-agents) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
name: Install Node Modules | ||
description: Installs node_modules using your configured package manager. | ||
|
||
inputs: | ||
- name: npm_legacy_install | ||
description: 'Install with legacy peer dependency resolution. This only applies to npm.' | ||
|
||
definition: | ||
using: 'node' | ||
main: workflow-steps/install-node-modules/main.js |