@@ -2,7 +2,7 @@ import * as path from 'node:path';
22
33import type { AccountlessApplication } from '@clerk/backend' ;
44
5- import { constants } from '../constants' ;
5+ import { constants , TRUSTED_OVERRIDES } from '../constants' ;
66import { PKGLAB } from '../presets/utils' ;
77import { createLogger , fs } from '../scripts' ;
88import { application } from './application' ;
@@ -125,13 +125,22 @@ export const applicationConfig = () => {
125125 ? [ ]
126126 : [ ...dependencies . entries ( ) ] . filter ( ( [ , version ] ) => version === PKGLAB ) . map ( ( [ name ] ) => [ name , 'latest' ] ) ,
127127 ) ;
128+ const packageJsonPath = path . resolve ( appDirPath , 'package.json' ) ;
129+ const contents = await fs . readJSON ( packageJsonPath ) ;
128130 if ( npmDeps . length > 0 ) {
129- const packageJsonPath = path . resolve ( appDirPath , 'package.json' ) ;
130131 logger . info ( `Modifying dependencies in "${ packageJsonPath } "` ) ;
131- const contents = await fs . readJSON ( packageJsonPath ) ;
132132 contents . dependencies = { ...contents . dependencies , ...Object . fromEntries ( npmDeps ) } ;
133- await fs . writeJSON ( packageJsonPath , contents , { spaces : 2 } ) ;
134133 }
134+ // Pin transitives to versions with pnpm "trustedPublisher" evidence so the
135+ // isolated tmp install passes pnpm 10's trust-downgrade check.
136+ contents . pnpm = {
137+ ...( contents . pnpm ?? { } ) ,
138+ overrides : {
139+ ...( contents . pnpm ?. overrides ?? { } ) ,
140+ ...TRUSTED_OVERRIDES ,
141+ } ,
142+ } ;
143+ await fs . writeJSON ( packageJsonPath , contents , { spaces : 2 } ) ;
135144
136145 return application ( self , appDirPath , appDirName , serverUrl ) ;
137146 } ,
0 commit comments