Skip to content

Commit 83edbc5

Browse files
Migrate from Yarn to pnpm (#469)
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> ### What changes are you making? <!-- Please describe why you are making these changes --> --- ### PR Checklist > [!IMPORTANT] > > - [ ] I've added tests to support my implementation > - [ ] I have read and agree with the [Contribution Guidelines](https://github.com/shopify/checkout-sheet-kit-react-native/blob/main/.github/CONTRIBUTING.md). > - [ ] I have read and agree with the [Code of Conduct](https://github.com/shopify/checkout-sheet-kit-react-native/blob/main/.github/CODE_OF_CONDUCT.md). > - [ ] I've updated the [README](https://github.com/shopify/checkout-sheet-kit-react-native). > > _Releasing a new version of the kit?_ > > - [ ] I have bumped the version number in the [`package.json` file](https://github.com/Shopify/checkout-sheet-kit-react-native/blob/main/modules/%40shopify/checkout-sheet-kit/package.json#L4). --- > [!TIP] > See the [Contributing documentation](https://github.com/shopify/checkout-sheet-kit-react-native/blob/main/.github/CONTRIBUTING.md#releasing-a-new-version) for instructions on how to publish a new version of the library.
1 parent 34e3e56 commit 83edbc5

25 files changed

Lines changed: 10502 additions & 14722 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: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@ description: Setup Node.js and install dependencies
44
runs:
55
using: composite
66
steps:
7+
# Versions are sourced from package.json:
8+
# - pnpm: `packageManager` field (read by pnpm/action-setup)
9+
# - node: `engines.node` field (read by setup-node via node-version-file)
10+
# Keep package.json as the single source of truth.
11+
- name: Install pnpm
12+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
13+
714
- name: Setup Node.js
815
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
916
with:
10-
node-version: 22.22.1
17+
node-version-file: package.json
1118
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
19+
cache: pnpm
1720

1821
- name: Cache turbo build setup
1922
uses: actions/cache@v4
@@ -23,20 +26,6 @@ runs:
2326
restore-keys: |
2427
${{ runner.os }}-turbo-
2528
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-
3929
- name: Install dependencies
40-
if: steps.yarn-cache.outputs.cache-hit != 'true'
41-
run: yarn install --immutable
30+
run: pnpm install --frozen-lockfile
4231
shell: bash

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ jobs:
3232
uses: ./.github/actions/setup
3333

3434
- run: |
35-
yarn module clean
36-
yarn module build
37-
yarn compare-snapshot
35+
pnpm module clean
36+
pnpm module build
37+
pnpm compare-snapshot
3838
3939
lint:
4040
name: Lint module + sample
@@ -52,9 +52,9 @@ jobs:
5252
uses: ./.github/actions/setup
5353

5454
- run: |
55-
yarn module build
56-
yarn module lint
57-
yarn sample lint
55+
pnpm module build
56+
pnpm module lint
57+
pnpm sample lint
5858
5959
test:
6060
name: Run jest tests
@@ -70,7 +70,7 @@ jobs:
7070
uses: ./.github/actions/setup
7171

7272
- run:
73-
yarn test --coverage
73+
pnpm test --coverage
7474
--testPathPatterns="modules/@shopify/checkout-sheet-kit/tests"
7575
--coverageReporters=json-summary
7676

@@ -111,8 +111,8 @@ jobs:
111111
java -version
112112
javac -version
113113
echo "STOREFRONT_DOMAIN=myshopify.com" > sample/.env
114-
yarn module build
115-
yarn sample test:android --no-daemon
114+
pnpm module build
115+
pnpm sample test:android --no-daemon
116116
117117
test-ios:
118118
name: Run Swift Tests
@@ -138,4 +138,4 @@ jobs:
138138

139139
- name: Run Swift tests
140140
run: |
141-
yarn sample test:ios
141+
pnpm sample test:ios

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ jobs:
3838
- name: Prepare release
3939
run: |
4040
cp README.md modules/@shopify/checkout-sheet-kit
41-
yarn module clean
42-
yarn module build
41+
pnpm module clean
42+
pnpm module build
4343
cd modules/@shopify/checkout-sheet-kit
4444
npm publish --access public --tag ${{ steps.npm-tag.outputs.tag }}
4545
env:

.gitignore

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ upload-keystore.jks
4242
# node.js
4343
#
4444
node_modules/
45+
.yarn/
4546
npm-debug.log
4647
yarn-error.log
47-
.yarn/install-state.gz
48+
pnpm-debug.log
4849

4950
# fastlane
5051
#
@@ -97,14 +98,6 @@ modules/@shopify/checkout-sheet-kit/android/gradlew.bat
9798
# Local gems
9899
sample/vendor
99100

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

.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

0 commit comments

Comments
 (0)