Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/install-cocoapods/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
with:
path: |
sample/ios/Pods
key: ${{ runner.os }}-cocoapods-${{ hashFiles('sample/ios/Podfile.lock', 'sample/Gemfile.lock', 'sample/Gemfile', 'package.json', 'sample/package.json', 'modules/@shopify/checkout-sheet-kit/package.json', 'yarn.lock') }}
key: ${{ runner.os }}-cocoapods-${{ hashFiles('sample/ios/Podfile.lock', 'sample/Gemfile.lock', 'sample/Gemfile', 'package.json', 'sample/package.json', 'modules/@shopify/checkout-sheet-kit/package.json', 'pnpm-lock.yaml') }}

- name: Install cocoapods
shell: bash
Expand Down
31 changes: 10 additions & 21 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ description: Setup Node.js and install dependencies
runs:
using: composite
steps:
# Versions are sourced from package.json:
# - pnpm: `packageManager` field (read by pnpm/action-setup)
# - node: `engines.node` field (read by setup-node via node-version-file)
# Keep package.json as the single source of truth.
- name: Install pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

- name: Setup Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version: 22.22.1
node-version-file: package.json
registry-url: 'https://registry.npmjs.org'

# TODO: Can be removed once node-version is 24 as this will be the minimum
- name: Install npm 11
run: npm install -g npm@11
shell: bash
cache: pnpm

- name: Cache turbo build setup
uses: actions/cache@v4
Expand All @@ -23,20 +26,6 @@ runs:
restore-keys: |
${{ runner.os }}-turbo-

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v4
with:
path: |
**/node_modules
.yarn/install-state.gz
key:
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-
Comment on lines -26 to -37
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already caching somewhere else?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the setup node step has built in cache for pnpm

 - name: Setup Node.js
      uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
      with:
        node-version-file: package.json
        registry-url: 'https://registry.npmjs.org'
        cache: pnpm


- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
run: pnpm install --frozen-lockfile
shell: bash
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
uses: ./.github/actions/setup

- run: |
yarn module clean
yarn module build
yarn compare-snapshot
pnpm module clean
pnpm module build
pnpm compare-snapshot

lint:
name: Lint module + sample
Expand All @@ -52,9 +52,9 @@ jobs:
uses: ./.github/actions/setup

- run: |
yarn module build
yarn module lint
yarn sample lint
pnpm module build
pnpm module lint
pnpm sample lint

test:
name: Run jest tests
Expand All @@ -70,7 +70,7 @@ jobs:
uses: ./.github/actions/setup

- run:
yarn test --coverage
pnpm test --coverage
--testPathPatterns="modules/@shopify/checkout-sheet-kit/tests"
--coverageReporters=json-summary

Expand Down Expand Up @@ -111,8 +111,8 @@ jobs:
java -version
javac -version
echo "STOREFRONT_DOMAIN=myshopify.com" > sample/.env
yarn module build
yarn sample test:android --no-daemon
pnpm module build
pnpm sample test:android --no-daemon

test-ios:
name: Run Swift Tests
Expand All @@ -138,4 +138,4 @@ jobs:

- name: Run Swift tests
run: |
yarn sample test:ios
pnpm sample test:ios
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
- name: Prepare release
run: |
cp README.md modules/@shopify/checkout-sheet-kit
yarn module clean
yarn module build
pnpm module clean
pnpm module build
cd modules/@shopify/checkout-sheet-kit
npm publish --access public --tag ${{ steps.npm-tag.outputs.tag }}
env:
Expand Down
11 changes: 2 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ upload-keystore.jks
# node.js
#
node_modules/
.yarn/
npm-debug.log
yarn-error.log
.yarn/install-state.gz
pnpm-debug.log

# fastlane
#
Expand Down Expand Up @@ -97,14 +98,6 @@ modules/@shopify/checkout-sheet-kit/android/gradlew.bat
# Local gems
sample/vendor

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Sample app
sample/**/AndroidManifest.xml

Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node-linker=hoisted
frozen-lockfile=true
925 changes: 0 additions & 925 deletions .yarn/releases/yarn-4.4.1.cjs

This file was deleted.

5 changes: 0 additions & 5 deletions .yarnrc.yml

This file was deleted.

44 changes: 22 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ see [guidelines and instructions](.github/CONTRIBUTING.md).

---

This repo is subdivided into 3 parts using yarn workspaces:
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`)
Expand All @@ -21,33 +21,33 @@ If you've cloned the repo and want to run the sample app, you will first need to
1. Install the NPM dependencies

```sh
yarn
pnpm install
```

2. Install iOS dependencies. (N.b. Android dependencies are automatically installed by Gradle)

```sh
yarn pod-install sample/ios
pnpm pod-install sample/ios
```

3. Build the Native Module

```sh
yarn module build
pnpm module build
```

4. Start the Metro server

```sh
yarn sample start
pnpm sample start
```

5. Run the sample application (in a new terminal / tab)

```sh
yarn sample ios
pnpm sample ios
# or
yarn sample android
pnpm sample android
```

## Optional: Speed up builds with sccache
Expand All @@ -68,8 +68,8 @@ The build scripts will automatically detect and use sccache if available. If you

```sh
# Disable sccache for a single build
SCCACHE=false yarn sample ios
SCCACHE=false yarn sample android
SCCACHE=false pnpm sample ios
SCCACHE=false pnpm sample android
```

## Making changes to the Native Module
Expand All @@ -80,23 +80,23 @@ 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).

However, if you're running the iOS/Android tests against the module, you will
first need to run `yarn module build` each time you change the TS code.
first need to run `pnpm module build` each time you change the TS code.

## Cleaning the workspaces

There are a handful of commands to clean the individual workspaces.

```sh
# Clear the current directory from watchman
yarn clean
pnpm clean

# Removes the "sample/node_modules" directory
# Removes "ios/pods" directory
# Removes "ios/build" directory
yarn sample clean
pnpm sample clean

# Removes the "lib" directory for the Native Module
yarn module clean
pnpm module clean
```

## Linting the code
Expand All @@ -106,10 +106,10 @@ eslint over the source code.

```sh
# Lint the Native Module TS code
yarn module lint
pnpm module lint

# Lint the Sample App TS code
yarn sample lint
pnpm sample lint
```

## Testing
Expand All @@ -119,13 +119,13 @@ testing the Native Module.

```sh
# Run Jest tests for "modules/@shopify/checkout-sheet-kit/src/**/*.tsx"
yarn test
pnpm test

# Run swift tests for the Native Module
yarn sample test:ios
pnpm sample test:ios

# Run Java tests for the Native Module
yarn sample test:android
pnpm sample test:android
```

## Running the sample app
Expand All @@ -136,19 +136,19 @@ commands at the root of the project directory.
### Install NPM dependencies

```sh
yarn
pnpm install
```

### Install Cocoapods

```sh
yarn pod-install sample/ios
pnpm pod-install sample/ios
```

### Build the local module

```sh
yarn module build
pnpm module build
```

### Update the dotenv file
Expand All @@ -166,5 +166,5 @@ STOREFRONT_VERSION="2025-07"
### Start the sample app

```sh
yarn sample start
pnpm sample start
```
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ application:
Install the Shopify Checkout Kit package dependency:

```sh
pnpm add @shopify/checkout-sheet-kit

# or using yarn
yarn add @shopify/checkout-sheet-kit

# or using npm
Expand Down
33 changes: 21 additions & 12 deletions dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,23 @@ up:
ios:
- version: 23C54 # 26.2
architecture_variant: arm64
# Node / pnpm versions are mirrored from package.json (engines.node,
# packageManager). dev validates engines.node matches the version below on
# every `dev up`, so drift is caught automatically. If you bump one, bump
# both.
- node:
version: v22.14.0
yarn: 1.22.22
package_manager: pnpm@10.33.1
- custom:
name: Remove stale Yarn artifacts
met?: test ! -d .yarn
meet: |
rm -rf .yarn
- custom:
name: Install NPM dependencies
met?: ls -l | grep node_modules
meet: |
yarn
pnpm install
- custom:
name: Install gems
met?: (cd sample/ios && bundle check)
Expand All @@ -32,37 +41,37 @@ up:
name: Install pods
met?: (cd sample/ios && bundle exec pod check --ignore-dev-pods)
meet: |
yarn pod-install
pnpm run pod-install
- custom:
name: Build node module
met?: (cd modules/@shopify/checkout-sheet-kit && ls -l | grep lib)
meet: |
yarn module build
pnpm module build

check:
lint_swift: ./scripts/lint_swift
lint_module: yarn module lint
lint_sample: yarn sample lint
lint_module: pnpm module lint
lint_sample: pnpm sample lint

commands:
server:
desc: 'Start development server'
run: yarn sample start --reset-cache
run: pnpm sample start --reset-cache

ios:
desc: 'Run iOS simulator'
run: yarn sample ios
run: pnpm sample ios

android:
desc: 'Run Android emulator'
run: yarn sample android
run: pnpm sample android

clean:
desc: 'rm -rf all generated directories'
run: |
yarn module clean
yarn sample clean
yarn clean
pnpm module clean
pnpm sample clean
pnpm clean
if command -v sccache >/dev/null 2>&1; then
sccache --stop-server 2>/dev/null || true
fi
Expand Down
2 changes: 1 addition & 1 deletion modules/@shopify/checkout-sheet-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"clean": "rm -rf lib",
"build": "bob build",
"lint": "yarn typecheck && eslint src",
"lint": "pnpm run typecheck && eslint src",
"typecheck": "tsc --noEmit"
},
"files": [
Expand Down
Loading
Loading