Skip to content

Commit d2bd63c

Browse files
myersgsimone
andauthored
chore: migrate from yarn to pnpm (#556)
Co-authored-by: Gianmarco <[email protected]>
1 parent 648a217 commit d2bd63c

File tree

7 files changed

+20329
-20649
lines changed

7 files changed

+20329
-20649
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- '.github/**'
66
- 'packages/**'
77
- 'package.json'
8-
- 'yarn.lock'
8+
- 'pnpm-lock.yaml'
99
- '!demo/**'
1010
- '!docs/**'
1111
- '!**.md'
@@ -24,44 +24,37 @@ jobs:
2424
with:
2525
node-version: '18'
2626

27-
- name: Get yarn cache directory path
28-
id: yarn-cache-dir-path
29-
run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
30-
31-
- name: Cache Yarn dependencies
27+
- name: Cache pnpm modules
3228
uses: actions/cache@v3
33-
id: yarn-cache
3429
with:
35-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
36-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
30+
path: ~/.pnpm-store
31+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
3732
restore-keys: |
38-
${{ runner.os }}-yarn-
33+
${{ runner.os }}-pnpm-
3934
40-
- name: Install dependencies
41-
run: yarn --silent
35+
- uses: pnpm/[email protected]
36+
with:
37+
version: 7.25.0
38+
run_install: true
4239

4340
- name: Check types
44-
run: yarn tsc
41+
run: pnpm tsc
4542

4643
- name: Check formatting
47-
run: yarn prettier
44+
run: pnpm prettier
4845

4946
- name: Lint files
50-
run: yarn lint:full
51-
52-
# TODO: this was blocking release #539
53-
# - name: Cache Yarn build output
54-
# uses: actions/cache@v3
55-
# id: yarn-build-cache
56-
# with:
57-
# path: packages/**/dist
58-
# key: ${{ runner.os }}-yarn-build-${{ hashFiles('packages/') }}
59-
# restore-keys: |
60-
# ${{ runner.os }}-yarn-build-
47+
run: pnpm lint:full
6148

62-
- name: Yarn build (if no cache hit)
63-
# if: steps.yarn-build-cache.outputs.cache-hit != 'true'
64-
run: yarn build
49+
- uses: actions/cache@v3
50+
name: Setup pnpm build cache
51+
id: pnpm-build-cache
52+
with:
53+
path: packages/**/dist
54+
key: ${{ runner.os }}-pnpm-build-${{ hashFiles('/packages/**/*') }}
55+
restore-keys: |
56+
${{ runner.os }}-pnpm-build-
6557
66-
# - name: Cypress run
67-
# run: yarn ci:test
58+
- name: Build without cache
59+
if: steps.pnpm-build-cache.outputs.cache-hit != 'true'
60+
run: pnpm build

.github/workflows/release.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,25 @@ jobs:
2525
with:
2626
node-version: '18'
2727

28-
- name: Get yarn cache directory path
29-
id: yarn-cache-dir-path
30-
run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
31-
32-
- name: Cache Yarn dependencies
28+
- name: Cache pnpm modules
3329
uses: actions/cache@v3
34-
id: yarn-cache
3530
with:
36-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
37-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
31+
path: ~/.pnpm-store
32+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
3833
restore-keys: |
39-
${{ runner.os }}-yarn-
34+
${{ runner.os }}-pnpm-
4035
41-
- name: Install dependencies
42-
run: yarn install --silent
36+
- uses: pnpm/[email protected]
37+
with:
38+
version: 7.25.0
39+
run_install: true
4340

4441
- name: Create Release Pull Request or Publish to npm
4542
id: changesets
4643
uses: changesets/action@v1
4744
with:
48-
version: yarn ci:version
49-
publish: yarn ci:release
45+
version: pnpm ci:version
46+
publish: pnpm ci:publish
5047
commit: 'chore(release): update monorepo packages versions'
5148
title: 'Upcoming Release Changes'
5249
env:

demo/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@
88
"serve": "vite preview"
99
},
1010
"dependencies": {
11+
"@leva-ui/plugin-bezier": "workspace:*",
12+
"@leva-ui/plugin-dates": "workspace:*",
13+
"@leva-ui/plugin-plot": "workspace:*",
14+
"@leva-ui/plugin-spring": "workspace:*",
1115
"@radix-ui/react-icons": "^1.0.3",
1216
"@react-three/drei": "^8.8.3",
1317
"@react-three/fiber": "^7.0.26",
1418
"@stitches/react": "1.2.8",
15-
"leva": "*",
19+
"@use-gesture/react": "^10.0.0",
20+
"leva": "workspace:*",
1621
"noisejs": "^2.1.0",
1722
"react": "^18.0.0",
1823
"react-dom": "^18.0.0",
24+
"react-dropzone": "^12.0.0",
1925
"react-use": "^17.3.2",
2026
"three": "^0.143.0",
2127
"wouter": "^2.7.5"

package.json

Lines changed: 43 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,31 @@
33
"version": "0.0.1",
44
"license": "MIT",
55
"private": true,
6-
"workspaces": [
7-
"packages/*",
8-
"demo"
9-
],
106
"preconstruct": {
117
"packages": [
128
"packages/*"
139
]
1410
},
1511
"scripts": {
16-
"postinstall": "husky install && preconstruct dev",
12+
"postinstall": "preconstruct dev",
1713
"build": "preconstruct build",
1814
"watch": "preconstruct watch",
1915
"dev": "preconstruct dev",
2016
"lint": "pretty-quick --staged",
2117
"lint:full": "eslint packages/*/src",
22-
"ci:version": "yarn changeset version",
23-
"ci:release": "yarn build && yarn changeset publish",
18+
"ci:version": "pnpm changeset version && pnpm --filter \"leva\" --filter \"@leva-ui/*\" install --lockfile-only",
19+
"ci:publish": "pnpm build && pnpm changeset publish",
2420
"validate": "preconstruct validate",
2521
"tsc": "tsc --noEmit",
26-
"size": "yarn build && size-limit",
22+
"size": "size-limit",
2723
"storybook": "start-storybook -p 6006",
2824
"build-storybook": "build-storybook --quiet",
2925
"cypress:open": "cypress open",
3026
"cypress:run": "cypress run",
31-
"demo:dev": "yarn workspace demo dev",
32-
"demo:build": "yarn workspace demo build",
33-
"demo:serve": "yarn workspace demo serve",
34-
"ci:test": "yarn demo:build && start-server-and-test demo:serve http-get://localhost:5000 cypress:run",
35-
"prepare": "husky install",
27+
"demo:dev": "pnpm --filter demo run dev",
28+
"demo:build": "pnpm --filter demo run build",
29+
"demo:serve": "pnpm --filter demo run serve",
30+
"ci:test": "pnpm demo:build && start-server-and-test demo:serve http-get://localhost:5000 cypress:run",
3631
"prettier": "prettier --check ."
3732
},
3833
"size-limit": [
@@ -57,52 +52,48 @@
5752
"url": "https://github.com/pmndrs/leva.git"
5853
},
5954
"bugs": "https://github.com/pmndrs/leva/issues",
60-
"peerDependencies": {
61-
"react": "^18.0.0 || ^19.0.0",
62-
"react-dom": "^18.0.0 || ^19.0.0"
63-
},
6455
"devDependencies": {
65-
"@babel/core": "^7.17.0",
66-
"@babel/preset-env": "^7.16.5",
67-
"@babel/preset-react": "^7.16.5",
68-
"@babel/preset-typescript": "^7.16.5",
69-
"@changesets/cli": "^2.18.1",
70-
"@emotion/react": "^11.7.1",
71-
"@preconstruct/cli": "^2.1.5",
72-
"@radix-ui/react-icons": "^1.0.3",
73-
"@size-limit/preset-big-lib": "^11.0.0",
74-
"@storybook/addon-actions": "^6.4.18",
75-
"@storybook/addon-essentials": "^6.4.18",
76-
"@storybook/addon-links": "^6.4.18",
77-
"@storybook/addon-storysource": "^6.4.18",
78-
"@storybook/react": "^6.4.18",
56+
"@babel/core": "^7.20.12",
57+
"@babel/preset-env": "^7.20.2",
58+
"@babel/preset-react": "^7.18.6",
59+
"@babel/preset-typescript": "^7.18.6",
60+
"@changesets/cli": "^2.26.0",
61+
"@emotion/react": "^11.10.5",
62+
"@preconstruct/cli": "^2.3.0",
63+
"@radix-ui/react-icons": "^1.1.1",
64+
"@size-limit/preset-big-lib": "^8.1.0",
65+
"@storybook/addon-actions": "^6.5.15",
66+
"@storybook/addon-essentials": "^6.5.15",
67+
"@storybook/addon-links": "^6.5.15",
68+
"@storybook/addon-storysource": "^6.5.15",
69+
"@storybook/react": "^6.5.15",
7970
"@testing-library/cypress": "^8.0.2",
80-
"@types/react": "^18.0.0",
81-
"@types/react-dom": "^18.0.0",
82-
"@typescript-eslint/eslint-plugin": "^5.10.2",
83-
"@typescript-eslint/parser": "^5.10.2",
84-
"all-contributors-cli": "^6.20.0",
85-
"babel-eslint": "^10.1.0",
71+
"@types/node": "^18.11.18",
72+
"@types/react": "^18.0.26",
73+
"@types/react-dom": "^18.0.10",
74+
"@typescript-eslint/eslint-plugin": "^5.48.2",
75+
"@typescript-eslint/parser": "^5.48.2",
76+
"@welldone-software/why-did-you-render": "^7.0.1",
77+
"all-contributors-cli": "^6.24.0",
8678
"cypress": "6.9.1",
87-
"eslint": "^8.8.0",
88-
"eslint-config-react-app": "^7.0.0",
79+
"eslint": "^8.32.0",
80+
"eslint-config-react-app": "^7.0.1",
8981
"eslint-plugin-cypress": "^2.12.1",
9082
"eslint-plugin-flowtype": "^8.0.3",
91-
"eslint-plugin-import": "^2.25.4",
92-
"eslint-plugin-jsx-a11y": "^6.5.1",
93-
"eslint-plugin-react": "^7.28.0",
94-
"eslint-plugin-react-hooks": "^4.3.0",
95-
"husky": "^7.0.4",
96-
"patch-package": "^6.4.7",
97-
"postinstall-postinstall": "^2.1.0",
98-
"prettier": "^2.5.1",
83+
"eslint-plugin-import": "^2.27.5",
84+
"eslint-plugin-jsx-a11y": "^6.7.1",
85+
"eslint-plugin-react": "^7.32.1",
86+
"eslint-plugin-react-hooks": "^4.6.0",
87+
"husky": "^8.0.3",
88+
"pnpm": "^7.25.0",
89+
"prettier": "^2.8.3",
9990
"pretty-quick": "^3.1.3",
100-
"react": "^18.0.0",
101-
"react-dom": "^18.0.0",
91+
"react": "^18.2.0",
92+
"react-dom": "^18.2.0",
10293
"size-limit": "^8.1.0",
103-
"start-server-and-test": "^1.14.0",
104-
"tsd": "^0.19.1",
105-
"typescript": "4.5.5"
94+
"start-server-and-test": "^1.15.2",
95+
"tsd": "^0.25.0",
96+
"typescript": "^4.9.4"
10697
},
10798
"prettier": {
10899
"bracketSameLine": true,

0 commit comments

Comments
 (0)