Skip to content
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

chore: updates dependencies and migrates infrastructural tooling #26

Merged
merged 4 commits into from
Jan 3, 2025
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
9 changes: 9 additions & 0 deletions .changeset/modern-carpets-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"next-merge-props": minor
---

- Migrates linting and formatting from eslint/prettier to biome.js.
- Migrates husky to v9 and modify existing git hooks.
- Migrates from swc to tsup for building/bundling.
- Migrates from tsc to tsup for generating declaration files.
- Migrates from jest to vitest.
20 changes: 0 additions & 20 deletions .eslintignore

This file was deleted.

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

This file was deleted.

24 changes: 15 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ name: Node.js CI
on: [push]
jobs:
build:
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
name: Build, lint, format, and test on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [16.14.x, 18.x]
node: [18.x, 20.x, 22.x]
os: [ubuntu-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2.2.2
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 8
version: 9
run_install: false

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
Expand All @@ -31,10 +31,16 @@ jobs:
run: pnpm install --no-frozen-lockfile

- name: Lint
run: pnpm run lint
run: pnpm lint

- name: Format
run: pnpm format

- name: Check types
run: pnpm check:types

- name: Test
run: pnpm run test -- --maxWorkers=2
run: pnpm test

- name: Build
run: pnpm run build
run: pnpm build
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2.2.2
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 8
version: 9
run_install: false

- name: Setup Node.js 18
uses: actions/setup-node@v2
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Install dependencies
run: pnpm install --no-frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
node_modules
coverage
dist
.eslintcache
tsconfig.tsbuildinfo
5 changes: 1 addition & 4 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm exec commitlint --edit $1
pnpm dlx commitlint --edit $1
6 changes: 1 addition & 5 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm run lint:fix
pnpm run test
pnpm format & pnpm lint
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm test
12 changes: 0 additions & 12 deletions .prettierignore

This file was deleted.

21 changes: 0 additions & 21 deletions .prettierrc

This file was deleted.

10 changes: 0 additions & 10 deletions .swcrc

This file was deleted.

98 changes: 98 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
"files": { "ignoreUnknown": false, "ignore": [] },
"formatter": {
"enabled": true,
"useEditorconfig": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 100,
"attributePosition": "auto",
"bracketSpacing": true,
"ignore": ["**/node_modules/**", "next-example/**", "coverage/**", "dist/**", "package.json"]
},
"organizeImports": { "enabled": true },
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"complexity": {
"noBannedTypes": "error",
"noUselessTypeConstraint": "error"
},
"correctness": {
"noPrecisionLoss": "error",
"noUnusedVariables": "off",
"useArrayLiterals": "off"
},
"style": {
"noNamespace": "error",
"noNonNullAssertion": "off",
"useAsConstAssertion": "error",
"useBlockStatements": "off"
},
"suspicious": {
"noExplicitAny": "off",
"noExtraNonNullAssertion": "error",
"noMisleadingInstantiator": "error",
"noUnsafeDeclarationMerging": "error"
}
},
"ignore": ["**/node_modules/**", "next-example/**", "coverage/**", "dist/**", "package.json"]
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "es5",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto",
"bracketSpacing": true
},
"globals": ["Atomics", "SharedArrayBuffer"]
},
"overrides": [
{
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
"linter": {
"rules": {
"correctness": {
"noConstAssign": "off",
"noGlobalObjectCalls": "off",
"noInvalidConstructorSuper": "off",
"noNewSymbol": "off",
"noSetterReturn": "off",
"noUndeclaredVariables": "off",
"noUnreachable": "off",
"noUnreachableSuper": "off"
},
"style": {
"noArguments": "error",
"noVar": "error",
"useConst": "error"
},
"suspicious": {
"noDuplicateClassMembers": "off",
"noDuplicateObjectKeys": "off",
"noDuplicateParameters": "off",
"noFunctionAssign": "off",
"noImportAssign": "off",
"noRedeclare": "off",
"noUnsafeNegation": "off",
"useGetterReturn": "off"
}
}
}
},
{
"include": [",*.json", ",*.yaml"],
"formatter": { "indentStyle": "space" }
}
]
}
4 changes: 2 additions & 2 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
export default {
extends: ['@commitlint/config-conventional'],
};
8 changes: 0 additions & 8 deletions jest.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions jest.setup.ts

This file was deleted.

Loading
Loading