Skip to content

Commit 5e919a0

Browse files
Update Yarn, add cache to Github Actions, and fix action-format using npm (#1556)
* Update Yarn, add cache to Github Actions, and fix action-format using npm * Remove unused packages and sync * Fix corepack with setup-node * Fix lint issues
1 parent 114d600 commit 5e919a0

File tree

213 files changed

+2944
-4211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+2944
-4211
lines changed

.github/workflows/action-format.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ jobs:
5959
6060
git clone $HEAD_REPO .
6161
git checkout -b "$HEAD_REF" "origin/$HEAD_REF"
62-
62+
- name: Enable corepack to fix https://github.com/actions/setup-node/pull/901
63+
run: corepack enable yarn
6364
- name: Use Node.js LTS (20.x)
6465
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
6566
with:
6667
node-version: 20.x
68+
cache: 'yarn'
6769
- name: Install project development dependencies
68-
run: npm install --no-save
70+
run: corepack yarn install --immutable
6971
- name: 'Format code'
7072
run: ./bin/format.sh
7173

.github/workflows/ci.js.yml

+16-9
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
16+
17+
- name: Enable corepack to fix https://github.com/actions/setup-node/pull/901
18+
run: corepack enable yarn
19+
1620
- name: Use Node.js LTS (20.x)
1721
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
1822
with:
1923
node-version: 20.x
24+
cache: 'yarn'
2025

2126
- name: Install project dependencies
22-
run: |
23-
corepack enable yarn
24-
corepack yarn install --immutable
27+
run: corepack yarn install --immutable
2528

2629
- name: Run exercism/typescript ci precheck (checks config, lint code, and runs tests) for all exercises
2730
run: corepack yarn ci:check
@@ -35,15 +38,17 @@ jobs:
3538

3639
steps:
3740
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
41+
- name: Enable corepack to fix https://github.com/actions/setup-node/pull/901
42+
run: corepack enable yarn
43+
3844
- name: Use Node.js ${{ matrix.node-version }}
3945
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
4046
with:
4147
node-version: ${{ matrix.node-version }}
48+
cache: 'yarn'
4249

4350
- name: Install project dependencies
44-
run: |
45-
corepack enable yarn
46-
corepack yarn install --immutable
51+
run: corepack yarn install --immutable
4752

4853
- name: Run exercism/typescript ci (checks config, lint code, and runs tests) for all exercises
4954
run: corepack yarn ci
@@ -57,10 +62,14 @@ jobs:
5762

5863
steps:
5964
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
65+
- name: Enable corepack to fix https://github.com/actions/setup-node/pull/901
66+
run: corepack enable yarn
67+
6068
- name: Use Node.js 20.x
6169
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
6270
with:
6371
node-version: 20.x
72+
cache: 'yarn'
6473

6574
- name: Remove root project files
6675
run: rm -f package.json yarn.lock .yarnrc.yml
@@ -73,9 +82,7 @@ jobs:
7382
7483
- name: Install project dependencies
7584
working-directory: exercises/practice/hello-world
76-
run: |
77-
corepack enable yarn
78-
corepack yarn install --no-immutable
85+
run: corepack yarn install --no-immutable
7986

8087
- name: Run tests
8188
working-directory: exercises/practice/hello-world

.github/workflows/pr.ci.js.yml

+17-9
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
1515
with:
1616
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
17+
1718
- name: Get changed files
1819
id: changed-files
1920
run: |
@@ -23,15 +24,17 @@ jobs:
2324
echo "changed_files=$(git diff --name-only --diff-filter=ACM ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
2425
fi
2526
27+
- name: Enable corepack to fix https://github.com/actions/setup-node/pull/901
28+
run: corepack enable yarn
29+
2630
- name: Use Node.js LTS (20.x)
2731
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
2832
with:
2933
node-version: 20.x
34+
cache: 'yarn'
3035

3136
- name: Install project dependencies
32-
run: |
33-
corepack enable yarn
34-
corepack yarn install --immutable
37+
run: corepack yarn install --immutable
3538

3639
- name: Run exercism/typescript ci precheck (stub files, config integrity) for changed exercises
3740
run: corepack yarn node scripts/pr-check.mjs ${{ steps.changed-files.outputs.changed_files }}
@@ -48,6 +51,7 @@ jobs:
4851
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
4952
with:
5053
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
54+
5155
- name: Get changed files
5256
id: changed-files
5357
run: |
@@ -57,15 +61,17 @@ jobs:
5761
echo "changed_files=$(git diff --name-only --diff-filter=ACM ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
5862
fi
5963
64+
- name: Enable corepack to fix https://github.com/actions/setup-node/pull/901
65+
run: corepack enable yarn
66+
6067
- name: Use Node.js ${{ matrix.node-version }}
6168
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
6269
with:
6370
node-version: ${{ matrix.node-version }}
71+
cache: 'yarn'
6472

6573
- name: Install project dependencies
66-
run: |
67-
corepack enable yarn
68-
corepack yarn install --immutable
74+
run: corepack yarn install --immutable
6975

7076
- name: Run exercism/typescript ci (runs tests) for changed/added exercises
7177
run: corepack yarn node scripts/pr.mjs ${{ steps.changed-files.outputs.changed_files }}
@@ -79,10 +85,14 @@ jobs:
7985

8086
steps:
8187
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
88+
- name: Enable corepack to fix https://github.com/actions/setup-node/pull/901
89+
run: corepack enable yarn
90+
8291
- name: Use Node.js 20.x
8392
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
8493
with:
8594
node-version: 20.x
95+
cache: 'yarn'
8696

8797
- name: Remove root project files
8898
run: rm -f package.json yarn.lock .yarnrc.yml
@@ -95,9 +105,7 @@ jobs:
95105
96106
- name: Install project dependencies
97107
working-directory: exercises/practice/hello-world
98-
run: |
99-
corepack enable yarn
100-
corepack yarn install --no-immutable
108+
run: corepack yarn install --no-immutable
101109

102110
- name: Run tests
103111
working-directory: exercises/practice/hello-world

.yarn/releases/yarn-4.3.1.cjs

-894
This file was deleted.

babel.config.cjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2-
presets: [[require('@exercism/babel-preset-typescript'), { corejs: '3.37' }]],
2+
// eslint-disable-next-line @typescript-eslint/no-require-imports
3+
presets: [[require('@exercism/babel-preset-typescript'), { corejs: '3.38' }]],
34
plugins: [],
45
}

common/babel.config.cjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2-
presets: [[require('@exercism/babel-preset-typescript'), { corejs: '3.37' }]],
2+
// eslint-disable-next-line @typescript-eslint/no-require-imports
3+
presets: [[require('@exercism/babel-preset-typescript'), { corejs: '3.38' }]],
34
plugins: [],
45
}

common/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
"node": "^18.16.0 || >=20.0.0"
1717
},
1818
"devDependencies": {
19-
"@exercism/babel-preset-typescript": "^0.5.0",
20-
"@exercism/eslint-config-typescript": "^0.7.1",
19+
"@exercism/babel-preset-typescript": "^0.6.0",
20+
"@exercism/eslint-config-typescript": "^0.8.0",
2121
"@jest/globals": "^29.7.0",
22-
"@types/node": "~22.0.2",
22+
"@types/node": "~22.7.6",
2323
"babel-jest": "^29.7.0",
24-
"core-js": "~3.37.1",
25-
"eslint": "^9.8.0",
24+
"core-js": "~3.38.1",
25+
"eslint": "^9.12.0",
2626
"expect": "^29.7.0",
2727
"jest": "^29.7.0",
2828
"prettier": "^3.3.3",
2929
"tstyche": "^2.1.1",
30-
"typescript": "~5.5.4",
31-
"typescript-eslint": "^7.18.0"
30+
"typescript": "~5.6.3",
31+
"typescript-eslint": "^8.10.0"
3232
},
3333
"scripts": {
3434
"test": "corepack yarn node test-runner.mjs",
@@ -38,5 +38,5 @@
3838
"lint:types": "corepack yarn tsc --noEmit -p .",
3939
"lint:ci": "corepack yarn eslint . --ext .tsx,.ts"
4040
},
41-
"packageManager": "yarn@4.3.1"
41+
"packageManager": "yarn@4.5.1"
4242
}

0 commit comments

Comments
 (0)