Skip to content

Commit c867495

Browse files
authored
GLSP-1637: Upgrade to node 22 (#43)
- Upgrad codebase and workflows to node 22 - Streamline CLAUDE.md and AGENTS.md - Add skills for verify,check and test
1 parent eec48b0 commit c867495

14 files changed

Lines changed: 285 additions & 121 deletions

File tree

.claude/skills/fix/SKILL.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: fix
3+
description: Auto-fix all lint, formatting, and copyright header issues across the workspace. Use when validation (`/verify`) fails or when explicitly requested.
4+
---
5+
6+
Run the full auto-fix suite for this project from the repository root:
7+
8+
```bash
9+
yarn fix:all
10+
```
11+
12+
After fixing, report what changed. If any issues remain that couldn't be auto-fixed, list them and suggest manual fixes.

.claude/skills/test/SKILL.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: test
3+
description: Run Playwright tests for a specific integration (standalone, theia, or vscode). Handles full environment setup including repo preparation and .env generation. Usage - /test standalone, /test theia, or /test vscode.
4+
---
5+
6+
Run Playwright tests for the specified integration. Handles environment setup, compilation, and test execution.
7+
8+
## Usage
9+
10+
`$ARGUMENTS` should be one of: `standalone`, `theia`, `vscode`, or empty (defaults to standalone).
11+
If `$ARGUMENTS` contains a specific test name pattern, run tests filtered by that pattern.
12+
13+
Optionally, the user may specify a version (branch or tag) for the GLSP repositories, e.g. `/test standalone v2.6.0` or `/test theia release_2.7.0`.
14+
Extract the version from `$ARGUMENTS` if present (anything that is not an integration name or test pattern). If no version is specified, default to `master`.
15+
16+
## Steps
17+
18+
### 1. Environment Setup
19+
20+
Check if `examples/workflow-test/.env` exists. If not, run the setup script to prepare repositories and generate it:
21+
22+
```bash
23+
bash .claude/skills/test/scripts/setup-env.sh --protocol https
24+
```
25+
26+
If the user specified a version (branch or tag), add `--branch <version>`:
27+
28+
```bash
29+
bash .claude/skills/test/scripts/setup-env.sh --protocol https --branch <version>
30+
```
31+
32+
When no version is specified, omit `--branch` entirely so each repository uses its own default branch.
33+
34+
This script will:
35+
36+
- Clone and build required GLSP repositories (via `yarn repo prepare`) at the specified branch/tag if the `repositories/` directory is missing or incomplete
37+
- Generate `examples/workflow-test/.env` with the correct values (server config, standalone URL, VSCode paths, etc.)
38+
39+
If the `.env` file already exists, skip this step.
40+
41+
### 2. Build
42+
43+
Ensure the project is compiled:
44+
45+
```bash
46+
yarn build
47+
```
48+
49+
### 3. Run Tests
50+
51+
Run the appropriate test command:
52+
53+
- **standalone** (default): `yarn test:standalone`
54+
- **theia**: `yarn test:theia`
55+
- **vscode**: `yarn test:vscode`
56+
- **pattern match**: If `$ARGUMENTS` contains a specific test name pattern, run: `cd examples/workflow-test && yarn playwright test -g "$ARGUMENTS"`
57+
58+
For **theia** tests, the Theia server needs to be running. Start it before running tests:
59+
60+
```bash
61+
yarn repo theia-integration start &
62+
```
63+
64+
Wait a few seconds for it to start before running the tests.
65+
66+
### 4. Report Failures
67+
68+
If tests fail, read the Playwright HTML report or error output and summarize failures with actionable suggestions.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/usr/bin/env bash
2+
# Setup script for GLSP Playwright test environment.
3+
# Ensures repositories are cloned/built and generates a .env file
4+
# in examples/workflow-test/ with the correct values.
5+
#
6+
# Usage: bash .claude/skills/test/scripts/setup-env.sh [--protocol ssh|https]
7+
8+
set -euo pipefail
9+
10+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11+
ROOT_DIR="$(cd "$SCRIPT_DIR/../../../.." && pwd)"
12+
WORKFLOW_TEST_DIR="$ROOT_DIR/examples/workflow-test"
13+
REPO_DIR="$WORKFLOW_TEST_DIR/repositories"
14+
ENV_FILE="$WORKFLOW_TEST_DIR/.env"
15+
16+
# Parse arguments
17+
PROTOCOL_VALUE="https"
18+
BRANCH_VALUE=""
19+
20+
while [[ $# -gt 0 ]]; do
21+
case "$1" in
22+
--protocol)
23+
PROTOCOL_VALUE="${2:-https}"
24+
shift 2
25+
;;
26+
--branch)
27+
BRANCH_VALUE="${2:-}"
28+
shift 2
29+
;;
30+
*)
31+
shift
32+
;;
33+
esac
34+
done
35+
36+
# --- Step 1: Prepare repositories if needed ---
37+
# Check if the glsp-client repo exists and has been built
38+
if [ ! -d "$REPO_DIR/glsp-client/examples/workflow-standalone/app" ]; then
39+
echo "Repositories not found or not built. Running 'yarn repo prepare'..."
40+
cd "$ROOT_DIR"
41+
BRANCH_ARG=""
42+
if [ -n "$BRANCH_VALUE" ]; then
43+
BRANCH_ARG="--branch $BRANCH_VALUE"
44+
fi
45+
yarn repo prepare --protocol "$PROTOCOL_VALUE" $BRANCH_ARG
46+
else
47+
echo "Repositories already prepared."
48+
fi
49+
50+
# --- Step 2: Generate .env file ---
51+
echo "Generating .env file at $ENV_FILE..."
52+
53+
cd "$ROOT_DIR"
54+
STANDALONE_URL="$(yarn -s repo client url)"
55+
VSCODE_VSIX_PATH="$(yarn -s repo vscode-integration vsixPath)"
56+
57+
cat > "$ENV_FILE" <<EOF
58+
GLSP_SERVER_DEBUG="true"
59+
GLSP_SERVER_PORT="8081"
60+
GLSP_SERVER_PLAYWRIGHT_MANAGED="true"
61+
GLSP_WEBSOCKET_PATH="workflow"
62+
GLSP_SERVER_TYPE="node"
63+
64+
# Integration URLs
65+
STANDALONE_URL="$STANDALONE_URL"
66+
THEIA_URL="http://localhost:3000"
67+
68+
# VSCode
69+
VSCODE_VSIX_ID="eclipse-glsp.workflow-vscode-example"
70+
VSCODE_VSIX_PATH="$VSCODE_VSIX_PATH"
71+
72+
# Server start command (used by Playwright to manage the server)
73+
GLSP_SERVER_START_COMMAND="yarn repo node-server start"
74+
EOF
75+
76+
echo "Environment setup complete. .env written to $ENV_FILE"

.claude/skills/verify/SKILL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: verify
3+
description: Run full project validation (build,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.
4+
---
5+
6+
Run the full validation suite for this project from the repository root:
7+
8+
```bash
9+
yarn check:all
10+
```
11+
12+
On failure:
13+
14+
1. Report which check failed and the specific errors
15+
2. Auto-fix by invoking the `/fix` skill
16+
3. Re-run `yarn check:all` to confirm everything passes

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1919
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
2020
with:
21-
node-version: 20.x
21+
node-version: 22.x
2222
- name: Install dependencies
2323
run: yarn install
2424
- name: Check for uncommitted changes in yarn.lock
@@ -35,7 +35,7 @@ jobs:
3535
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3636
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
3737
with:
38-
node-version: 20.x
38+
node-version: 22.x
3939
- name: Install
4040
run: |
4141
yarn install --ignore-scripts
@@ -65,7 +65,7 @@ jobs:
6565
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6666
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
6767
with:
68-
node-version: '20'
68+
node-version: '22'
6969
- name: Install dependencies
7070
run: yarn install
7171
- name: Prepare repos
@@ -103,7 +103,7 @@ jobs:
103103
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
104104
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
105105
with:
106-
node-version: '20'
106+
node-version: '22'
107107
- name: Set up JDK
108108
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
109109
with:

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3131
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
3232
with:
33-
node-version: '20'
33+
node-version: '22'
3434
- name: Install dependencies
3535
run: yarn install
3636
- name: Prepare repos

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
6868
if: steps.check_changes.outputs.should_publish == 'true'
6969
with:
70-
node-version: 20.x
70+
node-version: 22.x
7171
registry-url: 'https://registry.npmjs.org'
7272

7373
- name: Build

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ examples/workflow-test/playwright/.storage/*.json
1717
!*.env.example
1818
*.env
1919

20+
21+
.cache/
22+
2023
./claude/settings.local.json
2124
.claude/plans
2225
.reviews

AGENTS.md

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,16 @@
1-
# Repository Guidelines
1+
# AGENTS.md
22

3-
## Project Structure & Module Organization
3+
## Project Overview
44

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.
66

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
118

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
1311

14-
## Build, Test, and Development Commands
12+
## Code Style Rules
1513

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

CLAUDE.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
@AGENTS.md
1+
# CLAUDE.md
2+
3+
## Project Overview
4+
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+
7+
## Build & Development
8+
9+
- **Package manager**: Yarn 1.x (classic) — do not use Yarn 2+/Berry or npm
10+
- **Build**: `yarn` from root installs and compiles everything
11+
12+
## Validation
13+
14+
- After completing any code changes, always run the `/verify` skill before reporting completion
15+
- If verification fails, run the `/fix` skill to auto-fix issues, then re-run `/verify`
16+
17+
## Code Style Rules
18+
19+
- **No direct sprotty imports** — never import from `sprotty` or `sprotty-protocol` directly; use `@eclipse-glsp/client` instead (enforced by ESLint)
20+
- **Floating promises**`@typescript-eslint/no-floating-promises` is an error; always `await` or handle promises
21+
- **Path alias**`~/` maps to `packages/glsp-playwright/src/` in TypeScript configs

0 commit comments

Comments
 (0)