fix(create-rslib): support dynamic package name in rspress template#1465
Merged
Timeless0911 merged 3 commits intomainfrom Jan 30, 2026
Merged
fix(create-rslib): support dynamic package name in rspress template#1465Timeless0911 merged 3 commits intomainfrom
Timeless0911 merged 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the Rspress React TS template use a dynamic package name placeholder and wires create-rslib to replace that placeholder with the actual package name when generating a project.
Changes:
- Replaced hardcoded
rslib-react-tsreferences in the Rspress React TStsconfig.jsonanddocs/Button.mdxwith a{{ packageName }}placeholder. - Added
getPackageNameandreplacePackageNamePlaceholderhelpers increate-rslib/src/index.tsto read the generated project’spackage.jsonand replace the placeholder in copied Rspress template files. - Hooked the placeholder replacement into the
rspressextra tool action forreact-tstemplates so the generated docs and TS path mapping use the actual package name.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/create-rslib/template-rspress/react-ts/tsconfig.json | Uses {{ packageName }} in the paths key so the alias matches the generated package name once replaced. |
| packages/create-rslib/template-rspress/react-ts/docs/Button.mdx | Imports Button from {{ packageName }} to align docs imports with the generated package name after replacement. |
| packages/create-rslib/src/index.ts | Adds helpers to read the project’s package name and replace {{ packageName }} in Rspress template files during project creation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
This PR adds support for dynamic package name replacement in the Rspress React TS template.
rslib-react-tswith{{ packageName }}placeholder indocs/Button.mdxandtsconfig.json.create-rslibto replace the placeholder with the actual package name during project creation.Related Links
N/A
Checklist