-
Notifications
You must be signed in to change notification settings - Fork 1
Migrate React Native sample to Expo prebuild #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: graphite-base/297
Are you sure you want to change the base?
Changes from all commits
881e894
80e3d09
9241a0e
0efe5f5
7782700
b386d2f
ecf8970
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,14 +26,6 @@ jobs: | |
| echo "Xcode Path: $(xcode-select -p)" | ||
| echo "Xcode Version: $(xcrun xcodebuild -version)" | ||
|
|
||
| - name: Setup iOS Simulator | ||
| run: | | ||
| xcrun simctl list runtimes | ||
| xcrun simctl list devicetypes | grep iPhone | ||
| xcrun simctl delete all | ||
| CURRENT_SIMULATOR_UUID=$(xcrun simctl create TestDevice "iPhone 16 Pro") | ||
| echo "CURRENT_SIMULATOR_UUID=$CURRENT_SIMULATOR_UUID" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Setup Node.js, pnpm, and install dependencies | ||
| uses: ./.github/actions/setup | ||
| with: | ||
|
|
@@ -42,30 +34,6 @@ jobs: | |
| package-json-file: platforms/react-native/package.json | ||
| working-directory: platforms/react-native | ||
|
|
||
| - name: Setup Ruby | ||
| uses: ruby/setup-ruby@89f90524b88a01fe6e0b732220432cc6142926af # v1.313.0 | ||
| with: | ||
| ruby-version: 3.3.6 | ||
| bundler-cache: true | ||
| working-directory: platforms/react-native/sample | ||
|
|
||
| - name: Verify iOS lockfile uses published native SDK | ||
| run: scripts/check_published_podfile_lock sample/ios/Podfile.lock | ||
|
|
||
| - name: Cache cocoapods | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it'd be beneficial to bring back the caching |
||
| 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-kit-react-native/package.json', 'platforms/react-native/pnpm-lock.yaml') }} | ||
|
|
||
| - name: Install cocoapods | ||
| working-directory: platforms/react-native/sample | ||
| run: | | ||
| set -euo pipefail | ||
| bundle install | ||
| cd ios | ||
| bundle exec pod install --deployment --repo-update | ||
|
|
||
| - name: Build module | ||
| run: pnpm module build | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -223,7 +223,10 @@ Here's an example of how to get started with Apollo: | |
|
|
||
| ```tsx | ||
| import {ApolloClient, gql, ApolloProvider} from '@apollo/client'; | ||
| import {API_VERSION, STOREFRONT_DOMAIN, STOREFRONT_ACCESS_TOKEN} from '@env'; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this didn't need to change |
||
|
|
||
| const API_VERSION = '2026-04'; | ||
| const STOREFRONT_DOMAIN = 'your-store.myshopify.com'; | ||
| const STOREFRONT_ACCESS_TOKEN = 'your-public-storefront-access-token'; | ||
|
|
||
| // Create a new instance of the ApolloClient | ||
| const client = new ApolloClient({ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| const Constants = { | ||
| expoConfig: { | ||
| extra: { | ||
| API_VERSION: '2026-04', | ||
| CUSTOMER_ACCOUNT_API_SHOP_ID: 'test-shop-123', | ||
| CUSTOMER_ACCOUNT_API_CLIENT_ID: 'test-client-456', | ||
| STOREFRONT_DOMAIN: 'test-shop.myshopify.com', | ||
| STOREFRONT_ACCESS_TOKEN: 'test-storefront-token', | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| module.exports = { | ||
| __esModule: true, | ||
| default: Constants, | ||
| }; | ||
|
|
||
| export {}; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| const getRandomBytes = jest.fn((size: number) => new Uint8Array(size).fill(1)); | ||
| const digestStringAsync = jest.fn(async () => btoa(String.fromCharCode(...new Uint8Array(32).fill(1)))); | ||
|
|
||
| module.exports = { | ||
| __esModule: true, | ||
| CryptoDigestAlgorithm: {SHA256: 'SHA-256'}, | ||
| CryptoEncoding: {BASE64: 'base64'}, | ||
| getRandomBytes, | ||
| digestStringAsync, | ||
| }; | ||
|
|
||
| export {}; |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| module.exports = { | ||
| presets: ['module:@react-native/babel-preset'], | ||
| presets: ['babel-preset-expo'], | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,13 @@ | ||
| module.exports = { | ||
| preset: 'react-native', | ||
| preset: 'jest-expo', | ||
| modulePathIgnorePatterns: ['modules/@shopify/checkout-kit-react-native/lib'], | ||
| modulePaths: ['<rootDir>/node_modules', '<rootDir>/sample/node_modules'], | ||
| moduleNameMapper: { | ||
| '^react$': '<rootDir>/node_modules/react', | ||
| '^react-native$': '<rootDir>/__mocks__/react-native.ts', | ||
| }, | ||
| setupFiles: ['<rootDir>/jest.setup.ts'], | ||
| transform: { | ||
| '\\.[jt]sx?$': 'babel-jest', | ||
| }, | ||
| globals: { | ||
| 'ts-jest': { | ||
| tsConfig: { | ||
| importHelpers: true, | ||
| }, | ||
| }, | ||
| }, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now inlined into the
platforms/react-native/sample/scripts/build_iosscript