Skip to content
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
177 changes: 0 additions & 177 deletions .eslintrc

This file was deleted.

135 changes: 135 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: CI

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

jobs:
lint:
name: Lint & Format
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run Biome
run: npm run lint

typecheck:
name: Type Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run TypeScript type checking
run: npm run typecheck

test:
name: Test (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest

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

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test:ci -- --ci --coverage --maxWorkers=2

- name: Upload coverage to Codecov
if: matrix.node-version == '18.x'
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false

build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build CSS
run: npm run build-css

- name: Build project
run: npm run build

- name: Check dist directory
run: ls -la dist/

all-checks:
name: All CI Checks Passed
runs-on: ubuntu-latest
needs: [lint, typecheck, test, build]
if: always()

steps:
- name: Check if all jobs passed
run: |
if [[ "${{ needs.lint.result }}" != "success" ]]; then
echo "Lint job failed"
exit 1
fi
if [[ "${{ needs.typecheck.result }}" != "success" ]]; then
echo "Type check job failed"
exit 1
fi
if [[ "${{ needs.test.result }}" != "success" ]]; then
echo "Test job failed"
exit 1
fi
if [[ "${{ needs.build.result }}" != "success" ]]; then
echo "Build job failed"
exit 1
fi
echo "All checks passed!"
37 changes: 37 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.6/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"include": ["src/**/*.ts", "src/**/*.tsx"]
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"linter": {
"enabled": true,
"rules": {
"a11y": {
"noSvgWithoutTitle": "off"
},
"complexity": {
"noForEach": "off"
},
"correctness": {
"useExhaustiveDependencies": "warn"
},
"performance": {
"noDelete": "warn"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
}
}
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
roots: ['<rootDir>/src'],
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
moduleNameMapper: {
'^@src/(.$)$': '<rootDir>/src/$1',
'\\.(css)$': 'identity-obj-proxy',
Expand Down
Loading