|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +Trang landing của Fcitx5 Lotus — bộ gõ tiếng Việt cho Linux. SPA Vue 3 + Vite + TypeScript, UI tiếng Việt, theme Catppuccin, deploy lên GitHub Pages qua GitHub Actions. |
| 4 | + |
| 5 | +## Tech stack |
| 6 | + |
| 7 | +- Vue 3 (Composition API, `<script setup lang="ts">`) |
| 8 | +- Vite 7, TypeScript, vue-router 4 |
| 9 | +- Element Plus (auto-import), oh-vue-icons (`<v-icon>`), Bun |
| 10 | + |
| 11 | +## Lệnh |
| 12 | + |
| 13 | +- Cài đặt: `bun install` |
| 14 | +- Dev: `bun dev` |
| 15 | +- Lint: `bun run lint` / `bun run lint:fix` |
| 16 | +- Type-check: `bun run type-check` |
| 17 | +- Build: `bun run build` / Preview: `bun run preview` |
| 18 | + |
| 19 | +Quan trọng: khi chỉ kiểm tra code, chạy `bun run lint` + `bun run type-check` là đủ — **KHÔNG build**. CI (`ci.yml`) chạy cả 3 khi push. |
| 20 | + |
| 21 | +## Cấu trúc |
| 22 | + |
| 23 | +- `src/views/Home.vue` — layout, chỉ render các section + `initTheme()`. |
| 24 | +- `src/components/` — 8 section (NavBar, HeroSection, FeaturesSection, InstallSection, UsageSection, UninstallSection, ContributorsSection, FooterSection) + reusable (FeatureCard, UsageTable, CodeBlock, UninstallItem, InteractiveInstaller). |
| 25 | +- `src/utils/` — `theme.ts` (useTheme), `github.ts` (useGitHubStats, cache localStorage 2h), `actions.ts` (openLink, copyToClipboard, scroll...). |
| 26 | +- `src/data/` — `installer.ts`, `usage.ts` (dữ liệu hiển thị). |
| 27 | +- `src/assets/shared.css` — reset, theme vars, class dùng chung (non-scoped, import ở main.ts). |
| 28 | + |
| 29 | +## Quy ước |
| 30 | + |
| 31 | +- Mọi text UI bằng tiếng Việt; import alias `@/`; icon qua `el-icon` hoặc `<v-icon name="...">`. |
| 32 | +- State dùng chung giữa section → composable singleton (useTheme/useGitHubStats); không props/emit giữa section. |
| 33 | +- CSS: riêng 1 section → `<style scoped>`; class dùng chung hoặc render bởi component con → `shared.css` (scoped của cha không áp dụng vào con). Override Element Plus dùng `:root .el-*` cho đủ specificity. Không tự thêm CSS mới cho class không có rule (`.flex`, `.mb-0`...). |
| 34 | +- Không sửa tay `components.d.ts` / `auto-imports.d.ts` (generated). |
| 35 | +- Project không có test suite; không thêm test nếu không được yêu cầu. |
| 36 | + |
| 37 | +## Git |
| 38 | + |
| 39 | +- Commit theo Conventional Commits: `feat(...)`, `fix(...)`, `refactor(...)`. |
| 40 | +- Chạy `bun run lint` + `bun run type-check` trước khi commit; chỉ commit khi được yêu cầu. |
| 41 | + |
| 42 | +## Không được làm |
| 43 | + |
| 44 | +- KHÔNG build khi chỉ kiểm tra code. |
| 45 | +- KHÔNG đổi logic/hành vi khi refactor (giao diện phải y hệt). |
| 46 | +- KHÔNG sửa text hiển thị trừ khi được yêu cầu. |
| 47 | +- KHÔNG thêm dependency mới mà chưa hỏi. |
| 48 | +- KHÔNG commit secrets. |
0 commit comments