Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors build/lint/runtime wiring for the Hono app so production output is cleaner, dev/test-only routes stay out of prod, and message history reads are optimized.
Changes:
- Adjust TypeScript prod build output layout (rootDir/include/exclude) and update
start:prodto match. - Gate debug/test routes to development and tighten WebSocket/message handling.
- Add
messages.created_atindex + migration and update message history query to return chronological results efficiently.
Reviewed changes
Copilot reviewed 21 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.prod.json | Sets rootDir, narrows include, and excludes test/static-only TS from prod build. |
| package.json | Cleans build output before compiling, updates prod start path, removes unused dev dependency. |
| package-lock.json | Removes npm lockfile to reduce repo noise (pnpm is the package manager). |
| hono/testApp.ts | Tightens middleware typing for test app session injection. |
| hono/static/ChatPage.ts | Minor formatting; keeps message-load timeout logic intact. |
| hono/routes/ws.ts | Rejects unauthenticated WS connections on open; trims messages before storing/broadcasting. |
| hono/routes/ws.test.ts | Formatting cleanup in test setup. |
| hono/routes/messages.ts | Reworks message history query using a subquery to return oldest→newest without JS reversing. |
| hono/routes/messages.test.ts | Updates DB mock shape for the new subquery-based message query. |
| hono/routes/emailAuth.test.ts | Formatting update for mocked DB results. |
| hono/routes/auth.ts | Restricts /debug/session to development; keeps OAuth env validation. |
| hono/db/schema.ts | Adds messages_created_at_idx index definition. |
| hono/db/migrations/meta/_journal.json | Registers the new migration in the drizzle journal. |
| hono/db/migrations/meta/0002_snapshot.json | Adds schema snapshot including the new messages index. |
| hono/db/migrations/0002_bent_maria_hill.sql | Creates the messages_created_at_idx index in SQL. |
| hono/components/RegisterPage.tsx | Formatting-only JSX changes. |
| hono/components/LoginPage.tsx | Formatting-only JSX changes. |
| hono/components/ChatPage.tsx | Formatting-only JSX changes. |
| hono/components/AboutPage.tsx | Formatting-only JSX changes; preserves link security attributes. |
| hono/components/AboutPage.test.ts | Formatting-only changes to tests. |
| hono/app.tsx | Registers testAuth routes only in development; improves middleware typing. |
| e2e/database-persistence.spec.ts | Import order/formatting tweak. |
| e2e/app.spec.ts | Import order/formatting tweak. |
| biome.json | Narrows Biome includes to application code globs (hono/e2e) + root configs. |
| .gitignore | Removes large unrelated ignore block to reduce noise while keeping relevant ignores. |
Comment on lines
8
to
15
| "dev": "pnpm run build:client:watch & tsx watch hono/index.ts", | ||
| "build": "pnpm run build:client && tsc --project tsconfig.prod.json", | ||
| "build": "rm -rf dist && pnpm run build:client && tsc --project tsconfig.prod.json", | ||
| "build:client": "tsc --project tsconfig.client.json", | ||
| "build:client:watch": "tsc --project tsconfig.client.json --watch", | ||
| "build:check": "tsc --noEmit", | ||
| "start": "tsx hono/index.ts", | ||
| "start:prod": "node dist/hono/index.js", | ||
| "start:prod": "node dist/index.js", | ||
| "test": "vitest", |
There was a problem hiding this comment.
build uses rm -rf dist, which will fail on Windows shells. Consider replacing this with a cross-platform cleanup using Node’s fs.rmSync(..., { recursive: true, force: true }) (or an equivalent approach that doesn’t assume a POSIX shell).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation