Skip to content

Commit 12afb2e

Browse files
Migrate to pnpm (#11358)
1 parent c7dd3d3 commit 12afb2e

File tree

25 files changed

+10920
-10527
lines changed

25 files changed

+10920
-10527
lines changed

.changeset/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
"access": "public",
1818
"baseBranch": "dev",
1919
"updateInternalDependencies": "patch",
20+
"bumpVersionsWithWorkspaceProtocolOnly": true,
2021
"ignore": []
2122
}

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/fixtures/
22
node_modules/
3+
pnpm-lock.yaml
34
/docs/api
45
examples/**/dist/
56
packages/**/dist/

.github/workflows/deduplicate-yarn.yml renamed to .github/workflows/deduplicate-lock-file.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: ⚙️ Deduplicate yarn.lock
1+
name: ⚙️ Deduplicate lock file
22

33
on:
44
push:
55
branches:
66
- dev
77
paths:
8-
- ./yarn.lock
8+
- ./pnpm-lock.yaml
99

1010
concurrency:
1111
group: ${{ github.workflow }}-${{ github.ref }}
@@ -20,14 +20,17 @@ jobs:
2020
- name: ⬇️ Checkout repo
2121
uses: actions/checkout@v4
2222

23+
- name: 📦 Setup pnpm
24+
uses: pnpm/[email protected]
25+
2326
- name: ⎔ Setup node
2427
uses: actions/setup-node@v4
2528
with:
2629
node-version-file: ".nvmrc"
27-
cache: "yarn"
30+
cache: "pnpm"
2831

29-
- name: ⚙️ Dedupe yarn.lock
30-
run: npx yarn-deduplicate && rm -rf ./node_modules && yarn
32+
- name: ⚙️ Dedupe lock file
33+
run: pnpm dedupe && rm -rf ./node_modules && pnpm install
3134

3235
- name: 💪 Commit
3336
run: |
@@ -38,6 +41,6 @@ jobs:
3841
echo "💿 no deduplication needed"
3942
exit 0
4043
fi
41-
git commit -m "chore: deduplicate `yarn.lock`"
44+
git commit -m "chore: deduplicate `pnpm-lock.yaml`"
4245
git push
4346
echo "💿 https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"

.github/workflows/format.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,23 @@ jobs:
2121
with:
2222
token: ${{ secrets.FORMAT_PAT }}
2323

24+
- name: 📦 Setup pnpm
25+
uses: pnpm/[email protected]
26+
2427
- name: ⎔ Setup node
2528
uses: actions/setup-node@v4
2629
with:
27-
cache: yarn
30+
cache: pnpm
2831
node-version-file: ".nvmrc"
2932

3033
- name: 📥 Install deps
31-
run: yarn --frozen-lockfile
34+
run: pnpm install --frozen-lockfile
3235

3336
- name: 🔃 Sort contributors.yml
3437
run: sort --ignore-case --output contributors.yml contributors.yml
3538

3639
- name: 👔 Format
37-
run: yarn format
40+
run: pnpm format
3841

3942
- name: 💪 Commit
4043
run: |

.github/workflows/release-experimental.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,25 @@ jobs:
2222
with:
2323
fetch-depth: 0
2424

25+
- name: 📦 Setup pnpm
26+
uses: pnpm/[email protected]
27+
2528
- name: ⎔ Setup node
2629
uses: actions/setup-node@v4
2730
with:
28-
cache: yarn
31+
cache: pnpm
2932
node-version-file: ".nvmrc"
3033

3134
- name: 📥 Install deps
32-
run: yarn --frozen-lockfile
35+
run: pnpm install --frozen-lockfile
3336

3437
- name: 🏗 Build
35-
run: yarn build
38+
run: pnpm build
3639

3740
- name: 🔐 Setup npm auth
3841
run: |
3942
echo "registry=https://registry.npmjs.org" >> ~/.npmrc
4043
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
4144
4245
- name: 🚀 Publish
43-
run: npm run publish
46+
run: pnpm run publish

.github/workflows/release.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ jobs:
2727
with:
2828
fetch-depth: 0
2929

30+
- name: 📦 Setup pnpm
31+
uses: pnpm/[email protected]
32+
3033
- name: ⎔ Setup node
3134
uses: actions/setup-node@v4
3235
with:
3336
node-version-file: ".nvmrc"
34-
cache: "yarn"
37+
cache: "pnpm"
3538

3639
- name: 📥 Install deps
37-
run: yarn --frozen-lockfile
40+
run: pnpm install --frozen-lockfile
3841

3942
- name: 🔐 Setup npm auth
4043
run: |
@@ -50,10 +53,10 @@ jobs:
5053
id: changesets
5154
uses: changesets/action@v1
5255
with:
53-
version: yarn run version
56+
version: pnpm run version
5457
commit: "chore: Update version for release"
5558
title: "chore: Update version for release"
56-
publish: yarn run release
59+
publish: pnpm run release
5760
createGithubReleases: false
5861
env:
5962
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -70,11 +73,14 @@ jobs:
7073
- name: ⬇️ Checkout repo
7174
uses: actions/checkout@v4
7275

76+
- name: 📦 Setup pnpm
77+
uses: pnpm/[email protected]
78+
7379
- name: ⎔ Setup node
7480
uses: actions/setup-node@v4
7581
with:
7682
node-version: 16
77-
cache: "npm"
83+
cache: "pnpm"
7884

7985
- id: find_package_version
8086
run: |

.github/workflows/test.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ jobs:
3535
- name: ⬇️ Checkout repo
3636
uses: actions/checkout@v4
3737

38+
- name: 📦 Setup pnpm
39+
uses: pnpm/[email protected]
40+
3841
- name: ⎔ Setup node
3942
uses: actions/setup-node@v4
4043
with:
41-
cache: yarn
44+
cache: pnpm
4245
check-latest: true
4346
node-version: ${{ matrix.node }}
4447

@@ -49,16 +52,16 @@ jobs:
4952
echo "::remove-matcher owner=eslint-stylish::"
5053
5154
- name: 📥 Install deps
52-
run: yarn --frozen-lockfile
55+
run: pnpm install --frozen-lockfile
5356

5457
- name: 🏗 Build
55-
run: yarn build
58+
run: pnpm build
5659

5760
- name: 🔬 Lint
58-
run: yarn lint
61+
run: pnpm lint
5962

6063
- name: 🧪 Run tests
61-
run: yarn test
64+
run: pnpm test
6265

6366
- name: Check bundle size
64-
run: yarn size
67+
run: pnpm size

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ npm-debug.log
66
node_modules/
77

88
/examples/*/yarn.lock
9+
/examples/*/pnpm-lock.yaml
910
/examples/*/dist
1011
/tutorial/dist
1112

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignore-workspace-cycles=true
2+
enable-pre-post-scripts=true

DEVELOPMENT.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Changesets will do most of the heavy lifting for our releases. When changes are
1616
### Starting a new pre-release
1717

1818
- Ensure you are on the new `release-*` branch.
19-
- Enter Changesets pre-release mode using the `pre` tag: `yarn changeset pre enter pre`.
19+
- Enter Changesets pre-release mode using the `pre` tag: `pnpm changeset pre enter pre`.
2020
- Commit the change and push the `release-*` branch to GitHub.
2121
- Wait for the release workflow to finish. The Changesets action in the workflow will open a PR that will increment all versions and generate the changelogs.
2222
- Review the updated `CHANGELOG` files and make any adjustments necessary, then merge the PR into the `release-*` branch.
@@ -32,7 +32,7 @@ Changesets will do most of the heavy lifting for our releases. When changes are
3232
You may need to make changes to a pre-release prior to publishing a final stable release. To do so:
3333

3434
- Make whatever changes you need.
35-
- Create a new changeset: `yarn changeset`.
35+
- Create a new changeset: `pnpm changeset`.
3636
- **IMPORTANT:** This is required even if you ultimately don't want to include these changes in the logs. Remember, changelogs can be edited prior to publishing, but the Changeset version script needs to see new changesets in order to create a new version.
3737
- Commit the changesets and push the `release-*` branch to GitHub.
3838
- Wait for the release workflow to finish and the Changesets action to open its PR that will increment all versions.
@@ -42,7 +42,7 @@ You may need to make changes to a pre-release prior to publishing a final stable
4242

4343
### Publishing the stable release
4444

45-
- Exit Changesets pre-release mode: `yarn changeset pre exit`.
45+
- Exit Changesets pre-release mode: `pnpm changeset pre exit`.
4646
- Commit the edited pre-release file along with any unpublished changesets, and push the `release-*` branch to GitHub.
4747
- Wait for the release workflow to finish. The Changesets action in the workflow will open a PR that will increment all versions and generate the changelogs for the stable release.
4848
- Review the updated `CHANGELOG` files and make any adjustments necessary.
@@ -71,6 +71,6 @@ Experimental releases and hot-fixes do not need to be branched off of `dev`. Exp
7171

7272
- Create a new branch for the release: `git checkout -b release-experimental`
7373
- Make whatever changes you need and commit them: `git add . && git commit "experimental changes!"`
74-
- Update version numbers and create a release tag: `yarn run version:experimental`
74+
- Update version numbers and create a release tag: `pnpm run version:experimental`
7575
- Push to GitHub: `git push origin --follow-tags`
7676
- The CI workflow should automatically trigger from the experimental tag to publish the release to npm

0 commit comments

Comments
 (0)