Skip to content

Commit 929aaf2

Browse files
committed
chore: upgrade from yarn 1.22 to yarn 4.16 (Berry)
- packageManager: yarn@4.16.0 + .yarn/releases/yarn-4.16.0.cjs (no corepack dependency for users) - .yarnrc.yml: nodeLinker=node-modules (keep classic install), enableScripts=true - yarn.lock regenerated in Berry format - Husky pre-commit now uses "yarn install --mode=update-lockfile" (Berry-only equivalent of npm install --package-lock-only; refreshes lockfile in standalone mode without triggering postinstall or full install) - CI: replace "--frozen-lockfile" with "--immutable" (Berry syntax) and add "corepack enable" step - package.json: replace shell backticks with $(...) in test script (Yarn 4 shell does not expand backticks the same way Yarn 1 did) - .gitignore: track only .yarn/releases, .yarn/plugins etc.; ignore the rest
1 parent b99c502 commit 929aaf2

8 files changed

Lines changed: 10896 additions & 7233 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
with:
2121
node-version: '20'
2222
registry-url: 'https://registry.npmjs.org'
23-
cache: 'yarn'
2423

25-
- run: yarn install --frozen-lockfile
24+
- run: corepack enable
25+
- run: yarn install --immutable
2626
- run: yarn run lint --if-present
2727
- run: yarn run build --if-present
2828
- run: yarn test --if-present

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
uses: actions/setup-node@v4
1919
with:
2020
node-version: ${{ matrix.node-version }}
21-
cache: 'yarn'
22-
- run: yarn install --frozen-lockfile
21+
- run: corepack enable
22+
- run: yarn install --immutable
2323
- run: yarn run build
2424
- run: yarn test
2525
env:

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@ old
1212
silex/
1313
dist/
1414
.env
15+
16+
# Yarn 4 — only track .yarn/releases (the bundled yarn) + .yarn/plugins
17+
.yarn/*
18+
!.yarn/releases
19+
!.yarn/plugins
20+
!.yarn/patches
21+
!.yarn/sdks
22+
!.yarn/versions

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
yarn install --ignore-scripts
1+
yarn install --mode=update-lockfile
22
yarn run build
33
yarn run lint:fix
44
git update-index --again

.yarn/releases/yarn-4.16.0.cjs

Lines changed: 944 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
yarnPath: .yarn/releases/yarn-4.16.0.cjs
2+
3+
nodeLinker: node-modules
4+
enableScripts: true

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
"version:backwardcompat": "3.0.0",
66
"author": "Alex Hoyau (https://lexoyo.me/)",
77
"main": "dist/server/server/index.js",
8-
"bin": {
9-
"silex": "dist/server/server/cli.js"
10-
},
8+
"bin": "dist/server/server/cli.js",
119
"files": [
1210
"dist/",
1311
"src/",
@@ -93,7 +91,7 @@
9391
"build:plugins:client": "tsc -p tsconfig-plugins-client.json",
9492
"lint": "eslint \"src/ts/**/*.ts\"",
9593
"lint:fix": "yarn lint --fix",
96-
"test": "node --experimental-vm-modules `node_modules jest`/jest/bin/jest.js",
94+
"test": "node --experimental-vm-modules $(node_modules jest)/jest/bin/jest.js",
9795
"test:watch": "yarn test --watch",
9896
"prepare": "husky"
9997
},
@@ -141,8 +139,8 @@
141139
"html-minifier": "^4.0.0",
142140
"lit-html": "3.3.2",
143141
"mkdirp": "3.0.1",
144-
"node_modules-path": "2.4.0-canary.0",
145142
"node-fetch": "2.6.9",
143+
"node_modules-path": "2.4.0-canary.0",
146144
"normalize.css": "8.0.1",
147145
"npm-run-all": "^4.1.5",
148146
"object-path": "0.11.8",
@@ -219,5 +217,6 @@
219217
"bugs": {
220218
"url": "https://short.silex.me/community"
221219
},
222-
"homepage": "https://github.com/silexlabs/silex-lib#readme"
220+
"homepage": "https://github.com/silexlabs/silex-lib#readme",
221+
"packageManager": "yarn@4.16.0"
223222
}

yarn.lock

Lines changed: 9930 additions & 7222 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)