|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | + |
| 5 | +This repository is a Yarn workspace monorepo for the GLSP Node server stack. |
| 6 | + |
| 7 | +- `packages/server`: core framework (`src/common`, `src/node`, `src/browser`). |
| 8 | +- `packages/graph`: TypeScript GModel types and utilities. |
| 9 | +- `packages/layout-elk`: ELK-based layout integration. |
| 10 | +- `examples/workflow-server` and `examples/workflow-server-bundled`: runnable example server and bundling setup. |
| 11 | +- Root config files (`tsconfig.json`, `eslint.config.mjs`, `.mocharc`, `.nycrc`) define shared standards across packages. |
| 12 | + |
| 13 | +## Build, Test, and Development Commands |
| 14 | + |
| 15 | +Run from repository root unless noted. |
| 16 | + |
| 17 | +- `yarn`: install dependencies and trigger prepare build. |
| 18 | +- `yarn build`: compile TypeScript and bundle the workflow example. |
| 19 | +- `yarn lint`: run ESLint across the repo. |
| 20 | +- `yarn test`: run package tests via Lerna (`--no-bail`). |
| 21 | +- `yarn test:coverage`: run coverage per package (nyc). |
| 22 | +- `yarn format` / `yarn format:check`: apply/check Prettier formatting. |
| 23 | +- `yarn check:all`: full CI-style validation (lint, test, format, header checks). |
| 24 | +- `yarn start` or `yarn start:websocket`: launch bundled workflow example server. |
| 25 | + |
| 26 | +## Coding Style & Naming Conventions |
| 27 | + |
| 28 | +- Language: TypeScript (`Node >= 20`, Yarn 1.x). |
| 29 | +- Formatting and linting are enforced by `@eclipse-glsp/prettier-config` and `@eclipse-glsp/eslint-config`. |
| 30 | +- Use 4-space indentation and existing import ordering patterns. |
| 31 | +- Prefer descriptive kebab-case filenames; tests use `*.spec.ts`. |
| 32 | +- Keep public API barrel exports current (use `yarn generate:index` when needed). |
| 33 | + |
| 34 | +## Testing Guidelines |
| 35 | + |
| 36 | +- Framework: Mocha with shared config from `.mocharc`. |
| 37 | +- Place tests next to source files using `*.spec.ts` naming. |
| 38 | +- Run all tests: `yarn test`; package-only tests: `yarn --cwd packages/server test`. |
| 39 | +- Validate coverage with `yarn test:coverage` before opening larger changes. |
| 40 | + |
| 41 | +## Commit & Pull Request Guidelines |
| 42 | + |
| 43 | +- Open or reference an umbrella issue in `https://github.com/eclipse-glsp/glsp` before implementation. |
| 44 | +- Branch naming convention: `issues/<issue_number>` (for example, `issues/241`). |
| 45 | +- Commit messages should be imperative and include issue linkage with an absolute URL, e.g. `closes https://github.com/eclipse-glsp/glsp/issues/241`. |
| 46 | +- PRs should include: problem statement, scope, test evidence (`yarn test`, `yarn lint`), and screenshots/logs for behavior changes. |
| 47 | +- Ensure ECA requirements are met before requesting merge. |
0 commit comments