File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -753,14 +753,28 @@ async function installPackage(packageInfo) {
753753
754754 // pnpm v11 ignores overrides in package.json pnpm.overrides for subdependencies
755755 // (regression from v10). Overrides in pnpm-workspace.yaml still work.
756- // Write overrides to pnpm-workspace.yaml for pnpm, or package.json for npm.
757- if ( packageManager === 'pnpm' && Object . keys ( pnpmOverrides ) . length > 0 ) {
756+ // Also set pnpm v11 settings in workspace yaml since CLI --config flags
757+ // may not override workspace-level settings.
758+ if ( packageManager === 'pnpm' ) {
758759 const overrideLines = Object . entries ( pnpmOverrides )
759760 . map ( ( [ pkg , spec ] ) => ` ${ pkg } : '${ spec } '` )
760761 . join ( '\n' )
762+ const overridesSection =
763+ Object . keys ( pnpmOverrides ) . length > 0
764+ ? `\noverrides:\n${ overrideLines } \n`
765+ : ''
761766 await fs . writeFile (
762767 path . join ( packageTempDir , 'pnpm-workspace.yaml' ) ,
763- `packages:\n - .\n\noverrides:\n${ overrideLines } \n` ,
768+ [
769+ 'packages:' ,
770+ ' - .' ,
771+ '' ,
772+ '# pnpm v11 settings for third-party test installs.' ,
773+ 'blockExoticSubdeps: false' ,
774+ 'strictDepBuilds: false' ,
775+ 'resolutionMode: highest' ,
776+ overridesSection ,
777+ ] . join ( '\n' ) ,
764778 'utf8' ,
765779 )
766780 } else if ( packageManager === 'npm' ) {
Original file line number Diff line number Diff line change @@ -30,9 +30,18 @@ const PNPM_NPM_LIKE_FLAGS = [
3030]
3131
3232// Basic pnpm install flags for CI-friendly behavior.
33+ // These are for isolated test installs of third-party packages we don't control.
3334const PNPM_INSTALL_BASE_FLAGS = [
35+ // Allow git-resolved subdeps in third-party packages (e.g. evalmd → markdown-it).
36+ '--config.block-exotic-subdeps=false' ,
3437 // Prevent interactive prompts in CI environments.
3538 '--config.confirmModulesPurge=false' ,
39+ // Tell pnpm the registry may not have time metadata (SFW proxy strips it).
40+ '--config.registry-supports-time-field=false' ,
41+ // Use highest resolution to avoid time-based resolution failures.
42+ '--config.resolution-mode=highest' ,
43+ // Allow third-party build scripts (e.g. core-js, es5-ext postinstall).
44+ '--config.strict-dep-builds=false' ,
3645 // Allow lockfile updates (required for test package installations).
3746 '--no-frozen-lockfile' ,
3847]
You can’t perform that action at this time.
0 commit comments