@@ -87,13 +87,24 @@ function parseArgs(): { version: string; tag: "latest" | "rc"; noGitChecks: bool
8787
8888// ── Update version ──
8989
90+ function findPublishablePackages ( ) : string [ ] {
91+ const output = run ( "pnpm -r ls --json --depth -1" ) ;
92+ const packages = JSON . parse ( output ) as Array < { path : string ; private ?: boolean } > ;
93+ return packages
94+ . filter ( ( p ) => ! p . private && p . path !== ROOT && ! p . path . includes ( "/registry/software/" ) )
95+ . map ( ( p ) => join ( p . path , "package.json" ) ) ;
96+ }
97+
9098function setVersion ( version : string ) {
91- const file = join ( ROOT , "packages/core/package.json" ) ;
92- const content = readFileSync ( file , "utf-8" ) ;
93- const pkg = JSON . parse ( content ) ;
94- pkg . version = version ;
95- const indent = content . match ( / ^ ( \s + ) " / m) ?. [ 1 ] ?? "\t" ;
96- writeFileSync ( file , JSON . stringify ( pkg , null , indent ) + "\n" ) ;
99+ const files = findPublishablePackages ( ) ;
100+ for ( const file of files ) {
101+ const content = readFileSync ( file , "utf-8" ) ;
102+ const pkg = JSON . parse ( content ) ;
103+ pkg . version = version ;
104+ const indent = content . match ( / ^ ( \s + ) " / m) ?. [ 1 ] ?? "\t" ;
105+ writeFileSync ( file , JSON . stringify ( pkg , null , indent ) + "\n" ) ;
106+ console . log ( ` ${ pkg . name } → ${ version } ` ) ;
107+ }
97108}
98109
99110// ── Main ──
@@ -122,13 +133,17 @@ async function main() {
122133 console . log ( "\x1b[33m⚠ Skipping git checks (--no-git-checks)\x1b[0m" ) ;
123134 }
124135
125- const corePkg = JSON . parse ( readFileSync ( join ( ROOT , "packages/core/package.json" ) , "utf-8" ) ) ;
136+ const pkgFiles = findPublishablePackages ( ) ;
137+ const pkgNames = pkgFiles . map ( ( f ) => JSON . parse ( readFileSync ( f , "utf-8" ) ) . name as string ) ;
126138
127139 console . log ( `\n\x1b[1mRelease Plan\x1b[0m` ) ;
128- console . log ( ` Package: \x1b[36m${ corePkg . name } \x1b[0m` ) ;
129140 console . log ( ` Version: \x1b[36m${ version } \x1b[0m` ) ;
130141 console . log ( ` NPM tag: \x1b[36m${ tag } \x1b[0m` ) ;
131142 console . log ( ` Git tag: \x1b[36mv${ version } \x1b[0m` ) ;
143+ console . log ( ` Packages: \x1b[36m${ pkgNames . length } \x1b[0m` ) ;
144+ for ( const name of pkgNames ) {
145+ console . log ( ` - ${ name } ` ) ;
146+ }
132147 console . log ( ) ;
133148
134149 if ( ! ( await confirm ( "Proceed?" ) ) ) {
0 commit comments