Skip to content

Add reference-only build and pre-built data.json input for PR previews - #1629

Open
Vaivaswat2244 wants to merge 4 commits into
processing:mainfrom
Vaivaswat2244:feat/reference-only-build
Open

Vaivaswat2244 wants to merge 4 commits into
processing:mainfrom
Vaivaswat2244:feat/reference-only-build

Conversation

@Vaivaswat2244

@Vaivaswat2244 Vaivaswat2244 commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

First of the PRs for the reference previews discussed in processing/p5.js#9303: this adds just the build capability the preview workflow will use. Nothing here changes the normal build or deploy; both additions are opt-in via environment variables.

  • P5_DATA_JSON_PATH=<file> npm run build:reference uses a pre-built YUIDoc data.json instead of cloning p5.js and running its docs build, so CI can hand over the artifact a p5.js PR build already produced.
  • npm run build:reference-only builds only the English /reference/** pages; everything else 404s.
  • REFERENCE_SKIP_LOWERCASE=1 additionally skips the lowercase alias of each reference route, roughly halving the page count.

Timings from a run on ubuntu-latest: the reference-only build takes 2m50s against ~17m for the full site, producing data.json in a p5.js checkout takes 41s, and build:reference from that file takes 4s. Locally, the MDX output from P5_DATA_JSON_PATH is byte-identical (905/905 files) to the clone path for p5.js v2.3.3, the normal full build is unchanged, and an interrupted reference-only build restores src/pages.

Known coupling: reference pages still load the pages, top-banner, banner, and ui/*.yaml collections through their layouts, which this PR deliberately leaves alone.

Next up, in a follow-up PR: the workflow that receives a dispatch from p5.js CI, runs this build, and deploys a preview to Cloudflare.

cc @limzykenneth @ksen0

@Vaivaswat2244
Vaivaswat2244 force-pushed the feat/reference-only-build branch from ed1ed88 to 94bee64 Compare October 23, 2026 01:50

This branch has not been deployed

No deployments
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