feat: print an info message about dependencies that were not built (#7854)

close #7815
This commit is contained in:
Zoltan Kochan
2024-04-04 11:16:04 +02:00
committed by GitHub
parent 15dbb637e4
commit 1b26210bb6
2 changed files with 18 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/build-modules": minor
"pnpm": minor
---
Print an info message about dependencies that were not built [#7815](https://github.com/pnpm/pnpm/issues/7815).

View File

@@ -56,7 +56,14 @@ export async function buildModules (
warn,
}
const chunks = buildSequence(depGraph, rootDepPaths)
const allowBuild = opts.allowBuild ?? (() => true)
const ignoredPkgs = new Set<string>()
const allowBuild = opts.allowBuild
? (pkgName: string) => {
if (opts.allowBuild!(pkgName)) return true
ignoredPkgs.add(pkgName)
return false
}
: () => true
const groups = chunks.map((chunk) => {
chunk = chunk.filter((depPath) => {
const node = depGraph[depPath]
@@ -76,6 +83,10 @@ export async function buildModules (
)
})
await runGroups(opts.childConcurrency ?? 4, groups)
logger.info({
message: `The following dependencies have build scripts that were ignored: ${Array.from(ignoredPkgs).sort().join(', ')}`,
prefix: opts.lockfileDir,
})
}
async function buildDependency (