Skip to content

fix(@schematics/angular): generate pnpm-workspace.yaml with allowBuilds for pnpm projects - #34630

Merged
dgp1130 merged 2 commits into
angular:mainfrom
alan-agius4:fix/pnpm-workspace-allow-builds
Nov 4, 2026
Merged

dgp1130 merged 2 commits into
angular:mainfrom
alan-agius4:fix/pnpm-workspace-allow-builds

Conversation

@alan-agius4

@alan-agius4 alan-agius4 commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Starting in pnpm 11, strictDepBuilds is enabled by default and pnpm fails with ERR_PNPM_IGNORED_BUILDS when any dependency in the dependency graph declares lifecycle build scripts that are not listed in allowBuilds in pnpm-workspace.yaml.

Generate a pnpm-workspace.yaml file when scaffolding a new workspace with pnpm (@schematics/angular:workspace) that configures allowBuilds to false for the transitive build dependencies (@parcel/watcher, esbuild, lmdb, and msgpackr-extract), which already ship prebuilt native binaries via optionalDependencies and do not need their fallback install scripts to execute.

Fixes #34622

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for generating a pnpm-workspace.yaml template with predefined allowBuilds configurations when PNPM is selected as the package manager. It also refactors the PackageManager class to handle ignoreScripts defaults more consistently and adds corresponding unit tests. Feedback on the changes suggests destructuring ignoreScripts with a default value of true in the package manager's add method to improve consistency with the install method.

@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Nov 2, 2026
@alan-agius4
alan-agius4 force-pushed the fix/pnpm-workspace-allow-builds branch from b936b2f to bb007ed Compare November 2, 2026 11:46
…ds for pnpm projects

Starting in pnpm 11, `strictDepBuilds` is enabled by default and pnpm
fails with `ERR_PNPM_IGNORED_BUILDS` when any dependency in the graph
declares lifecycle build scripts that are not listed in `allowBuilds` in
`pnpm-workspace.yaml`.

Generate a `pnpm-workspace.yaml` file when scaffolding a new workspace
with `pnpm` that configures `allowBuilds` to `false` for the transitive
build dependencies (`@parcel/watcher`, `esbuild`, `lmdb`, and
`msgpackr-extract`), which already ship prebuilt native binaries via
`optionalDependencies` and do not need their fallback install scripts
to execute.

Fixes angular#34622
@alan-agius4
alan-agius4 force-pushed the fix/pnpm-workspace-allow-builds branch from 6a7df1f to bc870b8 Compare November 2, 2026 12:11
@alan-agius4
alan-agius4 requested a review from dgp1130 November 4, 2026 07:47
@dgp1130 dgp1130 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 4, 2026
@dgp1130
dgp1130 merged commit 12a7d2a into angular:main Nov 4, 2026
40 checks passed
@dgp1130

dgp1130 commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/cli area: @schematics/angular target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm add and pnpm install fail after ng new on pnpm 11+ (ERR_PNPM_IGNORED_BUILDS)

2 participants