1717 */
1818
1919import { execSync } from "child_process" ;
20+ import { readdirSync , readFileSync } from "fs" ;
2021import { join } from "path" ;
2122
2223const version = process . argv [ 2 ] ;
@@ -43,15 +44,25 @@ function extractChangesFromPrBody(body) {
4344 const lines = body . split ( "\n" ) ;
4445 const outputLines = [ ] ;
4546 let inDetails = false ;
47+ let inSummary = false ;
4648 let foundContent = false ;
4749
4850 for ( const line of lines ) {
49- // Skip the title line (# trigger.dev vX.Y.Z) and Summary section
51+ // Skip the title line (# trigger.dev vX.Y.Z)
5052 if ( line . startsWith ( "# trigger.dev v" ) ) continue ;
53+
54+ // Skip the entire Summary section (heading + content until next heading)
5155 if ( line . startsWith ( "## Summary" ) ) {
52- // Skip the summary line and its content (next non-empty line)
56+ inSummary = true ;
5357 continue ;
5458 }
59+ if ( inSummary ) {
60+ if ( line . startsWith ( "## " ) ) {
61+ inSummary = false ;
62+ } else {
63+ continue ;
64+ }
65+ }
5566
5667 // Stop before raw changeset output
5768 if ( line . trim ( ) === "<details>" ) {
@@ -112,19 +123,28 @@ function getContributors(previousVersion) {
112123
113124function getPublishedPackages ( ) {
114125 try {
115- const config = JSON . parse (
116- execSync ( "cat .changeset/config.json" , {
117- cwd : ROOT_DIR ,
118- encoding : "utf-8" ,
119- } )
120- ) ;
121- const fixed = config . fixed ?. [ 0 ] || [ ] ;
122- return fixed ;
126+ const packagesDir = join ( ROOT_DIR , "packages" ) ;
127+ const names = [ ] ;
128+ for ( const dir of readdirSync ( packagesDir , { withFileTypes : true } ) ) {
129+ if ( ! dir . isDirectory ( ) ) continue ;
130+ try {
131+ const pkg = JSON . parse (
132+ readFileSync ( join ( packagesDir , dir . name , "package.json" ) , "utf-8" )
133+ ) ;
134+ if ( pkg . name && ! pkg . private ) {
135+ names . push ( pkg . name ) ;
136+ }
137+ } catch {
138+ // skip directories without package.json
139+ }
140+ }
141+ return names . sort ( ) ;
123142 } catch {
124143 return [
125- "@trigger.dev/sdk" ,
126- "@trigger.dev/core" ,
127144 "@trigger.dev/build" ,
145+ "@trigger.dev/core" ,
146+ "@trigger.dev/react-hooks" ,
147+ "@trigger.dev/sdk" ,
128148 "trigger.dev" ,
129149 ] ;
130150 }
@@ -137,6 +157,12 @@ function getPreviousVersion(version) {
137157 } else if ( parts [ 1 ] > 0 ) {
138158 parts [ 1 ] -- ;
139159 parts [ 2 ] = 0 ;
160+ } else if ( parts [ 0 ] > 0 ) {
161+ parts [ 0 ] -- ;
162+ parts [ 1 ] = 0 ;
163+ parts [ 2 ] = 0 ;
164+ } else {
165+ return null ;
140166 }
141167 return parts . join ( "." ) ;
142168}
0 commit comments