@@ -12,18 +12,31 @@ async function createNextRelease() {
12
12
* Parse the package.json for `create-expo-stack`, and update it with the new
13
13
* "next" (development) version based on the parsed changesets
14
14
*/
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 ;
17
17
18
18
if ( newNextVersion ) {
19
+ const nextVersionWithHash = `${ newNextVersion } -next.${ commitHash } ` ;
20
+
19
21
/**
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
21
23
* that lives only for the duration of the CI run, and is not committed
22
24
*/
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 } ` ;
24
37
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 ) ;
27
40
}
28
41
} catch ( error ) {
29
42
console . log ( error ) ;
0 commit comments