Fix: avoid default value for "private" in normalize-packages script (#10121)

This commit is contained in:
Pierre Brunet
2026-07-23 11:43:21 +02:00
committed by GitHub
parent 43e45667ab
commit e22ee2547b
+4 -3
View File
@@ -36,9 +36,10 @@ const forceRelativeSymlink = async (target, path) => {
require('exec-promise')(() =>
getPackages(true).map(({ dir, name, package: pkg, relativeDir }) => {
// consider packages as private by default to avoid publishing them by mistake
if (!('private' in pkg)) {
pkg.private = true
if (!('private' in pkg) || typeof pkg.private !== 'boolean') {
throw new Error(
`Please specify "private" field in your package ${name}. true (if you don't want to publish it) or false (if it is a public package)`
)
}
pkg.name = name