@@ -237,7 +237,7 @@ const filtered =
237237 : packages . filter ( ( pkg ) => ! ! branches [ get_trigger ( pkg ) ] ) ;
238238
239239/** Retry `fn` every `interval`ms until it returns true or `timeout` is reached */
240- async function wait_until ( fn : ( ) => Promise < boolean > , interval = 10_000 , timeout = 3 * 60_000 ) {
240+ async function wait_until ( fn : ( ) => Promise < boolean > , interval = 10_000 , timeout = 5 * 60_000 ) {
241241 const deadline = Date . now ( ) + timeout ;
242242 while ( Date . now ( ) < deadline ) {
243243 if ( await fn ( ) ) return true ;
@@ -302,15 +302,29 @@ async function resolve_npm_packages(packages: Package[]) {
302302 }
303303}
304304
305- /** Update dependencies to latest published versions (for main branch syncs) */
305+ /** Update package.json to latest published npm versions (for main branch syncs) */
306306async function update_published_packages ( packages : Package [ ] ) {
307307 const names = packages
308308 . filter ( ( pkg ) => pkg . npm_packages ?. length && pkg . branch === 'main' )
309309 . flatMap ( ( pkg ) => pkg . npm_packages ! ) ;
310310
311311 if ( ! names . length ) return ;
312312
313- await invoke ( 'pnpm' , [ 'update' , ...names ] , { cwd : path . join ( dirname , '../..' ) } ) ;
313+ const pkg_json_path = path . join ( dirname , '../../package.json' ) ;
314+ const pkg_json = JSON . parse ( fs . readFileSync ( pkg_json_path , 'utf-8' ) ) ;
315+
316+ for ( const name of names ) {
317+ const latest = execSync ( `npm view ${ name } version` , { encoding : 'utf-8' } ) . trim ( ) ;
318+ const section =
319+ pkg_json . dependencies ?. [ name ] !== undefined ? 'dependencies' : 'devDependencies' ;
320+ pkg_json [ section ] [ name ] = `^${ latest } ` ;
321+ }
322+
323+ fs . writeFileSync ( pkg_json_path , JSON . stringify ( pkg_json , null , '\t' ) + '\n' ) ;
324+ execSync ( 'pnpm install --lockfile-only' , {
325+ cwd : path . join ( dirname , '../../../..' ) ,
326+ stdio : 'inherit'
327+ } ) ;
314328}
315329
316330/**
0 commit comments