Skip to content

Commit 6d848f4

Browse files
authored
chore: switch from npm to pnpm (RetroAchievements#2794)
1 parent 42867ed commit 6d848f4

File tree

9 files changed

+8163
-11845
lines changed

9 files changed

+8163
-11845
lines changed

.github/workflows/ci.yml

+21-6
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,19 @@ jobs:
6969
steps:
7070
- name: Checkout code
7171
uses: actions/checkout@v4
72+
- name: Install pnpm
73+
uses: pnpm/action-setup@v4
74+
with:
75+
version: 9
7276
- name: Use Node 20
7377
uses: actions/setup-node@v4
7478
with:
7579
node-version: '20'
80+
cache: 'pnpm'
7681
- name: Install
77-
run: npm install
82+
run: pnpm i
7883
- name: Type check
79-
run: npm run tsc
84+
run: pnpm tsc
8085

8186
eslint:
8287
runs-on: ubuntu-22.04
@@ -86,14 +91,19 @@ jobs:
8691
steps:
8792
- name: Checkout code
8893
uses: actions/checkout@v4
94+
- name: Install pnpm
95+
uses: pnpm/action-setup@v4
96+
with:
97+
version: 9
8998
- name: Use Node 20
9099
uses: actions/setup-node@v4
91100
with:
92101
node-version: '20'
102+
cache: 'pnpm'
93103
- name: Install
94-
run: npm install
104+
run: pnpm i
95105
- name: Lint
96-
run: npm run lint
106+
run: pnpm lint
97107

98108
vitest:
99109
runs-on: ubuntu-22.04
@@ -103,14 +113,19 @@ jobs:
103113
steps:
104114
- name: Checkout code
105115
uses: actions/checkout@v4
116+
- name: Install pnpm
117+
uses: pnpm/action-setup@v4
118+
with:
119+
version: 9
106120
- name: Use Node 20
107121
uses: actions/setup-node@v4
108122
with:
109123
node-version: '20'
124+
cache: 'pnpm'
110125
- name: Install
111-
run: npm install
126+
run: pnpm i
112127
- name: Test
113-
run: npm run test
128+
run: pnpm test
114129
env:
115130
VITE_BUILD_PATH: dist
116131
APP_URL: https://raweb.test

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
/tmp
2929
/.fleet
3030
/.idea
31+
/.pnpm-store
3132
/.project
3233
/.settings
3334
/.vscode

.hooks/post-merge

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
php composer.phar install
6-
npm install
7-
npm run build
6+
pnpm install
7+
pnpm build
88

99
printf "\n✅ post-merge OK\n\n"

.hooks/pre-push

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ vendor/bin/pint --test
88
printf "\n⏳ composer analyse\n"
99
vendor/bin/phpstan analyse --memory-limit 512M
1010

11-
printf "\n⏳ npm run lint:eslint\n"
12-
npm run lint:eslint
11+
printf "\n⏳ pnpm lint:eslint\n"
12+
pnpm lint:eslint
1313

14-
printf "\n⏳ npm run tsc\n"
15-
npm run tsc
14+
printf "\n⏳ pnpm tsc\n"
15+
pnpm tsc
1616

17-
printf "\n⏳ npm run test\n"
18-
npm run test
17+
printf "\n⏳ pnpm test\n"
18+
pnpm test
1919

2020
# Check the OS. Windows does not support the --parallel flag.
2121
if [ "$(uname)" = "Linux" ] || [ "$(uname)" = "Darwin" ]; then

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ It is a Laravel application ([TALL stack](https://tallstack.dev/)).
1010
- [Composer](https://getcomposer.org/) PHP dependency manager
1111
- [MariaDB 10](https://mariadb.com/docs/server/)
1212
- [Node.js 20](https://nodejs.org/)
13+
- [pnpm 9](https://pnpm.io/)
1314

1415
Validated to run on Windows, macOS, and Linux with any of the setup options below (Docker via Laravel Sail, VM with either nginx or Apache, Laravel Valet on macOS).
1516

@@ -131,11 +132,11 @@ AWS_MINIO=true
131132
### Build frontend assets
132133

133134
```shell
134-
npm install
135-
npm run build
135+
pnpm install
136+
pnpm build
136137
# Using Sail:
137-
sail npm install
138-
sail npm run build
138+
sail pnpm install
139+
sail pnpm build
139140
```
140141

141142
### Create filesystem symlinks

docs/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Before submitting a pull request:
3636

3737
- Follow **[PSR-12 Coding Standard](https://www.php-fig.org/psr/psr-12/)**. Run `composer fix` to fix most code style issues automatically.
3838

39-
- Ensure ESLint rules are followed. Run `npm run fix` to fix most code style issues automatically.
39+
- Ensure ESLint rules are followed. Run `pnpm fix` to fix most code style issues automatically.
4040

4141
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
4242

0 commit comments

Comments
 (0)