fix: pnpm add a-module-already-in-dev-deps should show message that it wasn't moved to dependencies (#7319)

close #926
This commit is contained in:
Yanzi
2023-11-20 02:40:09 +01:00
committed by GitHub
parent a2bf6a0e96
commit 45bdc79b17
2 changed files with 11 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/default-reporter": patch
"pnpm": patch
---
`pnpm add a-module-already-in-dev-deps` will show a message to notice the user that the package was not moved to "dependencies" [#926](https://github.com/pnpm/pnpm/issues/926).

View File

@@ -71,6 +71,11 @@ export function reportSummary (
msg += EOL
msg += _printDiffs(diffs)
msg += EOL
if (depType === 'dev' && opts.pnpmConfig?.saveDev === false) {
msg += EOL
msg += `The dependency was already listed in devDependencies.${EOL}If you want to make it a prod dependency, then move it manually.`
msg += EOL
}
} else if (opts.pnpmConfig?.[CONFIG_BY_DEP_TYPE[depType]] === false) {
msg += EOL
msg += `${chalk.cyanBright(`${propertyByDependencyType[depType] as string}:`)} skipped`