This project is a Next.js App Router application with TypeScript.
src/app: app entry points, global layout, and page UI (layout.tsx,page.tsx,globals.css)src/components: feature components and reusable UI primitives (src/components/ui)src/lib: domain utilities, schema validation, and pure helper logicsrc/stores: Zustand state store and related testssrc/i18n: locale messages and translation helperssrc/test: shared Vitest setup (setup.ts)public: static assets
Keep business logic in src/lib or src/stores, and keep UI components focused on rendering and interactions.
Use pnpm for all package workflows.
pnpm dev: run local development serverpnpm build: create production buildpnpm start: run production server from build outputpnpm lint: run ESLint with Next.js + TypeScript configpnpm test: run Vitest oncepnpm test:watch: run Vitest in watch mode
Example:
pnpm lint && pnpm test- Language: TypeScript (
strictmode enabled) - Indentation: 2 spaces
- Strings: prefer single quotes
- Semicolons: generally omitted in source files
- File names: kebab-case (e.g.,
language-switcher.tsx,time-calc.ts) - Imports: use
@/*alias forsrc/*paths when appropriate
Follow existing component patterns and keep changes consistent with nearby code.
- Framework: Vitest (
jsdom, globals enabled) + Testing Library - Setup file:
src/test/setup.ts - Test files: colocate with source as
*.test.ts(or*.test.tsxfor UI tests) - Prefer deterministic unit tests for
src/liband store behavior insrc/stores
Run pnpm test before opening a PR.
Current history uses concise, Conventional Commit-style messages (e.g., feat(timetable): ...).
- Recommended commit format:
type(scope): summary - Common types:
feat,fix,refactor,test,docs,chore - Write clear PR descriptions with:
- what changed
- why it changed
- how it was tested (
pnpm lint,pnpm test) - screenshots for UI-visible changes
Keep PRs focused and avoid mixing unrelated refactors with feature work.