diff --git a/.claude/skills/fix/SKILL.md b/.claude/skills/fix/SKILL.md new file mode 100644 index 0000000..8c7bf27 --- /dev/null +++ b/.claude/skills/fix/SKILL.md @@ -0,0 +1,12 @@ +--- +name: fix +description: Auto-fix all lint, formatting, and copyright header issues across the workspace. Use when validation (`/verify`) fails or when explicitly requested. +--- + +Run the full auto-fix suite for the GLSP Server Node monorepo from the repository root: + +```bash +yarn fix:all +``` + +After fixing, report what changed. If any issues remain that couldn't be auto-fixed, list them and suggest manual fixes. diff --git a/.claude/skills/verify/SKILL.md b/.claude/skills/verify/SKILL.md new file mode 100644 index 0000000..1e9a0d8 --- /dev/null +++ b/.claude/skills/verify/SKILL.md @@ -0,0 +1,16 @@ +--- +name: verify +description: Run full project validation (install, lint, test, format, copyright headers) to catch issues before committing. IMPORTANT - Proactively invoke this skill after completing any code changes (new features, bug fixes, refactors) before reporting completion to the user. +--- + +Run the full validation suite for the GLSP Server Node monorepo from the repository root (includes install, lint, test, format check, and copyright header check): + +```bash +yarn check:all +``` + +On failure: + +1. Report which checks failed and the specific errors +2. Auto-fix by invoking the `/fix` skill +3. Re-run `yarn check:all` to confirm everything passes diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ec7e91..01224a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: - node-version: 20.x + node-version: 22.x - name: Build run: yarn install - name: Bundle browser example @@ -39,7 +39,7 @@ jobs: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: - node-version: 20.x + node-version: 22.x - name: Install run: | yarn install @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: - node-version: 20.x + node-version: 22.x - name: Install run: | yarn install @@ -82,7 +82,7 @@ jobs: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: - node-version: 20.x + node-version: 22.x - name: Install run: | yarn install diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 86a902f..5f94f23 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -67,7 +67,7 @@ jobs: - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 if: steps.check_changes.outputs.should_publish == 'true' with: - node-version: 20.x + node-version: 22.x registry-url: 'https://registry.npmjs.org' - name: Build diff --git a/.mocharc b/.mocharc index c6f3b6c..32df1e5 100644 --- a/.mocharc +++ b/.mocharc @@ -1,4 +1,5 @@ { "$schema": "https://json.schemastore.org/mocharc", - "extends": "@eclipse-glsp/mocha-config" + "extends": "@eclipse-glsp/mocha-config", + "node-option": ["no-experimental-strip-types"] } diff --git a/AGENTS.md b/AGENTS.md index 7940aa8..256f264 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,47 +1,23 @@ -# Repository Guidelines +# AGENTS.md -## Project Structure & Module Organization +## Project Overview -This repository is a Yarn workspace monorepo for the GLSP Node server stack. +Eclipse GLSP Server Node monorepo. Provides the TypeScript-based server framework for the Graphical Language Server Platform (GLSP). Contains core server packages, graph model, ELK layout integration, and example workflow server. Uses Lerna with Yarn workspaces. -- `packages/server`: core framework (`src/common`, `src/node`, `src/browser`). -- `packages/graph`: TypeScript GModel types and utilities. -- `packages/layout-elk`: ELK-based layout integration. -- `examples/workflow-server` and `examples/workflow-server-bundled`: runnable example server and bundling setup. -- Root config files (`tsconfig.json`, `eslint.config.mjs`, `.mocharc`, `.nycrc`) define shared standards across packages. +## Build & Development -## Build, Test, and Development Commands +- **Package manager**: Yarn 1.x (classic) — do not use Yarn 2+/Berry or npm +- **Build**: `yarn` from root installs and compiles everything +- **Clean**: `yarn clean` +- **Start example server**: `yarn start` (TCP on 5007) or `yarn start:websocket` (WebSocket on 8081) -Run from repository root unless noted. +## Validation -- `yarn`: install dependencies and trigger prepare build. -- `yarn build`: compile TypeScript and bundle the workflow example. -- `yarn lint`: run ESLint across the repo. -- `yarn test`: run package tests via Lerna (`--no-bail`). -- `yarn test:coverage`: run coverage per package (nyc). -- `yarn format` / `yarn format:check`: apply/check Prettier formatting. -- `yarn check:all`: full CI-style validation (lint, test, format, header checks). -- `yarn start` or `yarn start:websocket`: launch bundled workflow example server. +- After completing any code changes, always run the `/verify` skill before reporting completion +- If verification fails, run the `/fix` skill to auto-fix issues, then re-run `/verify` -## Coding Style & Naming Conventions +## Import Rules -- Language: TypeScript (`Node >= 20`, Yarn 1.x). -- Formatting and linting are enforced by `@eclipse-glsp/prettier-config` and `@eclipse-glsp/eslint-config`. -- Use 4-space indentation and existing import ordering patterns. -- Prefer descriptive kebab-case filenames; tests use `*.spec.ts`. -- Keep public API barrel exports current (use `yarn generate:index` when needed). +These are enforced by ESLint and are easy to get wrong: -## Testing Guidelines - -- Framework: Mocha with shared config from `.mocharc`. -- Place tests next to source files using `*.spec.ts` naming. -- Run all tests: `yarn test`; package-only tests: `yarn --cwd packages/server test`. -- Validate coverage with `yarn test:coverage` before opening larger changes. - -## Commit & Pull Request Guidelines - -- Open or reference an umbrella issue in `https://github.com/eclipse-glsp/glsp` before implementation. -- Branch naming convention: `issues/` (for example, `issues/241`). -- Commit messages should be imperative and include issue linkage with an absolute URL, e.g. `closes https://github.com/eclipse-glsp/glsp/issues/241`. -- PRs should include: problem statement, scope, test evidence (`yarn test`, `yarn lint`), and screenshots/logs for behavior changes. -- Ensure ECA requirements are met before requesting merge. +- **Never import from `sprotty-protocol` directly** — use `@eclipse-glsp/protocol` instead diff --git a/CLAUDE.md b/CLAUDE.md index 43c994c..6859b0e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1 +1,26 @@ -@AGENTS.md +# CLAUDE.md + +## Project Overview + +Eclipse GLSP Server Node monorepo. Provides the TypeScript-based server framework for the Graphical Language Server Platform (GLSP). Contains core server packages, graph model, ELK layout integration, and example workflow server. Uses Lerna with Yarn workspaces. + +## Build & Development + +- **Package manager**: Yarn 1.x (classic) — do not use Yarn 2+/Berry or npm +- **Build**: `yarn` from root installs and compiles everything +- **Compile**: `yarn compile` (runs `tsc -b` with project references) +- **Clean**: `yarn clean` +- **Watch**: `yarn watch` (parallel TypeScript + bundle watch) +- **Start example server**: `yarn start` (TCP on 5007) or `yarn start:websocket` (WebSocket on 8081) + +## Validation + +- **Tests**: `yarn test` (Mocha), runs across all packages via Lerna +- After completing any code changes, always run the `/verify` skill before reporting completion +- If verification fails, run the `/fix` skill to auto-fix issues, then re-run `/verify` + +## Import Rules + +These are enforced by ESLint and are easy to get wrong: + +- **Never import from `sprotty-protocol` directly** — use `@eclipse-glsp/protocol` instead diff --git a/package.json b/package.json index c3afe66..8be6a35 100644 --- a/package.json +++ b/package.json @@ -37,14 +37,14 @@ }, "devDependencies": { "@eclipse-glsp/dev": "next", - "@types/node": "20.x", + "@types/node": "22.x", "concurrently": "^8.2.2", "lerna": "^9.0.0", "mocha-ctrf-json-reporter": "0.0.9", "typescript": "^5.9.2" }, "engines": { - "node": ">=20", + "node": ">=22", "yarn": ">=1.7.0 <2" } } diff --git a/yarn.lock b/yarn.lock index 4bacb71..ac1b054 100644 --- a/yarn.lock +++ b/yarn.lock @@ -223,18 +223,18 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== -"@eclipse-glsp/cli@2.7.0-next.8+b3f9de7": - version "2.7.0-next.8" - resolved "https://registry.yarnpkg.com/@eclipse-glsp/cli/-/cli-2.7.0-next.8.tgz#3c9df4b862153981084c67394275ffb5b8fc915d" - integrity sha512-c9z6F+Z06lzXvO81iAERt68lu9BLd5gzg1cPAZyoyTEimw0vmUq6zN/vZZ19Xvjev5AWiAtRVFYGcmDzIzUEOQ== - -"@eclipse-glsp/config-test@2.7.0-next.8+b3f9de7": - version "2.7.0-next.8" - resolved "https://registry.yarnpkg.com/@eclipse-glsp/config-test/-/config-test-2.7.0-next.8.tgz#ea951fc5ddab2ec0e03bbf139068740c39377449" - integrity sha512-OM0BMNHPUqx1zlfv1mo3WYDDYP7jPgTL2+5XC3kq6TPqdQNl3Ogh/QCGjfzAI+fFlC8d/pEAfC9hL2xM7k7NBQ== - dependencies: - "@eclipse-glsp/mocha-config" "2.7.0-next.8+b3f9de7" - "@eclipse-glsp/nyc-config" "2.7.0-next.8+b3f9de7" +"@eclipse-glsp/cli@2.7.0-next.10+743aad5": + version "2.7.0-next.10" + resolved "https://registry.yarnpkg.com/@eclipse-glsp/cli/-/cli-2.7.0-next.10.tgz#75cf853feb77396b534495fd50f31b26b271db0d" + integrity sha512-/r8TGvp8jE0Tdzp4Sl7QJxyGL8OmaCBOcwl6V53F6xnay9WmO/U6LNDDc4RLDXLXzNiUEFy4J2V5+nPcdTa2jg== + +"@eclipse-glsp/config-test@2.7.0-next.10+743aad5": + version "2.7.0-next.10" + resolved "https://registry.yarnpkg.com/@eclipse-glsp/config-test/-/config-test-2.7.0-next.10.tgz#aea5b8d3c86027c76b9ee06c42dfbb71746dc22c" + integrity sha512-xhgO3MnDJ5d/xhicXxIQgC6Q5EMXg7pqZfZNdhrhMTmLgx4iR292WAMGNAA8qSVETxddNTaw7zOb8gFoOYXeRA== + dependencies: + "@eclipse-glsp/mocha-config" "2.7.0-next.10+743aad5" + "@eclipse-glsp/nyc-config" "2.7.0-next.10+743aad5" "@istanbuljs/nyc-config-typescript" "^1.0.2" "@types/chai" "^4.3.7" "@types/mocha" "^10.0.2" @@ -247,14 +247,14 @@ sinon "^15.1.0" ts-node "^10.9.1" -"@eclipse-glsp/config@2.7.0-next.8+b3f9de7": - version "2.7.0-next.8" - resolved "https://registry.yarnpkg.com/@eclipse-glsp/config/-/config-2.7.0-next.8.tgz#654000963af07452bdcbc4de106222f2b1c4c0a8" - integrity sha512-xQvNqL+6sl4BZtVf3UcrPKzwneFfiQSnKR21CY39pGMp10NYcQud6heltlHC8U3fZtELp6JzQPaQtqIAlqBWMA== +"@eclipse-glsp/config@2.7.0-next.10+743aad5": + version "2.7.0-next.10" + resolved "https://registry.yarnpkg.com/@eclipse-glsp/config/-/config-2.7.0-next.10.tgz#e6aa4ab50057f828facd521cd2dee198aaf973e9" + integrity sha512-ZqIcL8nPAKLduPsoyOYvUrCb6kRv8YQQ7JXcp831YDzj1Ay3vlOq9yG2My6ytyQvR3hs9MFD09467elgYq9xrw== dependencies: - "@eclipse-glsp/eslint-config" "2.7.0-next.8+b3f9de7" - "@eclipse-glsp/prettier-config" "2.7.0-next.8+b3f9de7" - "@eclipse-glsp/ts-config" "2.7.0-next.8+b3f9de7" + "@eclipse-glsp/eslint-config" "2.7.0-next.10+743aad5" + "@eclipse-glsp/prettier-config" "2.7.0-next.10+743aad5" + "@eclipse-glsp/ts-config" "2.7.0-next.10+743aad5" "@eslint/js" "^9.0.0" "@stylistic/eslint-plugin" "^2.0.0" "@tony.ganchev/eslint-plugin-header" "^3.1.1" @@ -271,49 +271,49 @@ typescript-eslint "^8.0.0" "@eclipse-glsp/dev@next": - version "2.7.0-next.8" - resolved "https://registry.yarnpkg.com/@eclipse-glsp/dev/-/dev-2.7.0-next.8.tgz#38c3437eb39159de291b0963389f9f8731a52c72" - integrity sha512-Kz/j0loL9HSjt5uWcFOSOyOEL5JBCIqITEprduypzy4PNivApbrTSTxbwOFoJf4uylSWWO7q4fUNqGbzhU5KUQ== - dependencies: - "@eclipse-glsp/cli" "2.7.0-next.8+b3f9de7" - "@eclipse-glsp/config" "2.7.0-next.8+b3f9de7" - "@eclipse-glsp/config-test" "2.7.0-next.8+b3f9de7" - -"@eclipse-glsp/eslint-config@2.7.0-next.8+b3f9de7": - version "2.7.0-next.8" - resolved "https://registry.yarnpkg.com/@eclipse-glsp/eslint-config/-/eslint-config-2.7.0-next.8.tgz#e54068d0292c08c925db042d1b422c0545a3f6c2" - integrity sha512-d8ngS4eIEQ/b/KUrWr/iIh6TYdm7kJ9v/Bmmy57+3y6c/FqWY2Gk6yf9yZpDlkxP/JaLwkeYFPIVM4Ch2ThOBQ== - -"@eclipse-glsp/mocha-config@2.7.0-next.8+b3f9de7": - version "2.7.0-next.8" - resolved "https://registry.yarnpkg.com/@eclipse-glsp/mocha-config/-/mocha-config-2.7.0-next.8.tgz#3684eda8b5d66fe6426a4de3ff38242029ac0eff" - integrity sha512-4c/LFBNM7bHMXgaazAIMlezVoEqrQvn4MKBgN83WFgRoz6Njp/ybn/1GE9mtuHJIJLbwDmbfrSYmbZNtsGztaA== - -"@eclipse-glsp/nyc-config@2.7.0-next.8+b3f9de7": - version "2.7.0-next.8" - resolved "https://registry.yarnpkg.com/@eclipse-glsp/nyc-config/-/nyc-config-2.7.0-next.8.tgz#20cf405340bb318a639ef769f154fd68d0497878" - integrity sha512-h+8uKmmiBUGG4f1D0UKmUSH8HaypeJUHGxWkAKS03VTBIoLb/xlC7AKrBcGaOMLcmYvkjNF15NcTfbet9tY2bA== - -"@eclipse-glsp/prettier-config@2.7.0-next.8+b3f9de7": - version "2.7.0-next.8" - resolved "https://registry.yarnpkg.com/@eclipse-glsp/prettier-config/-/prettier-config-2.7.0-next.8.tgz#8f675cd2483c0fa88181b3eb2a3607a8dcc7dadd" - integrity sha512-upb5A7D3mHfMO4gINgKZOoMpFXRKAcjPZ/A9x0lr8+Zmf8ZQE8cr7dGYVHY6oCn7Qs3gZRf7Aw7BtTr08EKsZQ== + version "2.7.0-next.10" + resolved "https://registry.yarnpkg.com/@eclipse-glsp/dev/-/dev-2.7.0-next.10.tgz#81b1b86c2e17d21074c3e6c8fccaf0d396270fad" + integrity sha512-lsYYLkLoj35Q3Q8Uet+WCHJQQANHFGFR9/o6DcSIMdUrRhUkyX1uS7XezQr7u9+GJ76yIwp5Q1yMYrcEBpCuzg== + dependencies: + "@eclipse-glsp/cli" "2.7.0-next.10+743aad5" + "@eclipse-glsp/config" "2.7.0-next.10+743aad5" + "@eclipse-glsp/config-test" "2.7.0-next.10+743aad5" + +"@eclipse-glsp/eslint-config@2.7.0-next.10+743aad5": + version "2.7.0-next.10" + resolved "https://registry.yarnpkg.com/@eclipse-glsp/eslint-config/-/eslint-config-2.7.0-next.10.tgz#c3a0bd614f52ca3d3c25f1512b8bd28c30777b9a" + integrity sha512-3bUCnz/qPQbABYimg0Bfo2TFMV5Qsk5tcy2uxs6ZTefX+7+AkUHOc57/A9XgRt/o3ngt3wCD+XdRkosBO/N6vw== + +"@eclipse-glsp/mocha-config@2.7.0-next.10+743aad5": + version "2.7.0-next.10" + resolved "https://registry.yarnpkg.com/@eclipse-glsp/mocha-config/-/mocha-config-2.7.0-next.10.tgz#a804c7d3f60974b3df2dc6893efda2e6b1d97c5b" + integrity sha512-mHQh6XCDnSYloOtON4qN1w8N1mSu9siZi32lfXclh2oVRu16ykUn2oaSQ8aXS6HgMK8FoWaItj5HWNP82qmfwg== + +"@eclipse-glsp/nyc-config@2.7.0-next.10+743aad5": + version "2.7.0-next.10" + resolved "https://registry.yarnpkg.com/@eclipse-glsp/nyc-config/-/nyc-config-2.7.0-next.10.tgz#c8cf5a3e00020fefb4d8cd2368bc6da458b9dabb" + integrity sha512-aYHgC8vgdGw8iK9ncNUkHgeHi6xaFso+8dECzeoQ+zLAx8aKqmh1//iyHXSWCIzwg1GsU0LkFX8FWdvX866jUg== + +"@eclipse-glsp/prettier-config@2.7.0-next.10+743aad5": + version "2.7.0-next.10" + resolved "https://registry.yarnpkg.com/@eclipse-glsp/prettier-config/-/prettier-config-2.7.0-next.10.tgz#da3c8b84b033b4c2c0ee809c29fc650386527d62" + integrity sha512-ovjSsvyt487lbrJ1+s2bTX4X2L5vZHW8gMUT9w18YjzPUQPAN6wCfmCVa5NqA+NP9U9DeDOSFp9G5g+YePdUqA== dependencies: prettier-plugin-packagejson "~2.4.6" "@eclipse-glsp/protocol@next": - version "2.7.0-next.1" - resolved "https://registry.yarnpkg.com/@eclipse-glsp/protocol/-/protocol-2.7.0-next.1.tgz#813554aed6205111df55bccc3859e5877b80168a" - integrity sha512-GJ3AGnA3Pdl17JU89QCklO5A3jQIl6o6ZKhsHNcb57cJdLGm/OyM0yUsB0ZPaLXZEuRpGlfCuHcsBAjPLkqH3g== + version "2.7.0-next.3" + resolved "https://registry.yarnpkg.com/@eclipse-glsp/protocol/-/protocol-2.7.0-next.3.tgz#446fb5f0b13ca49651b35951903e92c1ef142f28" + integrity sha512-0QAsHKxCDaEqcqjdVIrYFlUhfbzCwcmHruTaYc74hnM/tOQbyk+DMIknhS8fGWGTb5orHjZM2hQTPrTjtHsUgg== dependencies: sprotty-protocol "1.4.0" uuid "~10.0.0" vscode-jsonrpc "8.2.0" -"@eclipse-glsp/ts-config@2.7.0-next.8+b3f9de7": - version "2.7.0-next.8" - resolved "https://registry.yarnpkg.com/@eclipse-glsp/ts-config/-/ts-config-2.7.0-next.8.tgz#b972ee70e39cbb6b595ed58686c6be4ccf7a2acb" - integrity sha512-9UOU6JF+KdNGKmxDX++xaVMVCriWYuk03UmgHgMjuH+JIxqI5lY3jV1eywuMEf1pAPiFidMa1cx3CFPp2ApFcg== +"@eclipse-glsp/ts-config@2.7.0-next.10+743aad5": + version "2.7.0-next.10" + resolved "https://registry.yarnpkg.com/@eclipse-glsp/ts-config/-/ts-config-2.7.0-next.10.tgz#b3e4443d720318408ff299b7613521f226b0a2f2" + integrity sha512-Parige4p4pLPt2mlBnH9AKUXOqAQcOSjjQYVJZJ5vVpVIcuVJr7+q8PVyezlQ/8MmHIrCaJ4o+/xcs6Oft+8cg== "@emnapi/core@^1.1.0": version "1.6.0" @@ -1511,10 +1511,10 @@ dependencies: undici-types "~5.26.4" -"@types/node@20.x": - version "20.19.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.19.11.tgz#728cab53092bd5f143beed7fbba7ba99de3c16c4" - integrity sha512-uug3FEEGv0r+jrecvUUpbY8lLisvIjg6AAic6a2bSP5OEOLeJsDSnvhCDov7ipFFMXS3orMpzlmi0ZcuGkBbow== +"@types/node@22.x": + version "22.19.15" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.19.15.tgz#6091d99fdf7c08cb57dc8b1345d407ba9a1df576" + integrity sha512-F0R/h2+dsy5wJAUe3tAU6oqa2qbWY5TpNfL/RGmo1y38hiyO1w3x2jPtt76wmuaJI4DQnOBu21cNXQ2STIUUWg== dependencies: undici-types "~6.21.0"