Migrate btcr2.dev to Astro Starlight (v2.0.0) - #4
Merged
Merged
Conversation
Port the x1 demo fix (59bc022) into the Astro layout: git rename detection applied the Create/Resolve/Update.vue changes and the new errors.ts under src/theme/demos/; the demo.md prose changes were hand-ported into src/content/docs/demo.mdx in its colon style. Version stays 2.0.0; the 1.1.1 changelog entry is preserved beneath 2.0.0 in rpm/btcr2-dev.spec. pnpm-workspace.yaml comes along from main. Verified: astro check + astro build green (11 pages); Node smoke against mutinynet passes (k1 create, x1 create via GenesisDocument.fromPublicKey + canonicalHashBytes, x1 resolve with sidecar genesisDocument).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR replaces the VitePress site with Astro Starlight and bumps the site to version 2.0.0. The page content, the Vue demo components, and the same-origin
/mempoolproxy contract do not change.Commits: the migration (61a3402), a sync merge with main v1.1.1 (c769795), and a sync merge with the CI fix on main (7eef545).
Why
@did-btcr2browser bundle loads only on the demo page.Mermaid.vuecomponent for diagrams, a theme entry that registered every component, TypeScript shims, and a custom CSS file. Starlight andastro-mermaidcover the same needs, so that code is deleted.docs/.vitepress/disttodist/. That is a packaging-visible change, so the version gets a major bump.What changed
@astrojs/vue+astro-mermaid. Config lives inastro.config.mjs(sidebar, social links, custom CSS, Vite/mempooldev proxy).docs/tosrc/content/docs/. Pages that import components are.mdx(index.mdx,demo.mdx,impls/ts.mdx). All other pages are plain.md. Starlight takes the page title from frontmatter, so pages have no H1 in the body.src/theme/are unchanged.demo.mdxmounts them withclient:only="vue", so they never render on the server.astro-mermaid, registered beforestarlightin the integrations list. The order matters. Diagram sources stay inline in the markdown. The standalone OKR sources move fromdocs/public/diagrams/okrs/topublic/diagrams/okrs/.src/examples/ts/.impls/ts.mdxembeds them with?rawimports and the Starlight<Code>component.astro checktypechecks them, so they must stay self-contained.src/styles/custom.cssaliases the--vp-c-*variables that the demo components still use to the Starlight--sl-color-*palette.rpm/btcr2-dev.specis atVersion: 2.0.0and installsdist/*.pnpm dev,pnpm build,pnpm preview, andpnpm typecheck(nowastro check) keep their names.pnpm cleanwipes.astroanddist.What stays the same
@did-btcr2packages and their version ranges./mempoolproxy contract. In dev, the Vite proxy inastro.config.mjsforwards/mempoolto mempool.space. In production, the web server must provide the same reverse proxy, for example nginxlocation /mempool/ { proxy_pass https://mempool.space/; }. Direct browser calls fail: the@did-btcr2/bitcoinREST client sendsContent-Type: application/jsonon GET requests, and mempool.space rejects the resulting CORS preflight.demo/index.html), so the old/demolinks resolve without rewrites.Verification
pnpm typecheck(astro check): 0 errors, 0 warnings, 1 hint.pnpm build: 11 pages. Pagefind index and sitemap created.npm install && npm run build, the recipe inrpm/btcr2-dev.spec, on Node 24: green, TypeScript 5.9.3 resolved.Review focus
astro.config.mjs: sidebar structure, integration order, the/mempoolproxy block.src/content/docs/demo.mdxandimpls/ts.mdx: the hand-ported MDX prose and the?rawexample embeds.src/styles/custom.css: the--vp-c-*alias block. Do not remove it.rpm/btcr2-dev.spec: output path and changelog entry.pnpm devand try Create, Resolve, and Update on mutinynet and testnet4.Out of scope
@did-btcr2/api0.19.x,@did-btcr2/common9.3.x, Astro 7.3, Starlight 0.42). Separate PRs, after the demos are re-tested on a test network.