mirror of
https://github.com/rustfs/console.git
synced 2026-09-24 16:30:56 +08:00
- 移除 149 个测试相关的翻译键(应该/should 开头的测试描述) - 移除测试数据相关的键(folder%test 等) - 移除函数性能测试相关的键 - 更新 AGENTS.md,添加语言包处理规则:排除测试目录 - 确保三个语言包的键保持一致(847 个键)
2.3 KiB
2.3 KiB
Repository Guidelines
Project Structure & Module Organization
- Core application lives under
pages/, with supporting UI atoms incomponents/. - Shared state and utilities are in
store/,composables/, andlib/. - Configuration lives in
app.config.ts,nuxt.config.ts, andconfig/. - Tests belong in
tests/, and static assets inpublic/orassets/.
Build, Test, and Development Commands
pnpm dev– start the Nuxt development server with hot reload.pnpm build– create a production build.pnpm preview– run the production bundle locally.pnpm test:run– execute the Vitest suite once.pnpm vue-tsc --noEmit– perform a strict type check.pnpm lint– runvue-tscand Prettier (format check only).
Coding Style & Naming Conventions
- Use Prettier defaults (see
.prettierrc.ts); runpnpm lintorpnpm lint:fix. - Vue files use
<script setup>with TypeScript; prefer composables for shared logic. - Component files use kebab-case (e.g.
bucket-selector.vue), but reference them using StudlyCase in templates (e.g.<BucketSelector />). - Override shadcn primitives outside
components/ui/; never edit files in that directory directly. - Render tabular data with the shared
DataTable+useDataTableutilities unless a specific requirement makes them unsuitable. - Language pack files should exclude test directories when processing translation keys.
Testing Guidelines
- Vitest is the primary framework; add new suites under
tests/. - Name files
*.spec.tsor*.test.tsand mirror source structure. - Keep tests deterministic; mock network calls through provided composables.
- Run
pnpm test:runbefore submitting major changes.
Commit & Pull Request Guidelines
- Follow conventional, action-oriented commit subjects (e.g.
feat: add bucket selector). - Each pull request should include: a concise summary, linked issue or task, screenshots for UI work, and testing notes (
pnpm test:run,pnpm vue-tsc, etc.). - Keep PRs scoped; large refactors should be coordinated in advance.
UI Theme Overrides
- Apply visual tweaks (e.g., removing shadows, altering colors) at usage sites via classes such as
class="shadow-none". - When extending shadcn components, create wrapper utilities (e.g.,
BucketSelector.vue) instead of forking primitives.