From 355efd3d47cf9aeb55713a14f6f93054f4895956 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Tue, 14 Oct 2025 21:08:29 +0700 Subject: [PATCH] Update instructions file --- .github/copilot-instructions.md | 61 +++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000000..284f5f4533 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,61 @@ +# Huly Server - Copilot Context + +## Project Overview + +**Monorepo**: Rush-managed backend infrastructure for Huly Platform +**Stack**: TypeScript, Node.js v20.11.0+, pnpm 10.15.1, Rush 5.158.1, Jest +**License**: Eclipse Public License 2.0 (Hardcore Engineering Inc.) + +## Package Categories + +- **Core**: core, server, client, middleware +- **Database**: mongo, postgres, elastic +- **Storage**: server-storage, minio, s3, datalake, hulylake +- **Infrastructure**: kafka, collaboration + +Standard structure: `src/` → `lib/` (compiled), `tsconfig.json`, `jest.config.js`, `package.json` with `@hcengineering/` scope + +## Essential Commands + +**Setup & Build:** + +```bash +rush install # Install dependencies +rush build # Build all packages +cd packages/ && rushx build # Build specific package +``` + +**Testing:** + +```bash +cd tests && ./prepare-tests.sh # First time: start Docker services (Elasticsearch, MongoDB, CockroachDB, Redpanda) +rush test # Run all tests +npm run test:coverage # With coverage +``` + +**Common Tasks:** + +- New package: Create dir in `packages/`, add to `rush.json`, run `rush update` +- Update deps: Edit `package.json`, run `rush update`, verify with `rush build` +- Troubleshoot: Check `packages//rush-logs/` for build errors, `coverage/` for test results + +## Key Concepts + +- **Domain Model**: WorkspaceIds (multi-tenant), Transactions (Tx), Documents (Doc), Domains, Permissions +- **Architecture**: Pluggable adapters, middleware pipeline, abstract storage, Kafka messaging, CRDT collaboration +- **Testing**: Docker Compose integration tests in `tests/`, `prepare-tests.sh` auto-detects running containers + +## Coding Standards + +- TypeScript strict mode, Prettier formatting +- Imports: `@hcengineering/` namespace, named imports, grouped (external/internal/types) +- Errors: `PlatformError` from `@hcengineering/platform`, `unknownError` wrapper +- Async: `async/await`, `MeasureContext` for cancellation, cleanup in finally blocks +- Security: No secrets in code, validate inputs, prepared statements, rate limiting + +## Quick Reference + +- Config: `rush.json`, `.nvmrc`, `common/config/rush/` +- Logs: `packages//rush-logs/`, `coverage/html/` +- Docs: `docs/tx-ordering-middleware-implementation.md` +- Tests: Force restart with `docker compose -p sanity down`