Repository navigation
Fix repo setup: pnpm 12, Docusaurus 3.10, PR CI, formatting - #7
Merged
Merged
Conversation
- 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.
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.
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
packageManager. Approved build scripts move topnpm-workspace.yaml, because pnpm 10+ ignores thepnpmfield inpackage.json. Before this,pnpm installfailed with pnpm 11+. Thepostman-code-generatorspostinstall 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).pnpm typecheckfailure.onBrokenMarkdownLinksmoves tomarkdown.hooks.pnpm audit --proddrops 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..nvmrc;enginesis now>=20, which Docusaurus 3.10 requires.baseUrlthat@docusaurus/tsconfigsets.Scripts
start,buildandtypecheckrungen-api-docsfirst. Before,sidebars.tsimported the gitignoreddocs/rpc/sidebar, so a fresh clone couldn't start.format/format:checkandsync-openapi.deployscript, since deployment goes through Actions.CI
deploy.ymlis replaced byci.yml, which runs on PRs and onmain: install (frozen lockfile), format check, typecheck, build. Deployment runs only onmain, as a separate job..nvmrcand a pnpm cache, updates actions to their current majors, and usescontents: readinstead ofwrite.Site
@easyops-cn/docusaurus-search-local)./blogpage.Formatting
.prettierrc.jsonand.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
src/openapi.jsonfrom Sage v0.13.1 (was 0.12.4) with the newpnpm sync-openapi [tag]script. It addscreate_transaction,finalize_clawback,get_wallet_addressandget_xch_usd_price.Verification
CI passes. Locally with pnpm 12.18.0 and Node 24:
pnpm install --frozen-lockfile,pnpm format:check,pnpm typecheckandpnpm buildall pass with no warnings. I checked the built output for search, edit links and the new RPC pages.