|
1 | 1 | --- |
2 | 2 | name: generate-changelog |
3 | | -description: Generate changelog pages from gramiojs org patches using ghlog CLI. Tracks last-seen commit SHAs per repo via --since-map for precise incremental updates. Also updates docs and skills to reflect changes. |
| 3 | +description: Generate changelog pages from gramiojs org patches using ghlog CLI. Tracks last-seen commit SHAs per repo via --since-map for precise incremental updates. Also updates docs and skills to reflect changes, and maintains the per-package GramIO upgrade data (public/migrations.json) that generates the upgrade skill, the upgrading guide, and the version picker. |
4 | 4 | allowed-tools: Read, Write, Edit, Bash, Glob, Grep |
5 | 5 | metadata: |
6 | 6 | internal: true |
@@ -284,11 +284,54 @@ If a notable new feature was added, create or update `skills/examples/<name>.ts` |
284 | 284 | - `skills/plugins/` — Update plugin guides if plugin behavior changed |
285 | 285 | - `skills/metadata.json` — Bump the version number and date |
286 | 286 |
|
| 287 | +#### Update the upgrade data (`public/migrations.json`) — MANDATORY |
| 288 | +
|
| 289 | +The `gramio-upgrade` skill, the `docs/guides/upgrading.md` page (EN + RU), and the `<UpgradePicker />` widget are all generated from **one source of truth: `public/migrations.json`**. You author the JSON here — **reusing the migration content you already wrote for the changelog page** (do not re-derive it) — then run the generator. Never hand-edit the derived files (`skills/gramio-upgrade/MIGRATIONS.md`, the generated block in `docs/guides/upgrading.md` / `docs/ru/guides/upgrading.md`); they'll be overwritten. |
| 290 | +
|
| 291 | +For **every package that had a version bump this run** (the same set you covered in steps 5–6): |
| 292 | +
|
| 293 | +1. Open `public/migrations.json`. Find `packages["<name>"]` (create it if the package is new — give it `repo`, a `layer` for dependency ordering: `1` types/composer/schema-parser/wrappergram, `2` contexts/files/format/keyboards/callback-data/storage*, `3` gramio, `4` plugins, `5` tooling/create-gramio — and an empty `entries: []`). |
| 294 | +2. **Prepend** a new entry to that package's `entries` array (newest first): |
| 295 | +
|
| 296 | + ```json |
| 297 | + { |
| 298 | + "from": "<installed-before>", |
| 299 | + "to": "<new-version>", |
| 300 | + "date": "YYYY-MM-DD", |
| 301 | + "changelog": "/changelogs/YYYY-MM-DD", |
| 302 | + "pendingPublish": false, |
| 303 | + "upgradeStraightTo": null, |
| 304 | + "peerBumps": ["@gramio/types ^10"], |
| 305 | + "notes": [{ "en": "…", "ru": "…" }], |
| 306 | + "breaking": [ |
| 307 | + { |
| 308 | + "en": { "title": "…", "desc": "…" }, |
| 309 | + "ru": { "title": "…", "desc": "…" }, |
| 310 | + "before": "old code (optional)", |
| 311 | + "after": "new code (optional)" |
| 312 | + } |
| 313 | + ], |
| 314 | + "deprecated": [], |
| 315 | + "new": [], |
| 316 | + "fixes": [] |
| 317 | + } |
| 318 | + ``` |
| 319 | +
|
| 320 | + Rules for the entry: |
| 321 | + - **Bilingual:** every `breaking`/`deprecated`/`new`/`fixes` item and every `notes` line needs both `en` and `ru` (write natural Russian, like the RU changelog — don't translate mechanically). `before`/`after` code stays language-agnostic (write it once). |
| 322 | + - Omit/empty any bucket that doesn't apply. `from: null` for a brand-new package's first release. Keep snippets short and runnable (camelCase `ctx` getters, `format\`\``, no `any`, no `ctx.payload`). |
| 323 | + - **Pending publish (step 5a):** set `"pendingPublish": true` if the version is tagged but not yet on npm. |
| 324 | + - **WIP rule (step 5b):** `to` must be the version whose SHA you saved, not a half-finished trailing commit. |
| 325 | + - **Known-bad release:** if there's an immediate follow-up fix (like `@gramio/scenes` 0.7.0 → 0.7.1), set `"upgradeStraightTo": "0.7.1"` and add a `fixes` item saying so. |
| 326 | +3. Run **`bun run build:migrations`** to regenerate `skills/gramio-upgrade/MIGRATIONS.md` and the generated blocks in both `upgrading.md` pages. Then `bun run build:migrations -- --check` should report "in sync". |
| 327 | +
|
287 | 328 | **Checklist before moving on from this step:** |
288 | 329 | - [ ] Every new plugin doc page has a corresponding `skills/plugins/<name>.md` |
289 | 330 | - [ ] Every new standalone doc page has a corresponding `skills/references/<name>.md` |
290 | 331 | - [ ] Notable new features have examples in `skills/examples/` |
291 | 332 | - [ ] Changed plugin behavior is reflected in existing `skills/plugins/` files |
| 333 | +- [ ] Every package version bump this run has a bilingual entry in `public/migrations.json` |
| 334 | +- [ ] `bun run build:migrations` was run and `-- --check` is green (derived files in sync) |
292 | 335 | - [ ] `skills/metadata.json` version and date are bumped |
293 | 336 |
|
294 | 337 | For each update, keep a record of what file was changed and why for the final report. |
|
0 commit comments