|
1 | | -# Repository Guidelines |
| 1 | +# AGENTS.md |
2 | 2 |
|
3 | | -## Project Structure & Module Organization |
| 3 | +## Project Overview |
4 | 4 |
|
5 | | -This repository is a Yarn workspaces monorepo. |
| 5 | +Eclipse GLSP Playwright — a Playwright-based testing framework for GLSP (Graphical Language Server Platform) diagram editors. Supports Standalone, Theia, and VS Code integrations. |
6 | 6 |
|
7 | | -- `packages/glsp-playwright/`: core library source (`src/`) and build output (`lib/`). |
8 | | -- `examples/workflow-test/`: runnable Playwright example with page objects in `src/` and tests in `tests/`. |
9 | | -- `docs/`: concept docs (`integration`, `extension`, `metadata`, and Playwright differences). |
10 | | -- Root config files (`tsconfig.json`, `eslint.config.mjs`, `lerna.json`) define shared tooling. |
| 7 | +## Build & Development |
11 | 8 |
|
12 | | -Use `packages/*` for reusable framework code and `examples/*` for integration demos and test fixtures. |
| 9 | +- **Package manager**: Yarn 1.x (classic) — do not use Yarn 2+/Berry or npm |
| 10 | +- **Build**: `yarn` from root installs and compiles everything |
13 | 11 |
|
14 | | -## Build, Test, and Development Commands |
| 12 | +## Code Style Rules |
15 | 13 |
|
16 | | -Run from repository root unless noted. |
17 | | - |
18 | | -- `yarn install`: install all workspace dependencies. |
19 | | -- `yarn build`: compile TypeScript project references and rewrite path aliases. |
20 | | -- `yarn lint`: run ESLint across the monorepo. |
21 | | -- `yarn format` / `yarn format:check`: apply/check Prettier formatting. |
22 | | -- `yarn test`: run example Playwright suite (`examples/workflow-test`). |
23 | | -- `yarn test:standalone`, `yarn test:theia`, `yarn test:vscode`: run integration-specific test projects. |
24 | | -- `yarn watch`: watch and rebuild TypeScript + alias output during development. |
25 | | - |
26 | | -## Coding Style & Naming Conventions |
27 | | - |
28 | | -- Language: TypeScript (`.ts`), 4-space indentation (follow existing files). |
29 | | -- Formatting: Prettier via `@eclipse-glsp/prettier-config`. |
30 | | -- Linting: ESLint (`eslint.config.mjs`) with strict TypeScript rules (for example, no floating promises). |
31 | | -- Naming patterns: |
32 | | - - Tests: `*.spec.ts` under `examples/workflow-test/tests/**`. |
33 | | - - Page objects/helpers: `*.po.ts`, `*.capability.ts`, `*.integration.ts`. |
34 | | - - Keep feature folders aligned with GLSP feature names (`tool-palette`, `validation`, `undo-redo`, etc.). |
35 | | - |
36 | | -## Testing Guidelines |
37 | | - |
38 | | -Tests use Playwright (`@playwright/test`) and run from compiled output (`examples/workflow-test/lib/tests`). |
39 | | - |
40 | | -- Build before testing when sources changed: `yarn build`. |
41 | | -- Prefer targeted runs during development, then run `yarn test` before opening a PR. |
42 | | -- Keep tests deterministic and cover standalone, Theia, and VS Code paths when relevant. |
43 | | - |
44 | | -## Commit & Pull Request Guidelines |
45 | | - |
46 | | -Commit history favors short, imperative subjects, often with issue IDs (example: `GLSP-1563: Update to node 20 and Theia 1.64.x`). |
47 | | - |
48 | | -- Reference related issue IDs in commit/PR text when available. |
49 | | -- PRs should fill all template sections in `.github/PULL_REQUEST_TEMPLATE.md`: |
50 | | - `What it does`, `How to test`, `Follow-ups`, and `Changelog` impact. |
51 | | -- Do not disclose vulnerabilities in issues/PRs; follow `SECURITY.md`. |
| 14 | +- **No direct sprotty imports** — never import from `sprotty` or `sprotty-protocol` directly; use `@eclipse-glsp/client` instead (enforced by ESLint) |
| 15 | +- **Floating promises** — `@typescript-eslint/no-floating-promises` is an error; always `await` or handle promises |
| 16 | +- **Path alias** — `~/` maps to `packages/glsp-playwright/src/` in TypeScript configs |
0 commit comments