Structure
ReactNativeCLI
A typed wrapper for npx react-native CLI commands used by ShipItKit.
struct ReactNativeCLIOverview
React Native CLI commands are invoked via npx react-native <subcommand> to ensure the project-local version of the CLI is always used, regardless of global installs.
Usage
let output = try await ReactNativeCLI(context: context.shell)
.buildAndroid(mode: "release")
.run()Topics
Initializers
init(context: ShellContext)Creates a
ReactNativeCLIbound to a shell context.
Instance Properties
let arguments: [String]Arguments for the selected
npx react-nativesubcommand.let config: ToolConfigurationShared configuration applied to commands produced by this client.
var context: ShellContextThe shell context used when running this command family.
let stderrDestination: OutputDestinationThe stderr handling strategy for built commands.
let stdoutDestination: OutputDestinationThe stdout handling strategy for built commands.
Instance Methods
func buildAndroid(mode: String, task: String?) -> ReactNativeCLInpx react-native build-android --mode=release— wraps Gradle to build Android.func buildIOS(mode: String, scheme: String?) -> ReactNativeCLInpx react-native build-ios --mode Release— compiles and validates the iOS bundle.func command() -> CommandBuilds the raw
npxcommand with react-native subcommand arguments.func settingStderrDestination(OutputDestination) -> ReactNativeCLIfunc settingStdoutDestination(OutputDestination) -> ReactNativeCLIfunc updatingConfiguration((ToolConfiguration) -> ToolConfiguration) -> ReactNativeCLI
Relationships
Conforms To
Swift.SendableSwift.SendableMetatypeSwiftyShell.OutputRedirectingCommandFamilySwiftyShell.RunnableCommandFamilySwiftyShell.ToolConfigurableCommandFamily