3.0 KiB
Repository Guidelines
Project Structure & Module Organization
The application lives in frontend/; run Node and npm commands there. Vue source is under frontend/src/:
components/contains the canvas editor, toolbar, settings, lists, and export UI.views/owns page-level layout;stores/mosaic.tsis the primary Pinia state and workflow coordinator.utils/contains framework-light color conversion, flood fill, RLE masks, persistence, and export logic.types/defines shared TypeScript models;composables/contains viewport behavior.assets/is for bundled assets, whilepublic/contains favicons and static files copied unchanged.
Repository documentation is in README.md; screenshots belong in doc/. Generated frontend/dist/ and root dist/ outputs are not source files.
Build, Test, and Development Commands
From frontend/:
npm install # install dependencies
npm run dev # start the Vite development server
npm run type-check # run vue-tsc
npm run lint # run Oxlint and ESLint with automatic fixes
npm run format # format src/ with Prettier
npm run build # type-check and create frontend/dist/
npm run preview # serve the production build locally
Node.js must satisfy ^22.18.0 || >=24.12.0. The root build.bat creates the deployable root dist/ on Windows.
Coding Style & Naming Conventions
Use Vue 3 Composition API and <script setup lang="ts">. Indent with two spaces, omit semicolons, prefer single quotes, and keep lines near 100 characters. Use PascalCase for Vue components (MosaicCanvas.vue), camelCase for functions and variables, and useXxx for composables. Keep UI text Slovak and code identifiers English. Avoid any; share types from src/types/. Keep large ImageData, Blob, canvas, and typed-array values shallow or marked raw.
Testing Guidelines
No test runner or coverage threshold is currently configured. Every change must pass npm run type-check, npm run lint, and npm run build. Keep algorithmic logic in utils/ so it can be tested without browser automation. If a test framework is introduced, use focused *.test.ts files and cover color math, flood fill, RLE operations, serialization, and backward compatibility.
Commit & Pull Request Guidelines
History uses short, descriptive Slovak commit subjects (for example, aktualizovany README.md) rather than Conventional Commits. Keep each commit focused and describe the outcome. Pull requests should include a concise summary, verification commands and results, linked issue when applicable, and screenshots for visible UI changes. Call out project-format or IndexedDB compatibility changes explicitly.
Security & Deployment
Image processing must remain local to the browser; do not add uploads or external APIs without explicit approval. deploy.bat targets a specific remote host and deletes its deployment directory before syncing—never run it without repository-owner authorization.