Skip to content

Commit d818b39

Browse files
committed
Migrate from yarn to pnpm #11465
Because yarn 1 has been obsolete for a long time. Yarn 4 workflow differs too much. pnpm offers delayed dependency update to protect against supply chain attack. pnpm is way more popular than Yarn. And Angular adopted pnpm themselves. See: - https://socket.dev/blog/pnpm-10-16-adds-new-setting-for-delayed-dependency-updates - https://npmtrends.com/@yarnpkg/cli-vs-@yarnpkg/cli-dist-vs-pnpm-vs-yarn - angular/angular@e7ac7f6
1 parent a5c0e5b commit d818b39

9 files changed

Lines changed: 9150 additions & 7193 deletions

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ jobs:
2424
with:
2525
fetch-depth: 2
2626

27+
- uses: pnpm/action-setup@v5
2728
- uses: actions/setup-node@v4
2829
with:
2930
node-version: '22'
31+
cache: 'pnpm'
3032

3133
- uses: shivammathur/setup-php@v2
3234
with:
@@ -41,12 +43,6 @@ jobs:
4143
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
4244
restore-keys: ${{ runner.os }}-composer-
4345

44-
- uses: actions/cache@v4
45-
with:
46-
path: ~/.cache/yarn
47-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
48-
restore-keys: ${{ runner.os }}-yarn-
49-
5046
- name: Setup problem matchers for PHP
5147
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
5248

@@ -63,6 +59,6 @@ jobs:
6359
- run: ./vendor/bin/php-cs-fixer fix --format=checkstyle | cs2pr
6460
- run: ./vendor/bin/phpstan analyse
6561
- run: ./vendor/bin/phpunit
66-
- run: yarn lint
62+
- run: pnpm lint
6763
- run: ./node_modules/.bin/prettier --experimental-cli --check .
6864
- run: ./node_modules/.bin/ng test --progress false --watch=false --browsers ChromeHeadlessCustom

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/htdocs/
1313
/logs/
1414
/node_modules/
15+
/pnpm-lock.yaml
1516
/server/
1617
/tests/
1718
/vendor/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ $ composer clear-config-cache
4646

4747
### Client
4848

49-
Run `yarn dev` for a dev server. Navigate to `http://my-ichtus.lan:4200/`. The app will
49+
Run `pnpm dev` for a dev server. Navigate to `http://my-ichtus.lan:4200/`. The app will
5050
automatically reload if you change any of the source files.
5151

5252
## Testing

angular.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
},
141141
"cli": {
142142
"schematicCollections": ["@angular-eslint/schematics"],
143-
"packageManager": "yarn",
143+
"packageManager": "pnpm",
144144
"analytics": false
145145
},
146146
"schematics": {

bin/build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ echo "Installing git hooks..."
6767
ln -fs ../../bin/pre-commit.sh .git/hooks/pre-commit
6868

6969
echo "Updating Node.js packages..."
70-
yarn install $NO_PROGRESS
70+
pnpm install
7171

7272
echo "Updating all PHP dependencies via composer..."
7373
$COMPOSER install --classmap-authoritative $NO_PROGRESS
@@ -84,8 +84,8 @@ $PHP ./bin/delete-old-log.php
8484

8585
if [ $IS_PRODUCTION -eq 1 ]; then
8686
echo "Building Angular application..."
87-
yarn run prod
87+
pnpm run prod
8888
else
8989
echo "Running Angular dev server..."
90-
yarn run dev
90+
pnpm run dev
9191
fi

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
"ng": "ng",
77
"client-config": "`which php8.4 || which php` ./bin/generate-client-configuration.php",
88
"postinstall": "playwright install chromium",
9-
"prerequisite": "mkdir -p htdocs/ && cp -v server/index.php htdocs/ && yarn client-config && yarn codegen",
10-
"dev": "yarn prerequisite && ng serve",
11-
"prod": "yarn prerequisite && ng build && find data/tmp/build/browser -type f -not -name '*.gz' -exec gzip --keep --best {} \\; && find htdocs -mindepth 1 -not -path 'htdocs/data*' -delete && cp -rv data/tmp/build/browser/* htdocs/",
12-
"test": "yarn prerequisite && ng test",
9+
"prerequisite": "mkdir -p htdocs/ && cp -v server/index.php htdocs/ && pnpm client-config && pnpm codegen",
10+
"dev": "pnpm prerequisite && ng serve",
11+
"prod": "pnpm prerequisite && ng build && find data/tmp/build/browser -type f -not -name '*.gz' -exec gzip --keep --best {} \\; && find htdocs -mindepth 1 -not -path 'htdocs/data*' -delete && cp -rv data/tmp/build/browser/* htdocs/",
12+
"test": "pnpm prerequisite && ng test",
1313
"lint": "ng lint --max-warnings 0",
1414
"e2e": "playwright test",
1515
"codegen": "./bin/dump-schema && graphql-codegen --config codegen.ts"
1616
},
17+
"packageManager": "pnpm@10.33.0",
1718
"dependencies": {
1819
"@angular/cdk": "^21.2.0",
1920
"@angular/common": "^21.2.0",

0 commit comments

Comments
 (0)