Skip to content

Commit f2501e7

Browse files
Migrate from Yarn to pnpm
Converts the repo from Yarn v4 (.yarnrc.yml) to pnpm 10.28.0. Lockfile was imported via `pnpm import` to preserve resolved versions, then re-resolved to sync with each package.json. Changes: - Replace yarn.lock with pnpm-lock.yaml; drop .yarnrc.yml and .yarn/. - Add pnpm-workspace.yaml (replaces root package.json#workspaces). - Add "packageManager": "pnpm@10.28.0" to root package.json. - Add pnpm.onlyBuiltDependencies for unrs-resolver so its postinstall runs (pnpm ignores build scripts by default). - Add .npmrc with `node-linker=hoisted` to preserve the flat node_modules layout React Native / Metro / CocoaPods / Gradle expect (mirrors the old .yarnrc.yml `nodeLinker: node-modules`), plus `frozen-lockfile=true`. - sample package.json: `@shopify/checkout-sheet-kit` now uses `workspace:*` instead of `link:../modules/...` (the pnpm-native equivalent). - Rewrite root scripts: `yarn workspace <name>` -> `pnpm --filter <name>`. - Swap `yarn` for `pnpm` across dev.yml, setup action, scripts, and CONTRIBUTING.md. README keeps yarn/npm install hints for end users installing the published package. - dev.yml: node task uses `package_manager: pnpm@10.28.0` instead of `yarn: 1.22.22`. - Setup action: drop the custom yarn cache, add `pnpm/action-setup` and use `cache: pnpm` on setup-node. Drop the `npm install -g npm@11` workaround since pnpm handles it. - Cocoapods cache key now hashes pnpm-lock.yaml. Workflow file changes (ci.yml, publish.yml) are excluded from this commit because the GitHub App doesn't have the `workflows` permission on this repo. See the PR body for a patch to apply. Requested by Kieran Osgood <kieran.osgood@shopify.com>
1 parent 8dbd066 commit f2501e7

18 files changed

Lines changed: 10341 additions & 14657 deletions

File tree

.github/actions/install-cocoapods/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717
with:
1818
path: |
1919
sample/ios/Pods
20-
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') }}
20+
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') }}
2121

2222
- name: Install cocoapods
2323
shell: bash

.github/actions/setup/action.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ description: Setup Node.js and install dependencies
44
runs:
55
using: composite
66
steps:
7+
- name: Install pnpm
8+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
9+
with:
10+
version: 10.28.0
11+
712
- name: Setup Node.js
813
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
914
with:
1015
node-version: 22.22.1
1116
registry-url: 'https://registry.npmjs.org'
12-
13-
# TODO: Can be removed once node-version is 24 as this will be the minimum
14-
- name: Install npm 11
15-
run: npm install -g npm@11
16-
shell: bash
17+
cache: pnpm
1718

1819
- name: Cache turbo build setup
1920
uses: actions/cache@v4
@@ -23,20 +24,6 @@ runs:
2324
restore-keys: |
2425
${{ runner.os }}-turbo-
2526
26-
- name: Cache dependencies
27-
id: yarn-cache
28-
uses: actions/cache@v4
29-
with:
30-
path: |
31-
**/node_modules
32-
.yarn/install-state.gz
33-
key:
34-
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
35-
restore-keys: |
36-
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
37-
${{ runner.os }}-yarn-
38-
3927
- name: Install dependencies
40-
if: steps.yarn-cache.outputs.cache-hit != 'true'
41-
run: yarn install --immutable
28+
run: pnpm install --frozen-lockfile
4229
shell: bash

.gitignore

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ upload-keystore.jks
4444
node_modules/
4545
npm-debug.log
4646
yarn-error.log
47-
.yarn/install-state.gz
47+
pnpm-debug.log
4848

4949
# fastlane
5050
#
@@ -97,14 +97,6 @@ modules/@shopify/checkout-sheet-kit/android/gradlew.bat
9797
# Local gems
9898
sample/vendor
9999

100-
# Yarn
101-
.yarn/*
102-
!.yarn/patches
103-
!.yarn/plugins
104-
!.yarn/releases
105-
!.yarn/sdks
106-
!.yarn/versions
107-
108100
# Sample app
109101
sample/**/AndroidManifest.xml
110102

.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

.yarn/releases/yarn-4.4.1.cjs

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

.yarnrc.yml

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

CONTRIBUTING.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ see [guidelines and instructions](.github/CONTRIBUTING.md).
55

66
---
77

8-
This repo is subdivided into 3 parts using yarn workspaces:
8+
This repo is subdivided into 3 parts using pnpm workspaces:
99

1010
- The base repo (workspace name = `checkout-sheet-kit-react-native`)
1111
- The `@shopify/checkout-sheet-kit` Native Module (workspace name = `module`)
@@ -21,33 +21,33 @@ If you've cloned the repo and want to run the sample app, you will first need to
2121
1. Install the NPM dependencies
2222

2323
```sh
24-
yarn
24+
pnpm install
2525
```
2626

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

2929
```sh
30-
yarn pod-install sample/ios
30+
pnpm pod-install sample/ios
3131
```
3232

3333
3. Build the Native Module
3434

3535
```sh
36-
yarn module build
36+
pnpm module build
3737
```
3838

3939
4. Start the Metro server
4040

4141
```sh
42-
yarn sample start
42+
pnpm sample start
4343
```
4444

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

4747
```sh
48-
yarn sample ios
48+
pnpm sample ios
4949
# or
50-
yarn sample android
50+
pnpm sample android
5151
```
5252

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

6969
```sh
7070
# Disable sccache for a single build
71-
SCCACHE=false yarn sample ios
72-
SCCACHE=false yarn sample android
71+
SCCACHE=false pnpm sample ios
72+
SCCACHE=false pnpm sample android
7373
```
7474

7575
## Making changes to the Native Module
@@ -80,23 +80,23 @@ observe your changes in the sample app. This is because the sample app is
8080
importing the TS files directly from the module directory (through symlinking).
8181

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

8585
## Cleaning the workspaces
8686

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

8989
```sh
9090
# Clear the current directory from watchman
91-
yarn clean
91+
pnpm clean
9292

9393
# Removes the "sample/node_modules" directory
9494
# Removes "ios/pods" directory
9595
# Removes "ios/build" directory
96-
yarn sample clean
96+
pnpm sample clean
9797

9898
# Removes the "lib" directory for the Native Module
99-
yarn module clean
99+
pnpm module clean
100100
```
101101

102102
## Linting the code
@@ -106,10 +106,10 @@ eslint over the source code.
106106

107107
```sh
108108
# Lint the Native Module TS code
109-
yarn module lint
109+
pnpm module lint
110110

111111
# Lint the Sample App TS code
112-
yarn sample lint
112+
pnpm sample lint
113113
```
114114

115115
## Testing
@@ -119,13 +119,13 @@ testing the Native Module.
119119

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

124124
# Run swift tests for the Native Module
125-
yarn sample test:ios
125+
pnpm sample test:ios
126126

127127
# Run Java tests for the Native Module
128-
yarn sample test:android
128+
pnpm sample test:android
129129
```
130130

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

138138
```sh
139-
yarn
139+
pnpm install
140140
```
141141

142142
### Install Cocoapods
143143

144144
```sh
145-
yarn pod-install sample/ios
145+
pnpm pod-install sample/ios
146146
```
147147

148148
### Build the local module
149149

150150
```sh
151-
yarn module build
151+
pnpm module build
152152
```
153153

154154
### Update the dotenv file
@@ -166,5 +166,5 @@ STOREFRONT_VERSION="2025-07"
166166
### Start the sample app
167167

168168
```sh
169-
yarn sample start
169+
pnpm sample start
170170
```

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ application:
8080
Install the Shopify Checkout Kit package dependency:
8181

8282
```sh
83+
pnpm add @shopify/checkout-sheet-kit
84+
85+
# or using yarn
8386
yarn add @shopify/checkout-sheet-kit
8487

8588
# or using npm

dev.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ up:
1717
architecture_variant: arm64
1818
- node:
1919
version: v22.14.0
20-
yarn: 1.22.22
20+
package_manager: pnpm@10.28.0
2121
- custom:
2222
name: Install NPM dependencies
2323
met?: ls -l | grep node_modules
2424
meet: |
25-
yarn
25+
pnpm install
2626
- custom:
2727
name: Install gems
2828
met?: (cd sample/ios && bundle check)
@@ -32,37 +32,37 @@ up:
3232
name: Install pods
3333
met?: (cd sample/ios && bundle exec pod check --ignore-dev-pods)
3434
meet: |
35-
yarn pod-install
35+
pnpm run pod-install
3636
- custom:
3737
name: Build node module
3838
met?: (cd modules/@shopify/checkout-sheet-kit && ls -l | grep lib)
3939
meet: |
40-
yarn module build
40+
pnpm module build
4141
4242
check:
4343
lint_swift: ./scripts/lint_swift
44-
lint_module: yarn module lint
45-
lint_sample: yarn sample lint
44+
lint_module: pnpm module lint
45+
lint_sample: pnpm sample lint
4646

4747
commands:
4848
server:
4949
desc: 'Start development server'
50-
run: yarn sample start --reset-cache
50+
run: pnpm sample start --reset-cache
5151

5252
ios:
5353
desc: 'Run iOS simulator'
54-
run: yarn sample ios
54+
run: pnpm sample ios
5555

5656
android:
5757
desc: 'Run Android emulator'
58-
run: yarn sample android
58+
run: pnpm sample android
5959

6060
clean:
6161
desc: 'rm -rf all generated directories'
6262
run: |
63-
yarn module clean
64-
yarn sample clean
65-
yarn clean
63+
pnpm module clean
64+
pnpm sample clean
65+
pnpm clean
6666
if command -v sccache >/dev/null 2>&1; then
6767
sccache --stop-server 2>/dev/null || true
6868
fi

modules/@shopify/checkout-sheet-kit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"scripts": {
2020
"clean": "rm -rf lib",
2121
"build": "bob build",
22-
"lint": "yarn typecheck && eslint src",
22+
"lint": "pnpm run typecheck && eslint src",
2323
"typecheck": "tsc --noEmit"
2424
},
2525
"files": [

0 commit comments

Comments
 (0)