Skip to content

Fix repo setup: pnpm 12, Docusaurus 3.10, PR CI, formatting - #7

Merged
Rigidity merged 6 commits into
mainfrom
rigidity/repo-setup-fixes
Nov 9, 2026
Merged

Rigidity merged 6 commits into
mainfrom
rigidity/repo-setup-fixes

Conversation

@Rigidity

@Rigidity Rigidity commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the setup problems found in a repo review. A fresh clone now installs, typechecks and builds, and CI checks every pull request.

Toolchain and dependencies

  • pnpm 12, pinned with packageManager. Approved build scripts move to pnpm-workspace.yaml, because pnpm 10+ ignores the pnpm field in package.json. Before this, pnpm install failed with pnpm 11+. The postman-code-generators postinstall is still skipped, as it was under pnpm 9. It reinstalls each codegen with the first package manager it finds globally, which is yarn on GitHub runners, and that fails. Snippet generation works without it (I checked 9 languages).
  • Docusaurus 3.7.0 → 3.10.2 and openapi-docs 4.5.1 → 5.2.0 (v5 requires Docusaurus 3.10). The plugin's v5 types fix the pnpm typecheck failure. onBrokenMarkdownLinks moves to markdown.hooks.
  • Regenerated the lockfile. pnpm audit --prod drops from 149 advisories to 8. Two same-major overrides (js-yaml, yaml) cover patched releases. The remaining 8 sit behind major-version pins in Docusaurus and the openapi plugin (tinypool, @faker-js/faker, uuid, serialize-javascript, deepmerge). They only run at build time, so I left them alone rather than force incompatible majors.
  • Node 24 via .nvmrc; engines is now >=20, which Docusaurus 3.10 requires.
  • TypeScript is pinned at 5.9. TS 6 and 7 reject the baseUrl that @docusaurus/tsconfig sets.

Scripts

  • start, build and typecheck run gen-api-docs first. Before, sidebars.ts imported the gitignored docs/rpc/sidebar, so a fresh clone couldn't start.
  • Added format / format:check and sync-openapi.
  • Removed the unused deploy script, since deployment goes through Actions.

CI

  • deploy.yml is replaced by ci.yml, which runs on PRs and on main: install (frozen lockfile), format check, typecheck, build. Deployment runs only on main, as a separate job.
  • Adds setup-node with .nvmrc and a pnpm cache, updates actions to their current majors, and uses contents: read instead of write.

Site

  • Local search (@easyops-cn/docusaurus-search-local).
  • "Edit this page" links, skipped for the generated RPC pages.
  • Turned off the default blog plugin, which was producing an empty /blog page.

Formatting

  • Added .prettierrc.json and .prettierignore (ignores the lockfile, the OpenAPI spec and generated output), then formatted the repo. The doc changes are cosmetic: table alignment, _em_ style, reflowed code samples.

OpenAPI spec

  • Regenerated src/openapi.json from Sage v0.13.1 (was 0.12.4) with the new pnpm sync-openapi [tag] script. It adds create_transaction, finalize_clawback, get_wallet_address and get_xch_usd_price.
  • The script runs locally (needs Rust) rather than as a bot workflow, because this repo doesn't allow Actions to create PRs.

Verification

CI passes. Locally with pnpm 12.18.0 and Node 24: pnpm install --frozen-lockfile, pnpm format:check, pnpm typecheck and pnpm build all pass with no warnings. I checked the built output for search, edit links and the new RPC pages.

- Pin pnpm via packageManager and move build-script approvals to
  pnpm-workspace.yaml, since pnpm 10+ ignores the package.json field
- Upgrade Docusaurus to 3.10.2 and openapi-docs to 5.2.0, which fixes
  the typecheck failure, and regenerate the lockfile
- Generate the RPC pages as part of start and build so a fresh clone works
- Add local search and edit links, disable the unused blog plugin
- Add a sync-openapi script and document the workflow in the README
Checks formatting, typecheck and build on every PR. Pushes to main
deploy to GitHub Pages as before. Pins Node via .nvmrc, caches pnpm
and narrows permissions to what each job needs.
It reinstalls each codegen with the first package manager it finds
globally, which is yarn on GitHub runners, and fails. The published
package generates snippets without it, as it did before the pnpm 12
upgrade.
sidebars.ts imports the generated sidebar, so tsc fails on a fresh
checkout without it.
@Rigidity
Rigidity merged commit 1d45f7a into main Nov 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant