Skip to content

Commit 9e37c7e

Browse files
committed
GLSP-1636: Switch client build from yarn/lerna to pnpm
- Migrate the client workspace from Yarn 1.x + Lerna to a pnpm workspace (pnpm-workspace.yaml, pinned 'packageManager', and an 'only-allow pnpm' preinstall guard) - Replace lerna-based publish/clean/index scripts with pnpm '-r' and 'glsp releng publish' commands - Declare previously-phantom dependencies explicitly and use the 'workspace:*' protocol for the in-repo @eclipse-glsp/ide reference, as pnpm's strict node_modules layout requires - Update GitHub Actions (ci/codeql/publish) and the Jenkins pipeline to install, build, and cache with pnpm - Remove yarn.lock and lerna.json; add pnpm-lock.yaml - Update README/AGENTS docs and VS Code tasks to reference pnpm Also: - Add a 'fix' client fix-and-verify skill Part of: eclipse-glsp/glsp#1636
1 parent ed01446 commit 9e37c7e

18 files changed

Lines changed: 3969 additions & 6973 deletions

File tree

.claude/skills/fix/SKILL.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: fix
3+
description: Run the fix-and-verify suite for the client workspace (build, auto-fix lint/format/headers). IMPORTANT - Proactively invoke this skill after completing any code changes to the client (new features, bug fixes, refactors) before reporting completion. Re-run it after manually addressing anything it could not auto-fix.
4+
---
5+
6+
Run the auto-fix and validation suite for the GLSP Eclipse Integration client monorepo. All commands run from the `client/` directory (the pnpm workspace root):
7+
8+
```bash
9+
cd client
10+
```
11+
12+
1. Build first (compiles all TypeScript packages and bundles the workflow webapp). This is a hard gate: if the build fails, stop immediately, report the build errors, and do not run any of the following steps.
13+
The build must pass before anything else runs.
14+
15+
```bash
16+
pnpm build
17+
```
18+
19+
2. Auto-fix lint, formatting, and copyright headers. Run all three even if an earlier one reports remaining problems (they are independent):
20+
21+
```bash
22+
pnpm lint:fix
23+
pnpm format
24+
pnpm headers:fix
25+
```
26+
27+
Then:
28+
29+
- If `pnpm build` failed, fix the compile errors and re-run this skill.
30+
- If `pnpm lint:fix` reported lint errors it could not fix, fix them manually and re-run this skill.
31+
- Otherwise if everything is clean (compile succeeds, formatting and headers are corrected in place, lint has no remaining errors) — report completion.

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,35 @@ jobs:
1717
runs-on: ubuntu-22.04
1818
steps:
1919
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
20+
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
21+
with:
22+
package_json_file: client/package.json
2023
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
2124
with:
2225
node-version: 22.x
26+
cache: pnpm
27+
cache-dependency-path: client/pnpm-lock.yaml
2328
- name: Build
2429
working-directory: ./client
25-
run: yarn install
26-
- name: Check for uncommitted changes in yarn.lock
27-
run: |
28-
if git diff --name-only | grep -q "^client/yarn.lock"; then
29-
echo "::error::The yarn.lock file has uncommitted changes!"
30-
exit 1
31-
fi
30+
run: pnpm build
3231
lint:
3332
name: Lint
3433
timeout-minutes: 60
3534
runs-on: ubuntu-22.04
3635
steps:
3736
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
37+
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
38+
with:
39+
package_json_file: client/package.json
3840
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
3941
with:
4042
node-version: 22.x
41-
- name: Install
42-
working-directory: ./client
43-
run: |
44-
yarn install
43+
cache: pnpm
44+
cache-dependency-path: client/pnpm-lock.yaml
4545
- name: Create eslint json report
4646
working-directory: ./client
4747
run: |
48-
yarn lint:ci
48+
pnpm lint:ci
4949
- name: Create summary
5050
if: always()
5151
working-directory: ./client

.github/workflows/codeql-analysis.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,16 @@ jobs:
5858
run: mvn -B clean verify --file pom.xml
5959
working-directory: server
6060

61-
- name: Build Client with yarn
61+
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
62+
with:
63+
package_json_file: client/package.json
64+
- name: Build Client with pnpm
6265
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
6366
with:
6467
node-version: '22'
65-
- run: yarn install
68+
cache: pnpm
69+
cache-dependency-path: client/pnpm-lock.yaml
70+
- run: pnpm build
6671

6772
# ℹ️ Command-line programs to run using the OS shell.
6873
# 📚 https://git.io/JvXDl

.github/workflows/publish.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
4646
with:
4747
ref: ${{ inputs.ref || github.event.inputs.ref || github.event.workflow_run.head_commit.id || github.sha }}
48-
# Fetch all history for lerna to determine versions
48+
# Fetch all history to determine the canary version (commits since last tag)
4949
fetch-depth: 0
5050

5151
- name: Check for changes in "client/packages" directory
@@ -64,26 +64,33 @@ jobs:
6464
echo "should_publish=true" >> $GITHUB_OUTPUT
6565
fi
6666
67+
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
68+
if: steps.check_changes.outputs.should_publish == 'true'
69+
with:
70+
package_json_file: client/package.json
71+
6772
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
6873
if: steps.check_changes.outputs.should_publish == 'true'
6974
with:
7075
node-version: 22.x
7176
registry-url: 'https://registry.npmjs.org'
77+
cache: pnpm
78+
cache-dependency-path: client/pnpm-lock.yaml
7279

7380
- name: Build
7481
working-directory: ./client
7582
if: steps.check_changes.outputs.should_publish == 'true'
76-
run: yarn
83+
run: pnpm compile
7784

7885
- name: Publish to NPM
7986
if: steps.check_changes.outputs.should_publish == 'true'
8087
working-directory: ./client
8188
run: |
8289
DIST_TAG="${{ inputs.dist-tag || github.event.inputs.dist-tag || 'next' }}"
8390
if [[ "$DIST_TAG" == "next" ]]; then
84-
yarn publish:next
91+
pnpm publish:next
8592
elif [[ "$DIST_TAG" == "latest" ]]; then
86-
yarn publish:latest
93+
pnpm publish:latest
8794
else
8895
echo "Unknown dist-tag: $DIST_TAG"
8996
exit 1

AGENTS.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Project Structure & Module Organization
44
This repository is split into two main parts:
5-
- `client/`: TypeScript/Yarn workspace for the GLSP IDE integration package and workflow webapp example.
5+
- `client/`: TypeScript/pnpm workspace for the GLSP IDE integration package and workflow webapp example.
66
- `client/packages/ide/src/`: reusable integration source.
77
- `client/examples/workflow-webapp/src/`: example app source, bundled to `client/examples/workflow-webapp/app/`.
88
- `server/`: Java 17 + Maven/Tycho Eclipse plugin build.
@@ -11,26 +11,25 @@ This repository is split into two main parts:
1111
- `server/releng/`: target platform, feature, and p2 repository modules.
1212

1313
## Build, Test, and Development Commands
14-
- `cd client && yarn install`: install workspace dependencies (Node `>=22`, Yarn 1.x).
15-
- `cd client && yarn build`: compile TS packages and bundle the workflow webapp.
16-
- `cd client && yarn lint`: run ESLint on all TS/TSX sources.
17-
- `cd client && yarn format:check`: verify Prettier formatting.
18-
- `cd client && yarn check:pr`: CI-like client gate (`build`, `lint`, `format:check`, headers).
19-
- `cd client/examples/workflow-webapp && yarn test`: run Mocha specs (`*.spec.ts|tsx`) for the example app.
14+
The client is a pnpm workspace — do not use yarn or npm. A recent pnpm switches to the version pinned in `client/package.json`'s `packageManager` field.
15+
- `cd client && pnpm install`: install workspace dependencies (Node `>=22`, pnpm 11+).
16+
- `cd client && pnpm build`: compile TS packages and bundle the workflow webapp.
17+
- `cd client && pnpm lint`: run ESLint on all TS/TSX sources.
18+
- `cd client && pnpm format:check`: verify Prettier formatting.
19+
- `cd client && pnpm check:all`: CI-like client gate (`install`, `lint`, `format:check`, headers).
20+
- `cd client && pnpm copy:client`: copy the bundled webapp into the server's diagram folder.
2021
- `cd server && mvn clean install`: build Eclipse bundles.
2122
- `cd server && mvn clean install -Pp2`: build including p2 artifacts.
2223
- `cd server && mvn checkstyle:check -B`: run Java style checks.
2324

2425
## Coding Style & Naming Conventions
2526
- TypeScript: 4-space indentation, single quotes, trailing commas disabled, max line length 140 (see `.prettierrc`).
26-
- Linting: ESLint with `@eclipse-glsp` config (`client/.eslintrc.js`).
27+
- Linting: ESLint with `@eclipse-glsp` config (`client/eslint.config.mjs`).
2728
- Java: follow Checkstyle rules configured via Maven (`maven-checkstyle-plugin`).
2829
- Naming: keep existing conventions (`*.spec.ts` for tests, PascalCase Java classes, kebab-case TS file names where already used).
2930

3031
## Testing Guidelines
31-
Prefer targeted tests for changed behavior:
32-
- Client example tests live beside sources and should match `*.spec.ts`/`*.spec.tsx`.
33-
- Run `yarn check:pr` for client-side validation before opening a PR.
32+
- Validate client changes by running `pnpm check:all` (from `client/`) before opening a PR.
3433
- For server changes, run `mvn clean verify` (or at least `mvn clean install`) and `mvn checkstyle:check`.
3534

3635
## Commit & Pull Request Guidelines

Jenkinsfile

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kind: Pod
44
spec:
55
containers:
66
- name: ci
7-
image: eclipseglsp/ci:alpine-v8.0
7+
image: eclipseglsp/ci:alpine-v9.0
88
resources:
99
limits:
1010
memory: "2Gi"
@@ -22,8 +22,8 @@ spec:
2222
- mountPath: "/home/jenkins"
2323
name: "jenkins-home"
2424
readOnly: false
25-
- mountPath: "/.yarn"
26-
name: "yarn-global"
25+
- mountPath: "/.pnpm-store"
26+
name: "pnpm-store"
2727
readOnly: false
2828
- name: settings-xml
2929
mountPath: /home/jenkins/.m2/settings.xml
@@ -61,7 +61,7 @@ spec:
6161
volumes:
6262
- name: "jenkins-home"
6363
emptyDir: {}
64-
- name: "yarn-global"
64+
- name: "pnpm-store"
6565
emptyDir: {}
6666
- name: settings-xml
6767
secret:
@@ -102,7 +102,9 @@ pipeline {
102102
}
103103

104104
environment {
105-
YARN_CACHE_FOLDER = "${env.WORKSPACE}/yarn-cache"
105+
npm_config_store_dir = "${env.WORKSPACE}/.pnpm-store"
106+
// CI=true makes pnpm's implicit pre-run install a frozen-lockfile install.
107+
CI = "true"
106108
SPAWN_WRAP_SHIM_ROOT = "${env.WORKSPACE}"
107109
EMAIL_TO= "glsp-build@eclipse.org"
108110
}
@@ -139,14 +141,9 @@ pipeline {
139141
container('ci') {
140142
timeout(30){
141143
dir('client') {
142-
sh "yarn install"
143-
script {
144-
// Fail the step if there are uncommited changes to the yarn.lock file
145-
if (sh(returnStatus: true, script: 'git diff --name-only | grep -q "^client/yarn.lock"') == 0) {
146-
echo 'The yarn.lock file has uncommited changes!'
147-
error 'The yarn.lock file has uncommited changes!'
148-
}
149-
}
144+
sh "pnpm build"
145+
// Copy the webapp bundle into the server's diagram folder for the server build.
146+
sh "pnpm copy:client"
150147
}
151148
}
152149
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ https://user-images.githubusercontent.com/588090/161574154-1da641be-86e1-4d4b-8c
1616

1717
### How to start the Workflow Diagram example?
1818

19-
First, you need to build both the client and the server (see instructions on [building the client](client/README.md#building) and [building the server](server/README.md#building)).
19+
First, you need to build both the client and the server (see instructions on [building the client](client/README.md#developer-documentation) and [building the server](server/README.md#building)).
2020
Then, import the following Eclipse plug-in projects into your Eclipse IDE workspace:
2121

2222
- `server/plugins/org.eclipse.glsp.ide.editor`

client/.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dist/
1111

1212
# Lock files
1313
package-lock.json
14-
yarn.lock
14+
pnpm-lock.yaml
1515
examples/workflow-webapp/app
1616
# Logs
1717
*.log

client/.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"kind": "build",
1111
"isDefault": true
1212
},
13-
"command": "yarn",
13+
"command": "pnpm build",
1414
"presentation": {
1515
"reveal": "always",
1616
"panel": "new"
@@ -21,7 +21,7 @@
2121
"label": "Watch all packages",
2222
"type": "shell",
2323
"group": "test",
24-
"command": "yarn watch",
24+
"command": "pnpm watch",
2525
"presentation": {
2626
"reveal": "always",
2727
"panel": "new"

client/README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,22 @@
33
Contains the client side glue code for opening browser-based GLSP diagrams in an Eclipse IDE editor as well as the workflow webapp example.
44
This project is available from npm via [@eclipse-glsp/ide](https://www.npmjs.com/package/@eclipse-glsp/ide).
55

6-
## Building
6+
## Developer Documentation
77

8-
To build this project locally, run `yarn` in this directory.
8+
### First time setup
9+
10+
- Install [node.js](https://nodejs.org/) (requires Node v22+)
11+
- Install pnpm: <https://pnpm.io/installation> (use pnpm 11+); a recent pnpm automatically switches to the version pinned in the `packageManager` field
12+
- Clone this repository
13+
- Install dependencies from this `client` directory: `pnpm i` or `pnpm i --frozen-lockfile`
14+
15+
### Build & Testing
16+
17+
- Build (all packages + workflow webapp bundle): `pnpm build`
18+
- Lint: `pnpm lint`
19+
- Check formatting: `pnpm format:check`
20+
- Clean (all packages): `pnpm clean`
21+
- `pnpm copy:client` copies the bundled webapp into the Eclipse server's diagram folder (`../server/example/org.eclipse.glsp.ide.workflow.editor/diagram`); the Jenkins build runs this automatically before building the server.
922

1023
## More information
1124

0 commit comments

Comments
 (0)