Skip to content

Conversation

@aster-void
Copy link
Contributor

No description provided.

aster-void and others added 11 commits November 30, 2025 22:56
Fixed all 154 type errors across the codebase by:

- Server: Add null checks and type annotations to route handlers
- Frontend: Add explicit type parameters to all useQuery calls
- API: Fix Eden Treaty call patterns (remove unnecessary body wrappers)
- Types: Add proper type assertions with `as unknown as Type`
- Safety: Add null guards and type checks for user input
- Clean: Remove unused imports and fix Svelte 5 state warnings

Final status:
- svelte-check: 0 errors, 0 warnings ✅
- prettier: all files formatted ✅
- biome: 58 warnings (acceptable `any` from framework limitations)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove all 'any' types and 'as' type assertions from server code
- Fix authMiddleware to use 'derive()' with 'as: global' scope for proper type inference
- Update all route handlers to use destructured parameters instead of ctx pattern
- Replace ctx.error() with set.status pattern
- Fix cookie plugin usage to use .value property correctly
- Fix Drizzle self-referencing table using AnyPgColumn type
- Update client code to remove type assertions and use proper typing

All src/ files now have 0 type errors. Remaining errors are only in node_modules dependencies.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
外部ライブラリ (@elysiajs/cookie) の型エラーを無視するように設定を変更

Changes:
- Updated check script to filter out node_modules errors and only fail on src/ errors
- Added ../../node_modules/.bun to tsconfig exclude array
- Added TypeScript as devDependency for consistent tsc version

Result: 0 type errors in src/ code ✅

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
非推奨の @elysiajs/cookie パッケージを削除し、Elysia の組み込み cookie 機能に移行

Changes:
- Removed @elysiajs/cookie package dependency
- Updated auth middleware to use Elysia's built-in cookie API
- Simplified cookie access: cookie.token?.value → cookie.token.value
- Removed unnecessary .use(cookie()) call

Result:
- ✅ All type errors resolved (0 errors in src/)
- ✅ Server runs successfully
- ✅ No external library type errors

The @elysiajs/cookie package is deprecated and has been merged into Elysia core.
Using the built-in cookie support eliminates type errors and follows current best practices.

References:
- https://elysiajs.com/patterns/cookie
- https://github.com/elysiajs/elysia-cookie

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
checkスクリプトをシンプルな `tsc --noEmit` に戻す

前回の複雑なフィルタリングスクリプトは、@elysiajs/cookie の型エラーを回避するための対症療法だった。
非推奨パッケージを削除して根本原因を解決したため、元のシンプルなスクリプトで問題なく動作する。

Result: ✅ tsc --noEmit passes with 0 errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 11, 2025

Deploying prism with  Cloudflare Pages  Cloudflare Pages

Latest commit: 158e413
Status: ✅  Deploy successful!
Preview URL: https://b35ad315.prism-c7z.pages.dev
Branch Preview URL: https://refactor-use-elysia-server.prism-c7z.pages.dev

View logs

aster-void and others added 18 commits December 12, 2025 01:20
This commit implements comprehensive improvements across the codebase:

Security fixes (high priority):
- Remove hardcoded default secrets in auth middleware
- Add validation for DATABASE_URL and JWT_SECRET environment variables
- Replace hardcoded API base URL with environment variable

Code quality improvements:
- Unify error handling using unwrapResponse function across 8 files
- Remove unnecessary .ts extensions from imports
- Split 21 oversized files (>100 lines) into smaller, focused modules
- Separate UI logic from business logic in Svelte components

Configuration improvements:
- Unify TypeScript configuration by extending root tsconfig
- Update biome.jsonc Svelte rules to warn on unused variables/imports

File splits:
- schema.ts (280→9 files): Split by domain (auth, orgs, messages, etc.)
- MessageInput.svelte (277→9 files): Separate UI components and logic
- Organization routes (240→6 files): Split by operation type
- Settings page (268→7 files): Extract sections into components
- MessageList.svelte (230→4 files): Separate item rendering and logic
- Plus 7 additional files split for better maintainability

All files now follow CLAUDE.md guidelines:
- Max 100 lines per file (recommended 30-50)
- Svelte 5 runes mode exclusively
- Logic separated into .svelte.ts files
- Clear separation of concerns

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fix biome linter errors by adding .ts extensions to all relative imports
in server and api-client code. This ensures compatibility with the
useImportExtensions rule enabled in biome.jsonc.

Also includes biome.jsonc updates to re-enable unused variable/import
detection for Svelte files (as warnings).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove all `any` types from organization routes by leveraging Elysia
  type inference and adding authMiddleware to route files
- Add optional chaining for cookie.token access to handle undefined cases
- Remove explicit type annotations where TypeScript can infer correctly

All TypeScript errors and biome lint warnings are now resolved.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove apps/convex directory
- Create auth.svelte.ts for Elysia-based auth
- Update signin/signout/reset pages to use Elysia auth
- Simplify hooks.server.ts and layout.server.ts
- Update config files (biome, gitignore, prettierignore, env.sample)
- Update Procfiles to use Elysia server
- Update README.md and docs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add PostgreSQL 16 service (starts with `devenv up`)
- Keep all existing packages (Rust, Tauri, Bun, etc.)
- Add rust-overlay input for Rust toolchain

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update api-client types to match server responses (null vs undefined)
- Add proper typed route helpers for Vote, File, Task, Organization, Channel
- Fix unwrapResponse to handle Eden Treaty's unknown data type
- Fix SignInForm constant binding error (use value instead of bind:value)
- Use unwrapResponse consistently across components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Message edit/delete with inline editing UI
- Message search with ILIKE query and SearchResults component
- Message pinning with pin/unpin API and PinnedMessages display
- WebSocket infrastructure with WsManager and auto-reconnect client
- DM/private channels with channelMembers table
- Unread counts with channelReadStatus tracking and badges

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Design Philosophy:
- Near-black base (#0a0a0b) with cyan primary accents
- Monospace fonts for code and timestamps
- Subtle borders with custom border-subtle class
- Compact, information-dense but scannable layouts

Changes:
- app.css: Custom Prism theme with OKLCH colors, CSS variables
- OrganizationSidebar: Simplified header with icon buttons
- ChannelList: Section headers, # prefix icons, unread badges
- Channel: Collapsible search, cleaner header
- MessageItem: Compact layout, grouped metadata
- MessageInput: Reorganized with clear sections

UX Improvements:
- Consistent spacing using 4px scale
- Custom scrollbar styling
- Focus states with primary color outline
- Hover states for interactive elements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add @bogeychan/elysia-logger for request logging
- Add db:migrate script to server package.json
- Configure devenv to run migrations before server starts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove Storybook configuration and dependencies
- Remove Playwright e2e test setup
- Remove legacy Procfiles (replaced by devenv)
- Consolidate env config into root .env.sample
- Add typed env.ts for server environment variables
- Update CLAUDE.md and README.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Google OAuth authentication using arctic library
- Redirect to /signin on 401 API responses
- Update signin page to use Google button

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace Arctic OAuth with better-auth library
- Update auth schema to use text IDs (better-auth requirement)
- Add credentials: include to API client for cookie auth
- Create auth-client.ts and use-store.svelte.ts utilities
- Add valibot env validation for frontend
- Fix callback URL to redirect to frontend origin
- Use actual auth state in +page.svelte instead of hardcoded value

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Server:
- Broadcast message:created/updated/deleted events from message routes

Client:
- Subscribe to WebSocket channel in MessageListController
- Handle real-time message events to update UI instantly

UI:
- Improve chat design based on "Clarity" design language
- Add smooth transitions and hover states
- Increase whitespace for better readability

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add useWebSocket hook for reusable subscriptions with auto-cleanup
- Add WebSocket broadcast for reactions (add/remove)
- Add real-time updates for pinned messages
- Replace polling with event-driven unread count updates in ChannelList
- Add destroy() method to MessageListController for proper cleanup
- Fix event listener accumulation by tracking handlers for removal

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
aster-void and others added 9 commits December 17, 2025 20:58
- useWebSocket now uses $effect internally for auto-cleanup
- API simplified to useWebSocket(eventType, handler)
- Fix CreateChannelButton offset by using icon button

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate from unplugin-icons to @lucide/svelte for simpler icon handling.
Removes vite plugin dependency and improves tree-shaking with deep imports.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add DISABLE_AUTH env var to bypass authentication with mock user
- Add PUBLIC_DISABLE_AUTH for frontend
- Fix WebSocket message handling with proper Elysia body schema
- Initialize WebSocket connection in root layout
- Add scripts/seed.ts to seed mock user, org, and channel

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Consolidate 3 redundant CI jobs into 2 focused jobs
- Add build verification for server and desktop apps
- Add build script to server package.json
- Update README with cleaner devenv instructions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix non-alias import in FileAttachment.svelte.ts
- Split messageList.controller.svelte.ts into 4 modules:
  - mutations, websocket, ui, and main controller
- Extract Channel.svelte logic to channel.svelte.ts
- Extract Personalization.svelte logic to hook file
- All controllers use reactive props pattern with $derived

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@aster-void aster-void marked this pull request as ready for review December 18, 2025 11:10
aster-void and others added 3 commits December 18, 2025 20:13
- Add e2e/ directory with Playwright configuration
  - Docker-based test database on port 5433
  - Global setup/teardown for server and frontend
  - Tests for message, channel, and navigation (9 tests)
- Mock session for DISABLE_AUTH mode in better-auth.ts
- Fix WebSocket URL duplication in +layout.svelte
- Add test:e2e scripts to package.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add PATCH /users/me endpoint for profile updates
- Implement personalization save functionality in frontend
- Fix unread route registration (move to root level)
- Unify route parameter names (:channelId/:orgId → :id)
- Add refetch method to QueryState type
- Remove debug console.logs and cleanup dead code
- Add personalization e2e tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix E2E tests: rename .spec.ts to .e2e.ts to avoid Playwright/Bun conflict
- Update .env.sample with missing JWT and Resend variables
- Add unit tests for auth, messages, channels, and organizations domains
- Refactor messages/routes.ts (295 lines) into modular route files
- Add structured logging with shared Pino logger instance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@aster-void aster-void force-pushed the refactor/use-elysia-server branch from d26677d to 158e413 Compare December 22, 2025 03:35
@aster-void aster-void merged commit 7116e1b into main Dec 23, 2025
3 checks passed
@aster-void aster-void deleted the refactor/use-elysia-server branch December 23, 2025 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants