feat(docs): migrate docs to rspress#3432
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
There was a problem hiding this comment.
Pull request overview
This PR introduces an Rspress-based documentation website under website/ and updates GitHub Pages deployment to build and publish that site, along with moving static assets into docs/public and updating image references.
Changes:
- Add a new
website/package with Rspress config, theme overrides, and lint/format tooling. - Update GitHub Pages workflow to build the Rspress site and deploy the generated artifact.
- Move/add docs static assets under
docs/publicand update README/docs references accordingly.
Reviewed changes
Copilot reviewed 15 out of 18 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
website/tsconfig.json |
Adds TS/MDX checking config for the Rspress site. |
website/theme/index.tsx |
Overrides the default Rspress home layout to show install tabs. |
website/theme/index.css |
Sets brand/theme CSS variables and minor badge styling. |
website/rspress.config.ts |
Defines Rspress site config, nav/sidebars, plugins, and base/root. |
website/README.md |
Adds local setup/build/preview instructions for the docs site. |
website/package.json |
Defines the website package scripts and dev dependencies. |
website/eslint.config.mjs |
Adds an ESLint flat config for the website package. |
website/AGENTS.md |
Adds contributor instructions for linting/formatting the website package. |
website/.prettierrc |
Sets Prettier config for website/. |
website/.prettierignore |
Ignores lockfiles for Prettier in website/. |
website/.gitignore |
Ignores doc_build/ and other generated artifacts in website/. |
README.md |
Updates the repository image path to the new docs/public location. |
pnpm-workspace.yaml |
Adjusts workspace packages list to include website. |
docs/public/favicon.ico |
Adds a favicon asset under docs/public. |
docs/public/bear.jpg |
Adds the bear image under docs/public. |
docs/learn/getting-started/introduction.md |
Updates the bear image reference to the new docs/public location. |
.github/workflows/docs.yml |
Builds the website package and deploys it to GitHub Pages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
dai-shi
left a comment
There was a problem hiding this comment.
Thanks for working on it.
As I said previously, I want ./docs to be neutral and want to deploy to both websites.
|
|
||
| jobs: | ||
| build: | ||
| uses: pmndrs/docs/.github/workflows/build.yml@v3 |
There was a problem hiding this comment.
We keep deploying to the current website.
So, please do not modify workflows/docs.yml and make it work.
Create a new workflows/website.yml for rspress.
There was a problem hiding this comment.
@dai-shi can't be separated because both use gh pages to publish the website. I could try to publish both under different paths but that would be tricky to implement
There was a problem hiding this comment.
Oh, I wasn't aware that gh pages is conflicting. Hmm.
|
|
||
| <div class="flex justify-center mb-4"> | ||
| <img src="../../bear.jpg" alt="Logo Zustand" /> | ||
| <img src="../../public/bear.jpg" alt="Logo Zustand" /> |
There was a problem hiding this comment.
Can't we keep the original position? If it's a hard requirement of rspress, I may consider a symbolic link as a last resort.
There was a problem hiding this comment.
@dai-shi hard requirement, should be under docs/public
There was a problem hiding this comment.
@dbritto-dev Can we copy ./docs/bear.jpg ./docs/public/bear.jpg in the GitHub Action?
| steps: | ||
| - id: deployment | ||
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 | ||
| uses: actions/deploy-pages@v4 |
There was a problem hiding this comment.
Please keep using commit hash for this and others.
dai-shi
left a comment
There was a problem hiding this comment.
One of the big requests for migrating to rspress was to enable PR preview, which was a real pain previously. Did you give it up?
@dai-shi yeah—there’s no straightforward way to support previews on GitHub Pages without publishing both versions under subpaths. For now, I’m hosting the preview from my own repo: https://dbritto-dev.github.io/zustand/ |
I think it's a great idea. Let's create a new repo (or two if it's easier) only for github pages. https://github.com/zustandjs/website-preview (use subpaths like Do you think that helps? Or, does one repo work both for previews and production? |
@dai-shi gh pages are only one per repo |
If you mean we can't deploy to external repo, let's use this action: https://github.com/peaceiris/actions-gh-pages It has |
we can create a website repo and
Gotcha, lots of work btw |
Let me know if you need help. I think we can have just one repo and use it for both production and previews.
I'm not sure if I think we can delete previews (with actions) when the PR is closed. |
|
@dai-shi let me play with that I'll let you know when I got something working |
No description provided.