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
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
DATABASE_URL=
BETTER_AUTH_SECRET=
BETTER_AUTH_URL=http://localhost:3000 # Base URL of your app
USESEND_API_KEY=
USESEND_API_KEY=
EMAIL_FROM=
TURNSTILE_SITE_KEY=
TURNSTILE_SECRET_KEY=
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: ci

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

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2
with:
bun-version: "latest"

- name: Install
run: bun install --frozen-lockfile

- name: Lint (Biome)
run: bun lint

- name: Typecheck
run: bun typecheck

- name: Test
run: bun test


33 changes: 32 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@
"serve": "bun --bun vite preview",
"start": "bun run .output/server/index.mjs",
"test": "bun --bun vitest run",
"typecheck": "bunx tsc -p tsconfig.json --noEmit",
"lint": "bunx biome check .",
"db:generate": "bun --bun drizzle-kit generate",
"db:migrate": "bun --bun drizzle-kit migrate",
"db:push": "bun --bun drizzle-kit push",
"db:pull": "bun --bun drizzle-kit pull",
"db:studio": "bun --bun drizzle-kit studio",
"better-auth:generate": "bunx --bun @better-auth/cli generate --config src/lib/auth/auth.ts --output src/db/schema/auth.ts",
"better-auth:generate": "bunx --bun @better-auth/cli generate --config src/features/auth/auth.ts --output src/db/schema/auth.ts",
"better-auth:secret": "bunx --bun @better-auth/cli secret"
},
"dependencies": {
"@fontsource-variable/geist": "^5.2.8",
"@fontsource-variable/geist-mono": "^5.2.7",
"@marsidev/react-turnstile": "^1.4.1",
"@radix-ui/react-alert-dialog": "^1.1.15",
"@radix-ui/react-avatar": "^1.1.11",
"@radix-ui/react-checkbox": "^1.3.3",
Expand Down Expand Up @@ -69,6 +72,7 @@
"@tanstack/react-query-devtools": "^5.91.2",
"@tanstack/react-router-devtools": "^1.144.0",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.2.1",
"@types/node": "^25.0.3",
"@types/react": "^19.2.7",
Expand All @@ -78,6 +82,7 @@
"concurrently": "^9.2.1",
"dotenv": "^17.2.3",
"drizzle-kit": "^0.31.8",
"happy-dom": "^20.0.11",
"typescript": "^5.9.3",
"ultracite": "^6.5.0",
"vite": "^7.3.0",
Expand Down
22 changes: 22 additions & 0 deletions tests/features/todo/schema.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { describe, expect, it } from "vitest";
import {
createTodoSchema,
deleteTodoSchema,
updateTodoSchema,
} from "@/features/todos/types/todo-types";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: import path is incorrect - the schemas are in @/features/todos/schema, not @/features/todos/types/todo-types

Suggested change
} from "@/features/todos/types/todo-types";
} from "@/features/todos/schema";
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/features/todo/schema.test.ts
Line: 6:6

Comment:
**syntax:** import path is incorrect - the schemas are in `@/features/todos/schema`, not `@/features/todos/types/todo-types`

```suggestion
} from "@/features/todos/schema";
```

How can I resolve this? If you propose a fix, please make it concise.


describe("todos schemas", () => {
it("createTodoSchema rejects empty title", () => {
expect(() => createTodoSchema.parse({ id: "1", title: "" })).toThrow();
});

it("updateTodoSchema allows partial updates", () => {
expect(() =>
updateTodoSchema.parse({ id: "1", updates: { completed: true } })
).not.toThrow();
});

it("deleteTodoSchema requires id", () => {
expect(() => deleteTodoSchema.parse({})).toThrow();
});
});
12 changes: 12 additions & 0 deletions tests/lib/utils.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { describe, expect, it } from "vitest";
import { cn } from "@/lib/utils";

describe("cn", () => {
it("joins truthy class names", () => {
expect(cn("a", undefined, null, false, "b")).toBe("a b");
});

it("merges tailwind classes", () => {
expect(cn("p-2", "p-4")).toBe("p-4");
});
});
1 change: 1 addition & 0 deletions tests/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "@testing-library/jest-dom/vitest";
13 changes: 13 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from "vitest/config";
import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig({
plugins: [tsconfigPaths()],
test: {
environment: "happy-dom",
setupFiles: ["./src/test/setup.ts"],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: setupFiles path is incorrect - the file is at ./tests/setup.ts, not ./src/test/setup.ts

Suggested change
setupFiles: ["./src/test/setup.ts"],
setupFiles: ["./tests/setup.ts"],
Prompt To Fix With AI
This is a comment left during a code review.
Path: vitest.config.ts
Line: 8:8

Comment:
**syntax:** setupFiles path is incorrect - the file is at `./tests/setup.ts`, not `./src/test/setup.ts`

```suggestion
    setupFiles: ["./tests/setup.ts"],
```

How can I resolve this? If you propose a fix, please make it concise.

globals: true,
},
});


Loading