Skip to content

Commit 98ca8fd

Browse files
Simplify toolchain, use Yarn 4 / PnP / ESLint 9 (#40)
* Add changelog entry * Reconfigure mocks * Upgrade workflows * Exclude from prettier
1 parent 599a82a commit 98ca8fd

File tree

79 files changed

+8147
-5392
lines changed

Some content is hidden

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

79 files changed

+8147
-5392
lines changed

.eslintignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 75 deletions
This file was deleted.

.github/workflows/format-code.yml renamed to .github/workflows/action-format.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Format code'
1+
name: 'javascript-lib-static-analysis / format'
22

33
on:
44
issue_comment:
@@ -7,16 +7,16 @@ on:
77
jobs:
88
format:
99
name: 'Format code'
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-22.04
1111
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/format')
1212
steps:
1313
- name: 'Post acknowledgement that it will format code'
1414
continue-on-error: true # Never fail the build if this fails
15-
uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # 2.0.0
15+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
1616
with:
1717
github-token: ${{ secrets.GITHUB_TOKEN }}
1818
script: |
19-
github.issues.createComment({
19+
github.rest.issues.createComment({
2020
issue_number: context.issue.number,
2121
owner: context.repo.owner,
2222
repo: context.repo.repo,
@@ -34,7 +34,7 @@ jobs:
3434
id: fork_status
3535
run: |
3636
IS_FORK="$(jq '.head.repo.fork' "/tmp/pr.json")"
37-
echo "::set-output name=fork::$IS_FORK"
37+
echo "fork=$IS_FORK" >> "$GITHUB_OUTPUT"
3838
3939
- name: 'Setup SSH deploy key'
4040
if: steps.fork_status.outputs.fork == 'false'
@@ -60,6 +60,10 @@ jobs:
6060
git clone $HEAD_REPO .
6161
git checkout -b "$HEAD_REF" "origin/$HEAD_REF"
6262
63+
- name: Use Node.js LTS (20.x)
64+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
65+
with:
66+
node-version: 20.x
6367
- name: 'Format code'
6468
run: ./bin/format.sh
6569

@@ -82,11 +86,11 @@ jobs:
8286
8387
- name: 'Post acknowledgement that it has formatted the code'
8488
continue-on-error: true # Never fail the build if this fails
85-
uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # 2.0.0
89+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
8690
with:
8791
github-token: ${{ secrets.GITHUB_TOKEN }}
8892
script: |
89-
github.issues.createComment({
93+
github.rest.issues.createComment({
9094
issue_number: context.issue.number,
9195
owner: context.repo.owner,
9296
repo: context.repo.repo,
@@ -96,11 +100,11 @@ jobs:
96100
- name: 'Post reminder to trigger build manually'
97101
continue-on-error: true # Never fail the build if this fails
98102
if: steps.fork_status.outputs.fork == 'true'
99-
uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # 2.0.0
103+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
100104
with:
101105
github-token: ${{ secrets.GITHUB_TOKEN }}
102106
script: |
103-
github.issues.createComment({
107+
github.rest.issues.createComment({
104108
issue_number: context.issue.number,
105109
owner: context.repo.owner,
106110
repo: context.repo.repo,

.github/workflows/ci.js.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,34 @@ on:
99

1010
jobs:
1111
precheck:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-22.04
1313

1414
steps:
15-
- uses: actions/checkout@v2
16-
- name: Use Node.js LTS (16.x)
17-
uses: actions/setup-node@v1
15+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
16+
- name: Use Node.js LTS (20.x)
17+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
1818
with:
19-
node-version: 16.x
19+
node-version: 20.x
2020

2121
- name: Install project dependencies
22-
run: yarn install --frozen-lockfile --ignore-scripts
22+
run: yarn install --immutable
2323

2424
- name: Lint code
2525
run: yarn lint
2626

2727
ci:
28-
runs-on: ubuntu-latest
28+
runs-on: ubuntu-22.04
2929

3030
strategy:
3131
matrix:
32-
node-version: [14.x, 16.x]
32+
node-version: [20.x, 22.x]
3333

3434
steps:
35-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
3636
- name: Use Node.js ${{ matrix.node-version }}
37-
uses: actions/setup-node@v1
37+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
3838
with:
3939
node-version: ${{ matrix.node-version }}
4040

4141
- name: Install project dependencies and run tests
42-
run: yarn install --frozen-lockfile
42+
run: yarn install --immutable

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,38 @@ on: pull_request
77

88
jobs:
99
precheck:
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-22.04
1111

1212
steps:
1313
- name: Checkout PR
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
1515

16-
- name: Use Node.js LTS (16.x)
17-
uses: actions/setup-node@v1
16+
- name: Use Node.js LTS (20.x)
17+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
1818
with:
19-
node-version: 16.x
19+
node-version: 20.x
2020

2121
- name: Install project dependencies
22-
run: yarn install --frozen-lockfile --ignore-scripts
22+
run: yarn install --immutable
2323

2424
- name: Lint code
2525
run: yarn lint
2626

2727
ci:
28-
runs-on: ubuntu-latest
28+
runs-on: ubuntu-22.04
2929

3030
strategy:
3131
matrix:
32-
node-version: [14.x, 16.x]
32+
node-version: [20.x, 22.x]
3333

3434
steps:
3535
- name: Checkout PR
36-
uses: actions/checkout@v2
36+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
3737

3838
- name: Use Node.js ${{ matrix.node-version }}
39-
uses: actions/setup-node@v1
39+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
4040
with:
4141
node-version: ${{ matrix.node-version }}
4242

4343
- name: Install project dependencies and run tests
44-
run: yarn install --frozen-lockfile
44+
run: yarn install --immutable

.github/workflows/verify-code-formatting.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ on:
77

88
jobs:
99
verify:
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-22.04
1111
steps:
1212
- name: 'Checkout code'
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
1414

1515
- name: 'Verify formatting of all files'
1616
run: ./bin/check-formatting.sh

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
/node_modules
22
/dist
3+
4+
.pnp.*
5+
.yarn/*
6+
!.yarn/patches
7+
!.yarn/plugins
8+
!.yarn/releases
9+
!.yarn/sdks
10+
!.yarn/versions

.prettierignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/dist
22
/test/fixtures
33

4+
/.vscode
5+
/.yarn
6+
47
# These are org-wide files (https://github.com/exercism/org-wide-files/)
58
/.github/labels.yml
69
/.github/workflows/sync-labels.yml
7-
810
/CODE_OF_CONDUCT.md
9-
/LICENSE
11+
/LICENSE

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"arcanis.vscode-zipfs",
4+
"dbaeumer.vscode-eslint",
5+
"esbenp.prettier-vscode"
6+
]
7+
}

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"search.exclude": {
3+
"**/.yarn": true,
4+
"**/.pnp.*": true
5+
},
6+
"eslint.nodePath": ".yarn/sdks",
7+
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
8+
"typescript.tsdk": ".yarn/sdks/typescript/lib",
9+
"typescript.enablePromptUseWorkspaceTsdk": true,
10+
"cSpell.words": ["Klazz"]
11+
}

0 commit comments

Comments
 (0)