Skip to content

feat(docs): migrate docs to rspress#3432

Open
dbritto-dev wants to merge 14 commits intopmndrs:mainfrom
dbritto-dev:main
Open

feat(docs): migrate docs to rspress#3432
dbritto-dev wants to merge 14 commits intopmndrs:mainfrom
dbritto-dev:main

Conversation

@dbritto-dev
Copy link
Copy Markdown
Collaborator

No description provided.

@dbritto-dev dbritto-dev self-assigned this Mar 18, 2026
Copilot AI review requested due to automatic review settings March 18, 2026 14:13
@dbritto-dev dbritto-dev added the enhancement New feature or request label Mar 18, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zustand-demo Ready Ready Preview, Comment Mar 23, 2026 4:19pm

Request Review

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Mar 18, 2026

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.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 18, 2026

commit: cc627f6

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/public and 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.

Comment thread website/tsconfig.json Outdated
Comment thread website/package.json
Comment thread website/README.md
Comment thread website/AGENTS.md
Comment thread website/rspress.config.ts
Comment thread .github/workflows/docs.yml Outdated
Comment thread website/package.json
Copy link
Copy Markdown
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

@dbritto-dev dbritto-dev Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I wasn't aware that gh pages is conflicting. Hmm.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


<div class="flex justify-center mb-4">
<img src="../../bear.jpg" alt="Logo Zustand" />
<img src="../../public/bear.jpg" alt="Logo Zustand" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dai-shi hard requirement, should be under docs/public

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbritto-dev Can we copy ./docs/bear.jpg ./docs/public/bear.jpg in the GitHub Action?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dai-shi sure, we can do that

steps:
- id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
uses: actions/deploy-pages@v4
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep using commit hash for this and others.

Copy link
Copy Markdown
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@dbritto-dev
Copy link
Copy Markdown
Collaborator Author

dbritto-dev commented Mar 18, 2026

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/

@dai-shi
Copy link
Copy Markdown
Member

dai-shi commented Mar 18, 2026

@dbritto-dev

publishing both versions under subpaths

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 /pr-123)
https://github.com/zustandjs/website (for production)

Do you think that helps? Or, does one repo work both for previews and production?

@dbritto-dev
Copy link
Copy Markdown
Collaborator Author

@dbritto-dev

publishing both versions under subpaths

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 /pr-123) https://github.com/zustandjs/website (for production)

Do you think that helps? Or, does one repo work both for previews and production?

@dai-shi gh pages are only one per repo

@dai-shi
Copy link
Copy Markdown
Member

dai-shi commented Mar 18, 2026

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 external_repository option. It requires a deploy key, but I've done this setup before.

@dbritto-dev
Copy link
Copy Markdown
Collaborator Author

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 external_repository option. It requires a deploy key, but I've done this setup before.

we can create a website repo and

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 external_repository option. It requires a deploy key, but I've done this setup before.

Gotcha, lots of work btw

@dai-shi
Copy link
Copy Markdown
Member

dai-shi commented Mar 19, 2026

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.

/ ---> production
/_previews/ ---> previews (for commits or PRs)

I'm not sure if peaceiris/actions-gh-pages is capable though. Otherwise, we can create two repos.

I think we can delete previews (with actions) when the PR is closed.

@dbritto-dev
Copy link
Copy Markdown
Collaborator Author

@dai-shi let me play with that I'll let you know when I got something working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants