Add sync-latest-to-next script and update docs#289
Conversation
Add a new executable script scripts/sync-latest-to-next.js to copy files from a product's latest/ tree to the matching next/ tree, rewriting internal latest→next links and preserving destination front matter. Update CLAUDE.md to require logging and to instruct running the sync script after editing latest/. Revise SDK guides (sdk/latest and sdk/next) for upgrades: add warnings, clarify upgrade handler type and InitGenesis override behavior, and expand notes on syncing full nodes; clean up Go example formatting in migration code. Also trim stray blank lines in ADR/RFC templates and make small copy edits in example tutorial pages and the v0.54 upgrade guide (clarify changelog references and fix anchors).
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Greptile SummaryThis PR introduces Confidence Score: 5/5Safe to merge; all remaining findings are P2 style suggestions with no correctness or data-integrity impact. The sync script logic is correct — front matter preservation, link rewriting, and directory walking all behave as intended. Documentation edits are accurate. The only issues found are: a duplicated instruction in CLAUDE.md, repeated paragraphs in the upgrade guide, a trailing space in one tutorial file, and an inaccurate comment in the script — none of which affect runtime behaviour or user-facing correctness. sdk/next/upgrade/upgrade.mdx (duplicate not-exhaustive paragraph) and CLAUDE.md (duplicate sync instruction). Important Files Changed
|
| - `next/` — active development. Default working directory for new content. | ||
| - `v0.53/`, `v10.1.x/`, etc. — archived versions. Do not edit these. | ||
|
|
There was a problem hiding this comment.
The instruction to run sync-latest-to-next.js after editing latest/ appears twice: once in the "Notes and sync" numbered list (item 2, lines 10-11) and again as a standalone paragraph here. Having it in two places risks the two versions drifting and makes CLAUDE.md longer without adding clarity.
|
|
||
| This guide provides an overview of the major changes in v0.54.0. However, this guide is not exhaustive for all breaking changes. For a comprehensive list of all breaking changes in v0.54.0, see the [Changelog](https://github.com/cosmos/cosmos-sdk/blob/release/v0.54.x/CHANGELOG.md). | ||
|
|
There was a problem hiding this comment.
Duplicate "not exhaustive" paragraph
The same "this guide is not exhaustive" message (with an identical Changelog link) already appears in the document's opening paragraph at lines 10-11. Having it a second time at the top of "Required Changes" adds noise without new information.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| ### Store v2 | ||
|
|
||
| Store v2 introduces breaking changes. For a comprehensive list of all breaking changes, see the [Changelog](https://github.com/cosmos/cosmos-sdk/blob/release/v0.54.x/CHANGELOG.md). |
There was a problem hiding this comment.
Duplicate Changelog link under Store v2
The sentence "Store v2 introduces breaking changes. For a comprehensive list of all breaking changes, see the [Changelog]..." repeats the same Changelog reference already given at the top of the document (lines 10-11) and again at line 80. One canonical mention is enough.
| In [quickstart](/sdk/next/tutorials/example/02-quickstart), you started a chain and submitted a transaction to increase the counter. In this tutorial, you'll build a simple counter module from scratch. It follows the same overall structure as the full `x/counter`, but uses a stripped-down version so you can focus on the core steps of building and wiring a module yourself. | ||
|
|
||
| By the end, you'll have built a working module and wired it into a running chain. For a deeper dive into how modules work in the Cosmos SDK, see [Intro to Modules](/sdk/next/learn/concepts/modules). | ||
| By the end, you'll have built a working module and wired it into a running chain. For a deeper dive into how modules work in the Cosmos SDK, see [Intro to Modules](/sdk/next/learn/concepts/modules). |
| function rewriteLinks(content, product) { | ||
| // Only rewrite /<product>/latest/ → /<product>/next/ for the product being synced. | ||
| // Cross-product links (e.g. /cometbft/latest/) are left unchanged — next/ files | ||
| // intentionally reference other products' latest/ versions. | ||
| const escapedProduct = product.replace(/-/g, '\\-'); | ||
| const re = new RegExp(`(https?:\\/\\/\\S+)|\\/${escapedProduct}\\/latest\\/`, 'g'); | ||
| return content.replace(re, (match, externalUrl) => { | ||
| if (externalUrl) return externalUrl; | ||
| return `/${product}/next/`; | ||
| }); |
There was a problem hiding this comment.
Add a new executable script scripts/sync-latest-to-next.js to copy files from a product's latest/ tree to the matching next/ tree, rewriting internal latest→next links and preserving destination front matter. Update CLAUDE.md to require logging and to instruct running the sync script after editing latest/. Revise SDK guides (sdk/latest and sdk/next) for upgrades: add warnings, clarify upgrade handler type and InitGenesis override behavior, and expand notes on syncing full nodes; clean up Go example formatting in migration code. Also trim stray blank lines in ADR/RFC templates and make small copy edits in example tutorial pages and the v0.54 upgrade guide (clarify changelog references and fix anchors).