Developer site of Majornutcracker: documentation for our open-source packages. A static Next.js export deployed to GitHub Pages; unknown routes redirect to the home page.
/— product list/docs/<product>/— README and API reference of the latest release, in two tabs (the tab follows the URL hash, e.g.#reference)
Requires Node (see .nvmrc) and Yarn Classic.
yarn install
yarn dev # http://localhost:3000 (syncs docs first)
yarn lint
yarn typecheck
yarn build # syncs docs, then static export to ./outNothing is copied by hand. scripts/sync-docs.mjs
runs before dev and build and, for every product in
lib/products.json:
- reads the package's
latestversion from the npm registry (each product's release workflow publishes on itsv*.*.*tag, so this is the newest release); - downloads that version's tarball and extracts
README.mdanddocs/REFERENCE.md; - writes it with the registry metadata (version, description, license,
repository…) to
content/<slug>/(gitignored).
Relative links in the markdown are rewritten: links between the README and
the reference switch tabs in-page; links to any other repo file point to the
product's repository at the released tag. README heading ids get a readme-
prefix so both docs can share the page. To add a product, append it to lib/products.json:
{ "slug": "my-package", "npm": "@majornutcracker/my-package" }The package must ship docs/REFERENCE.md in its npm files (npm always
includes README.md).
.github/workflows/deploy.yml builds and
publishes to GitHub Pages on every push to main, on demand, and daily
(cron), so a new product release shows up within a day without touching this
repo. In the repository settings, set Pages → Source to GitHub Actions.
GitHub disables scheduled workflows after 60 days without repository activity; re-enable it from the Actions tab if that happens.