Skip to content

Commit

Permalink
feat: update minimum supported node version to 20
Browse files Browse the repository at this point in the history
BREAKING CHANGE: we are now relying on the native fetch implementation
  • Loading branch information
DASPRiD committed Nov 1, 2024
1 parent 0d6e2f6 commit 24cb93e
Show file tree
Hide file tree
Showing 33 changed files with 5,934 additions and 9,692 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions .eslintrc.json

This file was deleted.

27 changes: 9 additions & 18 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,20 @@ jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
- name: Use pnpm 8.x
uses: pnpm/action-setup@v2
with:
node-version: 18.x
version: 8

- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
node-version: 20
cache: 'pnpm'

- name: Validate all commits from PR
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
run: pnpm dlx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
35 changes: 16 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,36 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js 18.x
uses: actions/setup-node@v3
- name: Use pnpm 8.x
uses: pnpm/action-setup@v2
with:
node-version: 18.x
version: 8

- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
node-version: 20
cache: 'pnpm'

- name: Install Dependencies
run: npm ci
run: pnpm install

- name: Lint
run: npm run lint
- name: Check
run: pnpm exec biome ci .

- name: Test
run: npm run test-ci
run: pnpm test-ci

- name: Type Check
run: pnpm exec tsc --noEmit

- name: Codecov
uses: codecov/codecov-action@v3

- name: Build
run: npm run build
run: pnpm build

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
Expand Down
33 changes: 15 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,30 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js 18.x
uses: actions/setup-node@v3
- name: Use pnpm 8.x
uses: pnpm/action-setup@v2
with:
node-version: 18.x
version: 8

- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
node-version: 20
cache: 'pnpm'

- name: Install Dependencies
run: npm ci
run: pnpm install

- name: Lint
run: npm run lint
- name: Check
run: pnpm exec biome ci .

- name: Test
run: npm run test-ci
run: pnpm test-ci

- name: Type Check
run: pnpm exec tsc --noEmit

- name: Codecov
uses: codecov/codecov-action@v3
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

1 change: 0 additions & 1 deletion .husky/pre-commit

This file was deleted.

3 changes: 3 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"node-option": ["import=tsx"]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Soliant Consulting
Copyright (c) 2024 Soliant Consulting

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
Expand Down
44 changes: 44 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"include": ["biome.json", "commitlint.config.cjs", "src/**/*", "test/**/*"]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noExcessiveCognitiveComplexity": "warn",
"useSimplifiedLogicExpression": "error"
},
"correctness": {
"noNewSymbol": "error",
"noUnusedImports": "error",
"noUnusedPrivateClassMembers": "error",
"useHookAtTopLevel": "error"
},
"style": {
"useBlockStatements": "error",
"useCollapsedElseIf": "error",
"useForOf": "error",
"useFragmentSyntax": "error",
"useShorthandArrayType": "error",
"useShorthandAssign": "error",
"useSingleCaseStatement": "error"
},
"suspicious": {
"noApproximativeNumericConstant": "warn",
"noConsoleLog": "error",
"noEmptyBlockStatements": "error"
}
}
},
"formatter": {
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 100
}
}
2 changes: 1 addition & 1 deletion commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']}
module.exports = { extends: ["@commitlint/config-conventional"] };
10 changes: 10 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pre-commit:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: pnpm exec biome check --write --no-errors-on-unmatched --files-ignore-unknown=true {staged_files} && git update-index --again

commit-msg:
commands:
lint-commit-msg:
run: pnpm exec commitlint --edit
Loading

0 comments on commit 24cb93e

Please sign in to comment.