Skip to content

Simplify toolchain, use Yarn 4 / PnP / ESLint 9 #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .eslintignore

This file was deleted.

75 changes: 0 additions & 75 deletions .eslintrc.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Format code'
name: 'javascript-lib-static-analysis / format'

on:
issue_comment:
Expand All @@ -7,16 +7,16 @@ on:
jobs:
format:
name: 'Format code'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/format')
steps:
- name: 'Post acknowledgement that it will format code'
continue-on-error: true # Never fail the build if this fails
uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # 2.0.0
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -34,7 +34,7 @@ jobs:
id: fork_status
run: |
IS_FORK="$(jq '.head.repo.fork' "/tmp/pr.json")"
echo "::set-output name=fork::$IS_FORK"
echo "fork=$IS_FORK" >> "$GITHUB_OUTPUT"

- name: 'Setup SSH deploy key'
if: steps.fork_status.outputs.fork == 'false'
Expand All @@ -60,6 +60,10 @@ jobs:
git clone $HEAD_REPO .
git checkout -b "$HEAD_REF" "origin/$HEAD_REF"

- name: Use Node.js LTS (20.x)
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version: 20.x
- name: 'Format code'
run: ./bin/format.sh

Expand All @@ -82,11 +86,11 @@ jobs:

- name: 'Post acknowledgement that it has formatted the code'
continue-on-error: true # Never fail the build if this fails
uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # 2.0.0
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -96,11 +100,11 @@ jobs:
- name: 'Post reminder to trigger build manually'
continue-on-error: true # Never fail the build if this fails
if: steps.fork_status.outputs.fork == 'true'
uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # 2.0.0
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/ci.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,34 @@ on:

jobs:
precheck:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

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

- name: Install project dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: yarn install --immutable

- name: Lint code
run: yarn lint

ci:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [20.x, 22.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version: ${{ matrix.node-version }}

- name: Install project dependencies and run tests
run: yarn install --frozen-lockfile
run: yarn install --immutable
22 changes: 11 additions & 11 deletions .github/workflows/pr.ci.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,38 @@ on: pull_request

jobs:
precheck:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout PR
uses: actions/checkout@v2
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

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

- name: Install project dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: yarn install --immutable

- name: Lint code
run: yarn lint

ci:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [20.x, 22.x]

steps:
- name: Checkout PR
uses: actions/checkout@v2
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version: ${{ matrix.node-version }}

- name: Install project dependencies and run tests
run: yarn install --frozen-lockfile
run: yarn install --immutable
4 changes: 2 additions & 2 deletions .github/workflows/verify-code-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:

jobs:
verify:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: 'Checkout code'
uses: actions/checkout@v2
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: 'Verify formatting of all files'
run: ./bin/check-formatting.sh
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
/node_modules
/dist

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
6 changes: 4 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/dist
/test/fixtures

/.vscode
/.yarn

# These are org-wide files (https://github.com/exercism/org-wide-files/)
/.github/labels.yml
/.github/workflows/sync-labels.yml

/CODE_OF_CONDUCT.md
/LICENSE
/LICENSE
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"cSpell.words": ["Klazz"]
}
Loading