From e3e6cae2768984b02b994b687b31d00a87dbe713 Mon Sep 17 00:00:00 2001 From: Tobias Ortmayr Date: Mon, 30 Mar 2026 22:20:02 +0200 Subject: [PATCH] GLSP-1637: Update to Node 22 - Update codebase to Node 22 - Update/refactor ai agent metadata - Add trimmed down/context optimized agent/claude md files - Add claude skill for build verification and fixing issues --- .claude/skills/fix/SKILL.md | 12 ++++ .claude/skills/verify/SKILL.md | 23 +++++++ .github/workflows/ci.yml | 8 +-- .github/workflows/e2e.yml | 2 +- .github/workflows/publish.yml | 2 +- .mocharc | 1 + AGENTS.md | 56 +++++------------ CLAUDE.md | 27 ++++++++- package.json | 4 +- yarn.lock | 108 ++++++++++++++++----------------- 10 files changed, 140 insertions(+), 103 deletions(-) create mode 100644 .claude/skills/fix/SKILL.md create mode 100644 .claude/skills/verify/SKILL.md diff --git a/.claude/skills/fix/SKILL.md b/.claude/skills/fix/SKILL.md new file mode 100644 index 00000000..6df8e754 --- /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 Client monorepo from the repository root: + +```bash +yarn lint:fix && yarn format && yarn headers:fix +``` + +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 00000000..e3e486b8 --- /dev/null +++ b/.claude/skills/verify/SKILL.md @@ -0,0 +1,23 @@ +--- +name: verify +description: Run full project validation (lint, 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 Client monorepo from the repository root: + +```bash +yarn check:all +``` + +In a parallel task, run the test suite to ensure all tests pass: + +```bash +yarn test +``` + +On failure: + +1. Report which checks/tests failed and the specific errors +2. If checks failed, auto-fix by invoking the `/fix` skill +3. In case of previous test failures, re-run the `yarn test` command to confirm all tests now pass +4. Re-run `yarn check:all` to confirm everything passes diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ca163b7..efa61103 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: Check for uncommitted changes in yarn.lock @@ -36,7 +36,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 @@ -58,7 +58,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 @@ -79,7 +79,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/e2e.yml b/.github/workflows/e2e.yml index 10fdad4f..59cecac4 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -36,7 +36,7 @@ jobs: path: 'glsp-playwright' - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: - node-version: '20' + node-version: '22' - name: Install dependencies run: | cd glsp-client diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7cb6d1d6..42987ca1 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 942cf547..91f2321a 100644 --- a/.mocharc +++ b/.mocharc @@ -1,6 +1,7 @@ { "$schema": "https://json.schemastore.org/mocharc", "extends": "@eclipse-glsp/mocha-config", + "node-option": ["no-experimental-strip-types"], "require": [ "ts-node/register", "tsconfig-paths/register", diff --git a/AGENTS.md b/AGENTS.md index d24ecbd3..ebd92ab4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,50 +1,26 @@ -# Repository Guidelines +# CLAUDE.md -## Project Structure & Module Organization +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. -This repository is a Yarn workspaces/Lerna monorepo. +## Project Overview -- `packages/client`: main GLSP client framework (`src/`, `css/`, unit tests as `*.spec.ts`). -- `packages/protocol`: client-server protocol types and JSON-RPC helpers. -- `packages/glsp-sprotty`: GLSP-specific sprotty re-exports/overrides. -- `examples/workflow-standalone`: browser demo app and example server launcher. -- `examples/workflow-glsp`: workflow diagram example package used by the standalone app. +Eclipse GLSP Client monorepo. Provides the sprotty-based client framework for the Graphical Language Server Platform (GLSP). Contains the core client packages and example applications. Uses Lerna with Yarn workspaces. -Keep new code inside the relevant package `src/` folder and colocate tests with implementation. +## 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` -Use Node `>=20` and Yarn `>=1.7.0 <2`. +## Validation -- `yarn install`: install all workspace dependencies. -- `yarn build`: compile TypeScript and bundle the standalone example. -- `yarn compile`: run TypeScript project builds only. -- `yarn lint`: run ESLint on `.ts/.tsx` sources. -- `yarn test`: run package test suites via Lerna. -- `yarn test:coverage`: generate coverage with `nyc` per package. -- `yarn watch`: run TypeScript/watch build flows. -- `yarn start:exampleServer`: download/start workflow example server. +- **Tests**: `yarn test` (Mocha), single test: `yarn test --grep 'test name'` -## Coding Style & Naming Conventions +## Inter-Package Import Rules -Code is TypeScript-first, formatted by Prettier (`@eclipse-glsp/prettier-config`) and linted by ESLint (`@eclipse-glsp`). +These are enforced by ESLint and are easy to get wrong: -- Follow existing formatting (4-space indentation, semicolons, single quotes). -- Use `PascalCase` for classes/types, `camelCase` for functions/variables. -- Use descriptive module filenames in kebab-case where established (e.g., `command-palette-tool.ts`). -- Prefer GLSP re-exports (`@eclipse-glsp/client`) instead of direct `sprotty` imports. - -## Testing Guidelines - -- Framework: Mocha with `ts-node` (`.mocharc` at repo root). -- Test files: `*.spec.ts` or `*.spec.tsx`, typically next to source files. -- Run targeted tests from a package, e.g. `yarn --cwd packages/client test`. -- Run `yarn test` and `yarn test:coverage` before opening a PR. - -## Commit & Pull Request Guidelines - -- Open/track an issue first in `https://github.com/eclipse-glsp/glsp`. -- Branch naming: `issues/` (for committers). -- Commit messages should be imperative and focused; reference the issue using an absolute URL (for auto-close). -- PRs should include: problem statement, solution summary, linked issue, and screenshots/GIFs for UI-visible changes. -- Before requesting review, run `yarn check:all`. +- **Never use relative imports** like `../` or `../index` — use package names +- **`@eclipse-glsp/protocol`**: Must NOT import from `sprotty`, `sprotty-protocol`, or `@eclipse-glsp/client` +- **`@eclipse-glsp/sprotty`**: Must NOT import directly from `sprotty-protocol` — use `sprotty` reexports instead +- **`@eclipse-glsp/client`**: Must NOT import directly from `sprotty` or `sprotty-protocol` — use `@eclipse-glsp/sprotty` reexports instead diff --git a/CLAUDE.md b/CLAUDE.md index 43c994c2..d2958a72 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1 +1,26 @@ -@AGENTS.md +# CLAUDE.md + +## Project Overview + +Eclipse GLSP Client monorepo. Provides the sprotty-based client framework for the Graphical Language Server Platform (GLSP). Contains the core client packages and example applications. 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 +- **Clean**: `yarn clean` + +## Validation + +- **Tests**: `yarn test` (Mocha), single test: `yarn test --grep 'test name'` +- 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` + +## Inter-Package Import Rules + +These are enforced by ESLint and are easy to get wrong: + +- **Never use relative imports** like `../` or `../index` — use package names +- **`@eclipse-glsp/protocol`**: Must NOT import from `sprotty`, `sprotty-protocol`, or `@eclipse-glsp/client` +- **`@eclipse-glsp/sprotty`**: Must NOT import directly from `sprotty-protocol` — use `sprotty` reexports instead +- **`@eclipse-glsp/client`**: Must NOT import directly from `sprotty` or `sprotty-protocol` — use `@eclipse-glsp/sprotty` reexports instead diff --git a/package.json b/package.json index add54264..888098dc 100644 --- a/package.json +++ b/package.json @@ -37,14 +37,14 @@ "devDependencies": { "@eclipse-glsp/dev": "next", "@types/lodash": "4.14.191", - "@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 f7738662..f394d86e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -256,18 +256,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" @@ -280,14 +280,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" @@ -304,40 +304,40 @@ 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/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.5.0" @@ -1533,10 +1533,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"