diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 43cf6efd..3a885b9e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -77,9 +77,9 @@ updates: - "version-update:semver-major" - "version-update:semver-minor" - # React Native — Checkout Sheet Kit module + # React Native — Checkout Kit module - package-ecosystem: npm - directory: "/platforms/react-native/modules/@shopify/checkout-sheet-kit" + directory: "/platforms/react-native/modules/@shopify/checkout-kit-react-native" schedule: interval: daily cooldown: diff --git a/.github/workflows/rn-test-ios.yml b/.github/workflows/rn-test-ios.yml index 4a5fae81..f5b45456 100644 --- a/.github/workflows/rn-test-ios.yml +++ b/.github/workflows/rn-test-ios.yml @@ -55,7 +55,7 @@ jobs: uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: platforms/react-native/sample/ios/Pods - key: ${{ runner.os }}-cocoapods-${{ hashFiles('platforms/react-native/sample/ios/Podfile.lock', 'platforms/react-native/sample/Gemfile.lock', 'platforms/react-native/sample/Gemfile', 'platforms/react-native/package.json', 'platforms/react-native/sample/package.json', 'platforms/react-native/modules/@shopify/checkout-sheet-kit/package.json', 'platforms/react-native/pnpm-lock.yaml') }} + key: ${{ runner.os }}-cocoapods-${{ hashFiles('platforms/react-native/sample/ios/Podfile.lock', 'platforms/react-native/sample/Gemfile.lock', 'platforms/react-native/sample/Gemfile', 'platforms/react-native/package.json', 'platforms/react-native/sample/package.json', 'platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json', 'platforms/react-native/pnpm-lock.yaml') }} - name: Install cocoapods working-directory: platforms/react-native/sample diff --git a/.github/workflows/rn-test.yml b/.github/workflows/rn-test.yml index c8115124..cf8282ab 100644 --- a/.github/workflows/rn-test.yml +++ b/.github/workflows/rn-test.yml @@ -27,7 +27,7 @@ jobs: working-directory: platforms/react-native - name: Run tests with coverage - run: pnpm test --coverage --testPathPatterns="modules/@shopify/checkout-sheet-kit/tests" --coverageReporters=json-summary + run: pnpm test --coverage --testPathPatterns="modules/@shopify/checkout-kit-react-native/tests" --coverageReporters=json-summary - name: Coverage comment if: github.event_name == 'pull_request' diff --git a/README.md b/README.md index 5b969f66..b9ad736d 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Checkout Kit is a monorepo containing all the platforms Checkout Kit supports to | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | --------------------------------------------------------------- | ------------------------------------------ | | [`ShopifyCheckoutKit` `ShopifyAcceleratedCheckouts`](platforms/swift/) | [![GitHub tag](https://img.shields.io/github/v/tag/Shopify/checkout-kit?label=SPM)](https://github.com/Shopify/checkout-kit/tags) [![CocoaPods](https://img.shields.io/cocoapods/v/ShopifyCheckoutKit.svg?label=CocoaPods)](https://cocoapods.org/pods/ShopifyCheckoutKit) | Swift Package Manager, CocoaPods | iOS checkout presentation and accelerated checkout libraries. | [Readme](platforms/swift/README.md) | | [`com.shopify:checkout-kit`](platforms/android/) | [![Maven Central](https://img.shields.io/maven-central/v/com.shopify/checkout-kit.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/com.shopify/checkout-kit) | Maven Central | Android checkout presentation and accelerated checkout support. | [Readme](platforms/android/README.md) | -| [`@shopify/checkout-kit`](platforms/react-native/) | [![npm latest](https://img.shields.io/npm/v/@shopify/checkout-kit/latest.svg?label=npm)](https://www.npmjs.com/package/@shopify/checkout-kit) | npm | React Native wrapper for Checkout Kit. | [Readme](platforms/react-native/README.md) | +| [`@shopify/checkout-kit-react-native`](platforms/react-native/) | [![npm latest](https://img.shields.io/npm/v/@shopify/checkout-kit-react-native/latest.svg?label=npm)](https://www.npmjs.com/package/@shopify/checkout-kit-react-native) | npm | React Native wrapper for Checkout Kit. | [Readme](platforms/react-native/README.md) | ## Versioning diff --git a/platforms/react-native/.gitignore b/platforms/react-native/.gitignore index 43318057..65c29da4 100644 --- a/platforms/react-native/.gitignore +++ b/platforms/react-native/.gitignore @@ -87,10 +87,10 @@ dist .turbo # Module -modules/@shopify/checkout-sheet-kit/android/gradle/wrapper/gradle-wrapper.jar -modules/@shopify/checkout-sheet-kit/android/gradle/wrapper/gradle-wrapper.properties -modules/@shopify/checkout-sheet-kit/android/gradlew -modules/@shopify/checkout-sheet-kit/android/gradlew.bat +modules/@shopify/checkout-kit-react-native/android/gradle/wrapper/gradle-wrapper.jar +modules/@shopify/checkout-kit-react-native/android/gradle/wrapper/gradle-wrapper.properties +modules/@shopify/checkout-kit-react-native/android/gradlew +modules/@shopify/checkout-kit-react-native/android/gradlew.bat # Sample bundle **/index.android.bundle diff --git a/platforms/react-native/CONTRIBUTING.md b/platforms/react-native/CONTRIBUTING.md index 6f328987..f1b16ed3 100644 --- a/platforms/react-native/CONTRIBUTING.md +++ b/platforms/react-native/CONTRIBUTING.md @@ -7,8 +7,8 @@ see [guidelines and instructions](.github/CONTRIBUTING.md). This repo is subdivided into 3 parts using pnpm workspaces: -- The base repo (workspace name = `checkout-sheet-kit-react-native`) -- The `@shopify/checkout-sheet-kit` Native Module (workspace name = `module`) +- The base repo (workspace name = `checkout-kit-react-native`) +- The `@shopify/checkout-kit-react-native` Native Module (workspace name = `module`) - The sample application (workspace name = `sample`) Each of the workspaces contains a separate `package.json` to manage tasks @@ -75,7 +75,7 @@ SCCACHE=false pnpm sample android ## Making changes to the Native Module If your intentions are to modify the TS code for the Native Module under -`modules/@shopify/checkout-sheet-kit`, note that you will not need to rebuild to +`modules/@shopify/checkout-kit-react-native`, note that you will not need to rebuild to observe your changes in the sample app. This is because the sample app is importing the TS files directly from the module directory (through symlinking). @@ -118,7 +118,7 @@ There are 3 types of tests in this repo: Typescript, Swift and Java - each for testing the Native Module. ```sh -# Run Jest tests for "modules/@shopify/checkout-sheet-kit/src/**/*.tsx" +# Run Jest tests for "modules/@shopify/checkout-kit-react-native/src/**/*.tsx" pnpm test # Run swift tests for the Native Module diff --git a/platforms/react-native/README.md b/platforms/react-native/README.md index afcd2440..467ddf60 100644 --- a/platforms/react-native/README.md +++ b/platforms/react-native/README.md @@ -1,7 +1,6 @@ # Shopify Checkout Kit - React Native -[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://github.com/Shopify/checkout-sheet-kit-react-native/blob/main/LICENSE) -[![GitHub Release](https://img.shields.io/github/release/shopify/checkout-sheet-kit-react-native.svg?style=flat)]() +[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://github.com/Shopify/checkout-kit/blob/main/LICENSE) gradients @@ -13,8 +12,6 @@ branding, and more. It also provides platform idiomatic defaults such as support for light and dark mode, and convenient developer APIs to embed, customize, and follow the lifecycle of the checkout experience. -Note: We're in the process of renaming "Checkout Sheet Kit" to "Checkout Kit." The dev docs and README already use the new name, while the package itself will be updated in an upcoming version. - Check out our blog to [learn how and why we built the Shopify Checkout Kit](https://www.shopify.com/partners/blog/mobile-checkout-sdks-for-ios-and-android). @@ -71,7 +68,7 @@ experiences. ## Version Compatibility -Starting with **v4.0.0**, `@shopify/checkout-sheet-kit` requires the React Native +Starting with **v4.0.0**, `@shopify/checkout-kit-react-native` requires the React Native **New Architecture** (TurboModules + Fabric). Apps on the old architecture must stay on the `v3.x` line until they migrate. @@ -95,13 +92,13 @@ application: Install the Shopify Checkout Kit package dependency: ```sh -pnpm add @shopify/checkout-sheet-kit +pnpm add @shopify/checkout-kit-react-native # or using yarn -yarn add @shopify/checkout-sheet-kit +yarn add @shopify/checkout-kit-react-native # or using npm -npm install @shopify/checkout-sheet-kit +npm install @shopify/checkout-kit-react-native ``` ### 2. Minimum Android requirements @@ -141,13 +138,13 @@ requirements have been checked, you can begin by importing the library in your application code: ```tsx -import {ShopifyCheckoutSheetProvider} from '@shopify/checkout-sheet-kit'; +import {ShopifyCheckoutProvider} from '@shopify/checkout-kit-react-native'; function AppWithContext() { return ( - + - + ); } ``` @@ -156,10 +153,10 @@ Doing so will now allow you to access the Native Module anywhere in your application using React hooks: ```tsx -import {useShopifyCheckoutSheet} from '@shopify/checkout-sheet-kit'; +import {useShopifyCheckout} from '@shopify/checkout-kit-react-native'; function App() { - const shopifyCheckout = useShopifyCheckoutSheet(); + const shopifyCheckout = useShopifyCheckout(); // Present the checkout shopifyCheckout.present(checkoutUrl); @@ -171,22 +168,22 @@ to obtain a checkout URL to pass to the kit. > [!NOTE] > The recommended usage of the library is through a -> `ShopifyCheckoutSheetProvider` Context provider, but see +> `ShopifyCheckoutProvider` Context provider, but see > [Programmatic usage](#programamatic-usage) below for details on how to use the > library without React context. ## Programmatic Usage -To use the library without React context, import the `ShopifyCheckoutSheet` +To use the library without React context, import the `ShopifyCheckout` class from the package and instantiate it. We recommend to instantiating the class at a relatively high level in your application, and exporting it for use throughout your app. ```tsx // shopify.ts -import {ShopifyCheckoutSheet} from '@shopify/checkout-sheet-kit'; +import {ShopifyCheckout} from '@shopify/checkout-kit-react-native'; -export const shopifyCheckout = new ShopifyCheckoutSheet({ +export const shopifyCheckout = new ShopifyCheckout({ // optional configuration }); ``` @@ -281,7 +278,7 @@ browser. To present a native checkout sheet in your application, provide the ```tsx function App() { - const shopifyCheckout = useShopifyCheckoutSheet() + const shopifyCheckout = useShopifyCheckout() const checkoutUrl = useRef(null) const [createCart] = useMutation(createCartMutation) const [addToCart] = useMutation(addToCartMutation) @@ -330,7 +327,7 @@ function App() { The SDK provides a way to customize the presented checkout experience through a `configuration` object in the Context Provider or a `setConfig` method on an -instance of the `ShopifyCheckoutSheet` class. +instance of the `ShopifyCheckout` class. | Name | Required | Default | Description | | ------------- | -------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -346,8 +343,8 @@ import { ColorScheme, Configuration, LogLevel, - ShopifyCheckoutSheetProvider, -} from '@shopify/checkout-sheet-kit'; + ShopifyCheckoutProvider, +} from '@shopify/checkout-kit-react-native'; const config: Configuration = { colorScheme: ColorScheme.web, @@ -370,14 +367,14 @@ const config: Configuration = { // If using React Context function AppWithContext() { return ( - + - + ); } -// If using ShopifyCheckoutSheet directly -const shopifyCheckout = new ShopifyCheckoutSheet(config); +// If using ShopifyCheckout directly +const shopifyCheckout = new ShopifyCheckout(config); ``` ### Colors @@ -424,8 +421,8 @@ slightly different, as you can specify different overrides for `light` and import { ColorScheme, Configuration, - ShopifyCheckoutSheetProvider, -} from '@shopify/checkout-sheet-kit'; + ShopifyCheckoutProvider, +} from '@shopify/checkout-kit-react-native'; const config: Configuration = { colorScheme: ColorScheme.automatic, @@ -452,9 +449,9 @@ const config: Configuration = { function AppWithContext() { return ( - + - + ); } ``` @@ -552,11 +549,11 @@ Once enabled, preloading a checkout is as simple as calling ```tsx // using hooks -const shopifyCheckout = useShopifyCheckoutSheet(); +const shopifyCheckout = useShopifyCheckout(); ShopifyCheckout.preload(checkoutUrl); // using a class instance -const shopifyCheckout = new ShopifyCheckoutSheet(); +const shopifyCheckout = new ShopifyCheckout(); shopifyCheckout.preload(checkoutUrl); ``` @@ -590,7 +587,7 @@ Instead, a better approach is to call `preload()` when you have a strong enough ### Cache invalidation -Should you wish to manually clear the preload cache, there is a `ShopifyCheckoutSheetKit.invalidate()` helper function to do so. +Should you wish to manually clear the preload cache, there is a `ShopifyCheckoutKit.invalidate()` helper function to do so. ## Checkout lifecycle @@ -613,7 +610,7 @@ an event listener in a React `useEffect`, ensuring to remove it on unmount. ```tsx // Using hooks -const shopifyCheckout = useShopifyCheckoutSheet(); +const shopifyCheckout = useShopifyCheckout(); useEffect(() => { const close = shopifyCheckout.addEventListener('close', () => { @@ -751,7 +748,7 @@ is completed. ### Universal Links - iOS See the -[Universal Links guide](https://github.com/Shopify/checkout-sheet-kit-react-native/blob/main/documentation/universal_links_ios.md) +[Universal Links guide](https://github.com/Shopify/checkout-kit/blob/main/documentation/universal_links_ios.md) for information on how to get started with adding support for Offsite Payments in your app. @@ -812,20 +809,20 @@ The geolocation request flow follows this sequence: > This section is only applicable for Android. In order to opt-out of the default permission handling, you can set `features.handleGeolocationRequests` to `false` -when you instantiate the `ShopifyCheckoutSheet` class. +when you instantiate the `ShopifyCheckout` class. If you're using the sheet programmatically, you can do so by specifying a `features` object as the second argument: ```tsx -const checkoutSheetKit = new ShopifyCheckoutSheet(config, {handleGeolocationRequests: false}); +const shopifyCheckout = new ShopifyCheckout(config, {handleGeolocationRequests: false}); ``` -If you're using the context provider, you can pass the same `features` object as a prop to the `ShopifyCheckoutSheetProvider` component: +If you're using the context provider, you can pass the same `features` object as a prop to the `ShopifyCheckoutProvider` component: ```tsx - + {children} - + ``` When opting out, you'll need to implement your own permission handling logic and communicate the result back to the checkout sheet. This can be useful if you want to: @@ -872,10 +869,10 @@ Accelerated checkout buttons surface Apple Pay and Shop Pay options earlier in t ### Configure the integration -Pass an `acceleratedCheckouts` configuration when setting up the provider or `ShopifyCheckoutSheet` instance. This connects the accelerated checkout buttons to your storefront. +Pass an `acceleratedCheckouts` configuration when setting up the provider or `ShopifyCheckout` instance. This connects the accelerated checkout buttons to your storefront. ```tsx -import {ShopifyCheckoutSheetProvider} from '@shopify/checkout-sheet-kit'; +import {ShopifyCheckoutProvider} from '@shopify/checkout-kit-react-native'; const config = { acceleratedCheckouts: { @@ -901,9 +898,9 @@ const config = { function App() { return ( - + - + ); } ``` @@ -919,7 +916,7 @@ Use `AcceleratedCheckoutButtons` to attach accelerated checkout calls-to-action import { AcceleratedCheckoutButtons, AcceleratedCheckoutWallet, -} from '@shopify/checkout-sheet-kit'; +} from '@shopify/checkout-kit-react-native'; function CartFooter({cartId}: {cartId: string}) { return ( @@ -964,7 +961,7 @@ Accelerated checkout buttons display every available wallet by default. Use `wal Use `applePayLabel` to map to the native `PayWithApplePayButtonLabel` values. The default is `plain`. ```tsx -import {ApplePayLabel} from '@shopify/checkout-sheet-kit'; +import {ApplePayLabel} from '@shopify/checkout-kit-react-native'; ({version: '0.7.0'})), preload: jest.fn(), @@ -77,15 +77,15 @@ module.exports = { codegenNativeComponent, TurboModuleRegistry: { getEnforcing: jest.fn((name: string) => { - if (name === 'ShopifyCheckoutSheetKit') { - return ShopifyCheckoutSheetKit; + if (name === 'ShopifyCheckoutKit') { + return ShopifyCheckoutKit; } return null; }), }, NativeModules: { - ShopifyCheckoutSheetKit: { - ...ShopifyCheckoutSheetKit, + ShopifyCheckoutKit: { + ...ShopifyCheckoutKit, eventEmitter: createMockEmitter(), }, }, diff --git a/platforms/react-native/dev.yml b/platforms/react-native/dev.yml index 1abbf7d5..b87a78b4 100644 --- a/platforms/react-native/dev.yml +++ b/platforms/react-native/dev.yml @@ -1,4 +1,4 @@ -name: checkout-sheet-kit-react-native +name: checkout-kit-react-native dev.edition: 2024 @@ -44,7 +44,7 @@ up: pnpm run pod-install - custom: name: Build node module - met?: (cd modules/@shopify/checkout-sheet-kit && ls -l | grep lib) + met?: (cd modules/@shopify/checkout-kit-react-native && ls -l | grep lib) meet: | pnpm module build diff --git a/platforms/react-native/docs/contributing/release.md b/platforms/react-native/docs/contributing/release.md index 3e478044..56d3dcaa 100644 --- a/platforms/react-native/docs/contributing/release.md +++ b/platforms/react-native/docs/contributing/release.md @@ -1,12 +1,12 @@ # Release -The `@shopify/checkout-sheet-kit` module is published to the NPM package +The `@shopify/checkout-kit-react-native` module is published to the NPM package registry with public access. In order to publish a new version of the package, you must complete the following steps: -1. Bump the version in `modules/@shopify/checkout-sheet-kit/package.json` to an +1. Bump the version in `modules/@shopify/checkout-kit-react-native/package.json` to an appropriate value. 2. Add a [Changelog](./CHANGELOG.md) entry. 3. Merge your PR to `main`. @@ -18,4 +18,4 @@ folder, build a new version, run `npm pack --dry-run` to verify the contents and publish to the NPM registry. You can follow the release action process via -https://github.com/Shopify/checkout-sheet-kit-react-native/actions/workflows/publish.yml. +https://github.com/Shopify/checkout-kit/actions/workflows/publish.yml. diff --git a/platforms/react-native/documentation/universal_links_ios.md b/platforms/react-native/documentation/universal_links_ios.md index 12262e4c..24c4f3d6 100644 --- a/platforms/react-native/documentation/universal_links_ios.md +++ b/platforms/react-native/documentation/universal_links_ios.md @@ -143,7 +143,7 @@ by "NOT" rules. ## Handling Universal Links in your app -See https://github.com/Shopify/checkout-sheet-kit-react-native/blob/main/sample/src/App.tsx for sample code to implement Universal Links in your app. +See https://github.com/Shopify/checkout-kit/blob/main/sample/src/App.tsx for sample code to implement Universal Links in your app. ## Security Considerations diff --git a/platforms/react-native/jest.config.js b/platforms/react-native/jest.config.js index 6763de59..9d239e6c 100644 --- a/platforms/react-native/jest.config.js +++ b/platforms/react-native/jest.config.js @@ -1,6 +1,6 @@ module.exports = { preset: 'react-native', - modulePathIgnorePatterns: ['modules/@shopify/checkout-sheet-kit/lib'], + modulePathIgnorePatterns: ['modules/@shopify/checkout-kit-react-native/lib'], modulePaths: ['/sample/node_modules'], setupFiles: ['/jest.setup.ts'], transform: { diff --git a/platforms/react-native/metro.config.js b/platforms/react-native/metro.config.js index e7eb3f45..9f26a893 100644 --- a/platforms/react-native/metro.config.js +++ b/platforms/react-native/metro.config.js @@ -18,14 +18,14 @@ const config = mergeConfig(getDefaultConfig(__dirname), { resolver: { resolveRequest: (context, moduleName, platform) => { if ( - moduleName === '@shopify/checkout-sheet-kit' || - moduleName.startsWith('@shopify/checkout-sheet-kit/') + moduleName === '@shopify/checkout-kit-react-native' || + moduleName.startsWith('@shopify/checkout-kit-react-native/') ) { - const sub = moduleName.replace('@shopify/checkout-sheet-kit', ''); + const sub = moduleName.replace('@shopify/checkout-kit-react-native', ''); const target = path.resolve( root, 'modules', - '@shopify/checkout-sheet-kit', + '@shopify/checkout-kit-react-native', 'src', sub ? sub.replace(/^\//, '') : 'index.ts', ); @@ -41,10 +41,10 @@ const config = mergeConfig(getDefaultConfig(__dirname), { 'node_modules', 'react-native-gesture-handler', ), - '@shopify/checkout-sheet-kit': path.resolve( + '@shopify/checkout-kit-react-native': path.resolve( root, 'modules', - '@shopify/checkout-sheet-kit', + '@shopify/checkout-kit-react-native', ), }, }, diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/LICENSE b/platforms/react-native/modules/@shopify/checkout-kit-react-native/LICENSE similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/LICENSE rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/LICENSE diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/RNShopifyCheckoutSheetKit.podspec b/platforms/react-native/modules/@shopify/checkout-kit-react-native/RNShopifyCheckoutKit.podspec similarity index 86% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/RNShopifyCheckoutSheetKit.podspec rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/RNShopifyCheckoutKit.podspec index 59fa16c5..c63ea545 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/RNShopifyCheckoutSheetKit.podspec +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/RNShopifyCheckoutKit.podspec @@ -3,7 +3,7 @@ require "json" package = JSON.parse(File.read(File.join(__dir__, "package.json"))) Pod::Spec.new do |s| - s.name = "RNShopifyCheckoutSheetKit" + s.name = "RNShopifyCheckoutKit" s.version = package["version"] s.summary = package["description"] s.homepage = package["homepage"] @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.authors = package["author"] s.platforms = { :ios => "13.0" } - s.source = { :git => "https://github.com/Shopify/checkout-sheet-kit-react-native.git", :tag => "#{s.version}" } + s.source = { :git => "https://github.com/Shopify/checkout-kit.git", :tag => "#{s.version}" } s.source_files = "ios/*.{h,m,mm,swift}" diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/android/build.gradle b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/build.gradle similarity index 97% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/android/build.gradle rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/android/build.gradle index dd55f324..8eae6fd6 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/android/build.gradle +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/build.gradle @@ -35,7 +35,7 @@ ndkVersion = "23.1.7779620" android { if (supportsNamespace()) { - namespace "com.shopify.reactnative.checkoutsheetkit" + namespace "com.shopify.reactnative.checkoutkit" sourceSets { main { diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/android/gradle.properties b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/gradle.properties similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/android/gradle.properties rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/android/gradle.properties diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/android/proguard-rules.pro b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/proguard-rules.pro similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/android/proguard-rules.pro rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/android/proguard-rules.pro diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/AndroidManifest.xml b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/AndroidManifest.xml similarity index 56% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/AndroidManifest.xml rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/AndroidManifest.xml index a5caf509..2d47c849 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/AndroidManifest.xml +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/AndroidManifest.xml @@ -1,3 +1,3 @@ + package="com.shopify.reactnative.checkoutkit"> diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/AndroidManifestNew.xml b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/AndroidManifestNew.xml similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/AndroidManifestNew.xml rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/AndroidManifestNew.xml diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/CustomCheckoutEventProcessor.java b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/java/com/shopify/reactnative/checkoutkit/CustomCheckoutEventProcessor.java similarity index 99% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/CustomCheckoutEventProcessor.java rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/java/com/shopify/reactnative/checkoutkit/CustomCheckoutEventProcessor.java index f1a194a2..218b5cf1 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/CustomCheckoutEventProcessor.java +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/java/com/shopify/reactnative/checkoutkit/CustomCheckoutEventProcessor.java @@ -21,7 +21,7 @@ of this software and associated documentation files (the "Software"), to deal OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.shopify.reactnative.checkoutsheetkit; +package com.shopify.reactnative.checkoutkit; import android.content.Context; import android.util.Log; diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitModule.java b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitModule.java similarity index 97% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitModule.java rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitModule.java index 03427892..4061d0a3 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitModule.java +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitModule.java @@ -21,7 +21,7 @@ of this software and associated documentation files (the "Software"), to deal OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.shopify.reactnative.checkoutsheetkit; +package com.shopify.reactnative.checkoutkit; import android.app.Activity; import android.content.Context; @@ -34,14 +34,14 @@ of this software and associated documentation files (the "Software"), to deal import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.WritableMap; -import com.shopify.checkoutsheetkit.NativeShopifyCheckoutSheetKitSpec; +import com.shopify.checkoutkit.NativeShopifyCheckoutKitSpec; import com.shopify.checkoutsheetkit.*; import java.util.HashMap; import java.util.Map; import java.util.Objects; -public class ShopifyCheckoutSheetKitModule extends NativeShopifyCheckoutSheetKitSpec { +public class ShopifyCheckoutKitModule extends NativeShopifyCheckoutKitSpec { public static Configuration checkoutConfig = new Configuration(); @@ -51,7 +51,7 @@ public class ShopifyCheckoutSheetKitModule extends NativeShopifyCheckoutSheetKit private CustomCheckoutEventProcessor checkoutEventProcessor; - public ShopifyCheckoutSheetKitModule(ReactApplicationContext reactContext) { + public ShopifyCheckoutKitModule(ReactApplicationContext reactContext) { super(reactContext); this.reactContext = reactContext; diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitPackage.java b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitPackage.java similarity index 85% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitPackage.java rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitPackage.java index f6cda161..14693a71 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitPackage.java +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitPackage.java @@ -21,7 +21,7 @@ of this software and associated documentation files (the "Software"), to deal OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.shopify.reactnative.checkoutsheetkit; +package com.shopify.reactnative.checkoutkit; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -38,7 +38,7 @@ of this software and associated documentation files (the "Software"), to deal import java.util.List; import java.util.Map; -public class ShopifyCheckoutSheetKitPackage extends TurboReactPackage { +public class ShopifyCheckoutKitPackage extends TurboReactPackage { @NonNull @Override @@ -49,8 +49,8 @@ public List createViewManagers(@NonNull ReactApplicationContext rea @Nullable @Override public NativeModule getModule(@NonNull String name, @NonNull ReactApplicationContext reactContext) { - if (name.equals(ShopifyCheckoutSheetKitModule.NAME)) { - return new ShopifyCheckoutSheetKitModule(reactContext); + if (name.equals(ShopifyCheckoutKitModule.NAME)) { + return new ShopifyCheckoutKitModule(reactContext); } return null; } @@ -60,10 +60,10 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() { return () -> { final Map moduleInfos = new HashMap<>(); moduleInfos.put( - ShopifyCheckoutSheetKitModule.NAME, + ShopifyCheckoutKitModule.NAME, new ReactModuleInfo( - ShopifyCheckoutSheetKitModule.NAME, - ShopifyCheckoutSheetKitModule.NAME, + ShopifyCheckoutKitModule.NAME, + ShopifyCheckoutKitModule.NAME, false, // canOverrideExistingModule false, // needsEagerInit false, // isCxxModule diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/.clang-format b/platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/.clang-format similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/.clang-format rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/.clang-format diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/AcceleratedCheckoutButtons+Extensions.swift b/platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/AcceleratedCheckoutButtons+Extensions.swift similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/AcceleratedCheckoutButtons+Extensions.swift rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/AcceleratedCheckoutButtons+Extensions.swift diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/AcceleratedCheckoutButtons.swift b/platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/AcceleratedCheckoutButtons.swift similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/AcceleratedCheckoutButtons.swift rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/AcceleratedCheckoutButtons.swift diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/ShopifyCheckoutSheetKit+EventSerialization.swift b/platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/ShopifyCheckoutKit+EventSerialization.swift similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/ShopifyCheckoutSheetKit+EventSerialization.swift rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/ShopifyCheckoutKit+EventSerialization.swift diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/ShopifyCheckoutSheetKit+Extensions.swift b/platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/ShopifyCheckoutKit+Extensions.swift similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/ShopifyCheckoutSheetKit+Extensions.swift rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/ShopifyCheckoutKit+Extensions.swift diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/ShopifyCheckoutSheetKit-Bridging-Header.h b/platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/ShopifyCheckoutKit-Bridging-Header.h similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/ShopifyCheckoutSheetKit-Bridging-Header.h rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/ShopifyCheckoutKit-Bridging-Header.h diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/ShopifyCheckoutSheetKit.mm b/platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/ShopifyCheckoutKit.mm similarity index 88% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/ShopifyCheckoutSheetKit.mm rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/ShopifyCheckoutKit.mm index d93be8df..060c88e6 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/ShopifyCheckoutSheetKit.mm +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/ShopifyCheckoutKit.mm @@ -24,19 +24,19 @@ of this software and associated documentation files (the "Software"), to deal #import #import -#import +#import -// Registers the Swift module class (ShopifyCheckoutSheetKit.swift) with the RN -// runtime under the name 'RCTShopifyCheckoutSheetKit', extending the codegen +// Registers the Swift module class (ShopifyCheckoutKit.swift) with the RN +// runtime under the name 'RCTShopifyCheckoutKit', extending the codegen // base class so TurboModule dispatch can find it. // // Method declarations (`RCT_EXTERN_METHOD`) are intentionally absent for most -// methods: the codegen-generated `NativeShopifyCheckoutSheetKitSpecJSI` invokes -// each method via its `@objc` selector directly (see ShopifyCheckoutSheetKit.swift). +// methods: the codegen-generated `NativeShopifyCheckoutKitSpecJSI` invokes +// each method via its `@objc` selector directly (see ShopifyCheckoutKit.swift). // `setConfig` is declared so ObjCTurboModule sees the Swift selector's // NSDictionary argument and does not apply codegen's C++ struct conversion before // invoking Swift. -@interface RCT_EXTERN_MODULE (RCTShopifyCheckoutSheetKit, NativeShopifyCheckoutSheetKitSpecBase) +@interface RCT_EXTERN_MODULE (RCTShopifyCheckoutKit, NativeShopifyCheckoutKitSpecBase) RCT_EXTERN_METHOD(setConfig:(NSDictionary *)configuration) @@ -48,16 +48,16 @@ @interface RCT_EXTERN_MODULE (RCTShopifyCheckoutSheetKit, NativeShopifyCheckoutS // our Swift class would not appear in the providers map and JS calls would // fall back to the legacy bridge — which has no methods declared here and // no sync support. -@interface RCTShopifyCheckoutSheetKit (TurboModule) +@interface RCTShopifyCheckoutKit (TurboModule) - (std::shared_ptr)getTurboModule: (const facebook::react::ObjCTurboModule::InitParams &)params; @end -@implementation RCTShopifyCheckoutSheetKit (TurboModule) +@implementation RCTShopifyCheckoutKit (TurboModule) - (std::shared_ptr)getTurboModule: (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared( + return std::make_shared( params); } @end diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/ShopifyCheckoutSheetKit.swift b/platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/ShopifyCheckoutKit.swift similarity index 97% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/ShopifyCheckoutSheetKit.swift rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/ShopifyCheckoutKit.swift index e6b57522..c500f0e4 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/ios/ShopifyCheckoutSheetKit.swift +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/ShopifyCheckoutKit.swift @@ -28,8 +28,8 @@ import ShopifyCheckoutSheetKit import SwiftUI import UIKit -@objc(RCTShopifyCheckoutSheetKit) -class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate { +@objc(RCTShopifyCheckoutKit) +class RCTShopifyCheckoutKit: RCTEventEmitter, CheckoutDelegate { private var hasListeners = false internal var checkoutSheet: UIViewController? @@ -303,8 +303,8 @@ class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate { return try contactFields.compactMap { guard let field = ShopifyAcceleratedCheckouts.RequiredContactFields(rawValue: $0), field != nil else { let message = "Unknown contactField option: \(String(describing: $0))" - print("[ShopifyCheckoutSheetKit] \(message)") - throw NSError(domain: "ShopifyCheckoutSheetKit", code: 1, userInfo: ["message": message]) + print("[ShopifyCheckoutKit] \(message)") + throw NSError(domain: "ShopifyCheckoutKit", code: 1, userInfo: ["message": message]) } return field } diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/package.json b/platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json similarity index 80% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/package.json rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json index c1347ba8..a1c7ad4b 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/package.json +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json @@ -1,5 +1,5 @@ { - "name": "@shopify/checkout-sheet-kit", + "name": "@shopify/checkout-kit-react-native", "license": "MIT", "version": "4.0.0", "main": "lib/commonjs/index.js", @@ -8,10 +8,11 @@ "module": "lib/module/index.js", "description": "A React Native library for Shopify's Checkout Kit.", "author": "Shopify", - "homepage": "https://github.com/shopify/checkout-sheet-kit-react-native", + "homepage": "https://github.com/Shopify/checkout-kit", "repository": { "type": "git", - "url": "https://github.com/Shopify/checkout-sheet-kit-react-native" + "url": "https://github.com/Shopify/checkout-kit.git", + "directory": "platforms/react-native/modules/@shopify/checkout-kit-react-native" }, "publishConfig": { "registry": "https://registry.npmjs.org/" @@ -55,15 +56,15 @@ "typescript": "^5.9.2" }, "codegenConfig": { - "name": "RNShopifyCheckoutSheetKitSpec", + "name": "RNShopifyCheckoutKitSpec", "type": "all", "jsSrcsDir": "src/specs", "android": { - "javaPackageName": "com.shopify.checkoutsheetkit" + "javaPackageName": "com.shopify.checkoutkit" }, "ios": { "modulesProvider": { - "ShopifyCheckoutSheetKit": "RCTShopifyCheckoutSheetKit" + "ShopifyCheckoutKit": "RCTShopifyCheckoutKit" }, "componentProvider": { "RCTAcceleratedCheckoutButtons": "RCTAcceleratedCheckoutButtonsManager" diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/package.snapshot.json b/platforms/react-native/modules/@shopify/checkout-kit-react-native/package.snapshot.json similarity index 69% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/package.snapshot.json rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/package.snapshot.json index 6e731350..e5fcd643 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/package.snapshot.json +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/package.snapshot.json @@ -4,16 +4,16 @@ "android/proguard-rules.pro", "android/src/main/AndroidManifest.xml", "android/src/main/AndroidManifestNew.xml", - "android/src/main/java/com/shopify/reactnative/checkoutsheetkit/CustomCheckoutEventProcessor.java", - "android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitModule.java", - "android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitPackage.java", + "android/src/main/java/com/shopify/reactnative/checkoutkit/CustomCheckoutEventProcessor.java", + "android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitModule.java", + "android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitPackage.java", "ios/AcceleratedCheckoutButtons.swift", "ios/AcceleratedCheckoutButtons+Extensions.swift", - "ios/ShopifyCheckoutSheetKit-Bridging-Header.h", - "ios/ShopifyCheckoutSheetKit.mm", - "ios/ShopifyCheckoutSheetKit.swift", - "ios/ShopifyCheckoutSheetKit+EventSerialization.swift", - "ios/ShopifyCheckoutSheetKit+Extensions.swift", + "ios/ShopifyCheckoutKit-Bridging-Header.h", + "ios/ShopifyCheckoutKit.mm", + "ios/ShopifyCheckoutKit.swift", + "ios/ShopifyCheckoutKit+EventSerialization.swift", + "ios/ShopifyCheckoutKit+Extensions.swift", "lib/commonjs/components/AcceleratedCheckoutButtons.js", "lib/commonjs/components/AcceleratedCheckoutButtons.js.map", "lib/commonjs/context.js", @@ -28,8 +28,8 @@ "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/NativeShopifyCheckoutKit.js", + "lib/commonjs/specs/NativeShopifyCheckoutKit.js.map", "lib/commonjs/specs/RCTAcceleratedCheckoutButtonsNativeComponent.js", "lib/commonjs/specs/RCTAcceleratedCheckoutButtonsNativeComponent.js.map", "lib/module/components/AcceleratedCheckoutButtons.js", @@ -46,8 +46,8 @@ "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/NativeShopifyCheckoutKit.js", + "lib/module/specs/NativeShopifyCheckoutKit.js.map", "lib/module/specs/RCTAcceleratedCheckoutButtonsNativeComponent.js", "lib/module/specs/RCTAcceleratedCheckoutButtonsNativeComponent.js.map", "lib/typescript/src/components/AcceleratedCheckoutButtons.d.ts", @@ -56,13 +56,13 @@ "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/NativeShopifyCheckoutKit.d.ts", + "lib/typescript/src/specs/NativeShopifyCheckoutKit.d.ts.map", "lib/typescript/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.d.ts", "lib/typescript/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.d.ts.map", "LICENSE", "package.json", - "RNShopifyCheckoutSheetKit.podspec", + "RNShopifyCheckoutKit.podspec", "src/components/AcceleratedCheckoutButtons.tsx", "src/context.tsx", "src/errors.d.ts", @@ -70,6 +70,6 @@ "src/index.d.ts", "src/index.ts", "src/pixels.d.ts", - "src/specs/NativeShopifyCheckoutSheetKit.ts", + "src/specs/NativeShopifyCheckoutKit.ts", "src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts" ] diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/src/components/AcceleratedCheckoutButtons.tsx b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/components/AcceleratedCheckoutButtons.tsx similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/src/components/AcceleratedCheckoutButtons.tsx rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/src/components/AcceleratedCheckoutButtons.tsx diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/src/context.tsx b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/context.tsx similarity index 84% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/src/context.tsx rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/src/context.tsx index c3a5db4d..a75c1874 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/src/context.tsx +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/context.tsx @@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SO import React, {useCallback, useMemo, useRef, useEffect, useState} from 'react'; import type {PropsWithChildren} from 'react'; import {type EmitterSubscription} from 'react-native'; -import {ShopifyCheckoutSheet} from './index'; +import {ShopifyCheckout} from './index'; import type {Features} from './index.d'; import type { AddEventListener, @@ -48,7 +48,7 @@ interface Context { version: Maybe; } -const ShopifyCheckoutSheetContext = React.createContext( +const ShopifyCheckoutContext = React.createContext( null as unknown as Context, ); @@ -57,17 +57,17 @@ interface Props { configuration?: Configuration; } -export function ShopifyCheckoutSheetProvider({ +export function ShopifyCheckoutProvider({ features, configuration, children, }: PropsWithChildren) { const [acceleratedCheckoutsAvailable, setAcceleratedCheckoutsAvailable] = useState(false); - const instance = useRef(null); + const instance = useRef(null); if (!instance.current) { - instance.current = new ShopifyCheckoutSheet(configuration, features); + instance.current = new ShopifyCheckout(configuration, features); } useEffect(() => { @@ -79,7 +79,7 @@ export function ShopifyCheckoutSheetProvider({ if (customer?.accessToken && (customer?.email || customer?.phoneNumber)) { // eslint-disable-next-line no-console console.warn( - '[ShopifyCheckoutSheetKit] Providing accessToken with contactFields (email / phoneNumber) is deprecated and will become an error in v4.' + + '[ShopifyCheckoutKit] Providing accessToken with contactFields (email / phoneNumber) is deprecated and will become an error in v4.' + 'When the user is authenticated with Customer Accounts, provide accessToken' + 'When the user is otherwise authenticated, provide email/phoneNumber.', ); @@ -156,20 +156,20 @@ export function ShopifyCheckoutSheetProvider({ ]); return ( - + {children} - + ); } -export function useShopifyCheckoutSheet() { - const context = React.useContext(ShopifyCheckoutSheetContext); +export function useShopifyCheckout() { + const context = React.useContext(ShopifyCheckoutContext); if (!context) { throw new Error( - 'useShopifyCheckoutSheet must be used from within a ShopifyCheckoutSheetContext', + 'useShopifyCheckout must be used from within a ShopifyCheckoutContext', ); } return context; } -export default ShopifyCheckoutSheetContext; +export default ShopifyCheckoutContext; diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/src/errors.d.ts b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/errors.d.ts similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/src/errors.d.ts rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/src/errors.d.ts diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/src/events.d.ts b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/events.d.ts similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/src/events.d.ts rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/src/events.d.ts diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/src/index.d.ts b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/index.d.ts similarity index 98% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/src/index.d.ts rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/src/index.d.ts index 5a5d73b7..132d741a 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/src/index.d.ts +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/index.d.ts @@ -29,7 +29,7 @@ import type {CheckoutException} from './errors'; export type Maybe = T | undefined; /** - * Configuration options for checkout sheet kit features + * Configuration options for Checkout Kit features */ export interface Features { /** @@ -48,7 +48,7 @@ export enum ColorScheme { } /** - * Log level for the checkout sheet kit. + * Log level for Checkout Kit. * Controls the verbosity of logs emitted by the native SDK. * @defaults to error */ @@ -132,7 +132,7 @@ interface CommonConfiguration { */ title?: string; /** - * Sets the log level for the checkout sheet kit. + * Sets the log level for Checkout Kit. * Controls the verbosity of logs emitted by the native SDK. * * @default LogLevel.error @@ -300,7 +300,7 @@ function removeEventListeners(event: CheckoutEvent): void; export type AddEventListener = typeof addEventListener; export type RemoveEventListeners = typeof removeEventListeners; -export interface ShopifyCheckoutSheetKit { +export interface ShopifyCheckoutKit { /** * The version number of the Shopify Checkout SDK. */ diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/src/index.ts b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/index.ts similarity index 92% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/src/index.ts rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/src/index.ts index 8becbe0c..4ecc9371 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/src/index.ts +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/index.ts @@ -27,8 +27,8 @@ import type { EventSubscription, PermissionStatus, } from 'react-native'; -import RNShopifyCheckoutSheetKit from './specs/NativeShopifyCheckoutSheetKit'; -import {ShopifyCheckoutSheetProvider, useShopifyCheckoutSheet} from './context'; +import RNShopifyCheckoutKit from './specs/NativeShopifyCheckoutKit'; +import {ShopifyCheckoutProvider, useShopifyCheckout} from './context'; import {ApplePayContactField, ColorScheme, LogLevel} from './index.d'; import type { AcceleratedCheckoutConfiguration, @@ -38,7 +38,7 @@ import type { Features, GeolocationRequestEvent, Maybe, - ShopifyCheckoutSheetKit, + ShopifyCheckoutKit, } from './index.d'; import {AcceleratedCheckoutWallet} from './index.d'; import type {CheckoutException, CheckoutNativeError} from './errors.d'; @@ -73,9 +73,9 @@ const colorSchemeValues: ReadonlySet = new Set( ); const logLevelValues: ReadonlySet = new Set(Object.values(LogLevel)); -class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { +class ShopifyCheckout implements ShopifyCheckoutKit { private static eventEmitter: NativeEventEmitter = new NativeEventEmitter( - RNShopifyCheckoutSheetKit, + RNShopifyCheckoutKit, ); private features: Features; @@ -86,7 +86,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { // TurboModule constants are immutable for the lifetime of the process — // capture once so `version` (and any future constants) can be read without // re-crossing the JSI boundary on every access. - private readonly constants = RNShopifyCheckoutSheetKit.getConstants(); + private readonly constants = RNShopifyCheckoutKit.getConstants(); public get acceleratedCheckoutsReady(): boolean { return this._acceleratedCheckoutsReady; @@ -97,7 +97,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { } /** - * Initializes a new ShopifyCheckoutSheet instance + * Initializes a new ShopifyCheckout instance * @param configuration Optional configuration settings for the checkout * @param features Optional feature flags to customize behavior, defaults to defaultFeatures */ @@ -123,14 +123,14 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { * Dismisses the currently displayed checkout sheet */ public dismiss(): void { - RNShopifyCheckoutSheetKit.dismiss(); + RNShopifyCheckoutKit.dismiss(); } /** * Invalidates the checkout that was cached using preload */ public invalidate(): void { - RNShopifyCheckoutSheetKit.invalidateCache(); + RNShopifyCheckoutKit.invalidateCache(); } /** @@ -138,7 +138,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { * @param checkoutUrl The URL of the checkout to preload */ public preload(checkoutUrl: string): void { - RNShopifyCheckoutSheetKit.preload(checkoutUrl); + RNShopifyCheckoutKit.preload(checkoutUrl); } /** @@ -146,7 +146,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { * @param checkoutUrl The URL of the checkout to display */ public present(checkoutUrl: string): void { - RNShopifyCheckoutSheetKit.present(checkoutUrl); + RNShopifyCheckoutKit.present(checkoutUrl); } /** @@ -154,7 +154,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { * @returns The current Configuration */ public getConfig(): Configuration { - return this.coerceConfigurationResult(RNShopifyCheckoutSheetKit.getConfig()); + return this.coerceConfigurationResult(RNShopifyCheckoutKit.getConfig()); } /** @@ -167,7 +167,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { configuration.acceleratedCheckouts, ); } - RNShopifyCheckoutSheetKit.setConfig(configuration); + RNShopifyCheckoutKit.setConfig(configuration); } /** @@ -211,7 +211,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { } // Default handler for all non-pixel events - return ShopifyCheckoutSheet.eventEmitter.addListener(event, eventCallback); + return ShopifyCheckout.eventEmitter.addListener(event, eventCallback); } /** @@ -219,7 +219,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { * @param event The type of event to remove listeners for */ public removeEventListeners(event: CheckoutEvent) { - ShopifyCheckoutSheet.eventEmitter.removeAllListeners(event); + ShopifyCheckout.eventEmitter.removeAllListeners(event); } /** @@ -243,7 +243,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { try { this.validateAcceleratedCheckoutsConfiguration(config); - return RNShopifyCheckoutSheetKit.configureAcceleratedCheckouts( + return RNShopifyCheckoutKit.configureAcceleratedCheckouts( config.storefrontDomain, config.storefrontAccessToken, config.customer?.email || null, @@ -256,7 +256,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { } catch (error) { // eslint-disable-next-line no-console console.error( - '[ShopifyCheckoutSheetKit] Failed to configure accelerated checkouts with', + '[ShopifyCheckoutKit] Failed to configure accelerated checkouts with', error, ); return false; @@ -272,7 +272,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { return false; } - return RNShopifyCheckoutSheetKit.isAcceleratedCheckoutAvailable(); + return RNShopifyCheckoutKit.isAcceleratedCheckoutAvailable(); } /** @@ -281,7 +281,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { */ public async initiateGeolocationRequest(allow: boolean) { if (Platform.OS === 'android') { - RNShopifyCheckoutSheetKit.initiateGeolocationRequest?.(allow); + RNShopifyCheckoutKit.initiateGeolocationRequest?.(allow); } } @@ -411,7 +411,7 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit { * the payload (preloading, title, nested colors) passes through unchanged. */ private coerceConfigurationResult( - raw: ReturnType, + raw: ReturnType, ): Configuration { return { ...raw, @@ -556,9 +556,9 @@ export { ApplePayStyle, ColorScheme, LogLevel, - ShopifyCheckoutSheet, - ShopifyCheckoutSheetProvider, - useShopifyCheckoutSheet, + ShopifyCheckout, + ShopifyCheckoutProvider, + useShopifyCheckout, }; // Error classes diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/src/pixels.d.ts b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/pixels.d.ts similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/src/pixels.d.ts rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/src/pixels.d.ts diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/src/specs/NativeShopifyCheckoutSheetKit.ts b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/specs/NativeShopifyCheckoutKit.ts similarity index 99% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/src/specs/NativeShopifyCheckoutSheetKit.ts rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/src/specs/NativeShopifyCheckoutKit.ts index b2dd0fba..d217aa57 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/src/specs/NativeShopifyCheckoutSheetKit.ts +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/specs/NativeShopifyCheckoutKit.ts @@ -97,5 +97,5 @@ export interface Spec extends TurboModule { } export default TurboModuleRegistry.getEnforcing( - 'ShopifyCheckoutSheetKit', + 'ShopifyCheckoutKit', ); diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/src/specs/RCTAcceleratedCheckoutButtonsNativeComponent.ts diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/tests/AcceleratedCheckoutButtons.test.tsx b/platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/AcceleratedCheckoutButtons.test.tsx similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/tests/AcceleratedCheckoutButtons.test.tsx rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/AcceleratedCheckoutButtons.test.tsx diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/tests/context.test.tsx b/platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/context.test.tsx similarity index 81% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/tests/context.test.tsx rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/context.test.tsx index 8f22f503..8de11f4f 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/tests/context.test.tsx +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/context.test.tsx @@ -2,8 +2,8 @@ import React from 'react'; import {render, act} from '@testing-library/react-native'; import {NativeModules, Platform} from 'react-native'; import { - ShopifyCheckoutSheetProvider, - useShopifyCheckoutSheet, + ShopifyCheckoutProvider, + useShopifyCheckout, } from '../src/context'; import {ApplePayContactField, ColorScheme, type Configuration} from '../src'; @@ -19,18 +19,18 @@ const HookTestComponent = ({ }: { onHookValue: (value: any) => void; }) => { - const hookValue = useShopifyCheckoutSheet(); + const hookValue = useShopifyCheckout(); onHookValue(hookValue); return null; }; const MockChild = () => null; -describe('ShopifyCheckoutSheetProvider', () => { +describe('ShopifyCheckoutProvider', () => { const TestComponent = ({children}: {children: React.ReactNode}) => ( - + {children} - + ); afterEach(() => { @@ -47,7 +47,7 @@ describe('ShopifyCheckoutSheetProvider', () => { expect(component).toBeTruthy(); }); - it('creates ShopifyCheckoutSheet instance with configuration', () => { + it('creates ShopifyCheckout instance with configuration', () => { render( @@ -55,29 +55,29 @@ describe('ShopifyCheckoutSheetProvider', () => { ); expect( - NativeModules.ShopifyCheckoutSheetKit.setConfig, + NativeModules.ShopifyCheckoutKit.setConfig, ).toHaveBeenCalledWith(config); }); it('skips configuration when no configuration is provided', () => { render( - + - , + , ); expect( - NativeModules.ShopifyCheckoutSheetKit.setConfig, + NativeModules.ShopifyCheckoutKit.setConfig, ).not.toHaveBeenCalled(); expect( - NativeModules.ShopifyCheckoutSheetKit.configureAcceleratedCheckouts, + NativeModules.ShopifyCheckoutKit.configureAcceleratedCheckouts, ).not.toHaveBeenCalled(); }); it('configures accelerated checkouts when provided', async () => { (Platform as any).Version = '17.0'; ( - NativeModules.ShopifyCheckoutSheetKit + NativeModules.ShopifyCheckoutKit .configureAcceleratedCheckouts as unknown as {mockReturnValue: any} ).mockReturnValue(true); @@ -101,9 +101,9 @@ describe('ShopifyCheckoutSheetProvider', () => { }; render( - + - , + , ); await act(async () => { @@ -111,7 +111,7 @@ describe('ShopifyCheckoutSheetProvider', () => { }); expect( - NativeModules.ShopifyCheckoutSheetKit.configureAcceleratedCheckouts, + NativeModules.ShopifyCheckoutKit.configureAcceleratedCheckouts, ).toHaveBeenCalledWith( 'test-shop.myshopify.com', 'shpat_test_token', @@ -138,16 +138,16 @@ describe('ShopifyCheckoutSheetProvider', () => { ); expect( - NativeModules.ShopifyCheckoutSheetKit.setConfig.mock.calls, + NativeModules.ShopifyCheckoutKit.setConfig.mock.calls, ).toHaveLength(2); }); }); -describe('useShopifyCheckoutSheet', () => { +describe('useShopifyCheckout', () => { const Wrapper = ({children}: {children: React.ReactNode}) => ( - + {children} - + ); afterEach(() => { @@ -205,7 +205,7 @@ describe('useShopifyCheckoutSheet', () => { hookValue.present(checkoutUrl); }); - expect(NativeModules.ShopifyCheckoutSheetKit.present).toHaveBeenCalledWith( + expect(NativeModules.ShopifyCheckoutKit.present).toHaveBeenCalledWith( checkoutUrl, ); }); @@ -227,7 +227,7 @@ describe('useShopifyCheckoutSheet', () => { }); expect( - NativeModules.ShopifyCheckoutSheetKit.present, + NativeModules.ShopifyCheckoutKit.present, ).not.toHaveBeenCalled(); }); @@ -247,7 +247,7 @@ describe('useShopifyCheckoutSheet', () => { hookValue.preload(checkoutUrl); }); - expect(NativeModules.ShopifyCheckoutSheetKit.preload).toHaveBeenCalledWith( + expect(NativeModules.ShopifyCheckoutKit.preload).toHaveBeenCalledWith( checkoutUrl, ); }); @@ -269,7 +269,7 @@ describe('useShopifyCheckoutSheet', () => { }); expect( - NativeModules.ShopifyCheckoutSheetKit.preload, + NativeModules.ShopifyCheckoutKit.preload, ).not.toHaveBeenCalled(); }); @@ -290,7 +290,7 @@ describe('useShopifyCheckoutSheet', () => { }); expect( - NativeModules.ShopifyCheckoutSheetKit.invalidateCache, + NativeModules.ShopifyCheckoutKit.invalidateCache, ).toHaveBeenCalled(); }); @@ -310,7 +310,7 @@ describe('useShopifyCheckoutSheet', () => { hookValue.dismiss(); }); - expect(NativeModules.ShopifyCheckoutSheetKit.dismiss).toHaveBeenCalled(); + expect(NativeModules.ShopifyCheckoutKit.dismiss).toHaveBeenCalled(); }); it('provides setConfig function', () => { @@ -332,7 +332,7 @@ describe('useShopifyCheckoutSheet', () => { }); expect( - NativeModules.ShopifyCheckoutSheetKit.setConfig, + NativeModules.ShopifyCheckoutKit.setConfig, ).toHaveBeenCalledWith(newConfig); }); @@ -355,7 +355,7 @@ describe('useShopifyCheckoutSheet', () => { logLevel: 'error', }); - expect(NativeModules.ShopifyCheckoutSheetKit.getConfig).toHaveBeenCalled(); + expect(NativeModules.ShopifyCheckoutKit.getConfig).toHaveBeenCalled(); }); it('provides version from the instance', () => { @@ -391,14 +391,14 @@ describe('useShopifyCheckoutSheet', () => { }); }); -describe('ShopifyCheckoutSheetContext without provider', () => { +describe('ShopifyCheckoutContext without provider', () => { it('throws error when hook is used without provider', () => { const errorSpy = jest.spyOn(console, 'error').mockImplementation(); expect(() => { render( {}} />); }).toThrow( - 'useShopifyCheckoutSheet must be used from within a ShopifyCheckoutSheetContext', + 'useShopifyCheckout must be used from within a ShopifyCheckoutContext', ); errorSpy.mockRestore(); diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/tests/index.test.ts b/platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/index.test.ts similarity index 90% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/tests/index.test.ts rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/index.test.ts index 8beeb28a..b04722e6 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/tests/index.test.ts +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/index.test.ts @@ -3,7 +3,7 @@ import { LifecycleEventParseError, - ShopifyCheckoutSheet, + ShopifyCheckout, CheckoutErrorCode, InternalError, ConfigurationError, @@ -23,7 +23,7 @@ import type {ApplePayContactField} from '../src/index.d'; import {TurboModuleRegistry, PermissionsAndroid, Platform} from 'react-native'; const NativeModule = TurboModuleRegistry.getEnforcing( - 'ShopifyCheckoutSheetKit', + 'ShopifyCheckoutKit', ) as any; const checkoutUrl = 'https://shopify.com/checkout'; @@ -63,9 +63,9 @@ describe('Exports', () => { }); }); -describe('ShopifyCheckoutSheetKit', () => { +describe('ShopifyCheckoutKit', () => { // @ts-expect-error "eventEmitter is private" - const eventEmitter = ShopifyCheckoutSheet.eventEmitter; + const eventEmitter = ShopifyCheckout.eventEmitter; afterEach(() => { NativeModule.setConfig.mockReset(); @@ -74,14 +74,14 @@ describe('ShopifyCheckoutSheetKit', () => { describe('instantiation', () => { it('calls `setConfig` with the specified config on instantiation', () => { - new ShopifyCheckoutSheet(config); + new ShopifyCheckout(config); expect( NativeModule.setConfig, ).toHaveBeenCalledWith(config); }); it('does not call `setConfig` if no config was specified on instantiation', () => { - new ShopifyCheckoutSheet(); + new ShopifyCheckout(); expect( NativeModule.setConfig, ).not.toHaveBeenCalled(); @@ -90,7 +90,7 @@ describe('ShopifyCheckoutSheetKit', () => { describe('setConfig', () => { it('calls the `setConfig` on the Native Module', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); instance.setConfig(config); expect( NativeModule.setConfig, @@ -101,7 +101,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('calls `setConfig` with logLevel configuration', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const configWithLogLevel: Configuration = { colorScheme: ColorScheme.automatic, logLevel: LogLevel.debug, @@ -115,7 +115,7 @@ describe('ShopifyCheckoutSheetKit', () => { describe('preload', () => { it('calls `preload` with a checkout URL', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); instance.preload(checkoutUrl); expect( NativeModule.preload, @@ -128,7 +128,7 @@ describe('ShopifyCheckoutSheetKit', () => { describe('invalidate', () => { it('calls `invalidateCache`', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); instance.invalidate(); expect( NativeModule.invalidateCache, @@ -138,7 +138,7 @@ describe('ShopifyCheckoutSheetKit', () => { describe('present', () => { it('calls `present` with a checkout URL', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); instance.present(checkoutUrl); expect( NativeModule.present, @@ -151,7 +151,7 @@ describe('ShopifyCheckoutSheetKit', () => { describe('dismiss', () => { it('calls `dismiss`', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); instance.dismiss(); expect( NativeModule.dismiss, @@ -161,7 +161,7 @@ describe('ShopifyCheckoutSheetKit', () => { describe('getConfig', () => { it('returns the parsed config from the Native Module', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); expect(instance.getConfig()).toStrictEqual({ preloading: true, colorScheme: ColorScheme.automatic, @@ -175,7 +175,7 @@ describe('ShopifyCheckoutSheetKit', () => { describe('addEventListener', () => { it('creates a new event listener for a specific event', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const eventName = 'close'; const callback = jest.fn(); instance.addEventListener(eventName, callback); @@ -187,7 +187,7 @@ describe('ShopifyCheckoutSheetKit', () => { describe('Pixel Events', () => { it('parses web pixel event JSON string data', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const eventName = 'pixel'; const callback = jest.fn(); instance.addEventListener(eventName, callback); @@ -210,7 +210,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('parses custom web pixel event data', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const eventName = 'pixel'; const callback = jest.fn(); instance.addEventListener(eventName, callback); @@ -238,7 +238,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('fails gracefully if custom event data cannot be parsed', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const eventName = 'pixel'; const callback = jest.fn(); instance.addEventListener(eventName, callback); @@ -267,7 +267,7 @@ describe('ShopifyCheckoutSheetKit', () => { it('prints an error if the web pixel event data cannot be parsed', () => { const mock = jest.spyOn(global.console, 'error'); - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const eventName = 'pixel'; const callback = jest.fn(); instance.addEventListener(eventName, callback); @@ -289,7 +289,7 @@ describe('ShopifyCheckoutSheetKit', () => { it('handles unexpected errors during event processing', () => { const mock = jest.spyOn(global.console, 'error'); - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const eventName = 'pixel'; const callback = jest.fn(() => { throw new Error('Callback error'); @@ -308,7 +308,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('handles falsy object event data', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const eventName = 'pixel'; const callback = jest.fn(); instance.addEventListener(eventName, callback); @@ -321,7 +321,7 @@ describe('ShopifyCheckoutSheetKit', () => { describe('Completed Event', () => { it('parses completed event string data as JSON', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const eventName = 'completed'; const callback = jest.fn(); instance.addEventListener(eventName, callback); @@ -341,7 +341,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('parses completed event JSON data', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const eventName = 'completed'; const callback = jest.fn(); instance.addEventListener(eventName, callback); @@ -359,7 +359,7 @@ describe('ShopifyCheckoutSheetKit', () => { it('prints an error if the completed event data cannot be parsed', () => { const mock = jest.spyOn(global.console, 'error'); - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const eventName = 'completed'; const callback = jest.fn(); instance.addEventListener(eventName, callback); @@ -432,7 +432,7 @@ describe('ShopifyCheckoutSheetKit', () => { error: any; constructor: new (...args: any[]) => any; }) => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const eventName = 'error'; const callback = jest.fn(); instance.addEventListener(eventName, callback); @@ -455,7 +455,7 @@ describe('ShopifyCheckoutSheetKit', () => { ); it('returns an unknown generic error if the error cannot be parsed', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const eventName = 'error'; const callback = jest.fn(); instance.addEventListener(eventName, callback); @@ -481,7 +481,7 @@ describe('ShopifyCheckoutSheetKit', () => { describe('removeEventListeners', () => { it('Removes all listeners for a specific event', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); instance.addEventListener('close', () => {}); instance.addEventListener('close', () => {}); instance.removeEventListeners('close'); @@ -513,7 +513,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('subscribes to geolocation requests on Android when feature is enabled', () => { - new ShopifyCheckoutSheet(defaultConfig); + new ShopifyCheckout(defaultConfig); expect(eventEmitter.addListener).toHaveBeenCalledWith( 'geolocationRequest', @@ -522,7 +522,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('does not subscribe to geolocation requests when feature is disabled', () => { - new ShopifyCheckoutSheet(defaultConfig, { + new ShopifyCheckout(defaultConfig, { handleGeolocationRequests: false, }); @@ -544,7 +544,7 @@ describe('ShopifyCheckoutSheetKit', () => { } ).mockResolvedValue(mockPermissions); - new ShopifyCheckoutSheet(); + new ShopifyCheckout(); await emitGeolocationRequest(); @@ -569,7 +569,7 @@ describe('ShopifyCheckoutSheetKit', () => { } ).mockResolvedValue(mockPermissions); - new ShopifyCheckoutSheet(); + new ShopifyCheckout(); await emitGeolocationRequest(); @@ -583,7 +583,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('cleans up geolocation callback on teardown', () => { - const sheet = new ShopifyCheckoutSheet(); + const sheet = new ShopifyCheckout(); const mockRemove = jest.fn(); // @ts-expect-error @@ -609,7 +609,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('does not subscribe to geolocation requests', () => { - new ShopifyCheckoutSheet(); + new ShopifyCheckout(); expect(eventEmitter.addListener).not.toHaveBeenCalledWith( 'geolocationRequest', @@ -618,7 +618,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('does not call the native function, even if an event is emitted', async () => { - new ShopifyCheckoutSheet(); + new ShopifyCheckout(); await emitGeolocationRequest(); @@ -628,7 +628,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('tears down gracefully', () => { - const sheet = new ShopifyCheckoutSheet(); + const sheet = new ShopifyCheckout(); expect(() => sheet.teardown()).not.toThrow(); }); @@ -638,7 +638,7 @@ describe('ShopifyCheckoutSheetKit', () => { describe('Feature Management', () => { it('returns true for undefined features (feature fallback)', () => { // Create instance without any features to test fallback - const instance = new ShopifyCheckoutSheet(undefined, {}); + const instance = new ShopifyCheckout(undefined, {}); // Access private method via type assertion to test featureEnabled const featureEnabled = (instance as any).featureEnabled( @@ -649,7 +649,7 @@ describe('ShopifyCheckoutSheetKit', () => { it('returns false when feature is explicitly disabled', () => { // Create instance with feature explicitly disabled - const instance = new ShopifyCheckoutSheet(undefined, { + const instance = new ShopifyCheckout(undefined, { handleGeolocationRequests: false, }); @@ -662,7 +662,7 @@ describe('ShopifyCheckoutSheetKit', () => { it('returns true when feature is explicitly enabled', () => { // Create instance with feature explicitly enabled - const instance = new ShopifyCheckoutSheet(undefined, { + const instance = new ShopifyCheckout(undefined, { handleGeolocationRequests: true, }); @@ -728,7 +728,7 @@ describe('ShopifyCheckoutSheetKit', () => { describe('configureAcceleratedCheckouts', () => { it('calls native configureAcceleratedCheckouts with correct parameters on iOS', async () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); NativeModule.configureAcceleratedCheckouts.mockReturnValue(true); const result = @@ -750,7 +750,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('calls native configureAcceleratedCheckouts with null customer data when not provided', async () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const minimalConfig = { storefrontDomain: 'test-shop.myshopify.com', storefrontAccessToken: 'shpat_test_token', @@ -775,7 +775,7 @@ describe('ShopifyCheckoutSheetKit', () => { it('returns false on Android', async () => { Platform.OS = 'android'; - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const result = instance.configureAcceleratedCheckouts(acceleratedConfig); @@ -787,7 +787,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('validates required storefrontDomain', async () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const invalidConfig = { ...acceleratedConfig, storefrontDomain: '', @@ -798,13 +798,13 @@ describe('ShopifyCheckoutSheetKit', () => { instance.configureAcceleratedCheckouts(invalidConfig), ).toBe(false); expect(console.error).toHaveBeenCalledWith( - '[ShopifyCheckoutSheetKit] Failed to configure accelerated checkouts with', + '[ShopifyCheckoutKit] Failed to configure accelerated checkouts with', expectedError, ); }); it('validates required storefrontAccessToken', async () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const invalidConfig = { ...acceleratedConfig, storefrontAccessToken: '', @@ -816,13 +816,13 @@ describe('ShopifyCheckoutSheetKit', () => { instance.configureAcceleratedCheckouts(invalidConfig), ).toBe(false); expect(console.error).toHaveBeenCalledWith( - '[ShopifyCheckoutSheetKit] Failed to configure accelerated checkouts with', + '[ShopifyCheckoutKit] Failed to configure accelerated checkouts with', expectedError, ); }); it('validates required merchantIdentifier when Apple Pay is configured', async () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const invalidConfig = { ...acceleratedConfig, wallets: { @@ -841,13 +841,13 @@ describe('ShopifyCheckoutSheetKit', () => { instance.configureAcceleratedCheckouts(invalidConfig), ).toBe(false); expect(console.error).toHaveBeenCalledWith( - '[ShopifyCheckoutSheetKit] Failed to configure accelerated checkouts with', + '[ShopifyCheckoutKit] Failed to configure accelerated checkouts with', expectedError, ); }); it('validates required contactFields when Apple Pay is configured', async () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const invalidConfig = { ...acceleratedConfig, wallets: { @@ -866,13 +866,13 @@ describe('ShopifyCheckoutSheetKit', () => { instance.configureAcceleratedCheckouts(invalidConfig as any), ).toBe(false); expect(console.error).toHaveBeenCalledWith( - '[ShopifyCheckoutSheetKit] Failed to configure accelerated checkouts with', + '[ShopifyCheckoutKit] Failed to configure accelerated checkouts with', expectedError, ); }); it('does not throw when Apple Pay wallet is not configured', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const configWithoutApplePay = { storefrontDomain: 'test-shop.myshopify.com', storefrontAccessToken: 'shpat_test_token', @@ -885,7 +885,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('throws when a non-string value is given for supportedShippingCountries', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const invalidConfig = { ...acceleratedConfig, wallets: { @@ -905,13 +905,13 @@ describe('ShopifyCheckoutSheetKit', () => { instance.configureAcceleratedCheckouts(invalidConfig as any), ).toBe(false); expect(console.error).toHaveBeenCalledWith( - '[ShopifyCheckoutSheetKit] Failed to configure accelerated checkouts with', + '[ShopifyCheckoutKit] Failed to configure accelerated checkouts with', expectedError, ); }); it('calls configureAcceleratedCheckouts with an empty array for supportShippingCountries when omitted', async () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); instance.configureAcceleratedCheckouts({ ...acceleratedConfig, @@ -938,7 +938,7 @@ describe('ShopifyCheckoutSheetKit', () => { }); it('calls configureAcceleratedCheckouts with supportShippingCountries when given', async () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); instance.configureAcceleratedCheckouts({ ...acceleratedConfig, @@ -968,7 +968,7 @@ describe('ShopifyCheckoutSheetKit', () => { describe('isAcceleratedCheckoutAvailable', () => { it('calls native isAcceleratedCheckoutAvailable on iOS', () => { - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); NativeModule.isAcceleratedCheckoutAvailable.mockReturnValue(true); const result = instance.isAcceleratedCheckoutAvailable(); @@ -981,7 +981,7 @@ describe('ShopifyCheckoutSheetKit', () => { it('returns false on Android', () => { Platform.OS = 'android'; - const instance = new ShopifyCheckoutSheet(); + const instance = new ShopifyCheckout(); const result = instance.isAcceleratedCheckoutAvailable(); diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/tests/linking.test.ts b/platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/linking.test.ts similarity index 91% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/tests/linking.test.ts rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/linking.test.ts index f83795f8..6610e6b5 100644 --- a/platforms/react-native/modules/@shopify/checkout-sheet-kit/tests/linking.test.ts +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/linking.test.ts @@ -17,6 +17,6 @@ describe('Native Module Linking', () => { it('throws error when native module is not linked', () => { expect(() => { require('../src/index'); - }).toThrow('ShopifyCheckoutSheetKit'); + }).toThrow('ShopifyCheckoutKit'); }); }); diff --git a/platforms/react-native/modules/@shopify/checkout-sheet-kit/tsconfig.build.json b/platforms/react-native/modules/@shopify/checkout-kit-react-native/tsconfig.build.json similarity index 100% rename from platforms/react-native/modules/@shopify/checkout-sheet-kit/tsconfig.build.json rename to platforms/react-native/modules/@shopify/checkout-kit-react-native/tsconfig.build.json diff --git a/platforms/react-native/package.json b/platforms/react-native/package.json index 1993ca2b..3a6e8c87 100644 --- a/platforms/react-native/package.json +++ b/platforms/react-native/package.json @@ -1,15 +1,15 @@ { - "name": "checkout-sheet-kit-react-native", + "name": "checkout-kit-react-native", "description": "A React Native library for Shopify's Checkout Kit.", "private": true, "version": "0.0.1", - "repository": "https://github.com/Shopify/checkout-sheet-kit-react-native", - "author": "Shopify (https://github.com/Shopify/checkout-sheet-kit-react-native)", + "repository": "https://github.com/Shopify/checkout-kit", + "author": "Shopify (https://github.com/Shopify/checkout-kit)", "license": "MIT", "bugs": { - "url": "https://github.com/Shopify/checkout-sheet-kit-react-native/issues" + "url": "https://github.com/Shopify/checkout-kit/issues" }, - "homepage": "https://github.com/Shopify/checkout-sheet-kit-react-native", + "homepage": "https://github.com/Shopify/checkout-kit", "packageManager": "pnpm@10.33.1+sha512.05ba3c1d5d1c18f68df06470d74055e62d41fc110a0c660db1b2dfb2785327f04cf0f68345d4609bc52089e7fa0343c31593b2f9594e2c5d5da426230acc9820", "pnpm": { "onlyBuiltDependencies": [ @@ -19,7 +19,7 @@ "scripts": { "clean": "rm -rf node_modules; watchman watch-del . || true", "sample": "pnpm --filter sample", - "module": "pnpm --filter @shopify/checkout-sheet-kit", + "module": "pnpm --filter @shopify/checkout-kit-react-native", "pod-install": "(cd sample/ios && bundle install && bundle exec pod repo update && bundle exec pod cache clean --all && bundle exec pod install --repo-update)", "snapshot": "./scripts/create_snapshot", "compare-snapshot": "./scripts/compare_snapshot", diff --git a/platforms/react-native/pnpm-lock.yaml b/platforms/react-native/pnpm-lock.yaml index d514be2f..c5f93463 100644 --- a/platforms/react-native/pnpm-lock.yaml +++ b/platforms/react-native/pnpm-lock.yaml @@ -96,7 +96,7 @@ importers: specifier: ^5.9.2 version: 5.9.2 - modules/@shopify/checkout-sheet-kit: + modules/@shopify/checkout-kit-react-native: dependencies: react: specifier: '*' @@ -135,9 +135,9 @@ importers: '@react-navigation/stack': specifier: ^7.4.8 version: 7.8.10(4bd8dd23d724a396af48ae32b42242ae) - '@shopify/checkout-sheet-kit': + '@shopify/checkout-kit-react-native': specifier: workspace:* - version: link:../modules/@shopify/checkout-sheet-kit + version: link:../modules/@shopify/checkout-kit-react-native '@types/react-native': specifier: '*' version: 0.73.0(@babel/core@7.28.3)(@react-native-community/cli@19.1.1(typescript@5.9.2))(@types/react@19.1.12)(react@19.1.0) @@ -4863,8 +4863,8 @@ snapshots: '@babel/helper-member-expression-to-functions@7.27.1': dependencies: - '@babel/traverse': 7.28.3 - '@babel/types': 7.28.2 + '@babel/traverse': 7.29.0 + '@babel/types': 7.29.0 transitivePeerDependencies: - supports-color @@ -4893,7 +4893,7 @@ snapshots: '@babel/helper-optimise-call-expression@7.27.1': dependencies: - '@babel/types': 7.28.2 + '@babel/types': 7.29.0 '@babel/helper-plugin-utils@7.27.1': {} @@ -5004,8 +5004,8 @@ snapshots: '@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-create-class-features-plugin': 7.28.3(@babel/core@7.28.3) - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-create-class-features-plugin': 7.28.6(@babel/core@7.28.3) + '@babel/helper-plugin-utils': 7.28.6 transitivePeerDependencies: - supports-color @@ -5036,22 +5036,22 @@ snapshots: '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.28.3)': dependencies: @@ -5081,12 +5081,12 @@ snapshots: '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/plugin-syntax-jsx@7.27.1(@babel/core@7.28.3)': dependencies: @@ -5096,7 +5096,7 @@ snapshots: '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.28.3)': dependencies: @@ -5106,17 +5106,17 @@ snapshots: '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.28.3)': dependencies: @@ -5126,12 +5126,12 @@ snapshots: '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/plugin-syntax-typescript@7.27.1(@babel/core@7.28.3)': dependencies: @@ -5458,7 +5458,7 @@ snapshots: dependencies: '@babel/core': 7.28.3 '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/plugin-transform-regenerator@7.28.3(@babel/core@7.28.3)': dependencies: @@ -5640,7 +5640,7 @@ snapshots: '@babel/preset-flow@7.27.1(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/helper-validator-option': 7.27.1 '@babel/plugin-transform-flow-strip-types': 7.27.1(@babel/core@7.28.3) @@ -5654,7 +5654,7 @@ snapshots: '@babel/preset-react@7.28.5(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/helper-validator-option': 7.27.1 '@babel/plugin-transform-react-display-name': 7.28.0(@babel/core@7.28.3) '@babel/plugin-transform-react-jsx': 7.27.1(@babel/core@7.28.3) @@ -5666,7 +5666,7 @@ snapshots: '@babel/preset-typescript@7.28.5(@babel/core@7.28.3)': dependencies: '@babel/core': 7.28.3 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@babel/helper-validator-option': 7.27.1 '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.28.3) '@babel/plugin-transform-modules-commonjs': 7.27.1(@babel/core@7.28.3) @@ -6539,8 +6539,8 @@ snapshots: '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.28.3 - '@babel/types': 7.28.2 + '@babel/parser': 7.29.2 + '@babel/types': 7.29.0 '@types/babel__generator': 7.6.7 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.20.4 @@ -6996,7 +6996,7 @@ snapshots: babel-plugin-istanbul@6.1.1: dependencies: - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 5.2.1 @@ -7006,7 +7006,7 @@ snapshots: babel-plugin-istanbul@7.0.0: dependencies: - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 6.0.3 @@ -8631,7 +8631,7 @@ snapshots: '@babel/generator': 7.28.3 '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.28.3) '@babel/plugin-syntax-typescript': 7.27.1(@babel/core@7.28.3) - '@babel/types': 7.28.2 + '@babel/types': 7.29.0 '@jest/expect-utils': 30.0.5 '@jest/get-type': 30.0.1 '@jest/snapshot-utils': 30.0.5 @@ -8955,9 +8955,9 @@ snapshots: metro-source-map@0.82.5: dependencies: - '@babel/traverse': 7.28.3 + '@babel/traverse': 7.29.0 '@babel/traverse--for-generate-function-map': '@babel/traverse@7.29.0' - '@babel/types': 7.28.2 + '@babel/types': 7.29.0 flow-enums-runtime: 0.0.6 invariant: 2.2.4 metro-symbolicate: 0.82.5 @@ -8984,7 +8984,7 @@ snapshots: '@babel/core': 7.28.3 '@babel/generator': 7.29.1 '@babel/template': 7.28.6 - '@babel/traverse': 7.28.3 + '@babel/traverse': 7.29.0 flow-enums-runtime: 0.0.6 nullthrows: 1.1.1 transitivePeerDependencies: diff --git a/platforms/react-native/sample/android/app/src/test/java/com/shopify/checkoutkitreactnative/ShopifyCheckoutSheetKitModuleTest.java b/platforms/react-native/sample/android/app/src/test/java/com/shopify/checkoutkitreactnative/ShopifyCheckoutKitModuleTest.java similarity index 81% rename from platforms/react-native/sample/android/app/src/test/java/com/shopify/checkoutkitreactnative/ShopifyCheckoutSheetKitModuleTest.java rename to platforms/react-native/sample/android/app/src/test/java/com/shopify/checkoutkitreactnative/ShopifyCheckoutKitModuleTest.java index f202f2a1..e1456698 100644 --- a/platforms/react-native/sample/android/app/src/test/java/com/shopify/checkoutkitreactnative/ShopifyCheckoutSheetKitModuleTest.java +++ b/platforms/react-native/sample/android/app/src/test/java/com/shopify/checkoutkitreactnative/ShopifyCheckoutKitModuleTest.java @@ -26,8 +26,8 @@ import com.shopify.checkoutsheetkit.lifecycleevents.OrderDetails; import com.shopify.checkoutsheetkit.lifecycleevents.CartInfo; import com.shopify.checkoutsheetkit.lifecycleevents.Price; -import com.shopify.reactnative.checkoutsheetkit.ShopifyCheckoutSheetKitModule; -import com.shopify.reactnative.checkoutsheetkit.CustomCheckoutEventProcessor; +import com.shopify.reactnative.checkoutkit.ShopifyCheckoutKitModule; +import com.shopify.reactnative.checkoutkit.CustomCheckoutEventProcessor; import org.junit.After; import org.junit.Before; @@ -49,7 +49,7 @@ import java.util.List; @RunWith(MockitoJUnitRunner.class) -public class ShopifyCheckoutSheetKitModuleTest { +public class ShopifyCheckoutKitModuleTest { @Mock private ReactApplicationContext mockReactContext; @Mock @@ -64,7 +64,7 @@ public class ShopifyCheckoutSheetKitModuleTest { @Captor private ArgumentCaptor stringCaptor; - private ShopifyCheckoutSheetKitModule shopifyCheckoutSheetKitModule; + private ShopifyCheckoutKitModule shopifyCheckoutKitModule; // Store initial configuration to restore after each test private Preloading initialPreloading; @@ -94,12 +94,12 @@ public void setup() { when(mockReactContext.getCurrentActivity()).thenReturn(mockComponentActivity); when(mockReactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)) .thenReturn(mockEventEmitter); - shopifyCheckoutSheetKitModule = new ShopifyCheckoutSheetKitModule(mockReactContext); + shopifyCheckoutKitModule = new ShopifyCheckoutKitModule(mockReactContext); // Capture initial configuration state to restore after each test - initialPreloading = ShopifyCheckoutSheetKitModule.checkoutConfig.getPreloading(); - initialColorScheme = ShopifyCheckoutSheetKitModule.checkoutConfig.getColorScheme(); - initialLogLevel = ShopifyCheckoutSheetKitModule.checkoutConfig.getLogLevel(); + initialPreloading = ShopifyCheckoutKitModule.checkoutConfig.getPreloading(); + initialColorScheme = ShopifyCheckoutKitModule.checkoutConfig.getColorScheme(); + initialLogLevel = ShopifyCheckoutKitModule.checkoutConfig.getLogLevel(); } @After @@ -114,7 +114,7 @@ public void tearDown() { configuration.setPreloading(initialPreloading); configuration.setColorScheme(initialColorScheme); configuration.setLogLevel(initialLogLevel); - ShopifyCheckoutSheetKitModule.checkoutConfig = configuration; + ShopifyCheckoutKitModule.checkoutConfig = configuration; }); } @@ -124,15 +124,15 @@ public void tearDown() { @Test public void testCanPresentCheckout() { - try (MockedStatic mockedShopifyCheckoutSheetKit = Mockito + try (MockedStatic mockedShopifyCheckoutKit = Mockito .mockStatic(ShopifyCheckoutSheetKit.class)) { String checkoutUrl = "https://shopify.com"; - shopifyCheckoutSheetKitModule.present(checkoutUrl); + shopifyCheckoutKitModule.present(checkoutUrl); verify(mockComponentActivity).runOnUiThread(runnableCaptor.capture()); runnableCaptor.getValue().run(); - mockedShopifyCheckoutSheetKit.verify(() -> { + mockedShopifyCheckoutKit.verify(() -> { ShopifyCheckoutSheetKit.present(eq(checkoutUrl), any(), any()); }); } @@ -140,12 +140,12 @@ public void testCanPresentCheckout() { @Test public void testCanPreloadCheckout() { - try (MockedStatic mockedShopifyCheckoutSheetKit = Mockito + try (MockedStatic mockedShopifyCheckoutKit = Mockito .mockStatic(ShopifyCheckoutSheetKit.class)) { String checkoutUrl = "https://shopify.com"; - shopifyCheckoutSheetKitModule.preload(checkoutUrl); + shopifyCheckoutKitModule.preload(checkoutUrl); - mockedShopifyCheckoutSheetKit.verify(() -> { + mockedShopifyCheckoutKit.verify(() -> { ShopifyCheckoutSheetKit.preload(eq(checkoutUrl), any()); }); } @@ -157,13 +157,13 @@ public void testCanPreloadCheckout() { @Test public void testModuleName() { - assertThat(shopifyCheckoutSheetKitModule.getName()) - .isEqualTo("ShopifyCheckoutSheetKit"); + assertThat(shopifyCheckoutKitModule.getName()) + .isEqualTo("ShopifyCheckoutKit"); } @Test public void testConstants() { - assertThat(shopifyCheckoutSheetKitModule.getConstants()) + assertThat(shopifyCheckoutKitModule.getConstants()) .isNotNull() .containsKey("version"); } @@ -175,10 +175,10 @@ public void testConstants() { @Test public void testHasCorrectDefaultConfiguration() { // Test that the module starts with sensible defaults - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getPreloading().getEnabled()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getPreloading().getEnabled()) .isTrue(); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getColorScheme().getId()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getColorScheme().getId()) .isEqualTo("automatic"); } @@ -187,9 +187,9 @@ public void testCanDisablePreloading() { JavaOnlyMap config = new JavaOnlyMap(); config.putBoolean("preloading", false); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getPreloading().getEnabled()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getPreloading().getEnabled()) .isFalse(); } @@ -198,9 +198,9 @@ public void testCanSetDarkColorScheme() { JavaOnlyMap config = new JavaOnlyMap(); config.putString("colorScheme", "dark"); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getColorScheme().getId()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getColorScheme().getId()) .isEqualTo("dark"); } @@ -209,9 +209,9 @@ public void testCanConfigureLightColorSchemeWithValidColors() { JavaOnlyMap androidColors = createValidLightColors(); JavaOnlyMap config = createConfigWithAndroidColors("light", androidColors); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getColorScheme().getId()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getColorScheme().getId()) .isEqualTo("light"); } @@ -220,9 +220,9 @@ public void testCanConfigureDarkColorSchemeWithValidColors() { JavaOnlyMap androidColors = createValidDarkColors(); JavaOnlyMap config = createConfigWithAndroidColors("dark", androidColors); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getColorScheme().getId()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getColorScheme().getId()) .isEqualTo("dark"); } @@ -242,9 +242,9 @@ public void testCanConfigureAutomaticColorSchemeWithLightAndDarkColors() { config.putString("colorScheme", "automatic"); config.putMap("colors", colorsConfig); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getColorScheme().getId()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getColorScheme().getId()) .isEqualTo("automatic"); } @@ -259,10 +259,10 @@ public void testInvalidColorConfigurationFallsBackToBasicScheme() { JavaOnlyMap config = createConfigWithAndroidColors("light", androidColors); // Should not throw exception - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); // Should fall back to basic light scheme without custom colors - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getColorScheme().getId()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getColorScheme().getId()) .isEqualTo("light"); } @@ -274,10 +274,10 @@ public void testPartialColorConfigurationIsRejected() { JavaOnlyMap config = createConfigWithAndroidColors("light", androidColors); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); // Should fall back to basic scheme since colors are incomplete - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getColorScheme().getId()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getColorScheme().getId()) .isEqualTo("light"); } @@ -288,9 +288,9 @@ public void testCanSetConfigWithCloseButtonColor() { JavaOnlyMap config = createConfigWithAndroidColors("light", androidColors); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getColorScheme().getId()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getColorScheme().getId()) .isEqualTo("light"); } @@ -300,9 +300,9 @@ public void testCanSetConfigWithMissingCloseButtonColor() { JavaOnlyMap androidColors = createValidLightColors(); JavaOnlyMap config = createConfigWithAndroidColors("light", androidColors); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getColorScheme().getId()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getColorScheme().getId()) .isEqualTo("light"); } @@ -314,10 +314,10 @@ public void testCanSetConfigWithInvalidCloseButtonColor() { // The method should not throw an exception when given invalid close button // color - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); // Verify the color scheme was set correctly despite invalid close button color - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getColorScheme().getId()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getColorScheme().getId()) .isEqualTo("light"); } @@ -330,9 +330,9 @@ public void testCanSetLogLevelDebug() { JavaOnlyMap config = new JavaOnlyMap(); config.putString("logLevel", "debug"); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getLogLevel()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getLogLevel()) .isEqualTo(LogLevel.DEBUG); } @@ -341,9 +341,9 @@ public void testCanSetLogLevelError() { JavaOnlyMap config = new JavaOnlyMap(); config.putString("logLevel", "error"); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getLogLevel()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getLogLevel()) .isEqualTo(LogLevel.ERROR); } @@ -352,10 +352,10 @@ public void testCanSetLogLevelNone() { JavaOnlyMap config = new JavaOnlyMap(); config.putString("logLevel", "none"); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); // "none" maps to ERROR on Android (closest equivalent) - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getLogLevel()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getLogLevel()) .isEqualTo(LogLevel.ERROR); } @@ -364,9 +364,9 @@ public void testInvalidLogLevelDefaultsToError() { JavaOnlyMap config = new JavaOnlyMap(); config.putString("logLevel", "invalid"); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getLogLevel()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getLogLevel()) .isEqualTo(LogLevel.ERROR); } @@ -375,9 +375,9 @@ public void testLogLevelHandlesUppercaseDebug() { JavaOnlyMap config = new JavaOnlyMap(); config.putString("logLevel", "DEBUG"); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getLogLevel()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getLogLevel()) .isEqualTo(LogLevel.DEBUG); } @@ -386,9 +386,9 @@ public void testLogLevelHandlesMixedCaseDebug() { JavaOnlyMap config = new JavaOnlyMap(); config.putString("logLevel", "Debug"); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getLogLevel()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getLogLevel()) .isEqualTo(LogLevel.DEBUG); } @@ -397,9 +397,9 @@ public void testLogLevelHandlesUppercaseError() { JavaOnlyMap config = new JavaOnlyMap(); config.putString("logLevel", "ERROR"); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getLogLevel()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getLogLevel()) .isEqualTo(LogLevel.ERROR); } @@ -408,9 +408,9 @@ public void testSetConfigWithoutLogLevelDefaultsToError() { JavaOnlyMap config = new JavaOnlyMap(); config.putBoolean("preloading", true); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getLogLevel()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getLogLevel()) .isEqualTo(LogLevel.ERROR); } @@ -419,9 +419,9 @@ public void testGetConfigReturnsDebugForDebugLogLevel() { JavaOnlyMap config = new JavaOnlyMap(); config.putString("logLevel", "debug"); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - WritableMap result = shopifyCheckoutSheetKitModule.getConfig(); + WritableMap result = shopifyCheckoutKitModule.getConfig(); assertThat(result).isNotNull(); assertThat(result.getString("logLevel")).isEqualTo("debug"); @@ -432,9 +432,9 @@ public void testGetConfigReturnsErrorForErrorLogLevel() { JavaOnlyMap config = new JavaOnlyMap(); config.putString("logLevel", "error"); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - WritableMap result = shopifyCheckoutSheetKitModule.getConfig(); + WritableMap result = shopifyCheckoutKitModule.getConfig(); assertThat(result).isNotNull(); assertThat(result.getString("logLevel")).isEqualTo("error"); @@ -445,9 +445,9 @@ public void testGetConfigReturnsErrorForNoneLogLevel() { JavaOnlyMap config = new JavaOnlyMap(); config.putString("logLevel", "none"); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - WritableMap result = shopifyCheckoutSheetKitModule.getConfig(); + WritableMap result = shopifyCheckoutKitModule.getConfig(); assertThat(result).isNotNull(); assertThat(result.getString("logLevel")).isEqualTo("error"); @@ -458,9 +458,9 @@ public void testGetConfigReturnsErrorForInvalidLogLevel() { JavaOnlyMap config = new JavaOnlyMap(); config.putString("logLevel", "invalid"); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); - WritableMap result = shopifyCheckoutSheetKitModule.getConfig(); + WritableMap result = shopifyCheckoutKitModule.getConfig(); assertThat(result).isNotNull(); assertThat(result.getString("logLevel")).isEqualTo("error"); @@ -468,7 +468,7 @@ public void testGetConfigReturnsErrorForInvalidLogLevel() { @Test public void testGetConfigReturnsDefaultLogLevel() { - WritableMap result = shopifyCheckoutSheetKitModule.getConfig(); + WritableMap result = shopifyCheckoutKitModule.getConfig(); assertThat(result).isNotNull(); assertThat(result.getString("logLevel")).isEqualTo("error"); @@ -612,12 +612,12 @@ public void testCompleteConfigurationAndEventFlow() { config.putBoolean("preloading", true); config.putString("colorScheme", "dark"); - shopifyCheckoutSheetKitModule.setConfig(config); + shopifyCheckoutKitModule.setConfig(config); // Verify configuration was applied - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getPreloading().getEnabled()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getPreloading().getEnabled()) .isTrue(); - assertThat(ShopifyCheckoutSheetKitModule.checkoutConfig.getColorScheme().getId()) + assertThat(ShopifyCheckoutKitModule.checkoutConfig.getColorScheme().getId()) .isEqualTo("dark"); // Test event processing with the configured module diff --git a/platforms/react-native/sample/ios/Podfile b/platforms/react-native/sample/ios/Podfile index fb5df779..dbb21cbe 100644 --- a/platforms/react-native/sample/ios/Podfile +++ b/platforms/react-native/sample/ios/Podfile @@ -21,7 +21,7 @@ end target 'ReactNative' do config = use_native_modules! - pod "RNShopifyCheckoutSheetKit", :path => "../../modules/@shopify/checkout-sheet-kit" + pod "RNShopifyCheckoutKit", :path => "../../modules/@shopify/checkout-kit-react-native" use_react_native!( :path => config[:reactNativePath], diff --git a/platforms/react-native/sample/ios/Podfile.lock b/platforms/react-native/sample/ios/Podfile.lock index 07faf199..0d0e4215 100644 --- a/platforms/react-native/sample/ios/Podfile.lock +++ b/platforms/react-native/sample/ios/Podfile.lock @@ -2578,7 +2578,7 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - RNShopifyCheckoutSheetKit (4.0.0): + - RNShopifyCheckoutKit (4.0.0): - boost - DoubleConversion - fast_float @@ -2730,7 +2730,7 @@ DEPENDENCIES: - RNGestureHandler (from `../../node_modules/react-native-gesture-handler`) - RNReanimated (from `../../node_modules/react-native-reanimated`) - RNScreens (from `../../node_modules/react-native-screens`) - - "RNShopifyCheckoutSheetKit (from `../../modules/@shopify/checkout-sheet-kit`)" + - "RNShopifyCheckoutKit (from `../../modules/@shopify/checkout-kit-react-native`)" - RNVectorIcons (from `../../node_modules/react-native-vector-icons`) - SocketRocket (~> 0.7.1) - Yoga (from `../../node_modules/react-native/ReactCommon/yoga`) @@ -2906,8 +2906,8 @@ EXTERNAL SOURCES: :path: "../../node_modules/react-native-reanimated" RNScreens: :path: "../../node_modules/react-native-screens" - RNShopifyCheckoutSheetKit: - :path: "../../modules/@shopify/checkout-sheet-kit" + RNShopifyCheckoutKit: + :path: "../../modules/@shopify/checkout-kit-react-native" RNVectorIcons: :path: "../../node_modules/react-native-vector-icons" Yoga: @@ -2996,12 +2996,12 @@ SPEC CHECKSUMS: RNGestureHandler: eeb622199ef1fb3a076243131095df1c797072f0 RNReanimated: 237d420b7bb4378ef1dacc7d7a5c674fddb4b5d2 RNScreens: 3fc29af06302e1f1c18a7829fe57cbc2c0259912 - RNShopifyCheckoutSheetKit: 2a8c97d7780466538843d4cb1368c7ed76a33689 + RNShopifyCheckoutKit: 68b0b757093fdc6fc26282d4482cf7806c126359 RNVectorIcons: be4d047a76ad307ffe54732208fb0498fcb8477f ShopifyCheckoutSheetKit: 5253ca4da4c4f31069286509693930d02b4150d8 SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Yoga: a742cc68e8366fcfc681808162492bc0aa7a9498 -PODFILE CHECKSUM: 3606e2ca8922c8312d4d68801864023c36cbc5d4 +PODFILE CHECKSUM: 28ea9102024c9bb598fab013ab9b79a2b233064d COCOAPODS: 1.15.2 diff --git a/platforms/react-native/sample/ios/ReactNative.xcodeproj/project.pbxproj b/platforms/react-native/sample/ios/ReactNative.xcodeproj/project.pbxproj index e7e5f976..bbe3425d 100644 --- a/platforms/react-native/sample/ios/ReactNative.xcodeproj/project.pbxproj +++ b/platforms/react-native/sample/ios/ReactNative.xcodeproj/project.pbxproj @@ -10,7 +10,7 @@ 0A018AC7205EBA49E1E67311 /* libPods-ReactNative.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E0AC43398437CA0E3D05DDF /* libPods-ReactNative.a */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 37C6EE1EB87AA54212E67EDE /* libPods-ReactNativeTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 591887D86C91BE07EFFC9303 /* libPods-ReactNativeTests.a */; }; - 6A1F48E72B16900600BA591C /* ShopifyCheckoutSheetKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A1F48E62B16900600BA591C /* ShopifyCheckoutSheetKitTests.swift */; }; + 6A1F48E72B16900600BA591C /* ShopifyCheckoutKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A1F48E62B16900600BA591C /* ShopifyCheckoutKitTests.swift */; }; 6A58AAE82E607E0200A6AA85 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A58AAE72E607DFB00A6AA85 /* AppDelegate.swift */; }; 6A86196D2BF36EB900E5EE1A /* CheckoutDidFailTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A86196C2BF36EB900E5EE1A /* CheckoutDidFailTests.swift */; }; 6AEEAAB22C00010100E5EE1B /* AcceleratedCheckouts_SupportedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AEEAAB02C00010100E5EE1B /* AcceleratedCheckouts_SupportedTests.swift */; }; @@ -40,7 +40,7 @@ 39099806D4750FF73C4975E3 /* Pods-ReactNativeTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeTests.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeTests/Pods-ReactNativeTests.release.xcconfig"; sourceTree = ""; }; 4EF1B8B6CA16C991C5BEE2F2 /* Pods-ReactNative.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNative.release.xcconfig"; path = "Target Support Files/Pods-ReactNative/Pods-ReactNative.release.xcconfig"; sourceTree = ""; }; 591887D86C91BE07EFFC9303 /* libPods-ReactNativeTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ReactNativeTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 6A1F48E62B16900600BA591C /* ShopifyCheckoutSheetKitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopifyCheckoutSheetKitTests.swift; sourceTree = ""; }; + 6A1F48E62B16900600BA591C /* ShopifyCheckoutKitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopifyCheckoutKitTests.swift; sourceTree = ""; }; 6A58AAE72E607DFB00A6AA85 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 6A86196C2BF36EB900E5EE1A /* CheckoutDidFailTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckoutDidFailTests.swift; sourceTree = ""; }; 6A8D64CF2AF25C1200FE4E4A /* ReactNative.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = ReactNative.entitlements; path = ReactNative/ReactNative.entitlements; sourceTree = ""; }; @@ -84,7 +84,7 @@ isa = PBXGroup; children = ( 00E356F01AD99517003FC87E /* Supporting Files */, - 6A1F48E62B16900600BA591C /* ShopifyCheckoutSheetKitTests.swift */, + 6A1F48E62B16900600BA591C /* ShopifyCheckoutKitTests.swift */, 6A86196C2BF36EB900E5EE1A /* CheckoutDidFailTests.swift */, 6AEEAAB02C00010100E5EE1B /* AcceleratedCheckouts_SupportedTests.swift */, 6AEEAAB12C00010100E5EE1B /* AcceleratedCheckouts_UnsupportedTests.swift */, @@ -383,7 +383,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6A1F48E72B16900600BA591C /* ShopifyCheckoutSheetKitTests.swift in Sources */, + 6A1F48E72B16900600BA591C /* ShopifyCheckoutKitTests.swift in Sources */, 6A86196D2BF36EB900E5EE1A /* CheckoutDidFailTests.swift in Sources */, 6AEEAAB22C00010100E5EE1B /* AcceleratedCheckouts_SupportedTests.swift in Sources */, 6AEEAAB32C00010100E5EE1B /* AcceleratedCheckouts_UnsupportedTests.swift in Sources */, @@ -463,7 +463,7 @@ "\"${PODS_ROOT}/Headers/Public/hermes-engine\"", "\"${PODS_ROOT}/Headers/Public/libevent\"", "\"${PODS_ROOT}/Headers/Public/react-native-safe-area-context\"", - "\"${PODS_ROOT}/Headers/Public/RNShopifyCheckoutSheetKit\"", + "\"${PODS_ROOT}/Headers/Public/RNShopifyCheckoutKit\"", "\"$(PODS_ROOT)/DoubleConversion\"", "\"$(PODS_ROOT)/boost\"", "\"$(PODS_ROOT)/Headers/Private/React-Core\"", @@ -475,7 +475,7 @@ "\"$(PODS_ROOT)/Headers/Public/React-hermes\"", "\"$(PODS_ROOT)/Headers/Public/hermes-engine\"", "\"$(PODS_ROOT)/../../node_modules/react-native/ReactCommon\"", - "\"${PODS_ROOT}/Headers/Public/RNShopifyCheckoutSheetKit\"/**", + "\"${PODS_ROOT}/Headers/Public/RNShopifyCheckoutKit\"/**", ); INFOPLIST_FILE = ReactNativeTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.6; @@ -528,7 +528,7 @@ "\"${PODS_CONFIGURATION_BUILD_DIR}/glog\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/libevent\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-safe-area-context\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/RNShopifyCheckoutSheetKit\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/RNShopifyCheckoutKit\"", "\"${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}\"", /usr/lib/swift, ); @@ -539,7 +539,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.shopify.example.CheckoutKitReactNative; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_INCLUDE_PATHS = "$(inherited) \"${PODS_CONFIGURATION_BUILD_DIR}/ShopifyCheckoutSheetKit\" \"${PODS_CONFIGURATION_BUILD_DIR}/YogaKit\" \"${PODS_CONFIGURATION_BUILD_DIR}/RNShopifyCheckoutSheetKit\"/**"; + SWIFT_INCLUDE_PATHS = "$(inherited) \"${PODS_CONFIGURATION_BUILD_DIR}/ShopifyCheckoutSheetKit\" \"${PODS_CONFIGURATION_BUILD_DIR}/YogaKit\" \"${PODS_CONFIGURATION_BUILD_DIR}/RNShopifyCheckoutKit\"/**"; SWIFT_OBJC_BRIDGING_HEADER = "ReactNativeTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -597,7 +597,7 @@ "\"${PODS_ROOT}/Headers/Public/hermes-engine\"", "\"${PODS_ROOT}/Headers/Public/libevent\"", "\"${PODS_ROOT}/Headers/Public/react-native-safe-area-context\"", - "\"${PODS_ROOT}/Headers/Public/RNShopifyCheckoutSheetKit\"", + "\"${PODS_ROOT}/Headers/Public/RNShopifyCheckoutKit\"", "\"$(PODS_ROOT)/DoubleConversion\"", "\"$(PODS_ROOT)/boost\"", "\"$(PODS_ROOT)/Headers/Private/React-Core\"", @@ -609,7 +609,7 @@ "\"$(PODS_ROOT)/Headers/Public/React-hermes\"", "\"$(PODS_ROOT)/Headers/Public/hermes-engine\"", "\"$(PODS_ROOT)/../../node_modules/react-native/ReactCommon\"", - "\"${PODS_ROOT}/Headers/Public/RNShopifyCheckoutSheetKit\"/**", + "\"${PODS_ROOT}/Headers/Public/RNShopifyCheckoutKit\"/**", ); INFOPLIST_FILE = ReactNativeTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.6; @@ -625,7 +625,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.shopify.example.CheckoutKitReactNative; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_INCLUDE_PATHS = "$(inherited) \"${PODS_CONFIGURATION_BUILD_DIR}/ShopifyCheckoutSheetKit\" \"${PODS_CONFIGURATION_BUILD_DIR}/YogaKit\" \"${PODS_CONFIGURATION_BUILD_DIR}/RNShopifyCheckoutSheetKit\"/**"; + SWIFT_INCLUDE_PATHS = "$(inherited) \"${PODS_CONFIGURATION_BUILD_DIR}/ShopifyCheckoutSheetKit\" \"${PODS_CONFIGURATION_BUILD_DIR}/YogaKit\" \"${PODS_CONFIGURATION_BUILD_DIR}/RNShopifyCheckoutKit\"/**"; SWIFT_OBJC_BRIDGING_HEADER = "ReactNativeTests-Bridging-Header.h"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNative.app/ReactNative"; @@ -685,7 +685,7 @@ "\"${PODS_ROOT}/Headers/Public/hermes-engine\"", "\"${PODS_ROOT}/Headers/Public/libevent\"", "\"${PODS_ROOT}/Headers/Public/react-native-safe-area-context\"", - "\"${PODS_ROOT}/Headers/Public/RNShopifyCheckoutSheetKit\"/**", + "\"${PODS_ROOT}/Headers/Public/RNShopifyCheckoutKit\"/**", "\"$(PODS_ROOT)/DoubleConversion\"", "\"$(PODS_ROOT)/boost\"", "\"$(PODS_ROOT)/Headers/Private/React-Core\"", @@ -775,7 +775,7 @@ "\"${PODS_ROOT}/Headers/Public/hermes-engine\"", "\"${PODS_ROOT}/Headers/Public/libevent\"", "\"${PODS_ROOT}/Headers/Public/react-native-safe-area-context\"", - "\"${PODS_ROOT}/Headers/Public/RNShopifyCheckoutSheetKit\"/**", + "\"${PODS_ROOT}/Headers/Public/RNShopifyCheckoutKit\"/**", "\"$(PODS_ROOT)/DoubleConversion\"", "\"$(PODS_ROOT)/boost\"", "\"$(PODS_ROOT)/Headers/Private/React-Core\"", diff --git a/platforms/react-native/sample/ios/ReactNativeTests/AcceleratedCheckouts_SupportedTests.swift b/platforms/react-native/sample/ios/ReactNativeTests/AcceleratedCheckouts_SupportedTests.swift index d54a3b53..c623e8f6 100644 --- a/platforms/react-native/sample/ios/ReactNativeTests/AcceleratedCheckouts_SupportedTests.swift +++ b/platforms/react-native/sample/ios/ReactNativeTests/AcceleratedCheckouts_SupportedTests.swift @@ -24,7 +24,7 @@ import Foundation import PassKit import SwiftUI -@testable import RNShopifyCheckoutSheetKit +@testable import RNShopifyCheckoutKit @testable import ShopifyCheckoutSheetKit import XCTest @@ -36,18 +36,18 @@ struct WalletButtons { @available(iOS 16.0, *) class AcceleratedCheckouts_SupportedTests: XCTestCase { - private var shopifyCheckoutSheetKit: RCTShopifyCheckoutSheetKit! + private var shopifyCheckoutKit: RCTShopifyCheckoutKit! override func setUp() { super.setUp() - shopifyCheckoutSheetKit = RCTShopifyCheckoutSheetKit() + shopifyCheckoutKit = RCTShopifyCheckoutKit() resetSharedConfigurations() resetCheckoutKitDefaults() } override func tearDown() { resetSharedConfigurations() - shopifyCheckoutSheetKit = nil + shopifyCheckoutKit = nil super.tearDown() } @@ -72,7 +72,7 @@ class AcceleratedCheckouts_SupportedTests: XCTestCase { let contactFields: [String]? = includeApplePay ? ["email", "phone"] : nil let supportedShippingCountries: [String]? = includeApplePay ? ["IE", "CA"] : nil - return shopifyCheckoutSheetKit.configureAcceleratedCheckouts( + return shopifyCheckoutKit.configureAcceleratedCheckouts( storefrontDomain, storefrontAccessToken: accessToken, customerEmail: email, @@ -93,23 +93,23 @@ class AcceleratedCheckouts_SupportedTests: XCTestCase { } func testIsAcceleratedCheckoutAvailableBeforeAndAfterConfig() throws { - XCTAssertEqual(shopifyCheckoutSheetKit.isAcceleratedCheckoutAvailable().boolValue, false) + XCTAssertEqual(shopifyCheckoutKit.isAcceleratedCheckoutAvailable().boolValue, false) configureAcceleratedCheckouts(includeApplePay: false) - XCTAssertEqual(shopifyCheckoutSheetKit.isAcceleratedCheckoutAvailable().boolValue, true) + XCTAssertEqual(shopifyCheckoutKit.isAcceleratedCheckoutAvailable().boolValue, true) } func testIsApplePayAvailableRequiresApplePayConfig() throws { - XCTAssertEqual(shopifyCheckoutSheetKit.isApplePayAvailable().boolValue, false) + XCTAssertEqual(shopifyCheckoutKit.isApplePayAvailable().boolValue, false) configureAcceleratedCheckouts(includeApplePay: false) - XCTAssertEqual(shopifyCheckoutSheetKit.isApplePayAvailable().boolValue, false) + XCTAssertEqual(shopifyCheckoutKit.isApplePayAvailable().boolValue, false) configureAcceleratedCheckouts(includeApplePay: true) - XCTAssertEqual(shopifyCheckoutSheetKit.isApplePayAvailable().boolValue, true) + XCTAssertEqual(shopifyCheckoutKit.isApplePayAvailable().boolValue, true) } func testConfigureAcceleratedCheckoutsStoresCustomerAccessToken() throws { @@ -359,7 +359,7 @@ class AcceleratedCheckouts_SupportedTests: XCTestCase { let storefrontDomain = "example.myshopify.com" let accessToken = "shpat_test_token" - let resolved = shopifyCheckoutSheetKit.configureAcceleratedCheckouts( + let resolved = shopifyCheckoutKit.configureAcceleratedCheckouts( storefrontDomain, storefrontAccessToken: accessToken, customerEmail: nil, diff --git a/platforms/react-native/sample/ios/ReactNativeTests/AcceleratedCheckouts_UnsupportedTests.swift b/platforms/react-native/sample/ios/ReactNativeTests/AcceleratedCheckouts_UnsupportedTests.swift index 48db5837..f50483b8 100644 --- a/platforms/react-native/sample/ios/ReactNativeTests/AcceleratedCheckouts_UnsupportedTests.swift +++ b/platforms/react-native/sample/ios/ReactNativeTests/AcceleratedCheckouts_UnsupportedTests.swift @@ -22,16 +22,16 @@ */ import Foundation -@testable import RNShopifyCheckoutSheetKit +@testable import RNShopifyCheckoutKit import XCTest class AcceleratedCheckouts_UnsupportedTests: XCTestCase { - private var module: RCTShopifyCheckoutSheetKit! + private var module: RCTShopifyCheckoutKit! private var manager: RCTAcceleratedCheckoutButtonsManager! override func setUp() { super.setUp() - module = RCTShopifyCheckoutSheetKit() + module = RCTShopifyCheckoutKit() manager = RCTAcceleratedCheckoutButtonsManager() manager.supported = false } diff --git a/platforms/react-native/sample/ios/ReactNativeTests/CheckoutDidFailTests.swift b/platforms/react-native/sample/ios/ReactNativeTests/CheckoutDidFailTests.swift index a8243e2d..4fcf4cb0 100644 --- a/platforms/react-native/sample/ios/ReactNativeTests/CheckoutDidFailTests.swift +++ b/platforms/react-native/sample/ios/ReactNativeTests/CheckoutDidFailTests.swift @@ -22,31 +22,31 @@ */ import Foundation -@testable import RNShopifyCheckoutSheetKit +@testable import RNShopifyCheckoutKit @testable import ShopifyCheckoutSheetKit import XCTest class CheckoutDidFailTests: XCTestCase { - private var shopifyCheckoutSheetKit: RCTShopifyCheckoutSheetKit! + private var shopifyCheckoutKit: RCTShopifyCheckoutKit! override func setUp() { super.setUp() - shopifyCheckoutSheetKit = getShopifyCheckoutSheetKit() - resetShopifyCheckoutSheetKitDefaults() + shopifyCheckoutKit = getShopifyCheckoutKit() + resetShopifyCheckoutKitDefaults() } - private func resetShopifyCheckoutSheetKitDefaults() { + private func resetShopifyCheckoutKitDefaults() { ShopifyCheckoutSheetKit.configuration.preloading = Configuration.Preloading(enabled: true) ShopifyCheckoutSheetKit.configuration.colorScheme = .automatic } override func tearDown() { - shopifyCheckoutSheetKit = nil + shopifyCheckoutKit = nil super.tearDown() } - private func getShopifyCheckoutSheetKit() -> RCTShopifyCheckoutSheetKit { - return RCTShopifyCheckoutSheetKit() + private func getShopifyCheckoutKit() -> RCTShopifyCheckoutKit { + return RCTShopifyCheckoutKit() } func testCheckoutDidFailEmitsCheckoutExpiredError() { @@ -187,14 +187,14 @@ class CheckoutDidFailTests: XCTestCase { } } - private func mockSendEvent(eventName: String) -> RCTShopifyCheckoutSheetKitMock { - let mock = RCTShopifyCheckoutSheetKitMock() + private func mockSendEvent(eventName: String) -> RCTShopifyCheckoutKitMock { + let mock = RCTShopifyCheckoutKitMock() mock.eventName = eventName return mock } - private func mockAsyncSendEvent(eventName: String) -> AsyncRCTShopifyCheckoutSheetKitMock { - let mock = AsyncRCTShopifyCheckoutSheetKitMock() + private func mockAsyncSendEvent(eventName: String) -> AsyncRCTShopifyCheckoutKitMock { + let mock = AsyncRCTShopifyCheckoutKitMock() mock.eventName = eventName return mock } diff --git a/platforms/react-native/sample/ios/ReactNativeTests/EventSerializationTests.swift b/platforms/react-native/sample/ios/ReactNativeTests/EventSerializationTests.swift index bcecbfa9..0bd88db4 100644 --- a/platforms/react-native/sample/ios/ReactNativeTests/EventSerializationTests.swift +++ b/platforms/react-native/sample/ios/ReactNativeTests/EventSerializationTests.swift @@ -22,7 +22,7 @@ */ import Foundation -@testable import RNShopifyCheckoutSheetKit +@testable import RNShopifyCheckoutKit import ShopifyCheckoutSheetKit import XCTest diff --git a/platforms/react-native/sample/ios/ReactNativeTests/ShopifyCheckoutSheetKitTests.swift b/platforms/react-native/sample/ios/ReactNativeTests/ShopifyCheckoutKitTests.swift similarity index 85% rename from platforms/react-native/sample/ios/ReactNativeTests/ShopifyCheckoutSheetKitTests.swift rename to platforms/react-native/sample/ios/ReactNativeTests/ShopifyCheckoutKitTests.swift index 2f4708c1..6c49553e 100644 --- a/platforms/react-native/sample/ios/ReactNativeTests/ShopifyCheckoutSheetKitTests.swift +++ b/platforms/react-native/sample/ios/ReactNativeTests/ShopifyCheckoutKitTests.swift @@ -22,39 +22,39 @@ */ import Foundation -@testable import RNShopifyCheckoutSheetKit +@testable import RNShopifyCheckoutKit @testable import ShopifyCheckoutSheetKit import XCTest -class ShopifyCheckoutSheetKitTests: XCTestCase { - private var shopifyCheckoutSheetKit: RCTShopifyCheckoutSheetKit! +class ShopifyCheckoutKitTests: XCTestCase { + private var shopifyCheckoutKit: RCTShopifyCheckoutKit! override func setUp() { super.setUp() - shopifyCheckoutSheetKit = getShopifyCheckoutSheetKit() - resetShopifyCheckoutSheetKitDefaults() + shopifyCheckoutKit = getShopifyCheckoutKit() + resetShopifyCheckoutKitDefaults() } override func tearDown() { - shopifyCheckoutSheetKit = nil + shopifyCheckoutKit = nil super.tearDown() } - private func resetShopifyCheckoutSheetKitDefaults() { + private func resetShopifyCheckoutKitDefaults() { ShopifyCheckoutSheetKit.configuration.preloading = Configuration.Preloading(enabled: true) ShopifyCheckoutSheetKit.configuration.colorScheme = .automatic ShopifyCheckoutSheetKit.configuration.closeButtonTintColor = nil ShopifyCheckoutSheetKit.configuration.logLevel = LogLevel.error } - private func getShopifyCheckoutSheetKit() -> RCTShopifyCheckoutSheetKit { - return RCTShopifyCheckoutSheetKit() + private func getShopifyCheckoutKit() -> RCTShopifyCheckoutKit { + return RCTShopifyCheckoutKit() } /// getConfig func testReturnsDefaultConfig() { // Call getConfig and capture the result - let result = shopifyCheckoutSheetKit.getConfig() as? [String: Any] + let result = shopifyCheckoutKit.getConfig() as? [String: Any] // Verify that getConfig returned the expected result XCTAssertEqual(result?["preloading"] as? Bool, true) @@ -74,7 +74,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { ] ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) XCTAssertTrue(ShopifyCheckoutSheetKit.configuration.preloading.enabled) XCTAssertEqual(ShopifyCheckoutSheetKit.configuration.colorScheme, .dark) @@ -87,7 +87,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { "preloading": false ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) XCTAssertFalse(ShopifyCheckoutSheetKit.configuration.preloading.enabled) } @@ -102,7 +102,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { ] let defaultColorFallback = UIColor(red: 0, green: 0, blue: 0, alpha: 1) - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) XCTAssertEqual(ShopifyCheckoutSheetKit.configuration.tintColor, defaultColorFallback) } @@ -116,7 +116,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { ] ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) XCTAssertEqual(ShopifyCheckoutSheetKit.configuration.closeButtonTintColor, UIColor(hex: "#FF0000")) } @@ -131,7 +131,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { ] let defaultColorFallback = UIColor(red: 0, green: 0, blue: 0, alpha: 1) - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) XCTAssertEqual(ShopifyCheckoutSheetKit.configuration.closeButtonTintColor, defaultColorFallback) } @@ -145,7 +145,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { ] ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) // closeButtonTintColor should remain nil when not specified (uses system default) XCTAssertNil(ShopifyCheckoutSheetKit.configuration.closeButtonTintColor) @@ -160,11 +160,11 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { ] ] ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) // Call getConfig and capture the result var result: [String: Any]? - result = shopifyCheckoutSheetKit.getConfig() as? [String: Any] + result = shopifyCheckoutKit.getConfig() as? [String: Any] // Verify that getConfig returned the close button color XCTAssertNotNil(result?["closeButtonColor"]) @@ -177,7 +177,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { "logLevel": "debug" ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) XCTAssertEqual(ShopifyCheckoutSheetKit.configuration.logLevel, LogLevel.debug) } @@ -187,7 +187,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { "logLevel": "error" ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) XCTAssertEqual(ShopifyCheckoutSheetKit.configuration.logLevel, LogLevel.error) } @@ -197,7 +197,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { "logLevel": "none" ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) XCTAssertEqual(ShopifyCheckoutSheetKit.configuration.logLevel, LogLevel.none) } @@ -207,7 +207,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { "logLevel": "invalid" ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) XCTAssertEqual(ShopifyCheckoutSheetKit.configuration.logLevel, LogLevel.error) } @@ -217,7 +217,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { "logLevel": "DEBUG" ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) XCTAssertEqual(ShopifyCheckoutSheetKit.configuration.logLevel, LogLevel.debug) } @@ -227,7 +227,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { "logLevel": "Debug" ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) XCTAssertEqual(ShopifyCheckoutSheetKit.configuration.logLevel, LogLevel.debug) } @@ -237,7 +237,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { "logLevel": "ERROR" ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) XCTAssertEqual(ShopifyCheckoutSheetKit.configuration.logLevel, LogLevel.error) } @@ -247,7 +247,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { "preloading": true ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) XCTAssertEqual(ShopifyCheckoutSheetKit.configuration.logLevel, LogLevel.error) } @@ -256,17 +256,17 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { let configuration: [AnyHashable: Any] = [ "logLevel": "debug" ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) var result: [String: Any]? - result = shopifyCheckoutSheetKit.getConfig() as? [String: Any] + result = shopifyCheckoutKit.getConfig() as? [String: Any] XCTAssertEqual(result?["logLevel"] as? String, "debug") } func testGetConfigReturnsDefaultLogLevel() { var result: [String: Any]? - result = shopifyCheckoutSheetKit.getConfig() as? [String: Any] + result = shopifyCheckoutKit.getConfig() as? [String: Any] XCTAssertEqual(result?["logLevel"] as? String, "error") } @@ -275,10 +275,10 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { let configuration: [AnyHashable: Any] = [ "logLevel": "debug" ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) var result: [String: Any]? - result = shopifyCheckoutSheetKit.getConfig() as? [String: Any] + result = shopifyCheckoutKit.getConfig() as? [String: Any] XCTAssertEqual(result?["logLevel"] as? String, "debug") } @@ -287,10 +287,10 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { let configuration: [AnyHashable: Any] = [ "logLevel": "error" ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) var result: [String: Any]? - result = shopifyCheckoutSheetKit.getConfig() as? [String: Any] + result = shopifyCheckoutKit.getConfig() as? [String: Any] XCTAssertEqual(result?["logLevel"] as? String, "error") } @@ -299,10 +299,10 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { let configuration: [AnyHashable: Any] = [ "logLevel": "none" ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) var result: [String: Any]? - result = shopifyCheckoutSheetKit.getConfig() as? [String: Any] + result = shopifyCheckoutKit.getConfig() as? [String: Any] XCTAssertEqual(result?["logLevel"] as? String, "error") } @@ -311,10 +311,10 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { let configuration: [AnyHashable: Any] = [ "logLevel": "invalid" ] - shopifyCheckoutSheetKit.setConfig(configuration) + shopifyCheckoutKit.setConfig(configuration) var result: [String: Any]? - result = shopifyCheckoutSheetKit.getConfig() as? [String: Any] + result = shopifyCheckoutKit.getConfig() as? [String: Any] XCTAssertEqual(result?["logLevel"] as? String, "error") } @@ -382,7 +382,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { } } - mock.checkoutSheet = MockCheckoutSheet() + mock.checkoutSheet = MockCheckout() mock.startObserving() mock.checkoutDidCancel() @@ -392,7 +392,7 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { XCTAssertTrue(mock.didSendEvent) // swiftlint:disable:next force_cast - XCTAssertTrue((mock.checkoutSheet as! MockCheckoutSheet).dismissWasCalled) + XCTAssertTrue((mock.checkoutSheet as! MockCheckout).dismissWasCalled) } /// checkoutDidEmitWebPixelEvent @@ -477,20 +477,20 @@ class ShopifyCheckoutSheetKitTests: XCTestCase { } } - private func mockSendEvent(eventName: String) -> RCTShopifyCheckoutSheetKitMock { - let mock = RCTShopifyCheckoutSheetKitMock() + private func mockSendEvent(eventName: String) -> RCTShopifyCheckoutKitMock { + let mock = RCTShopifyCheckoutKitMock() mock.eventName = eventName return mock } - private func mockAsyncSendEvent(eventName: String) -> AsyncRCTShopifyCheckoutSheetKitMock { - let mock = AsyncRCTShopifyCheckoutSheetKitMock() + private func mockAsyncSendEvent(eventName: String) -> AsyncRCTShopifyCheckoutKitMock { + let mock = AsyncRCTShopifyCheckoutKitMock() mock.eventName = eventName return mock } } -class RCTShopifyCheckoutSheetKitMock: RCTShopifyCheckoutSheetKit { +class RCTShopifyCheckoutKitMock: RCTShopifyCheckoutKit { var didSendEvent = false var eventName: String? var eventBody: Any! @@ -503,7 +503,7 @@ class RCTShopifyCheckoutSheetKitMock: RCTShopifyCheckoutSheetKit { } } -class AsyncRCTShopifyCheckoutSheetKitMock: RCTShopifyCheckoutSheetKit { +class AsyncRCTShopifyCheckoutKitMock: RCTShopifyCheckoutKit { var didSendEvent = false var eventName: String? var sendEventImplementation: ((String?, Any?) -> Void)? @@ -513,7 +513,7 @@ class AsyncRCTShopifyCheckoutSheetKitMock: RCTShopifyCheckoutSheetKit { } } -class MockCheckoutSheet: UIViewController { +class MockCheckout: UIViewController { var dismissWasCalled = false override func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) { diff --git a/platforms/react-native/sample/package.json b/platforms/react-native/sample/package.json index 0a793a38..30283da1 100644 --- a/platforms/react-native/sample/package.json +++ b/platforms/react-native/sample/package.json @@ -22,7 +22,7 @@ "@react-navigation/native": "^7.1.17", "@react-navigation/native-stack": "^7.3.25", "@react-navigation/stack": "^7.4.8", - "@shopify/checkout-sheet-kit": "workspace:*", + "@shopify/checkout-kit-react-native": "workspace:*", "graphql": "^16.8.2", "jotai": "^2.13.1", "react-native-config": "1.5.6", diff --git a/platforms/react-native/sample/react-native.config.js b/platforms/react-native/sample/react-native.config.js index 93429c7b..dfc71555 100644 --- a/platforms/react-native/sample/react-native.config.js +++ b/platforms/react-native/sample/react-native.config.js @@ -53,8 +53,8 @@ module.exports = { 'react-native-webview': { root: resolvePackageRoot('react-native-webview'), }, - '@shopify/checkout-sheet-kit': { - root: path.resolve(root, 'modules', '@shopify/checkout-sheet-kit'), + '@shopify/checkout-kit-react-native': { + root: path.resolve(root, 'modules', '@shopify/checkout-kit-react-native'), }, }, }; diff --git a/platforms/react-native/sample/scripts/android_sccache b/platforms/react-native/sample/scripts/android_sccache index ba02b4a9..c97b65c5 100755 --- a/platforms/react-native/sample/scripts/android_sccache +++ b/platforms/react-native/sample/scripts/android_sccache @@ -10,7 +10,7 @@ if [ "${SCCACHE:-}" = "false" ]; then fi if command -v sccache >/dev/null 2>&1; then - ANDROID_SCCACHE_SHIM_DIR="${TMPDIR:-/tmp}/checkout-sheet-kit-react-native-sccache" + ANDROID_SCCACHE_SHIM_DIR="${TMPDIR:-/tmp}/checkout-kit-react-native-sccache" mkdir -p "$ANDROID_SCCACHE_SHIM_DIR" cat > "$ANDROID_SCCACHE_SHIM_DIR/ccache" <<'EOF' #!/usr/bin/env sh diff --git a/platforms/react-native/sample/src/App.tsx b/platforms/react-native/sample/src/App.tsx index b67bd33d..12af01b9 100644 --- a/platforms/react-native/sample/src/App.tsx +++ b/platforms/react-native/sample/src/App.tsx @@ -39,19 +39,19 @@ import SettingsScreen from './screens/SettingsScreen'; import AccountScreen from './screens/AccountScreen'; import LoginScreen from './screens/LoginScreen'; -import type {Configuration, Features} from '@shopify/checkout-sheet-kit'; +import type {Configuration, Features} from '@shopify/checkout-kit-react-native'; import { ApplePayContactField, ColorScheme, LogLevel, - ShopifyCheckoutSheetProvider, - useShopifyCheckoutSheet, -} from '@shopify/checkout-sheet-kit'; + ShopifyCheckoutProvider, + useShopifyCheckout, +} from '@shopify/checkout-kit-react-native'; import type { CheckoutCompletedEvent, CheckoutException, PixelEvent, -} from '@shopify/checkout-sheet-kit'; +} from '@shopify/checkout-kit-react-native'; import {ConfigProvider, useConfig} from './context/Config'; import {BuyerIdentityMode} from './auth/types'; import { @@ -209,7 +209,7 @@ const checkoutKitConfigDefaults: Configuration = { }; function AppWithContext({children}: PropsWithChildren) { - const shopify = useShopifyCheckoutSheet(); + const shopify = useShopifyCheckout(); const eventHandlers = useShopifyEventHandlers(); useEffect(() => { @@ -454,11 +454,11 @@ function AppWithCheckoutKit({children}: PropsWithChildren) { }, [appConfig, checkoutKitThemeConfig, isAuthenticated, customerEmail, accessToken]); return ( - {children} - + ); } @@ -475,7 +475,7 @@ function Routes() { const {totalQuantity} = useCart(); const navigation = useNavigation>(); const {url: initialUrl} = useInitialURL(); - const shopify = useShopifyCheckoutSheet(); + const shopify = useShopifyCheckout(); useEffect(() => { async function handleUniversalLink(url: string) { diff --git a/platforms/react-native/sample/src/context/Cart.tsx b/platforms/react-native/sample/src/context/Cart.tsx index a3b15272..bdf6990c 100644 --- a/platforms/react-native/sample/src/context/Cart.tsx +++ b/platforms/react-native/sample/src/context/Cart.tsx @@ -8,7 +8,7 @@ import React, { } from 'react'; import {Alert} from 'react-native'; import {atom, useAtom} from 'jotai'; -import {useShopifyCheckoutSheet} from '@shopify/checkout-sheet-kit'; +import {useShopifyCheckout} from '@shopify/checkout-kit-react-native'; import useShopify from '../hooks/useShopify'; import {useConfig} from './Config'; import {useAuth} from './Auth'; @@ -48,7 +48,7 @@ const cartIdState = atom(defaultCartId); const totalQuantityState = atom(defaultTotalQuantity); export const CartProvider: React.FC = ({children}) => { - const shopify = useShopifyCheckoutSheet(); + const shopify = useShopifyCheckout(); // Reuse the same cart ID for the lifetime of the app const [checkoutURL, setCheckoutURL] = useAtom(checkoutURLState); // Reuse the same cart ID for the lifetime of the app diff --git a/platforms/react-native/sample/src/context/Config.tsx b/platforms/react-native/sample/src/context/Config.tsx index 407fde01..ec78298c 100644 --- a/platforms/react-native/sample/src/context/Config.tsx +++ b/platforms/react-native/sample/src/context/Config.tsx @@ -6,7 +6,7 @@ import React, { useMemo, useState, } from 'react'; -import {ColorScheme, ApplePayStyle} from '@shopify/checkout-sheet-kit'; +import {ColorScheme, ApplePayStyle} from '@shopify/checkout-kit-react-native'; import EncryptedStorage from 'react-native-encrypted-storage'; import {useTheme} from './Theme'; import {BuyerIdentityMode} from '../auth/types'; diff --git a/platforms/react-native/sample/src/context/Theme.tsx b/platforms/react-native/sample/src/context/Theme.tsx index b4f2d712..fd185ed0 100644 --- a/platforms/react-native/sample/src/context/Theme.tsx +++ b/platforms/react-native/sample/src/context/Theme.tsx @@ -4,7 +4,7 @@ import type {ColorSchemeName} from 'react-native'; import {Appearance, useColorScheme} from 'react-native'; import type {Theme} from '@react-navigation/native'; import {DarkTheme, DefaultTheme} from '@react-navigation/native'; -import {ColorScheme} from '@shopify/checkout-sheet-kit'; +import {ColorScheme} from '@shopify/checkout-kit-react-native'; interface Context { cornerRadius: number; diff --git a/platforms/react-native/sample/src/hooks/useCheckoutEventHandlers.ts b/platforms/react-native/sample/src/hooks/useCheckoutEventHandlers.ts index 2511b5eb..59e6b337 100644 --- a/platforms/react-native/sample/src/hooks/useCheckoutEventHandlers.ts +++ b/platforms/react-native/sample/src/hooks/useCheckoutEventHandlers.ts @@ -8,7 +8,7 @@ import type { CheckoutException, PixelEvent, RenderStateChangeEvent, -} from '@shopify/checkout-sheet-kit'; +} from '@shopify/checkout-kit-react-native'; import {Linking} from 'react-native'; interface EventHandlers { diff --git a/platforms/react-native/sample/src/screens/CartScreen.tsx b/platforms/react-native/sample/src/screens/CartScreen.tsx index e5712df3..b08705c3 100644 --- a/platforms/react-native/sample/src/screens/CartScreen.tsx +++ b/platforms/react-native/sample/src/screens/CartScreen.tsx @@ -36,11 +36,11 @@ import { import Icon from 'react-native-vector-icons/Entypo'; import { - useShopifyCheckoutSheet, + useShopifyCheckout, AcceleratedCheckoutButtons, ApplePayLabel, AcceleratedCheckoutWallet, -} from '@shopify/checkout-sheet-kit'; +} from '@shopify/checkout-kit-react-native'; import {useConfig} from '../context/Config'; import useShopify from '../hooks/useShopify'; import type {CartLineItem} from '../../@types'; @@ -51,7 +51,7 @@ import {currency} from '../utils'; import {useShopifyEventHandlers} from '../hooks/useCheckoutEventHandlers'; function CartScreen(): React.JSX.Element { - const ShopifyCheckout = useShopifyCheckoutSheet(); + const ShopifyCheckout = useShopifyCheckout(); const [refreshing, setRefreshing] = React.useState(false); const {cartId, checkoutURL, totalQuantity, removeFromCart, addingToCart} = useCart(); diff --git a/platforms/react-native/sample/src/screens/ProductDetailsScreen.tsx b/platforms/react-native/sample/src/screens/ProductDetailsScreen.tsx index 8835a824..2e912da1 100644 --- a/platforms/react-native/sample/src/screens/ProductDetailsScreen.tsx +++ b/platforms/react-native/sample/src/screens/ProductDetailsScreen.tsx @@ -43,8 +43,8 @@ import { AcceleratedCheckoutButtons, AcceleratedCheckoutWallet, ApplePayLabel, - useShopifyCheckoutSheet, -} from '@shopify/checkout-sheet-kit'; + useShopifyCheckout, +} from '@shopify/checkout-kit-react-native'; import {useConfig} from '../context/Config'; import {useShopifyEventHandlers} from '../hooks/useCheckoutEventHandlers'; @@ -96,7 +96,7 @@ function ProductDetails({ const styles = createStyles(colors, cornerRadius); const image = product.images?.edges[0]?.node; const variant = getVariant(product); - const {acceleratedCheckoutsAvailable} = useShopifyCheckoutSheet(); + const {acceleratedCheckoutsAvailable} = useShopifyCheckout(); const eventHandlers = useShopifyEventHandlers( 'PDP - AcceleratedCheckoutButtons', diff --git a/platforms/react-native/sample/src/screens/SettingsScreen.tsx b/platforms/react-native/sample/src/screens/SettingsScreen.tsx index 2d670204..29f9b6d4 100644 --- a/platforms/react-native/sample/src/screens/SettingsScreen.tsx +++ b/platforms/react-native/sample/src/screens/SettingsScreen.tsx @@ -37,8 +37,8 @@ import {useConfig} from '../context/Config'; import { ApplePayStyle, ColorScheme, - useShopifyCheckoutSheet, -} from '@shopify/checkout-sheet-kit'; + useShopifyCheckout, +} from '@shopify/checkout-kit-react-native'; import type {Colors} from '../context/Theme'; import {useTheme} from '../context/Theme'; import {useNavigation} from '@react-navigation/native'; @@ -94,7 +94,7 @@ interface SectionData { } function SettingsScreen() { - const shopify = useShopifyCheckoutSheet(); + const shopify = useShopifyCheckout(); const {appConfig, setAppConfig} = useConfig(); const {colors, setColorScheme} = useTheme(); const styles = createStyles(colors); diff --git a/platforms/react-native/scripts/compare_snapshot b/platforms/react-native/scripts/compare_snapshot index 9a270f76..32bd3020 100755 --- a/platforms/react-native/scripts/compare_snapshot +++ b/platforms/react-native/scripts/compare_snapshot @@ -1,6 +1,6 @@ #!/bin/bash -FILENAME="modules/@shopify/checkout-sheet-kit/package.snapshot.json" +FILENAME="modules/@shopify/checkout-kit-react-native/package.snapshot.json" TMP_SNAPSHOT_FILENAME="snapshot.json" # Set up some colors to use later diff --git a/platforms/react-native/scripts/copy_license b/platforms/react-native/scripts/copy_license index ad8aa264..af75710e 100755 --- a/platforms/react-native/scripts/copy_license +++ b/platforms/react-native/scripts/copy_license @@ -110,9 +110,9 @@ normalized_license = normalize_whitespace(File.read('LICENSE')) check_only = ARGV.include?('--check') modified = [] -modified += copy_license('modules/@shopify/checkout-sheet-kit/ios', license_block, normalized_license, check_only: check_only) -modified += copy_license('modules/@shopify/checkout-sheet-kit/android', license_block, normalized_license, check_only: check_only) -modified += copy_license('modules/@shopify/checkout-sheet-kit/src', license_block, normalized_license, check_only: check_only) +modified += copy_license('modules/@shopify/checkout-kit-react-native/ios', license_block, normalized_license, check_only: check_only) +modified += copy_license('modules/@shopify/checkout-kit-react-native/android', license_block, normalized_license, check_only: check_only) +modified += copy_license('modules/@shopify/checkout-kit-react-native/src', license_block, normalized_license, check_only: check_only) if check_only if modified.empty? diff --git a/platforms/react-native/scripts/create_snapshot b/platforms/react-native/scripts/create_snapshot index 165f4c19..71182d50 100755 --- a/platforms/react-native/scripts/create_snapshot +++ b/platforms/react-native/scripts/create_snapshot @@ -1,5 +1,5 @@ #!/bin/bash -OUTPUT_FILE=${1:-modules/@shopify/checkout-sheet-kit/package.snapshot.json} +OUTPUT_FILE=${1:-modules/@shopify/checkout-kit-react-native/package.snapshot.json} -(cd modules/@shopify/checkout-sheet-kit && pnpm pack --dry-run --json) | jq ".files | map(.path)" > $OUTPUT_FILE +(cd modules/@shopify/checkout-kit-react-native && pnpm pack --dry-run --json) | jq ".files | map(.path)" > $OUTPUT_FILE diff --git a/platforms/react-native/scripts/lint_swift b/platforms/react-native/scripts/lint_swift index 1995895f..c737b6e3 100755 --- a/platforms/react-native/scripts/lint_swift +++ b/platforms/react-native/scripts/lint_swift @@ -1,6 +1,6 @@ #!/bin/bash -DIR=modules/@shopify/checkout-sheet-kit +DIR=modules/@shopify/checkout-kit-react-native MODE="${1:-check}" # Validate the mode diff --git a/platforms/react-native/turbo.json b/platforms/react-native/turbo.json index 2d8a88a3..ab58b9b9 100644 --- a/platforms/react-native/turbo.json +++ b/platforms/react-native/turbo.json @@ -2,7 +2,7 @@ "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { - "outputs": ["./modules/@shopify/checkout-sheet-kit/lib/**"] + "outputs": ["./modules/@shopify/checkout-kit-react-native/lib/**"] }, "lint": {}, "build:android": {