Skip to content

Commit d7393de

Browse files
committed
fix: retrieve proper RN version for iOS build
1 parent 1bfaf2a commit d7393de

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/cli/src/brownfield/commands/packageIos.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
type BuildFlags as AppleBuildFlags,
66
} from '@rock-js/platform-apple-helpers';
77
import { packageIosAction } from '@rock-js/plugin-brownfield-ios';
8+
import { getReactNativeVersion } from '@rock-js/tools';
89

910
import { Command } from 'commander';
1011

@@ -51,7 +52,10 @@ export const packageIosCommand = curryOptions(
5152
{
5253
projectRoot,
5354
reactNativePath: userConfig.reactNativePath,
54-
reactNativeVersion: userConfig.reactNativeVersion,
55+
// below: the userConfig.reactNativeVersion may be a non-semver-format string,
56+
// e.g. '0.82' (note the missing patch component),
57+
// therefore we resolve it manually from RN's package.json using Rock's utils
58+
reactNativeVersion: getReactNativeVersion(projectRoot),
5559
usePrebuiltRNCore: 0, // for brownfield, it is required to build RN from source
5660
packageDir: path.join(brownieCacheDir, 'package'), // the output directory for artifacts
5761
skipCache: true, // cache is dependent on existence of Rock config file

0 commit comments

Comments
 (0)