Skip to content

Commit 87da5c4

Browse files
committed
Move React Native dev commands under root dev.yml
1 parent d26f92e commit 87da5c4

4 files changed

Lines changed: 79 additions & 88 deletions

File tree

dev.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ up:
77
- mint
88
- xcbeautify
99
- jq
10+
- swiftlint
11+
- sccache
1012
- ruby
1113
- custom:
1214
name: Install bundle packages
@@ -50,6 +52,24 @@ up:
5052
([ -f "./platforms/swift/Samples/MobileBuyIntegration/MobileBuyIntegration/MobileBuyIntegration.entitlements" ] || exit 1;)
5153
meet: cd platforms/swift && ./Scripts/setup_entitlements
5254

55+
- node:
56+
version: v22.14.0
57+
package_manager: pnpm@10.33.1
58+
packages:
59+
- platforms/react-native
60+
- custom:
61+
name: Install NPM dependencies (React Native)
62+
met?: ls -l platforms/react-native | grep node_modules
63+
meet: cd platforms/react-native && pnpm install
64+
- custom:
65+
name: Install gems (React Native sample)
66+
met?: (cd platforms/react-native/sample/ios && bundle check)
67+
meet: cd platforms/react-native/sample/ios && bundle install
68+
- custom:
69+
name: Install pods (React Native sample)
70+
met?: (cd platforms/react-native/sample/ios && bundle exec pod check --ignore-dev-pods)
71+
meet: cd platforms/react-native && pnpm run pod-install
72+
5373
open:
5474
"GitHub": "https://github.com/Shopify/checkout-kit"
5575
"Issues": "https://github.com/Shopify/checkout-kit/issues"
@@ -60,6 +80,9 @@ check:
6080
android-detekt: cd platforms/android && ./gradlew detekt
6181
android-lint: cd platforms/android && ./gradlew lintRelease
6282
swift-lint: cd platforms/swift && ./Scripts/lint
83+
react-native-lint-swift: cd platforms/react-native && ./scripts/lint_swift
84+
react-native-lint-module: cd platforms/react-native && pnpm module lint
85+
react-native-lint-sample: cd platforms/react-native && pnpm sample lint
6386

6487
commands:
6588
# Repo-wide
@@ -187,3 +210,51 @@ commands:
187210
`dev swift test <test_class_name>` - Run only the specified test class.
188211
syntax: "[test_class_name]"
189212
run: cd platforms/swift && ./Scripts/xcode_run test ShopifyCheckoutKit-Package "$1"
213+
214+
# React Native
215+
react-native:
216+
desc: "React Native Checkout Kit commands"
217+
aliases: [rn]
218+
subcommands:
219+
server:
220+
desc: Start Metro development server
221+
run: cd platforms/react-native && pnpm sample start --reset-cache
222+
ios:
223+
desc: Run the iOS sample app in the simulator
224+
run: cd platforms/react-native && pnpm sample ios
225+
android:
226+
desc: Run the Android sample app in the emulator
227+
run: cd platforms/react-native && pnpm sample android
228+
clean:
229+
desc: Remove generated directories and stop sccache
230+
run: |
231+
cd platforms/react-native
232+
pnpm module clean
233+
pnpm sample clean
234+
pnpm clean
235+
if command -v sccache >/dev/null 2>&1; then
236+
sccache --stop-server 2>/dev/null || true
237+
fi
238+
echo "Cleaned root, module and sample workspaces"
239+
lint:
240+
desc: Run all React Native lint checks (Swift, module, sample)
241+
aliases: [style, check]
242+
run: |
243+
set -e
244+
cd platforms/react-native
245+
./scripts/lint_swift
246+
pnpm module lint
247+
pnpm sample lint
248+
subcommands:
249+
swift:
250+
desc: Lint Swift code via SwiftLint
251+
run: cd platforms/react-native && ./scripts/lint_swift
252+
module:
253+
desc: Lint the @shopify/checkout-sheet-kit module
254+
run: cd platforms/react-native && pnpm module lint
255+
sample:
256+
desc: Lint the sample app
257+
run: cd platforms/react-native && pnpm sample lint
258+
fix:
259+
desc: Auto-fix Swift lint issues
260+
run: cd platforms/react-native && ./scripts/lint_swift fix

platforms/react-native/CONTRIBUTING.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Contributing
22

33
We welcome code contributions, feature requests, and reporting of issues. Please
4-
see [guidelines and instructions](.github/CONTRIBUTING.md).
4+
see [guidelines and instructions](../../.github/CONTRIBUTING.md).
55

66
---
77

@@ -16,7 +16,10 @@ specific to each workspace.
1616

1717
## Getting started
1818

19-
If you've cloned the repo and want to run the sample app, you will first need to:
19+
If you've cloned the repo and want to run the sample app, Shopify employees can
20+
run `dev up` and `dev react-native <command>` from the repo root (`dev rn` is
21+
an alias). The underlying `pnpm` commands below are run from
22+
`platforms/react-native`:
2023

2124
1. Install the NPM dependencies
2225

@@ -130,8 +133,8 @@ pnpm sample test:android
130133

131134
## Running the sample app
132135

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.
136+
To run the sample app in this repo with `pnpm`, first run the following commands
137+
from `platforms/react-native`.
135138

136139
### Install NPM dependencies
137140

platforms/react-native/dev.yml

Lines changed: 0 additions & 83 deletions
This file was deleted.

platforms/react-native/scripts/lint_swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ print_linting_error() {
6464
local tool_name=$1
6565
echo "$tool_name detected issues that need to be fixed."
6666
echo "🔧 How to fix:"
67-
echo " Shopify employee? Run 'dev fix' or 'dev check' to see detailed output"
67+
echo " Shopify employee? Run 'dev react-native fix' or 'dev react-native lint' to see detailed output"
6868
echo " Not a Shopify employee? Run './scripts/lint_swift fix' to auto-fix issues"
6969
if [[ "$tool_name" == "SwiftLint" ]]; then
7070
echo " Then fix any remaining non-autofixable issues manually"

0 commit comments

Comments
 (0)