refactor(ddd-lite): shell layout + kernel contract + base64 reference module#8
Conversation
Step 1 of DDD-lite restructure. Pure move, no behavior change.
- src/components/shell/* -> src/app/shell/*
- src/stores/* -> src/app/stores/* (app-level state)
- src/tools/registry.ts -> src/shared/kernel/registry.ts
- src/lib/utils.ts -> src/shared/utils.ts
- src/lib/{hotkeys,storage,fonts,themes} -> src/shared/lib/*
- shadcn ui -> src/shared/ui, common -> src/shared/components
Delete ghost dirs (features/, tools/<tool> stubs, types/). Add
src/modules/ as canonical tool home. Rewrite @/ imports and
components.json aliases. vp check green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…t rules Step 2 of DDD-lite restructure. - ToolModule contract + optional ToolDefinition.loader (lazy module barrel) - Tool route lazy-renders a module when loader is set, else keeps the "not implemented" placeholder; Suspense fallback added - shared/kernel/result.ts: Result/Ok/Err/DomainError + ok/err/domainError helpers for total, never-throwing domain functions - Boundary rules in vite.config.ts lint block (Vite+ ignores .oxlintrc.json): * domain/ may not import react/react-dom, app state, storage, or modules * modules reachable only via their barrel (@/modules/<tool>) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Step 3 of DDD-lite restructure — first real tool, the template others copy.
Layout (modules/base64/):
- domain/base64.ts pure, total, Result-returning encode/decode +
UTF-8 correctness, url-safe option
- domain/base64.test.ts 12 unit tests, no React (vite-plus/test)
- ui/store.ts zustand store for tool state, persisted to
IndexedDB via the shared idb adapter
- ui/use-base64.ts view-model seam: reads store, derives output/error
- ui/base64-tool.tsx presentational entry component (default export)
- index.ts public barrel (only the entry component)
State is managed with zustand (per request), not the local useReducer
hook from the original Q5 plan. To honor CLAUDE.md (tool IO in IndexedDB),
add shared/lib/storage/idb-zustand.ts: a zustand StateStorage adapter over
the existing idb helper, keyed by tool id. New tool stores reuse it.
Register loader: () => import("@/modules/base64") so the route lazy-loads
the module; build confirms it splits into its own chunk.
Intra-module imports are relative; the @/modules/*/{domain,ui} alias is
lint-banned past the barrel.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
devbox | 918675d | Commit Preview URL Branch Preview URL |
Jun 02 2026, 06:35 AM |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR adds a complete Base64 encoding/decoding tool module and establishes lazy-loaded tool architecture. It introduces shared domain logic patterns via a ChangesBase64 Tool and Lazy-Loaded Tool System
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
Step 1 of the DDD-lite refactor. Establishes the layered module shape and lands the first tool as the reference template.
app/shared/kernellayout.Resulttype, and boundary lint rules.Architecture
app/— VS Code-style shell + global state.shared/kernel/—registry.ts(tool catalog + loader contract),result.ts(Resulttype).modules/<tool>/— self-contained tool;base64is the reference template.Test plan
vp check(format + lint + typecheck)vp test🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Tests