1.2 KiB
1.2 KiB
web-tool
React 19 + TypeScript 6 + Vite 8 + Tailwind CSS 4.
Commands
npm run dev # dev server
npm run build # tsc -b && vite build (typecheck first, then bundle)
npm run lint # eslint .
npm run preview # vite preview (serve built dist/)
Architecture
- Entry:
src/main.tsx→src/App.tsx - Tools: 6 single-file tools in
src/tools/(JsonTool, Base64Tool, UrlTool, TimestampTool, HtmlEntitiesTool, CaseConverterTool) - Nav: sidebar in
src/components/Sidebar.tsx; add a new tool by importing inApp.tsxand registering intoolsrecord - Styling: Tailwind CSS v4 — uses
@import "tailwindcss"(NOT@tailwinddirectives)
Conventions
verbatimModuleSyntaxis on — useimport typefor type-only importserasableSyntaxOnlyis on — no enums, no namespaces, no parameter properties- Chinese (zh-CN) labels only, no i18n
Docker
docker compose up -d
Multi-stage build (node:22-alpine → nginx). Serves via Traefik behind tool.linkerhand.cc. Requires external traefik-net network.
Gotchas
npm run buildrunstsc -bfirst; fix type errors before expecting a build to succeed- No test framework or test scripts; nothing to run for verification beyond build + lint