Skip to content

Commit b82a603

Browse files
Juanita-Dashclaude
andcommitted
Import React Native package into monorepo
Imports the source of github.com/Shopify/checkout-sheet-kit-react-native at commit a349b97 (current main) under react-native/. No code changes are made — this is a verbatim snapshot. Includes v4.0.0 (New Architecture Release) and the fast-xml-parser 4.5.3 → 4.5.6 bump (Shopify/checkout-sheet-kit-react-native#462, #484) which clears the multirepo-denylist-check on this PR. The .github/ directory is intentionally not imported; CI workflows will be re-authored at the monorepo root with rn-* prefixes (matching the existing swift-* / android-* convention) in a follow-up. Supersedes #28 — re-cut on current source main per Kieran's review. Mirrors the import-then-rename pattern used by the Swift (#9#22) and Android subdirs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 33fe749 commit b82a603

183 files changed

Lines changed: 31231 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

react-native/.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
indent_style = space
10+
indent_size = 2
11+
12+
end_of_line = lf
13+
charset = utf-8
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true

react-native/.gitignore

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# VSCode
6+
.vscode/settings.json
7+
8+
# Xcode
9+
#
10+
build/
11+
*.pbxuser
12+
!default.pbxuser
13+
*.mode1v3
14+
!default.mode1v3
15+
*.mode2v3
16+
!default.mode2v3
17+
*.perspectivev3
18+
!default.perspectivev3
19+
xcuserdata
20+
*.xccheckout
21+
*.moved-aside
22+
DerivedData
23+
*.hmap
24+
*.ipa
25+
*.xcuserstate
26+
ios/.xcode.env.local
27+
28+
# Android/IntelliJ
29+
#
30+
build/
31+
.idea
32+
.gradle
33+
local.properties
34+
*.iml
35+
*.hprof
36+
.cxx/
37+
*.keystore
38+
!debug.keystore
39+
upload-keystore.jks
40+
.kotlin/
41+
42+
# node.js
43+
#
44+
node_modules/
45+
.yarn/
46+
npm-debug.log
47+
yarn-error.log
48+
pnpm-debug.log
49+
50+
# fastlane
51+
#
52+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
53+
# screenshots whenever they are needed.
54+
# For more information about the recommended setup visit:
55+
# https://docs.fastlane.tools/best-practices/source-control/
56+
57+
**/fastlane/report.xml
58+
**/fastlane/Preview.html
59+
**/fastlane/screenshots
60+
**/fastlane/test_output
61+
62+
# Bundle artifact
63+
*.jsbundle
64+
65+
# Ruby / CocoaPods
66+
/**/Pods/
67+
/vendor/bundle/
68+
69+
# Temporary files created by Metro to check the health of the file watcher
70+
.metro-health-check*
71+
72+
# testing
73+
/coverage
74+
75+
# Env
76+
.env
77+
.env.local
78+
.env.development.local
79+
.env.test.local
80+
.env.production.local
81+
**/.xcode.env.local
82+
83+
# Build
84+
.build
85+
lib
86+
dist
87+
.turbo
88+
89+
# Module
90+
modules/@shopify/checkout-sheet-kit/android/gradle/wrapper/gradle-wrapper.jar
91+
modules/@shopify/checkout-sheet-kit/android/gradle/wrapper/gradle-wrapper.properties
92+
modules/@shopify/checkout-sheet-kit/android/gradlew
93+
modules/@shopify/checkout-sheet-kit/android/gradlew.bat
94+
95+
# Sample bundle
96+
**/index.android.bundle
97+
98+
# Local gems
99+
sample/vendor
100+
101+
# Sample app
102+
sample/**/AndroidManifest.xml
103+
104+
.claude/
105+
CLAUDE.md

react-native/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node-linker=hoisted
2+
frozen-lockfile=true

react-native/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.3.6

react-native/.swiftformat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--indent 4
2+
--linebreaks lf
3+
--wraparguments before-first
4+
--wrapcollections before-first
5+
--commas inline
6+
--allman false
7+
--semicolons inline
8+
--trimwhitespace always
9+
--disable redundantReturn,hoistAwait,preferKeyPath,redundantInternal,redundantPublic
10+
--swiftversion 5.7.1
11+
--extensionacl on-declarations

react-native/.swiftlint.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
disabled_rules:
2+
- line_length
3+
- file_length
4+
- non_optional_string_data_conversion
5+
- type_body_length
6+
- type_name
7+
- identifier_name
8+
- opening_brace
9+
- function_body_length
10+
- trailing_comma
11+
- function_parameter_count
12+
13+
opt_in_rules:
14+
- array_init
15+
- collection_alignment
16+
- comma_inheritance
17+
- convenience_type
18+
- closure_spacing
19+
- direct_return
20+
- empty_count
21+
- empty_string
22+
- fatal_error_message
23+
- first_where
24+
- identical_operands
25+
- indentation_width
26+
- joined_default_parameter
27+
- modifier_order
28+
- overridden_super_call
29+
- toggle_bool
30+
- switch_case_alignment:
31+
indented_cases: false
32+
- fallthrough
33+
- explicit_acl
34+
35+
nesting:
36+
type_level:
37+
warning: 2
38+
39+
reporter: "xcode"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"esbenp.prettier-vscode",
4+
"editorconfig.editorconfig",
5+
"msjsdiag.vscode-react-native",
6+
"yzhang.markdown-all-in-one"
7+
]
8+
}

react-native/.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

react-native/CONTRIBUTING.md

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
# Contributing
2+
3+
We welcome code contributions, feature requests, and reporting of issues. Please
4+
see [guidelines and instructions](.github/CONTRIBUTING.md).
5+
6+
---
7+
8+
This repo is subdivided into 3 parts using pnpm workspaces:
9+
10+
- The base repo (workspace name = `checkout-sheet-kit-react-native`)
11+
- The `@shopify/checkout-sheet-kit` Native Module (workspace name = `module`)
12+
- The sample application (workspace name = `sample`)
13+
14+
Each of the workspaces contains a separate `package.json` to manage tasks
15+
specific to each workspace.
16+
17+
## Getting started
18+
19+
If you've cloned the repo and want to run the sample app, you will first need to:
20+
21+
1. Install the NPM dependencies
22+
23+
```sh
24+
pnpm install
25+
```
26+
27+
2. Install iOS dependencies. (N.b. Android dependencies are automatically installed by Gradle)
28+
29+
```sh
30+
pnpm pod-install sample/ios
31+
```
32+
33+
3. Build the Native Module
34+
35+
```sh
36+
pnpm module build
37+
```
38+
39+
4. Start the Metro server
40+
41+
```sh
42+
pnpm sample start
43+
```
44+
45+
5. Run the sample application (in a new terminal / tab)
46+
47+
```sh
48+
pnpm sample ios
49+
# or
50+
pnpm sample android
51+
```
52+
53+
## Optional: Speed up builds with sccache
54+
55+
For faster native compilation (especially on incremental builds), you can install [sccache](https://github.com/mozilla/sccache), a shared compilation cache:
56+
57+
```sh
58+
# macOS (using Homebrew)
59+
brew install sccache
60+
61+
# Ubuntu/Debian
62+
cargo install sccache
63+
64+
# Other systems: see https://github.com/mozilla/sccache#installation
65+
```
66+
67+
The build scripts will automatically detect and use sccache if available. On Android, React Native's CMake files look for a command named `ccache`, so the sample Android scripts put an sccache-backed compatibility command first on `PATH`. If you encounter any build issues, you can temporarily disable it:
68+
69+
```sh
70+
# Disable sccache for a single build
71+
SCCACHE=false pnpm sample ios
72+
SCCACHE=false pnpm sample android
73+
```
74+
75+
## Making changes to the Native Module
76+
77+
If your intentions are to modify the TS code for the Native Module under
78+
`modules/@shopify/checkout-sheet-kit`, note that you will not need to rebuild to
79+
observe your changes in the sample app. This is because the sample app is
80+
importing the TS files directly from the module directory (through symlinking).
81+
82+
However, if you're running the iOS/Android tests against the module, you will
83+
first need to run `pnpm module build` each time you change the TS code.
84+
85+
## Cleaning the workspaces
86+
87+
There are a handful of commands to clean the individual workspaces.
88+
89+
```sh
90+
# Clear the current directory from watchman
91+
pnpm clean
92+
93+
# Removes the "sample/node_modules" directory
94+
# Removes "ios/pods" directory
95+
# Removes "ios/build" directory
96+
pnpm sample clean
97+
98+
# Removes the "lib" directory for the Native Module
99+
pnpm module clean
100+
```
101+
102+
## Linting the code
103+
104+
Linting the codespaces will (1) compile the code with TypeScript and (2) run
105+
eslint over the source code.
106+
107+
```sh
108+
# Lint the Native Module TS code
109+
pnpm module lint
110+
111+
# Lint the Sample App TS code
112+
pnpm sample lint
113+
```
114+
115+
## Testing
116+
117+
There are 3 types of tests in this repo: Typescript, Swift and Java - each for
118+
testing the Native Module.
119+
120+
```sh
121+
# Run Jest tests for "modules/@shopify/checkout-sheet-kit/src/**/*.tsx"
122+
pnpm test
123+
124+
# Run swift tests for the Native Module
125+
pnpm sample test:ios
126+
127+
# Run Java tests for the Native Module
128+
pnpm sample test:android
129+
```
130+
131+
## Running the sample app
132+
133+
To run the sample app in this repo, first clone the repo and run the following
134+
commands at the root of the project directory.
135+
136+
### Install NPM dependencies
137+
138+
```sh
139+
pnpm install
140+
```
141+
142+
### Install Cocoapods
143+
144+
```sh
145+
pnpm pod-install sample/ios
146+
```
147+
148+
### Build the local module
149+
150+
```sh
151+
pnpm module build
152+
```
153+
154+
### Update the dotenv file
155+
156+
Replace the details in the `sample/.env.example` file and rename it to
157+
`sample/.env`
158+
159+
```
160+
# Storefront Details
161+
STOREFRONT_DOMAIN="YOUR_STORE.myshopify.com"
162+
STOREFRONT_ACCESS_TOKEN="YOUR_PUBLIC_STOREFRONT_ACCESS_TOKEN"
163+
STOREFRONT_VERSION="2025-07"
164+
```
165+
166+
### Start the sample app
167+
168+
```sh
169+
pnpm sample start
170+
```

react-native/LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
MIT License
2+
3+
Copyright 2023 - Present, Shopify Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)