Skip to content

Latest commit

 

History

History
75 lines (55 loc) · 4.33 KB

File metadata and controls

75 lines (55 loc) · 4.33 KB
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.

SrcPush Bare RN Setup

Overview

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.

Workflow

  1. Inspect the app before editing. Verify the React Native version, the native entry files, and whether @srcpush/react-native-code-push or an older CodePush package is already present. Check package.json, ios/Podfile, the iOS app delegate, android/app/build.gradle, android/app/src/main/res/values/strings.xml, and the Android application class.

  2. Install the runtime dependency first. Add @srcpush/react-native-code-push to app dependencies. Keep the CLI out of runtime dependencies. Prefer local dev dependency or CI installation for @srcpush/code-push-cli.

  3. Wire Android native integration. Apply the Gradle helper from the package in android/app/build.gradle. Ensure an app resource named CodePushDeploymentKey exists. Add getJSBundleFile() 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.

  4. Wire iOS native integration. Add the CodePush pod in ios/Podfile when autolinking is not sufficient for the project’s setup. Import CodePush in the app delegate and return [CodePush bundleURL] for non-debug builds. Add CodePushDeploymentKey to Info.plist. Add CodePushServerURL and CodePushPublicKey only when the deployment backend requires them.

  5. Configure the JS runtime deliberately. Wrap the root component with codePush(...) or call codePush.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.

  6. 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.

  7. Verify both integration and release readiness. Confirm native files compile, pod install completes, Android resolves the Gradle script, and release commands reference the correct app names and binary version targeting.

Output Shape

When applying this skill, prefer producing:

  • Concrete edits in app files.
  • Placeholder values such as YOUR_SRCPUSH_APP_NAME and YOUR_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.

Guardrails

  • 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.

References

Minimal Checklist

  1. Add the library.
  2. Patch Android native entry and config resources.
  3. Patch iOS app delegate and Info.plist.
  4. Add JS sync behavior.
  5. Add release scripts.
  6. Keep secrets outside git.