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 authored and GitHub committed 2023-11-20 03:40:09 +02:00
1 parent a2bf6a0e96
commit 45bdc79b17
2 files changed
+11

No files matched your search

+6
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).
@@ -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`