@@ -12,18 +12,31 @@ async function createNextRelease() {
1212 * Parse the package.json for `create-expo-stack`, and update it with the new
1313 * "next" (development) version based on the parsed changesets
1414 */
15- const packageJson = await Bun . file ( process . cwd ( ) + '/cli/package.json' ) . json ( ) ;
16- const newNextVersion = releasePlan . releases . find ( ( release ) => release . name === packageJson . name ) ?. newVersion ;
15+ const cliPackageJson = await Bun . file ( process . cwd ( ) + '/cli/package.json' ) . json ( ) ;
16+ const newNextVersion = releasePlan . releases . find ( ( release ) => release . name === cliPackageJson . name ) ?. newVersion ;
1717
1818 if ( newNextVersion ) {
19+ const nextVersionWithHash = `${ newNextVersion } -next.${ commitHash } ` ;
20+
1921 /**
20- * Write the new "next" version to `package.json` . It is an ephemeral change
22+ * Write the new "next" version to `create-expo-stack` package.json. It is an ephemeral change
2123 * that lives only for the duration of the CI run, and is not committed
2224 */
23- packageJson . version = `${ newNextVersion } -next.${ commitHash } ` ;
25+ cliPackageJson . version = nextVersionWithHash ;
26+
27+ const cliContent = JSON . stringify ( cliPackageJson , null , '\t' ) + '\n' ;
28+ await Bun . write ( process . cwd ( ) + '/cli/package.json' , cliContent ) ;
29+
30+ /**
31+ * Also update the rn-new package.json with the same version and update its dependency
32+ * on create-expo-stack to match the new next version
33+ */
34+ const rnNewPackageJson = await Bun . file ( process . cwd ( ) + '/packages/rn-new/package.json' ) . json ( ) ;
35+ rnNewPackageJson . version = nextVersionWithHash ;
36+ rnNewPackageJson . dependencies [ 'create-expo-stack' ] = `^${ nextVersionWithHash } ` ;
2437
25- const content = JSON . stringify ( packageJson , null , '\t' ) + '\n' ;
26- await Bun . write ( process . cwd ( ) + '/cli/ package.json' , content ) ;
38+ const rnNewContent = JSON . stringify ( rnNewPackageJson , null , '\t' ) + '\n' ;
39+ await Bun . write ( process . cwd ( ) + '/packages/rn-new/ package.json' , rnNewContent ) ;
2740 }
2841 } catch ( error ) {
2942 console . log ( error ) ;
0 commit comments