mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-17 18:05:42 +02:00
1.4 KiB
1.4 KiB
Huly Platform - Copilot Instructions
TypeScript/Svelte 4 monorepo using Rush.js (pnpm 10.15.1), Node >=20 <25, Webpack 5, Electron, Jest.
Code Style
TypeScript: Strict types, interfaces over types, avoid any, export types separately
Svelte: Script/style/markup order, reactive $:, stores for state, small focused components
Naming: Files kebab-case, Components PascalCase, functions camelCase, constants UPPER_SNAKE_CASE
Structure
models/*- Shared types/modelsserver-*- Server packagesplugins/*- Client pluginspackages/*- Reusable utilities- Projects 2-3 levels deep, each with
package.json
Rush Commands
rush install # Install deps
rush build # Build all
rush build --to PKG # Build specific
rush add -p PKG # Add dependency
Patterns
- Always handle errors (proper Error subclasses, catch promises)
- Use async/await, Promise.all() for parallel ops
- Svelte stores for shared state, separate business logic
- JSDoc public APIs, tests alongside code
- Run
rushx testbefore commit
Avoid
❌ any without reason ❌ console.log() ❌ Mixed concerns ❌ Circular deps ❌ Ignoring TS errors
When Coding
Infer location from context (models/server/plugins/packages), match existing patterns, include proper imports/types, add error handling, use existing utils first.