Skip to content

refactor: feature-based architecture with clean layer separation#169

Merged
tknkaa merged 4 commits into
mainfrom
restore-clean-architecture
Jun 28, 2026
Merged

refactor: feature-based architecture with clean layer separation#169
tknkaa merged 4 commits into
mainfrom
restore-clean-architecture

Conversation

@tknkaa

@tknkaa tknkaa commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Re-applies the clean architecture refactor that was previously reverted (#443af99).

  • Layer separation: Splits the monolithic lib/game-service.ts into features/game/repository.ts (raw DB calls) and features/game/service.ts (business logic)
  • Route consolidation: Removes 5 separate API route files (api.agari, api.games, api.ryukyoku, api.tedashi, api.tsumogiri) in favor of a single intent-dispatched action in routes/play/_index.tsx
  • Directory structure: Moves types to app/types/, auth to features/auth/, DB to app/db/, and nests route components/hooks under components/ and hooks/ subdirectories
  • Tests: Adds unit tests for agari and score logic
  • Package manager: Migrates from npm (package-lock.json) to pnpm (pnpm-lock.yaml)

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
hitori-mahjong 359bbb9 Jun 28 2026, 02:50 PM

@tknkaa tknkaa changed the title refactor refactor: feature-based architecture with clean layer separation Jun 28, 2026
tknkaa and others added 2 commits June 28, 2026 23:18
- Add null check before destructuring randomHaiyama[0] in startNewGame
  and restartGame to prevent crash when no haiyama is available
- Replace bare Error throws with GameError throughout service.ts so
  callers can discriminate status codes uniformly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Upgrade @biomejs/biome from 2.3.11 to 2.5.1
- Run biome migrate: update schema URL and replace deprecated
  linter.rules.recommended with preset
- Switch check script from pnpx to local biome to avoid version skew
- Add <title> to logo.svg to satisfy a11y/noSvgWithoutTitle

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tknkaa tknkaa marked this pull request as draft June 28, 2026 14:27
@tknkaa tknkaa marked this pull request as ready for review June 28, 2026 15:03
@tknkaa tknkaa merged commit fe25cf1 into main Jun 28, 2026
2 checks passed
@tknkaa tknkaa deleted the restore-clean-architecture branch June 28, 2026 15:03
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.

1 participant