Skip to content

Commit 6ae3b5c

Browse files
chore: use corepack & yarn v4 (#515)
1 parent 4a5a3b3 commit 6ae3b5c

File tree

11 files changed

+3703
-3683
lines changed

11 files changed

+3703
-3683
lines changed

.devcontainer/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM mcr.microsoft.com/devcontainers/javascript-node:20
2+
3+
RUN corepack enable

.devcontainer/devcontainer.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "Node.js",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"customizations": {
7+
"vscode": {
8+
"extensions": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
9+
}
10+
},
11+
"onCreateCommand": "yarn install",
12+
"remoteUser": "node"
13+
}

.github/workflows/check.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ jobs:
55
runs-on: ubuntu-latest
66
steps:
77
- uses: actions/checkout@v4
8+
# waiting on: https://github.com/actions/setup-node/issues/531
9+
- run: corepack enable
810
- uses: actions/setup-node@v4
911
with:
1012
node-version: 20
11-
cache: 'npm'
13+
cache: 'yarn'
1214
- name: run eslint
1315
run: |
14-
npm ci
15-
npm run build
16-
npm run typecheck
17-
npm run lint:check
18-
npm run format:check
19-
npm run sync
20-
env:
21-
CI: true
16+
yarn install --immutable
17+
yarn build
18+
yarn typecheck
19+
yarn lint:check
20+
yarn format:check
21+
yarn sync

.github/workflows/publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ jobs:
3636
- uses: actions/checkout@v4
3737
with:
3838
fetch-depth: 0
39+
# waiting on: https://github.com/actions/setup-node/issues/531
40+
- run: corepack enable
3941
- uses: actions/setup-node@v4
4042
with:
4143
node-version: 20
4244
registry-url: 'https://registry.npmjs.org'
43-
cache: 'npm'
44-
- run: npm ci
45+
cache: 'yarn'
46+
- run: yarn install --immutable
4547
- env:
4648
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
49+
# yarn doesn't have an equivalent --provenance
4750
run: npm publish --provenance --access public

.github/workflows/sync.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ jobs:
1212
- uses: actions/checkout@v4
1313
with:
1414
ssh-key: ${{ secrets.ACTION_DEPLOY_KEY }}
15+
# waiting on: https://github.com/actions/setup-node/issues/531
16+
- run: corepack enable
1517
- uses: actions/setup-node@v4
1618
with:
1719
node-version: 20
18-
cache: 'npm'
19-
- run: npm ci
20-
- run: npm run sync
20+
cache: 'yarn'
21+
- run: yarn install --immutable
22+
- run: yarn sync
2123
- name: git config
2224
run: |
2325
git config --local user.name "GitHub Actions"

.github/workflows/test.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ jobs:
55
runs-on: ubuntu-latest
66
steps:
77
- uses: actions/checkout@v4
8+
# waiting on: https://github.com/actions/setup-node/issues/531
9+
- run: corepack enable
810
- uses: actions/setup-node@v4
911
with:
1012
node-version: 20
11-
cache: 'npm'
13+
cache: 'yarn'
1214
- name: Install deps, build, then clear deps
1315
run: |
14-
npm ci
15-
npm run build
16+
yarn install --immutable
17+
yarn build
1618
rm -rf node_modules
1719
- name: Test on Node 20
1820
run: |
1921
node -v
20-
npm run test
22+
node bin/test.js
2123
# Not using a matrix here since it's simpler
2224
# to just duplicate it and not spawn new instances
2325
- uses: actions/setup-node@v4
@@ -26,4 +28,4 @@ jobs:
2628
- name: Test on Node 18
2729
run: |
2830
node -v
29-
npm run test
31+
node bin/test.js

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,15 @@ typings/
5454
# Output of 'npm pack'
5555
*.tgz
5656

57-
# Yarn Integrity file
57+
# Yarn
5858
.yarn-integrity
59+
.pnp.*
60+
.yarn/*
61+
!.yarn/patches
62+
!.yarn/plugins
63+
!.yarn/releases
64+
!.yarn/sdks
65+
!.yarn/versions
5966

6067
# dotenv environment variables file
6168
.env

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

0 commit comments

Comments
 (0)