From f2eecfc8e6e039eb0f77da79c72b8ea118cf85a9 Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Wed, 25 Mar 2026 09:54:29 +0000 Subject: [PATCH 01/10] chore: bump dev.yml to iOS 26.2 From e635cf3a0ffef33bd5e2a16d39b5d44714aa3949 Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Wed, 25 Mar 2026 11:31:29 +0000 Subject: [PATCH 02/10] Add TurboModule specs and codegen components to prepare RN new-arch migration Prepare codebase for React Native new-architecture (TurboModules/codegen) by adding JS specs, codegen native components, and test mocks. What changed and why: - Added a TurboModule spec (NativeShopifyCheckoutSheetKit) and a codegen native component spec (RCTAcceleratedCheckoutButtonsNativeComponent) to declare the native API surface and typed component props. This moves JS to consume the new-arch API surface via TurboModuleRegistry and codegenNativeComponent instead of using NativeModules/requireNativeComponent directly. - Updated AcceleratedCheckoutButtons to import codegenNativeComponent and use the generated native component type instead of requireNativeComponent. - Added codegenConfig to the package.json to configure codegen generation for this module. - Added Jest mocks for codegenNativeComponent and extended the react-native manual mock to provide TurboModuleRegistry.getEnforcing, getConstants, and event listener helpers so unit tests run against the new-arch surface. - Added a moduleNameMapper entry to jest.config.js so tests resolve the codegenNativeComponent import to the new mock. - Updated a linking test to assert TurboModuleRegistry behavior (throws when module not present) rather than the old NativeModules linking error. - Adjusted runtime usage to read version via getConstants() and cast getConfig() return types for better typing with the spec. Context and next steps: - These changes are groundwork only: they enable the JS-side migration to the RN new architecture and allow tests to run against the new-arch signatures. - Native implementations (iOS/Android) still need corresponding TurboModule and codegen native component implementations, and we must decide on compatibility strategy (clean break vs dual support). Dual support will add duplication (parallel native hooks, bridging shims) and phased rollout; a clean break requires coordinating release timelines for hosts consuming this module. - Suggested next phases: (1) implement native TurboModule & codegen components on each platform, (2) add migration shims to continue supporting old NativeModules if dual-mode required, (3) integration testing & performance validation, (4) cutover and remove old-arch shims when safe. This commit prepares the repository for the migration and makes future work (native bindings and compatibility strategy) easier to implement and test. --- __mocks__/codegenNativeComponent.ts | 11 +++ __mocks__/react-native.ts | 11 +++ jest.config.js | 4 + .../@shopify/checkout-sheet-kit/package.json | 8 ++ .../components/AcceleratedCheckoutButtons.tsx | 5 +- .../@shopify/checkout-sheet-kit/src/index.ts | 22 ++---- .../specs/NativeShopifyCheckoutSheetKit.ts | 78 +++++++++++++++++++ ...celeratedCheckoutButtonsNativeComponent.ts | 69 ++++++++++++++++ .../checkout-sheet-kit/tests/linking.test.ts | 27 +++---- 9 files changed, 199 insertions(+), 36 deletions(-) create mode 100644 __mocks__/codegenNativeComponent.ts create mode 100644 modules/@shopify/checkout-sheet-kit/src/specs/NativeShopifyCheckoutSheetKit.ts create mode 100644 modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts diff --git a/__mocks__/codegenNativeComponent.ts b/__mocks__/codegenNativeComponent.ts new file mode 100644 index 00000000..56bc43de --- /dev/null +++ b/__mocks__/codegenNativeComponent.ts @@ -0,0 +1,11 @@ +const React = require('react'); + +const codegenNativeComponent = (_name: string) => { + return (props: any) => + React.createElement('View', { + ...props, + testID: props?.testID ?? 'accelerated-checkout-buttons', + }); +}; + +export default codegenNativeComponent; diff --git a/__mocks__/react-native.ts b/__mocks__/react-native.ts index 34cb204a..6dd8d395 100644 --- a/__mocks__/react-native.ts +++ b/__mocks__/react-native.ts @@ -47,6 +47,7 @@ const exampleConfig = {preloading: true}; const ShopifyCheckoutSheetKit = { version: '0.7.0', + getConstants: jest.fn(() => ({version: '0.7.0'})), preload: jest.fn(), present: jest.fn(), dismiss: jest.fn(), @@ -58,6 +59,8 @@ const ShopifyCheckoutSheetKit = { initiateGeolocationRequest: jest.fn(), configureAcceleratedCheckouts: jest.fn(), isAcceleratedCheckoutAvailable: jest.fn(), + addListener: jest.fn(), + removeListeners: jest.fn(), }; // CommonJS export for Jest manual mock resolution @@ -68,6 +71,14 @@ module.exports = { }, NativeEventEmitter: jest.fn(() => createMockEmitter()), requireNativeComponent, + TurboModuleRegistry: { + getEnforcing: jest.fn((name: string) => { + if (name === 'ShopifyCheckoutSheetKit') { + return ShopifyCheckoutSheetKit; + } + return null; + }), + }, NativeModules: { ShopifyCheckoutSheetKit: { ...ShopifyCheckoutSheetKit, diff --git a/jest.config.js b/jest.config.js index 6763de59..d43f8497 100644 --- a/jest.config.js +++ b/jest.config.js @@ -3,6 +3,10 @@ module.exports = { modulePathIgnorePatterns: ['modules/@shopify/checkout-sheet-kit/lib'], modulePaths: ['/sample/node_modules'], setupFiles: ['/jest.setup.ts'], + moduleNameMapper: { + 'react-native/Libraries/Utilities/codegenNativeComponent': + '/__mocks__/codegenNativeComponent.ts', + }, transform: { '\\.[jt]sx?$': 'babel-jest', }, diff --git a/modules/@shopify/checkout-sheet-kit/package.json b/modules/@shopify/checkout-sheet-kit/package.json index 64c3421c..79c1b3a0 100644 --- a/modules/@shopify/checkout-sheet-kit/package.json +++ b/modules/@shopify/checkout-sheet-kit/package.json @@ -54,6 +54,14 @@ "react-native-builder-bob": "^0.23.2", "typescript": "^5.9.2" }, + "codegenConfig": { + "name": "RNShopifyCheckoutSheetKitSpec", + "type": "all", + "jsSrcsDir": "src/specs", + "android": { + "javaPackageName": "com.shopify.checkoutsheetkit" + } + }, "react-native-builder-bob": { "source": "src", "output": "lib", diff --git a/modules/@shopify/checkout-sheet-kit/src/components/AcceleratedCheckoutButtons.tsx b/modules/@shopify/checkout-sheet-kit/src/components/AcceleratedCheckoutButtons.tsx index 7958fe85..ae770bb0 100644 --- a/modules/@shopify/checkout-sheet-kit/src/components/AcceleratedCheckoutButtons.tsx +++ b/modules/@shopify/checkout-sheet-kit/src/components/AcceleratedCheckoutButtons.tsx @@ -22,8 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SO */ import React, {useCallback, useMemo, useState} from 'react'; -import {requireNativeComponent, Platform} from 'react-native'; +import {Platform} from 'react-native'; import type {ViewStyle} from 'react-native'; +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; import type { AcceleratedCheckoutWallet, CheckoutCompletedEvent, @@ -164,7 +165,7 @@ interface NativeAcceleratedCheckoutButtonsProps { } const RCTAcceleratedCheckoutButtons = - requireNativeComponent( + codegenNativeComponent( 'RCTAcceleratedCheckoutButtons', ); diff --git a/modules/@shopify/checkout-sheet-kit/src/index.ts b/modules/@shopify/checkout-sheet-kit/src/index.ts index 964f6312..89ff238b 100644 --- a/modules/@shopify/checkout-sheet-kit/src/index.ts +++ b/modules/@shopify/checkout-sheet-kit/src/index.ts @@ -21,17 +21,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import { - NativeModules, - NativeEventEmitter, - PermissionsAndroid, - Platform, -} from 'react-native'; +import {NativeEventEmitter, PermissionsAndroid, Platform} from 'react-native'; import type { EmitterSubscription, EventSubscription, PermissionStatus, } from 'react-native'; +import NativeShopifyCheckoutSheetKit from './specs/NativeShopifyCheckoutSheetKit'; import {ShopifyCheckoutSheetProvider, useShopifyCheckoutSheet} from './context'; import {ApplePayContactField, ColorScheme, LogLevel} from './index.d'; import type { @@ -64,14 +60,7 @@ import type { RenderStateChangeEvent, } from './components/AcceleratedCheckoutButtons'; -const RNShopifyCheckoutSheetKit = NativeModules.ShopifyCheckoutSheetKit; - -if (!('ShopifyCheckoutSheetKit' in NativeModules)) { - throw new Error(` - "@shopify/checkout-sheet-kit" is not correctly linked. - - If you are building for iOS, make sure to run "pod install" first and restart the metro server.`); -} +const RNShopifyCheckoutSheetKit = NativeShopifyCheckoutSheetKit; const defaultFeatures: Features = { handleGeolocationRequests: true, @@ -114,7 +103,8 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { } } - public readonly version: string = RNShopifyCheckoutSheetKit.version; + public readonly version: string = + RNShopifyCheckoutSheetKit.getConstants().version; /** * Dismisses the currently displayed checkout sheet @@ -151,7 +141,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { * @returns Promise containing the current Configuration */ public async getConfig(): Promise { - return RNShopifyCheckoutSheetKit.getConfig(); + return RNShopifyCheckoutSheetKit.getConfig() as Promise; } /** diff --git a/modules/@shopify/checkout-sheet-kit/src/specs/NativeShopifyCheckoutSheetKit.ts b/modules/@shopify/checkout-sheet-kit/src/specs/NativeShopifyCheckoutSheetKit.ts new file mode 100644 index 00000000..84928eaa --- /dev/null +++ b/modules/@shopify/checkout-sheet-kit/src/specs/NativeShopifyCheckoutSheetKit.ts @@ -0,0 +1,78 @@ +import type {TurboModule} from 'react-native'; +import {TurboModuleRegistry} from 'react-native'; + +type IosColorsSpec = { + tintColor?: string; + backgroundColor?: string; + closeButtonColor?: string; +}; + +type AndroidColorsBaseSpec = { + progressIndicator?: string; + backgroundColor?: string; + headerBackgroundColor?: string; + headerTextColor?: string; + closeButtonColor?: string; +}; + +type AndroidColorsSpec = { + progressIndicator?: string; + backgroundColor?: string; + headerBackgroundColor?: string; + headerTextColor?: string; + closeButtonColor?: string; + light?: AndroidColorsBaseSpec; + dark?: AndroidColorsBaseSpec; +}; + +type ColorsSpec = { + ios?: IosColorsSpec; + android?: AndroidColorsSpec; +}; + +type ConfigurationSpec = { + preloading?: boolean; + title?: string; + colorScheme?: string; + logLevel?: string; + colors?: ColorsSpec; +}; + +type ConfigurationResultSpec = { + preloading: boolean; + colorScheme: string; + logLevel: string; + title?: string; + tintColor?: string; + backgroundColor?: string; + closeButtonColor?: string; +}; + +export interface Spec extends TurboModule { + present(checkoutUrl: string): void; + preload(checkoutUrl: string): void; + dismiss(): void; + invalidateCache(): void; + setConfig(configuration: ConfigurationSpec): void; + getConfig(): Promise; + configureAcceleratedCheckouts( + storefrontDomain: string, + storefrontAccessToken: string, + customerEmail: string | null, + customerPhoneNumber: string | null, + customerAccessToken: string | null, + applePayMerchantIdentifier: string | null, + applyPayContactFields: string[], + supportedShippingCountries: string[], + ): Promise; + isAcceleratedCheckoutAvailable(): Promise; + isApplePayAvailable(): Promise; + initiateGeolocationRequest(allow: boolean): void; + addListener(eventName: string): void; + removeListeners(count: number): void; + getConstants(): {version: string}; +} + +export default TurboModuleRegistry.getEnforcing( + 'ShopifyCheckoutSheetKit', +); diff --git a/modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts b/modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts new file mode 100644 index 00000000..f2b43574 --- /dev/null +++ b/modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts @@ -0,0 +1,69 @@ +import type {ViewProps} from 'react-native'; +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import type { + BubblingEventHandler, + DirectEventHandler, + Double, + Float, +} from 'react-native/Libraries/Types/CodegenTypes'; + +type FailEvent = Readonly<{ + __typename: string; + message: string; + code?: string; + recoverable?: boolean; +}>; + +type CompleteEvent = Readonly<{ + orderDetails: { + id: string; + cart: { + token: string; + lines: ReadonlyArray< + Readonly<{ + title: string; + quantity: Double; + merchandiseId?: string; + productId?: string; + }> + >; + }; + email?: string; + phone?: string; + }; +}>; + +type RenderStateChangeEvent = Readonly<{ + state: string; + reason?: string; +}>; + +type ClickLinkEvent = Readonly<{url: string}>; +type SizeChangeEvent = Readonly<{height: Double}>; + +type CheckoutIdentifierSpec = Readonly<{ + cartId?: string; + variantId?: string; + quantity?: Double; +}>; + +interface NativeProps extends ViewProps { + checkoutIdentifier: CheckoutIdentifierSpec; + cornerRadius?: Float; + wallets?: ReadonlyArray; + applePayLabel?: string; + onFail?: BubblingEventHandler; + onComplete?: BubblingEventHandler; + onCancel?: BubblingEventHandler; + onRenderStateChange?: BubblingEventHandler; + onWebPixelEvent?: BubblingEventHandler>; + onClickLink?: BubblingEventHandler; + onSizeChange?: DirectEventHandler; + onShouldRecoverFromError?: DirectEventHandler< + Readonly<{recoverable: boolean}> + >; +} + +export default codegenNativeComponent( + 'RCTAcceleratedCheckoutButtons', +); diff --git a/modules/@shopify/checkout-sheet-kit/tests/linking.test.ts b/modules/@shopify/checkout-sheet-kit/tests/linking.test.ts index b2587f05..f83795f8 100644 --- a/modules/@shopify/checkout-sheet-kit/tests/linking.test.ts +++ b/modules/@shopify/checkout-sheet-kit/tests/linking.test.ts @@ -1,31 +1,22 @@ -/** - * Test for native module linking error - */ - -// Mock NativeModules without ShopifyCheckoutSheetKit jest.mock('react-native', () => ({ - NativeModules: { - // Intentionally empty to trigger linking error - }, + NativeModules: {}, NativeEventEmitter: jest.fn(), Platform: { OS: 'ios', }, - requireNativeComponent: jest.fn().mockImplementation(() => { - const mockComponent = (props: any) => { - // Use React.createElement with plain object instead - const mockReact = jest.requireActual('react'); - return mockReact.createElement('View', props); - }; - return mockComponent; - }), + TurboModuleRegistry: { + getEnforcing: jest.fn((name: string) => { + throw new Error( + `TurboModuleRegistry.getEnforcing(...): '${name}' could not be found.`, + ); + }), + }, })); describe('Native Module Linking', () => { it('throws error when native module is not linked', () => { expect(() => { - // This will trigger the linking check require('../src/index'); - }).toThrow('@shopify/checkout-sheet-kit" is not correctly linked.'); + }).toThrow('ShopifyCheckoutSheetKit'); }); }); From 7fee740b1120e0ec319321633fba253505d6f716 Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Thu, 26 Mar 2026 10:50:46 +0000 Subject: [PATCH 03/10] Remove cart from orderDetails type and simplify sample RN scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reduce the surface area and simplify startup scripts to prepare for the React Native new-arch migration. - Narrow CompleteEvent.orderDetails to a readonly object containing only id, email and phone (remove nested cart/lines). This reduces the amount of complex data being passed through the bridge and simplifies the typings for the accelerated checkout UI component and its native/JS contract. Note: this is a breaking API/type change for any consumers that relied on the cart payload — update callers accordingly. - Simplify sample/package.json scripts by removing hard-coded simulator selection for ios/start. This makes the sample project scripts more portable across developer machines and CI and avoids simulator name mismatches during iteration. These changes are intended to lower duplication and complexity while we plan the phased migration to the new RN architecture (fewer/cleaner native<->JS contracts makes a cleaner transition). --- ...CTAcceleratedCheckoutButtonsNativeComponent.ts | 15 ++------------- sample/package.json | 4 ++-- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts b/modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts index f2b43574..1698e802 100644 --- a/modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts +++ b/modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts @@ -15,22 +15,11 @@ type FailEvent = Readonly<{ }>; type CompleteEvent = Readonly<{ - orderDetails: { + orderDetails: Readonly<{ id: string; - cart: { - token: string; - lines: ReadonlyArray< - Readonly<{ - title: string; - quantity: Double; - merchandiseId?: string; - productId?: string; - }> - >; - }; email?: string; phone?: string; - }; + }>; }>; type RenderStateChangeEvent = Readonly<{ diff --git a/sample/package.json b/sample/package.json index 3c70b08d..206396f1 100644 --- a/sample/package.json +++ b/sample/package.json @@ -10,8 +10,8 @@ "release:android": "sh ./scripts/release_android", "build:ios": "sh ./scripts/build_ios", "lint": "yarn typecheck && eslint .", - "ios": "react-native run-ios --simulator 'iPhone 15 Pro'", - "start": "react-native start -- --simulator 'iPhone 15 Pro' --reset-cache", + "ios": "react-native run-ios", + "start": "react-native start -- --reset-cache", "typecheck": "tsc --noEmit", "test:ios": "sh ./scripts/test_ios", "test:android": "sh ./scripts/test_android" From ee2d61c1b2205b8b6aab81716e5d3853f73acb67 Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Thu, 26 Mar 2026 12:04:28 +0000 Subject: [PATCH 04/10] Add native spec files to support React Native new-arch migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add TypeScript spec stubs and package snapshot entries to prepare for React Native’s new architecture. These changes introduce spec files for the native module/native component surface (with MIT license headers) and update the package snapshot so the generated commonjs/module/typescript artifacts and type declarations are tracked. This is a preparatory change to enable codegen/TurboModule and native component integration as part of the larger new-arch migration. No runtime behavior is changed here — this just lays the groundwork for the phased migration to the new RN architecture and packaging of the generated artifacts. --- .../checkout-sheet-kit/package.snapshot.json | 16 ++++++++++++- .../specs/NativeShopifyCheckoutSheetKit.ts | 23 +++++++++++++++++++ ...celeratedCheckoutButtonsNativeComponent.ts | 23 +++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) diff --git a/modules/@shopify/checkout-sheet-kit/package.snapshot.json b/modules/@shopify/checkout-sheet-kit/package.snapshot.json index 782ccbaa..8cddcc9f 100644 --- a/modules/@shopify/checkout-sheet-kit/package.snapshot.json +++ b/modules/@shopify/checkout-sheet-kit/package.snapshot.json @@ -30,6 +30,10 @@ "lib/commonjs/index.js.map", "lib/commonjs/pixels.d.js", "lib/commonjs/pixels.d.js.map", + "lib/commonjs/specs/NativeShopifyCheckoutSheetKit.js", + "lib/commonjs/specs/NativeShopifyCheckoutSheetKit.js.map", + "lib/commonjs/specs/RCTAcceleratedCheckoutButtonsNativeComponent.js", + "lib/commonjs/specs/RCTAcceleratedCheckoutButtonsNativeComponent.js.map", "lib/module/components/AcceleratedCheckoutButtons.js", "lib/module/components/AcceleratedCheckoutButtons.js.map", "lib/module/context.js", @@ -44,12 +48,20 @@ "lib/module/index.js.map", "lib/module/pixels.d.js", "lib/module/pixels.d.js.map", + "lib/module/specs/NativeShopifyCheckoutSheetKit.js", + "lib/module/specs/NativeShopifyCheckoutSheetKit.js.map", + "lib/module/specs/RCTAcceleratedCheckoutButtonsNativeComponent.js", + "lib/module/specs/RCTAcceleratedCheckoutButtonsNativeComponent.js.map", "lib/typescript/src/components/AcceleratedCheckoutButtons.d.ts", "lib/typescript/src/components/AcceleratedCheckoutButtons.d.ts.map", "lib/typescript/src/context.d.ts", "lib/typescript/src/context.d.ts.map", "lib/typescript/src/index.d.ts", "lib/typescript/src/index.d.ts.map", + "lib/typescript/src/specs/NativeShopifyCheckoutSheetKit.d.ts", + "lib/typescript/src/specs/NativeShopifyCheckoutSheetKit.d.ts.map", + "lib/typescript/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.d.ts", + "lib/typescript/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.d.ts.map", "package.json", "src/components/AcceleratedCheckoutButtons.tsx", "src/context.tsx", @@ -57,5 +69,7 @@ "src/events.d.ts", "src/index.d.ts", "src/index.ts", - "src/pixels.d.ts" + "src/pixels.d.ts", + "src/specs/NativeShopifyCheckoutSheetKit.ts", + "src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts" ] diff --git a/modules/@shopify/checkout-sheet-kit/src/specs/NativeShopifyCheckoutSheetKit.ts b/modules/@shopify/checkout-sheet-kit/src/specs/NativeShopifyCheckoutSheetKit.ts index 84928eaa..89855ea5 100644 --- a/modules/@shopify/checkout-sheet-kit/src/specs/NativeShopifyCheckoutSheetKit.ts +++ b/modules/@shopify/checkout-sheet-kit/src/specs/NativeShopifyCheckoutSheetKit.ts @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright 2023 - Present, Shopify Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + import type {TurboModule} from 'react-native'; import {TurboModuleRegistry} from 'react-native'; diff --git a/modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts b/modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts index 1698e802..b5d62ff8 100644 --- a/modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts +++ b/modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright 2023 - Present, Shopify Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + import type {ViewProps} from 'react-native'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; import type { From 2ee691f6a689810a17737478b7dc95da624eeb30 Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Thu, 26 Mar 2026 12:29:11 +0000 Subject: [PATCH 05/10] Make npm upgrade non-fatal in CI setup for broken macOS runners The macOS runner's pre-installed npm has a corrupted promise-retry module, causing `npm install -g npm@11` to fail. Since all CI jobs use yarn (not npm), this step is non-critical. Emit a warning annotation and continue instead of failing the job. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/actions/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 7fb7163e..98e2d80d 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -12,7 +12,7 @@ runs: # TODO: Can be removed once node-version is 24 as this will be the minimum - name: Install npm 11 - run: npm install -g npm@11 + run: npm install -g npm@11 || echo "::warning::npm upgrade failed — not required for yarn-based CI" shell: bash - name: Cache turbo build setup From 2a71204338c0a58f1b0b75b228594d2dec96068e Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Thu, 26 Mar 2026 12:36:59 +0000 Subject: [PATCH 06/10] Add plugin repositories to Android settings.gradle for resilient dependency resolution The Gradle foojay-resolver-convention plugin needs gson from Maven Central, which intermittently returns 403. Adding explicit pluginManagement repositories (gradlePluginPortal, google, mavenCentral) provides fallback mirrors. Co-Authored-By: Claude Opus 4.6 (1M context) --- sample/android/settings.gradle | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sample/android/settings.gradle b/sample/android/settings.gradle index f49ac411..53360013 100644 --- a/sample/android/settings.gradle +++ b/sample/android/settings.gradle @@ -1,4 +1,11 @@ -pluginManagement { includeBuild("../../node_modules/@react-native/gradle-plugin") } +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } + includeBuild("../../node_modules/@react-native/gradle-plugin") +} plugins { id("com.facebook.react.settings") } extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } From 974f9915e3f7b03e34ccbfec1cf4d0804eb78b82 Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Thu, 26 Mar 2026 17:53:04 +0000 Subject: [PATCH 07/10] Update action.yml --- .github/actions/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 98e2d80d..4b0f3111 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -12,7 +12,7 @@ runs: # TODO: Can be removed once node-version is 24 as this will be the minimum - name: Install npm 11 - run: npm install -g npm@11 || echo "::warning::npm upgrade failed — not required for yarn-based CI" + run: npm install -g npm@11" shell: bash - name: Cache turbo build setup From 88357e2f6512956c05d7234758a49bc6c65aed95 Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Thu, 26 Mar 2026 17:53:46 +0000 Subject: [PATCH 08/10] Update action.yml --- .github/actions/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 4b0f3111..7fb7163e 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -12,7 +12,7 @@ runs: # TODO: Can be removed once node-version is 24 as this will be the minimum - name: Install npm 11 - run: npm install -g npm@11" + run: npm install -g npm@11 shell: bash - name: Cache turbo build setup From d3d4478d9b4659e68756e230b3f3126577f4c082 Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Thu, 26 Mar 2026 18:00:55 +0000 Subject: [PATCH 09/10] Make npm upgrade non-fatal in CI setup for broken macOS runners The macOS runner's pre-installed npm has a corrupted promise-retry module, causing `npm install -g npm@11` to fail. Since all CI jobs use yarn (not npm), this step is non-critical. Emit a warning annotation and continue instead of failing the job. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/actions/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 7fb7163e..98e2d80d 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -12,7 +12,7 @@ runs: # TODO: Can be removed once node-version is 24 as this will be the minimum - name: Install npm 11 - run: npm install -g npm@11 + run: npm install -g npm@11 || echo "::warning::npm upgrade failed — not required for yarn-based CI" shell: bash - name: Cache turbo build setup From cc709d6383854f35cb5616e457452de7999c280b Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Mon, 30 Mar 2026 13:56:32 +0100 Subject: [PATCH 10/10] revert npm upgrade --- .github/actions/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 98e2d80d..7fb7163e 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -12,7 +12,7 @@ runs: # TODO: Can be removed once node-version is 24 as this will be the minimum - name: Install npm 11 - run: npm install -g npm@11 || echo "::warning::npm upgrade failed — not required for yarn-based CI" + run: npm install -g npm@11 shell: bash - name: Cache turbo build setup