-
Notifications
You must be signed in to change notification settings - Fork 951
feat(install): add --frozen-lockfile flag for CI environments #10239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ type InstallCmdOptions = { | |
| noOptional: boolean; | ||
| recurringInstall: boolean; | ||
| lockfileOnly: boolean; | ||
| frozenLockfile: boolean; | ||
| allowScripts?: string; | ||
| disallowScripts?: string; | ||
| }; | ||
|
|
@@ -69,6 +70,7 @@ automatically imports components, compiles components, links to node_modules, an | |
| ], | ||
| ['', 'no-optional [noOptional]', 'do not install optional dependencies (works with pnpm only)'], | ||
| ['', 'lockfile-only', 'dependencies are not written to node_modules. Only the lockfile is updated'], | ||
| ['', 'frozen-lockfile', 'fail if the lockfile needs to be updated (useful for CI environments)'], | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zubeyralmaho yarn supports this flag as well. So, maybe let's pass it to yarn too.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zkochan Done! Added immutable option to Yarn's project.install() call, which is Yarn Berry's equivalent of --frozen-lockfile. Also skipped persistLockfile() when the flag is active. |
||
| ['', 'allow-scripts [pkgNames]', 'a comma separated list of package names that are allowed to run installation scripts'], | ||
| ['', 'disallow-scripts [pkgNames]', 'a comma separated list of package names that are NOT allowed to run installation scripts'], | ||
| ] as CommandOptions; | ||
|
|
@@ -134,6 +136,7 @@ automatically imports components, compiles components, links to node_modules, an | |
| updateAll: options.update, | ||
| recurringInstall: options.recurringInstall, | ||
| lockfileOnly: options.lockfileOnly, | ||
| frozenLockfile: options.frozenLockfile, | ||
| showExternalPackageManagerPrompt: true, | ||
| allowScripts: this._parseAllowScriptsFlags(options.allowScripts, options.disallowScripts), | ||
| }; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.