| name | srcpush-bare-rn-setup |
|---|---|
| description | Configure SrcPush in bare React Native projects, including native iOS/Android wiring, runtime sync behavior, deployment-key placeholders, and release automation. Use when Codex needs to add or repair over-the-air update support in an OSS React Native app, migrate an existing CodePush-style setup to @srcpush/react-native-code-push, create release scripts or CI workflows, or inject SrcPush config into Info.plist and Android strings/build files without leaking secrets. |
Configure SrcPush for a bare React Native app without assuming private project conventions. Wire native entry points, add safe placeholders for deployment config, define JS sync behavior, and prepare local or CI release commands.
-
Inspect the app before editing. Verify the React Native version, the native entry files, and whether
@srcpush/react-native-code-pushor an older CodePush package is already present. Checkpackage.json,ios/Podfile, the iOS app delegate,android/app/build.gradle,android/app/src/main/res/values/strings.xml, and the Android application class. -
Install the runtime dependency first. Add
@srcpush/react-native-code-pushto app dependencies. Keep the CLI out of runtime dependencies. Prefer local dev dependency or CI installation for@srcpush/code-push-cli. -
Wire Android native integration. Apply the Gradle helper from the package in
android/app/build.gradle. Ensure an app resource namedCodePushDeploymentKeyexists. AddgetJSBundleFile()override in the application class so the runtime can resolve the downloaded bundle. Keep server URL, public key, or deployment key values in placeholders or CI-managed injection, not hardcoded secrets. -
Wire iOS native integration. Add the
CodePushpod inios/Podfilewhen autolinking is not sufficient for the project’s setup. ImportCodePushin the app delegate and return[CodePush bundleURL]for non-debug builds. AddCodePushDeploymentKeytoInfo.plist. AddCodePushServerURLandCodePushPublicKeyonly when the deployment backend requires them. -
Configure the JS runtime deliberately. Wrap the root component with
codePush(...)or callcodePush.sync(...)from a controlled startup path. Choose install behavior per platform. A common default is immediate install on iOS and next restart on Android. Disable built-in dialogs if the product requires a custom update UI. -
Create non-sensitive release automation. Add package scripts using placeholders for app names, deployment names, plist path, and private key path. Put access keys, private keys, deployment keys, and public keys in environment variables or CI secrets. Never copy app-specific values from a private project into the skill output.
-
Verify both integration and release readiness. Confirm native files compile,
pod installcompletes, Android resolves the Gradle script, and release commands reference the correct app names and binary version targeting.
When applying this skill, prefer producing:
- Concrete edits in app files.
- Placeholder values such as
YOUR_SRCPUSH_APP_NAMEandYOUR_DEPLOYMENT_KEY. - A short release command block for Android and iOS.
- A note explaining which values must come from CI secrets or local environment variables.
- Do not hardcode private deployment keys, access keys, bundle IDs, or internal endpoints.
- Prefer adding placeholders to tracked files and injecting real values in CI.
- If the project already has AppCenter CodePush or a forked CodePush setup, preserve working logic and migrate incrementally.
- Read references/native-integration.md for the expected file-level Android and iOS changes.
- Read references/release-and-ci.md for generic release scripts and CI workflow patterns.
- Use scripts/inject-srcpush-config.js when the project already contains Source Push placeholders and only needs environment-driven config values written into
strings.xmlandInfo.plist.
- Add the library.
- Patch Android native entry and config resources.
- Patch iOS app delegate and
Info.plist. - Add JS sync behavior.
- Add release scripts.
- Keep secrets outside git.