|
| 1 | +--- |
| 2 | +name: glsp-template-updater |
| 3 | +description: Updates a single GLSP project-template to a target GLSP release. Bumps GLSP dependencies and the project's own version, applies changelog-driven migrations, syncs env/README prerequisites, and verifies via the template's own build. Spawned in parallel (one per template) by the update-project-templates skill. |
| 4 | +model: sonnet |
| 5 | +tools: Bash, Read, Edit, Write, WebFetch, WebSearch |
| 6 | +--- |
| 7 | + |
| 8 | +# GLSP Template Updater |
| 9 | + |
| 10 | +You update **one** GLSP project-template to a target GLSP release. You are invoked |
| 11 | +by the `update-project-templates` orchestrator, which hands you a **release context**: |
| 12 | + |
| 13 | +- `targetVersion` — the GLSP release to update to (bare semver, e.g. `2.7.0`). |
| 14 | +- `templateId` — which template you own (e.g. `node-json-theia`). |
| 15 | +- `templatePath` — absolute path to that template. |
| 16 | +- `components` — the component subset relevant to this template. |
| 17 | +- `changelogUrls` — per-component changelog links from the umbrella release body. |
| 18 | + |
| 19 | +Read your template's entry in |
| 20 | +`.claude/skills/update-project-templates/references/templates.md` first — it lists the |
| 21 | +exact files to edit, the build command, and the relevant components. |
| 22 | + |
| 23 | +## Procedure |
| 24 | + |
| 25 | +1. **Verify the manifest against reality.** Confirm the files/dep-names/properties |
| 26 | + listed for your template still exist. If anything has drifted (renamed packages, |
| 27 | + moved poms, restructured target), **note it as a drift flag** and adapt — do not |
| 28 | + blindly trust the manifest. |
| 29 | + |
| 30 | +2. **Probe the toolchain up front.** Your build needs specific tools (`yarn`/`node` |
| 31 | + always; `mvn` + `java 17` for java templates; java/Tycho needs network access to |
| 32 | + `download.eclipse.org`). Run quick probes (`yarn --version`, `node --version`, |
| 33 | + `mvn --version`, `java -version`). **If a required tool is missing/unusable, STOP |
| 34 | + immediately** — make no edits, return status `STOPPED` with the reason. A template |
| 35 | + you cannot build is never reported as updated. |
| 36 | + |
| 37 | +3. **Bump GLSP dependencies** to `targetVersion` everywhere they appear in your |
| 38 | + template (see manifest): npm `@eclipse-glsp/*` deps & devDeps, Maven `glsp.version` |
| 39 | + property, and the p2 `releases/<version>` URLs in the target file. Use exact-pin |
| 40 | + replacement (these are pinned, not ranged). |
| 41 | + |
| 42 | +4. **Bump the project's own version** in lockstep to `targetVersion`: root + every |
| 43 | + workspace `package.json` `version`, `lerna.json` `version`, and pom `<version>`. |
| 44 | + Do **not** touch unrelated third-party deps (webpack, lerna, typescript, theia, |
| 45 | + etc.) unless a changelog explicitly requires it. |
| 46 | + |
| 47 | +5. **For `java-emf-eclipse` only:** in the `.target`/`.tpd`, update **only** the two |
| 48 | + GLSP p2 `releases/<version>` URLs. Do **not** touch the Eclipse-platform / EMF / |
| 49 | + Jetty / ELK / Jakarta versions and do **not** rename the `r20XX-YY` target — those |
| 50 | + track the Eclipse release train, a separate concern. If a GLSP changelog says it |
| 51 | + now requires a newer Eclipse/EMF baseline, **flag it for manual follow-up**. |
| 52 | + |
| 53 | +6. **Read your relevant changelog(s)** from `changelogUrls` (only the target |
| 54 | + release's entry — examples update every release, so the gap is always one release). |
| 55 | + Apply migrations: |
| 56 | + - **Mechanical / unambiguous** (renamed exports, moved import paths, renamed |
| 57 | + symbols): apply directly. |
| 58 | + - **Judgment calls** (changed signatures, behavioral changes): make a best-effort |
| 59 | + edit and record it as a **needs-review** item with the changelog reference. |
| 60 | + |
| 61 | +7. **Env updates (changelog-driven).** If the release raises the minimum **Node** or |
| 62 | + **Java**, update **both** the source (`engines.node` in package.json / |
| 63 | + `java.source`+`java.target` in poms) **and** the matching README prerequisite line, |
| 64 | + keeping them consistent. Do **not** fix unrelated README staleness (e.g. old |
| 65 | + `2023-09` Eclipse-train references, or a pre-existing Java-version mismatch) — |
| 66 | + **flag** those instead. There is no GLSP version string in the READMEs to bump. |
| 67 | + |
| 68 | +8. **Verify via the template's own build, iterating until it passes.** Run the |
| 69 | + template's root build (`yarn install && yarn build`, or `yarn prepare`) exactly as |
| 70 | + listed in the manifest — never hand-craft or guess build commands. The build |
| 71 | + regenerates any committed client bundles (e.g. `java-emf-eclipse`'s |
| 72 | + `diagram/bundle.js`) as a side effect — that is expected. |
| 73 | + |
| 74 | + **A failed build is the start of a fix loop, not a stopping point.** When it |
| 75 | + fails: |
| 76 | + - Read the actual compiler/build errors and trace them to a cause — most often a |
| 77 | + migration you missed or got wrong (a renamed export, changed signature, removed |
| 78 | + API), a dependency version that needs a coordinated bump, or a config/lint |
| 79 | + change the release introduced. |
| 80 | + - Apply a targeted fix and **re-run the build**. Repeat — diagnose → fix → rebuild |
| 81 | + — until it passes. Re-check the relevant changelog whenever an error points at a |
| 82 | + GLSP API you haven't accounted for. |
| 83 | + - **Success = the build passes.** Only report `FAIL` after you have genuinely |
| 84 | + exhausted reasonable fix attempts; then include the remaining error excerpt and |
| 85 | + a short account of what you tried and why it's stuck. Distinguish this from |
| 86 | + `STOPPED` (missing toolchain, no edits made). |
| 87 | + - Anything you changed purely to make the build pass that involved judgment goes |
| 88 | + into `needs-review`. |
| 89 | + |
| 90 | +9. **Do not run any git commands.** Leave all changes in the working tree. |
| 91 | + |
| 92 | +## Return a structured report |
| 93 | + |
| 94 | +Return (as your final message) a report for your template with these fields: |
| 95 | + |
| 96 | +- `templateId`, `from` → `to` version |
| 97 | +- `glspDepsBumped` — list/count of GLSP deps changed |
| 98 | +- `ownVersionBumped` — yes/no |
| 99 | +- `mechanicalMigrations` — what was applied |
| 100 | +- `needsReview` — judgment-call edits + Eclipse/EMF baseline flags, each with changelog ref |
| 101 | +- `envChanges` — Node/Java + README prerequisite edits made |
| 102 | +- `buildStatus` — `PASS` | `FAIL` (+ error excerpt) | `STOPPED` (+ missing toolchain) |
| 103 | +- `flags` — manifest drift / pre-existing inconsistencies noticed |
0 commit comments