mirror of
https://github.com/rustfs/console.git
synced 2026-08-28 19:47:21 +08:00
2.2 KiB
2.2 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. - Components use StudlyCase filenames (e.g.
BucketSelector.vue) but reference via kebab-case in templates. - 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.
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.