Skip to content

Commit 768e36f

Browse files
authored
fix: lock version of react-native installed by init (#1188)
1 parent 5046966 commit 768e36f

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

.changeset/fruity-shrimps-shave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@callstack/repack-init": patch
3+
---
4+
5+
Fix `@callstack/repack-init` installing unsupported versions of `react-native`

packages/init/src/tasks/createNewProject.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import path from 'node:path';
22
import { execa } from 'execa';
3+
import versionsJson from '../../versions.json' with { type: 'json' };
34
import type { PackageManager } from '../types/pm.js';
45
import { RepackInitError } from '../utils/error.js';
56
import spinner from '../utils/spinner.js';
@@ -17,6 +18,8 @@ export default async function createNewProject(
1718
projectName,
1819
'--directory',
1920
path.join(cwd, projectName),
21+
'--version',
22+
versionsJson['react-native'],
2023
'--skip-install',
2124
'--skip-git-init',
2225
];

packages/init/versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"react-native": "0.79",
23
"rspack": {
34
"@rspack/core": "^1.3.4",
45
"@swc/helpers": "^0.5.17"

0 commit comments

Comments
 (0)