From b7accb8f4d93cf74d9c436640a51f8748c36c3de Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Thu, 28 May 2026 13:04:41 +0100 Subject: [PATCH 1/2] chore: centralize RN native SDK versions --- .github/CONTRIBUTING.md | 17 +++++++++++++++++ .../RNShopifyCheckoutKit.podspec | 7 +++++-- .../android/build.gradle | 16 +++++++++++----- .../checkout-kit-react-native/package.json | 6 ++++++ .../sample/android/app/build.gradle | 13 +++++++++---- platforms/react-native/sample/ios/Podfile.lock | 13 +++++-------- .../scripts/publish_android_snapshot | 2 +- 7 files changed, 54 insertions(+), 20 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 9d267f83..62f9e756 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -86,6 +86,7 @@ Open a pull request with the following changes: 2. Bump the metadata version in `platforms/swift/Sources/ShopifyCheckoutKit/MetaData.swift`. 3. Bump the podspec version in `ShopifyCheckoutKit.podspec` (at the repo root). 4. Add an entry to the top of `platforms/swift/CHANGELOG.md`. +5. If the React Native package should consume this Swift SDK release, update `checkoutKit.nativeSdkVersions.ios` in `platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json` to the same version. All Swift version declarations must match exactly. Supported release versions are `X.Y.Z` and prerelease versions are `X.Y.Z-{alpha|beta|rc}.N`. @@ -133,6 +134,7 @@ Open a pull request with the following changes: 1. Bump the `versionName` in `platforms/android/lib/build.gradle`. 2. Add an entry to the top of `platforms/android/CHANGELOG.md`. +3. If the React Native package should consume this Android SDK release, update `checkoutKit.nativeSdkVersions.android` in `platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json` to the same version. Supported release versions are `X.Y.Z` and prerelease versions are `X.Y.Z-{alpha|beta|rc}.N`. @@ -148,6 +150,21 @@ Once merged, run the [Release package workflow](../../actions/workflows/release. ## React Native (`platforms/react-native/`) +### Native SDK dependency versions + +The React Native package reads its published native SDK dependency versions from `platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json`: + +```json +"checkoutKit": { + "nativeSdkVersions": { + "ios": "4.0.0-alpha.1", + "android": "4.0.0-alpha.1" + } +} +``` + +When updating the Swift or Android SDK version that React Native should consume, update the matching `checkoutKit.nativeSdkVersions` entry in this package file. These values drive `RNShopifyCheckoutKit.podspec` for iOS and the module/sample Gradle dependencies for Android, so they must stay aligned with the published native SDK versions used by the React Native release. + ### Public API surface The library's public API is tracked via a committed report at `platforms/react-native/modules/@shopify/checkout-kit-react-native/api/checkout-kit-react-native.api.md`, generated by [@microsoft/api-extractor](https://api-extractor.com/) from the bob-produced `.d.ts` files. The unified `Breaking Changes` CI workflow runs `dev rn api check` on every PR that touches React Native sources and fails if the regenerated report diverges from the committed one. diff --git a/platforms/react-native/modules/@shopify/checkout-kit-react-native/RNShopifyCheckoutKit.podspec b/platforms/react-native/modules/@shopify/checkout-kit-react-native/RNShopifyCheckoutKit.podspec index c595c09b..48b6dfc8 100644 --- a/platforms/react-native/modules/@shopify/checkout-kit-react-native/RNShopifyCheckoutKit.podspec +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/RNShopifyCheckoutKit.podspec @@ -1,6 +1,9 @@ require "json" package = JSON.parse(File.read(File.join(__dir__, "package.json"))) +ios_native_sdk_version = package.dig("checkoutKit", "nativeSdkVersions", "ios") + +raise "checkoutKit.nativeSdkVersions.ios is required in package.json" if ios_native_sdk_version.to_s.empty? Pod::Spec.new do |s| s.name = "RNShopifyCheckoutKit" @@ -28,8 +31,8 @@ Pod::Spec.new do |s| s.dependency "ShopifyCheckoutKit" s.dependency "ShopifyCheckoutKit/AcceleratedCheckouts" else - s.dependency "ShopifyCheckoutKit", "~> 0.0.0" - s.dependency "ShopifyCheckoutKit/AcceleratedCheckouts", "~> 0.0.0" + s.dependency "ShopifyCheckoutKit", "~> #{ios_native_sdk_version}" + s.dependency "ShopifyCheckoutKit/AcceleratedCheckouts", "~> #{ios_native_sdk_version}" end install_modules_dependencies(s) diff --git a/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/build.gradle b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/build.gradle index cf61a495..3075dbd9 100644 --- a/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/build.gradle +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/build.gradle @@ -90,6 +90,17 @@ android { } +def useLocalSdk = (System.getenv("USE_LOCAL_SDK") ?: "0") == "1" +def packageJsonFile = file("../package.json") +def packageJson = new groovy.json.JsonSlurper().parse(packageJsonFile) +def shopifySdkVersion = packageJson.checkoutKit?.nativeSdkVersions?.android as String + +if (shopifySdkVersion == null || shopifySdkVersion.trim().isEmpty()) { + throw new GradleException("checkoutKit.nativeSdkVersions.android is required in ${packageJsonFile}") +} + +def shopifySdkArtifact = "com.shopify:checkout-kit:$shopifySdkVersion" + repositories { mavenLocal() mavenCentral() @@ -97,11 +108,6 @@ repositories { } -def useLocalSdk = (System.getenv("USE_LOCAL_SDK") ?: "0") == "1" -def shopifySdkArtifact = useLocalSdk - ? "com.shopify:checkout-kit:4.0.0-alpha.1" - : "com.shopify:checkout-kit:0.0.0" - dependencies { // For < 0.71, this will be from the local maven repo // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin diff --git a/platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json b/platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json index 3f4aec9c..3c0bd1f5 100644 --- a/platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json @@ -17,6 +17,12 @@ "publishConfig": { "registry": "https://registry.npmjs.org/" }, + "checkoutKit": { + "nativeSdkVersions": { + "ios": "4.0.0-alpha.1", + "android": "4.0.0-alpha.1" + } + }, "scripts": { "clean": "rm -rf lib", "build": "bob build", diff --git a/platforms/react-native/sample/android/app/build.gradle b/platforms/react-native/sample/android/app/build.gradle index 09296b1d..8b296825 100644 --- a/platforms/react-native/sample/android/app/build.gradle +++ b/platforms/react-native/sample/android/app/build.gradle @@ -153,10 +153,15 @@ android { } } -def useLocalSdk = (System.getenv("USE_LOCAL_SDK") ?: "0") == "1" -def shopifySdkArtifact = useLocalSdk - ? "com.shopify:checkout-kit:4.0.0-alpha.1" - : "com.shopify:checkout-kit:0.0.0" +def checkoutKitPackageJsonFile = rootProject.file("../../modules/@shopify/checkout-kit-react-native/package.json") +def checkoutKitPackageJson = new groovy.json.JsonSlurper().parse(checkoutKitPackageJsonFile) +def shopifySdkVersion = checkoutKitPackageJson.checkoutKit?.nativeSdkVersions?.android as String + +if (shopifySdkVersion == null || shopifySdkVersion.trim().isEmpty()) { + throw new GradleException("checkoutKit.nativeSdkVersions.android is required in ${checkoutKitPackageJsonFile}") +} + +def shopifySdkArtifact = "com.shopify:checkout-kit:$shopifySdkVersion" dependencies { // The version of react-native is set by the React Native Gradle Plugin diff --git a/platforms/react-native/sample/ios/Podfile.lock b/platforms/react-native/sample/ios/Podfile.lock index 6270d487..4b4b5ff0 100644 --- a/platforms/react-native/sample/ios/Podfile.lock +++ b/platforms/react-native/sample/ios/Podfile.lock @@ -2605,8 +2605,8 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - ShopifyCheckoutKit - - ShopifyCheckoutKit/AcceleratedCheckouts + - ShopifyCheckoutKit (~> 4.0.0-alpha.1) + - ShopifyCheckoutKit/AcceleratedCheckouts (~> 4.0.0-alpha.1) - SocketRocket - Yoga - RNVectorIcons (10.3.0): @@ -2732,13 +2732,12 @@ DEPENDENCIES: - RNScreens (from `../../node_modules/react-native-screens`) - "RNShopifyCheckoutKit (from `../../modules/@shopify/checkout-kit-react-native`)" - RNVectorIcons (from `../../node_modules/react-native-vector-icons`) - - ShopifyCheckoutKit (from `../../../../`) - - ShopifyCheckoutKit/AcceleratedCheckouts (from `../../../../`) - SocketRocket (~> 0.7.1) - Yoga (from `../../node_modules/react-native/ReactCommon/yoga`) SPEC REPOS: trunk: + - ShopifyCheckoutKit - SocketRocket EXTERNAL SOURCES: @@ -2911,8 +2910,6 @@ EXTERNAL SOURCES: :path: "../../modules/@shopify/checkout-kit-react-native" RNVectorIcons: :path: "../../node_modules/react-native-vector-icons" - ShopifyCheckoutKit: - :path: "../../../../" Yoga: :path: "../../node_modules/react-native/ReactCommon/yoga" @@ -2999,9 +2996,9 @@ SPEC CHECKSUMS: RNGestureHandler: eeb622199ef1fb3a076243131095df1c797072f0 RNReanimated: 237d420b7bb4378ef1dacc7d7a5c674fddb4b5d2 RNScreens: 3fc29af06302e1f1c18a7829fe57cbc2c0259912 - RNShopifyCheckoutKit: 554996990cd493b49bc64e8f4a42bea4266e5a2d + RNShopifyCheckoutKit: 23f4881a5a839cc7b5e0840ccfec3b317c3c3bd6 RNVectorIcons: be4d047a76ad307ffe54732208fb0498fcb8477f - ShopifyCheckoutKit: 86b4e0976e98b17dc0a1de0399ec5a0a4f8171b5 + ShopifyCheckoutKit: ffd719db529ac48907536d855182d7c57c85659f SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Yoga: a742cc68e8366fcfc681808162492bc0aa7a9498 diff --git a/platforms/react-native/scripts/publish_android_snapshot b/platforms/react-native/scripts/publish_android_snapshot index 3ed71a5b..ce7c23a8 100755 --- a/platforms/react-native/scripts/publish_android_snapshot +++ b/platforms/react-native/scripts/publish_android_snapshot @@ -11,4 +11,4 @@ ANDROID_SDK_PATH="$SCRIPT_DIR/../../android" cd "$ANDROID_SDK_PATH" ./gradlew :lib:publishToMavenLocal -q -echo "publish_android_snapshot: published com.shopify:checkout-kit:4.0.0-alpha.1 to ~/.m2/" +echo "publish_android_snapshot: published com.shopify:checkout-kit to ~/.m2/" From 7dc139f4bc3a00b2ec48a5db2f5775f44ba04a1c Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Thu, 28 May 2026 13:16:44 +0100 Subject: [PATCH 2/2] fix: remove USE_LOCAL_SDK from CI runs --- .github/workflows/rn-build-android.yml | 4 ---- .github/workflows/rn-build-ios.yml | 6 ------ .github/workflows/rn-check-packed-files.yml | 6 ------ .github/workflows/rn-lint.yml | 6 ------ .github/workflows/rn-test-android.yml | 4 ---- .github/workflows/rn-test-ios.yml | 6 ------ platforms/react-native/CONTRIBUTING.md | 2 +- 7 files changed, 1 insertion(+), 33 deletions(-) diff --git a/.github/workflows/rn-build-android.yml b/.github/workflows/rn-build-android.yml index 6f28d4a7..3b76854b 100644 --- a/.github/workflows/rn-build-android.yml +++ b/.github/workflows/rn-build-android.yml @@ -9,10 +9,6 @@ permissions: env: JAVA_VERSION: '22' - # TODO: remove once ShopifyCheckoutKit is published to CocoaPods trunk and - # Maven Central. Tracks the new pod/AAR name introduced by the - # ShopifyCheckoutSheetKit → ShopifyCheckoutKit rename. - USE_LOCAL_SDK: "1" jobs: build-android: diff --git a/.github/workflows/rn-build-ios.yml b/.github/workflows/rn-build-ios.yml index ebdab520..5c88e487 100644 --- a/.github/workflows/rn-build-ios.yml +++ b/.github/workflows/rn-build-ios.yml @@ -7,12 +7,6 @@ on: permissions: contents: read -# TODO: remove once ShopifyCheckoutKit is published to CocoaPods trunk and -# Maven Central. Tracks the new pod/AAR name introduced by the -# ShopifyCheckoutSheetKit → ShopifyCheckoutKit rename. -env: - USE_LOCAL_SDK: "1" - jobs: build-ios: name: Build iOS Sample diff --git a/.github/workflows/rn-check-packed-files.yml b/.github/workflows/rn-check-packed-files.yml index 65fac36e..e29d9eba 100644 --- a/.github/workflows/rn-check-packed-files.yml +++ b/.github/workflows/rn-check-packed-files.yml @@ -7,12 +7,6 @@ on: permissions: contents: read -# TODO: remove once ShopifyCheckoutKit is published to CocoaPods trunk and -# Maven Central. Tracks the new pod/AAR name introduced by the -# ShopifyCheckoutSheetKit → ShopifyCheckoutKit rename. -env: - USE_LOCAL_SDK: "1" - jobs: check-packed-files: name: Check package files diff --git a/.github/workflows/rn-lint.yml b/.github/workflows/rn-lint.yml index 3f278839..ccbf615b 100644 --- a/.github/workflows/rn-lint.yml +++ b/.github/workflows/rn-lint.yml @@ -7,12 +7,6 @@ on: permissions: contents: read -# TODO: remove once ShopifyCheckoutKit is published to CocoaPods trunk and -# Maven Central. Tracks the new pod/AAR name introduced by the -# ShopifyCheckoutSheetKit → ShopifyCheckoutKit rename. -env: - USE_LOCAL_SDK: "1" - jobs: swiftlint: name: SwiftLint diff --git a/.github/workflows/rn-test-android.yml b/.github/workflows/rn-test-android.yml index 6f026b35..00c9de63 100644 --- a/.github/workflows/rn-test-android.yml +++ b/.github/workflows/rn-test-android.yml @@ -9,10 +9,6 @@ permissions: env: JAVA_VERSION: '22' - # TODO: remove once ShopifyCheckoutKit is published to CocoaPods trunk and - # Maven Central. Tracks the new pod/AAR name introduced by the - # ShopifyCheckoutSheetKit → ShopifyCheckoutKit rename. - USE_LOCAL_SDK: "1" jobs: test-android: diff --git a/.github/workflows/rn-test-ios.yml b/.github/workflows/rn-test-ios.yml index 653eec04..76bcc171 100644 --- a/.github/workflows/rn-test-ios.yml +++ b/.github/workflows/rn-test-ios.yml @@ -7,12 +7,6 @@ on: permissions: contents: read -# TODO: remove once ShopifyCheckoutKit is published to CocoaPods trunk and -# Maven Central. Tracks the new pod/AAR name introduced by the -# ShopifyCheckoutSheetKit → ShopifyCheckoutKit rename. -env: - USE_LOCAL_SDK: "1" - jobs: test-ios: name: Run iOS Tests diff --git a/platforms/react-native/CONTRIBUTING.md b/platforms/react-native/CONTRIBUTING.md index d2c5f691..f72495be 100644 --- a/platforms/react-native/CONTRIBUTING.md +++ b/platforms/react-native/CONTRIBUTING.md @@ -78,7 +78,7 @@ USE_LOCAL_SDK=1 dev rn android ### CI -CI uses the default (published) path naturally — no special flag handling. As defense-in-depth, the build wiring still ignores `USE_LOCAL_SDK=1` when the `CI` env var is set (GitHub Actions sets `CI=true` automatically). +CI uses the default (published) path naturally — no special flag handling. Keep `USE_LOCAL_SDK=1` scoped to local development or explicit validation against unreleased native SDK changes. ### Gotchas