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
18 changes: 18 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
coverage:
status:
project:
default:
target: 40%
threshold: 5%
patch:
default:
target: 70%

ignore:
- "**/*.test.ts"
- "**/*.test.tsx"
- "**/test-utils/**"
- "**/__tests__/**"
- "**/__mocks__/**"
- "vite.config.ts"
- "vitest.config.ts"
18 changes: 0 additions & 18 deletions .eslintrc.cjs

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Tests

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Authenticate NPM registry
run: echo -e "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_TOKEN }}\n@capawesome-team:registry=https://npm.pkg.github.com/" > ~/.npmrc

- name: Add Firebase credentials
run: echo '${{ secrets.FIREBASE_CREDS }}' > ./src/firebase.json

- name: Install dependencies
run: pnpm install

- name: Type check
run: pnpm run typecheck

- name: Lint
run: pnpm run lint

- name: Run tests
run: pnpm run test

- name: Generate coverage
run: pnpm run test:coverage

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ dist-ssr
*.njsproj
*.sln
*.sw?

.claude/
CLAUDE.md

coverage/

.tanstack/
docs/plans/
41 changes: 41 additions & 0 deletions bumpers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
rules:
- match: ' /tmp'
send: Use a "tmp" directory in the project root instead.
- match: 'go test '
send: |
Use "just test" instead for TDD integration:
- just test
- just test-unit
- just test-integration
- just test-e2e
These commands have *exactly* the same arguments as "go test" and
actually pass args straight through to the official commands. No
special syntax required. They still MUST include paths like ./... and ./internal/example/...
- match: ^(gci|go vet|goimports|gofumpt|go *fmt|golangci-lint)
send: Use "just lint fix" instead to resolve lint/formatting issues.
- match: git commit --no-verify|LEFTHOOK=0
send: Pre-commit hooks must not be skipped.
- match: fieldalignment
send: Fix field alignment issues by adding names to struct fields and running "just lint fix".
- match: find\s+.*-exec\s+(rm(\s+-\w+)*|sed\s+-i|>\s*\S+)\s+
send: Don't use dangerous exec in find commands.
- match: BUMPERS_SKIP=1
send: Bumpers should not be skipped.
- match: ^bumpers\.yml^
tool: Read|Edit|Grep
send: Bumpers configuration file should not be accessed.
- match: cat.*EOF.*>\s*[^\s]
send: Use Write tool instead of cat heredoc redirection to create files.
commands:
- name: test
send: Run "just test" to run all tests and fix ALL failing tests if any.
- name: lint
send: Run "just lint fix" and fix ALL linting issues if any.
- name: check
send: Run "just lint fix" and "just test" and fix ALL issues if any.
- name: commit
send: Commit ALL modified files.
- name: logs
send: Read log file in ~/.local/share/bumpers/bumpers.log
session:
- add: 'Today''s date is: {{.Today}}'
113 changes: 113 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import js from '@eslint/js'
import typescript from '@typescript-eslint/eslint-plugin'
import typescriptParser from '@typescript-eslint/parser'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import react from 'eslint-plugin-react'
import jsxA11y from 'eslint-plugin-jsx-a11y'
import importX from 'eslint-plugin-import-x'
import globals from 'globals'

export default [
{
ignores: [
'dist/**',
'node_modules/**',
'coverage/**',
'android/**',
'ios/**',
'*.config.{js,ts}',
'vite.config.ts',
'vitest.config.ts',
'tailwind.config.js',
'postcss.config.js',
'src/__tests__/**',
'src/__mocks__/**',
'src/test-setup.ts',
'src/test-utils/**'
]
},

// Base configs
js.configs.recommended,
{
files: ['src/**/*.{ts,tsx}'],
languageOptions: {
parser: typescriptParser,
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.browser,
...globals.es2022
},
parserOptions: {
ecmaFeatures: {
jsx: true
}
}
},

plugins: {
'@typescript-eslint': typescript,
'react': react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'jsx-a11y': jsxA11y,
'import-x': importX
},

rules: {
// TypeScript rules
...typescript.configs.recommended.rules,
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'prefer-const': 'error',

// React rules
...react.configs.recommended.rules,
'react/react-in-jsx-scope': 'off', // Not needed with React 17+ JSX transform
'react/jsx-uses-react': 'off', // Not needed with React 17+ JSX transform

// React Hooks
...reactHooks.configs.recommended.rules,

// React Refresh
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true }
],

// Accessibility rules
...jsxA11y.configs.recommended.rules,

// Import rules
'import-x/no-unresolved': 'error',
'import-x/order': [
'warn',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index'
],
'newlines-between': 'never'
}
]
},

settings: {
react: {
version: 'detect'
},
'import-x/resolver': {
typescript: {
alwaysTryTypes: true,
project: './tsconfig.json'
}
}
}
}
]
30 changes: 24 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build && pnpm exec cap sync",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 3",
"eslist": "pnpm run lint",
"preview": "vite preview",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"test": "vitest",
"test:coverage": "vitest --coverage",
"test:ui": "vitest --ui"
},
"dependencies": {
"@capacitor-community/keep-awake": "^7.1.0",
Expand Down Expand Up @@ -60,8 +63,13 @@
"devDependencies": {
"@capacitor/assets": "^3.0.5",
"@capacitor/cli": "^7.4.1",
"@eslint/js": "^9.34.0",
"@faker-js/faker": "^10.0.0",
"@tanstack/eslint-plugin-query": "^5.81.2",
"@tanstack/router-vite-plugin": "^1.125.6",
"@testing-library/jest-dom": "^6.8.0",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/lodash": "^4.17.20",
"@types/node": "^24.0.11",
"@types/react": "^19.1.8",
Expand All @@ -70,25 +78,35 @@
"@typescript-eslint/eslint-plugin": "^8.36.0",
"@typescript-eslint/parser": "^8.36.0",
"@vitejs/plugin-react": "^4.6.0",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "^3.2.4",
"autoprefixer": "^10.4.21",
"eslint": "^9.30.1",
"eslint": "^9.34.0",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import-x": "^4.16.1",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.3.0",
"happy-dom": "^18.0.1",
"msw": "^2.10.5",
"postcss": "^8.5.6",
"prettier": "^3.6.2",
"prettier-plugin-tailwindcss": "^0.6.13",
"tailwindcss": "^4.1.11",
"tdd-guard-vitest": "^0.1.3",
"tw-animate-css": "^1.3.5",
"typescript": "^5.8.3",
"vite": "7.0.3"
"vite": "7.0.3",
"vitest": "^3.2.4"
},
"pnpm": {
"onlyBuiltDependencies": [
"@firebase/util",
"@tailwindcss/oxide",
"esbuild",
"protobufjs",
"sharp"
"protobufjs"
]
}
}
Loading