feat: publish the theme's documentation as a developer spoke - #8
Merged
Merged
Conversation
The theme now carries the shared brand mark and the navbar and footer logo definitions, so it has documentation worth publishing rather than only being a dependency of the sites that do. This adds that site, in docusaurus/, and deploys it under docs.vantagecompute.ai/developer/docusaurus-theme/ alongside every other spoke. The site installs @vantagecompute/docusaurus-theme from npm at a pinned 0.4.7 rather than through a file: link to the repository around it. A file: link would render the working tree, so the site would show a design nobody can install yet and would never catch a packaging mistake: a file the build needs that `files` in package.json does not ship. The cost is that the pin trails the package by up to one release, which `just docs-pin <version>` moves once the version is on npm. Both CI and the deploy assert the asset list directly rather than trusting a green build, because that failure is quiet: a site missing static/ builds clean and renders in the wrong typeface. CI checks `npm pack --dry-run`; the deploy checks what npm actually installed. Both checkouts use fetch-depth: 0. getProjectVersion() shells out to `git describe --tags`, and a shallow checkout carries no tags, so the navbar badge would read as a bare commit hash on every deploy. Two TypeScript 7 accommodations in the docs site: @docusaurus/tsconfig still sets `baseUrl`, which TS7 removed, so extending it fails before it compiles anything and the options are inlined instead. And staticDirectories lists only the theme's directory: git does not track empty directories, so a local static/ with nothing in it fails the client bundle outright. Alongside: - Pin every action to the SHA of its latest release, including publish.yml, which was on floating @v4 tags. - Bump the dev dependencies to the current releases (docusaurus 3.10.2, @types/node 26.4.1, @types/react 19.2.18). - Fix the README component table, which listed an MDXComponents override that does not exist and omitted the Navbar/Logo one that does. - Fix MIGRATION.md, which dated the shared brand mark to an unreleased 0.5.0. It shipped in 0.4.7. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
The theme now carries the shared brand mark and the navbar and footer logo definitions, so it has documentation worth publishing rather than only being a dependency of the sites that do. This adds that site, in
docusaurus/, and deploys it underdocs.vantagecompute.ai/developer/docusaurus-theme/alongside every other spoke.Companion: vantagecompute/vantage-docs#120 registers the spoke and mints the deploy role. That has to land and deploy first or the deploy workflow here fails at the credentials step.
The site
12 pages in
docusaurus/docs/: overview, installation, usage, migration, contributing, a design-system section (tokens, typography) and a reference section (exports, components, assets, customization).Spoke contract settings:
baseUrl: '/developer/docusaurus-theme/',trailingSlash: false(the edge rewrites extensionless URLs to{path}.html),noIndex: true.It installs the published tarball, not the working tree
package.jsonpins"@vantagecompute/docusaurus-theme": "0.4.7"from npm rather than afile:link to the repository around it. Afile:link would render the working tree, so the site would show a design nobody can install yet, and it would never catch a packaging mistake: a file the build needs thatfilesinpackage.jsondoes not ship.The cost is that the pin trails the package by up to one release.
just docs-pin <version>moves it, and refuses a version that is not on npm yet.Workflows
ci.yml(new)deploy-docs.yml(new)docusaurus/**, av[0-9]+.[0-9]+.[0-9]+tag, or dispatchpublish.ymlTwo details worth review:
Both jobs assert the asset list rather than trusting a green build. A site missing
static/builds clean and renders in the wrong typeface, so neither exit code tells you anything. CI checksnpm pack --dry-run --json; the deploy checks what npm actually installed intonode_modules.Both checkouts use
fetch-depth: 0.getProjectVersion()shells out togit describe --tags, and a shallow checkout carries no tags, so the navbar badge would read as a bare commit hash on every deploy. (Worth porting to the other spokes;armasec-litehas this bug.)The docs deploy triggers on main rather than only on a tag because the pages live in this repository and are not generated from a release artifact: a wording fix should not wait for the next version bump. The tag trigger stays because a release changes what the version badge says even when no page did.
TypeScript 7
Two accommodations in the docs site:
@docusaurus/tsconfigstill setsbaseUrl, which TS7 removed, so extending it fails before it compiles anything. The options are inlined instead.staticDirectorieslists only the theme's directory. Git does not track empty directories, so a localstatic/with nothing in it fails the client bundle outright withunable to locate ... glob.Alongside
publish.ymlincluded, which was on floating@v4tags. Verified againstreleases/latest: checkout v7.0.1, setup-node v7.0.0, configure-aws-credentials v6.2.4. All jobs on node 24.@types/node26.4.1,@types/react19.2.18).npm-check-updatesis clean in bothpackage.jsonfiles.MDXComponentsoverride that does not exist insrc/theme/, and omitted theNavbar/Logoone that does.MIGRATION.mddated the shared brand mark to an unreleased 0.5.0. It shipped in 0.4.7.justfilegainsdocs-install,docs-serve,docs-build,docs-clean,docs-pin.Verification
npm run typecheckandnpm run buildboth pass from a clean tree.onBrokenLinks: 'throw', so the build link-checks the site. The renderedbuild/index.htmlcarriesv0.4.7in the version badge, and the fonts, icons and favicon all resolve out of the package.Before this can deploy
After vantagecompute/vantage-docs#120 lands and the stack deploys, set on this repo:
DOCS_BUCKET,DOCS_CF_DISTRIBUTION_IDDOCS_SPOKE_ROLE_ARN(vantage-docs-spoke-docusaurus-theme)ci.ymlneeds none of them.🤖 Generated with Claude Code