10 improvements to the frontend dev experience: 1. TypeScript strict mode enabled (tsconfig.app.json) - strict: true, noImplicitAny: true, noUnusedLocals: true - noUnusedParameters: true, noImplicitReturns: true - noUncheckedIndexedAccess: true - Passes with 0 errors 2. Vitest configured with jsdom + @testing-library/react - vitest.config.ts with coverage provider - src/test/setup.ts stubs all env vars - src/App.test.tsx: smoke test (renders without crash) - 1 test passing 3. .editorconfig added (matches biome: 2-space, lf, 120 cols) 4. Makefile added with standard targets: make install/dev/build/lint/format/check/typecheck/test/ci/clean 5. Zod env validation (src/lib/env.ts) - All import.meta.env calls validated via zod schema - Fails fast with clear error if env vars are invalid - src/lib/config.ts re-exports from validated env 6. Playwright E2E config + smoke tests - playwright.config.ts with chromium - e2e/smoke.spec.ts: homepage + navigation tests 7. CI workflow now blocking on lint + typecheck + test + build - Removed continue-on-error from lint step - Added vitest run step - Added tsc --noEmit step 8. rollup-plugin-visualizer added to vite.config.ts - Generates dist/stats.html on build 9. Pre-commit hook updated with --staged flag - Only lints staged files, not entire repo 10. Removed broken .clinerules symlink Build: 18s, 0 TS errors, 1 test passing, 0 format errors
25 lines
No EOL
569 B
TypeScript
25 lines
No EOL
569 B
TypeScript
import { defineConfig, devices } from '@playwright/test'
|
|
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: process.env.CI ? 1 : undefined,
|
|
reporter: 'html',
|
|
use: {
|
|
baseURL: 'http://localhost:5173',
|
|
trace: 'on-first-retry',
|
|
},
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: { ...devices['Desktop Chrome'] },
|
|
},
|
|
],
|
|
webServer: {
|
|
command: 'bun run dev',
|
|
url: 'http://localhost:5173',
|
|
reuseExistingServer: !process.env.CI,
|
|
},
|
|
}) |