Bring the codebase in line with CLAUDE.md conventions

- Convert getRouter, OrderingPage, and OrderStatusRoute from function
  declarations to arrow functions
- Migrate header-user.tsx off raw Tailwind classes onto a co-located
  SCSS module, and remove Tailwind entirely (deps, Vite plugin,
  styles.css) since it was the only consumer and duplicated the
  documented SCSS Modules system
- Fix CLAUDE.md's stale ~/ alias example and structure diagram to
  match the project's actual #/ and @/ aliases and directories

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-10 08:06:22 +02:00
co-authored by Claude Sonnet 5
parent ff8fc388c0
commit 0d8f8f8148
12 changed files with 113 additions and 338 deletions
+13 -4
View File
@@ -38,8 +38,13 @@ src/
├── routeTree.gen.ts # AUTO-GENERATED — never edit by hand
├── router.tsx # router instance/config
├── components/
│ ├── ui/ # base primitives (buttons, inputs, etc.)
│ └── <domain>/ # feature-specific components, e.g. posts/, auth/
│ ├── ui/ # base primitives (buttons, inputs, etc.) — not
│ │ populated yet; add it when a shared primitive
│ │ is needed
│ └── <domain>/ # feature-specific components, e.g. ordering/, orders/
├── domain/ # framework-free business logic, e.g. ordering.ts
├── server/ # server functions (createServerFn) callable from routes
├── integrations/ # third-party integration glue, e.g. better-auth/
├── lib/ # shared utilities, API clients, helpers
├── db/
│ ├── schema.ts # Drizzle schema definitions
@@ -73,7 +78,8 @@ drizzle/ # generated SQL migrations — never hand-edit
- Class names in `.module.scss` files are camelCase (e.g. `.cardHeader`, not
`.card-header`) so they read naturally as `styles.cardHeader`.
- Shared tokens (colors, spacing, breakpoints) live in `src/styles/_variables.scss`
and are pulled in with `@use '~/styles/variables' as *;` — don't hardcode
and are pulled in with a relative `@use '../styles/variables' as *;` (Sass
doesn't resolve the `#/`/`@/` TS path aliases) — don't hardcode
colors/spacing that already exist as a variable.
- `src/styles/globals.scss` is for resets and truly global rules only
(imported once in `__root.tsx`); component-specific styles always go in a
@@ -94,7 +100,10 @@ drizzle/ # generated SQL migrations — never hand-edit
the `function` keyword — e.g. `const getUser = async (id: string) => {...}`
and `export const Button = (props: ButtonProps) => {...}`.
- [Naming conventions: PascalCase components, camelCase functions/vars, etc.]
- [Import order / path aliases, e.g. `~/` or `@/` for `src/`]
- Path aliases `#/*` and `@/*` both resolve to `src/*` (see `tsconfig.json`
and `package.json`'s `imports` field) — use either for TS/TSX imports.
SCSS files can't use these aliases; use relative `@use`/`@import` paths
there instead.
- Co-locate a component's test file next to it unless it's a shared
primitive in `components/ui/` (see "Styling" for `.module.scss` placement).
- No comments unless they're unavoidable for understanding — e.g. explaining