fix: dependency status check should never throw an exception (#8852) (#8857)

This commit is contained in:
Zoltan Kochan
2024-12-10 17:16:08 +01:00
committed by GitHub
parent aaffaa0f6b
commit 31911f103e
5 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
---
"@pnpm/plugin-commands-deploy": major
"pnpm": major
"@pnpm/plugin-commands-installation": patch
---
The deploy command works only in workspaces that use the `inject-workspace-packages=true` setting.

View File

@@ -141,6 +141,7 @@
"nodetouch",
"noent",
"nonexec",
"noninjected",
"nopadding",
"noproxy",
"nosystem",

View File

@@ -267,6 +267,7 @@ export type InstallCommandOptions = Pick<Config,
| 'hooks'
| 'ignorePnpmfile'
| 'ignoreScripts'
| 'injectWorkspacePackages'
| 'linkWorkspacePackages'
| 'rawLocalConfig'
| 'lockfileDir'

View File

@@ -62,6 +62,9 @@ export async function handler (
if (!opts.workspaceDir) {
throw new PnpmError('CANNOT_DEPLOY', 'A deploy is only possible from inside a workspace')
}
if (!opts.injectWorkspacePackages) {
throw new PnpmError('DEPLOY_NONINJECTED_WORKSPACE', 'We only support deploy from workspaces that use the inject-workspace-packages=true setting')
}
const selectedDirs = Object.keys(opts.selectedProjectsGraph ?? {})
if (selectedDirs.length === 0) {
throw new PnpmError('NOTHING_TO_DEPLOY', 'No project was selected for deployment')

View File

@@ -27,6 +27,7 @@ export const DEFAULT_OPTS = {
optionalDependencies: true,
},
key: undefined,
injectWorkspacePackages: true,
linkWorkspacePackages: true,
localAddress: undefined,
lock: false,