feat(iconfont): add API and introduction markdown files - #12
Conversation
… via ?raw - Move the large bilingual (EN/CN) API description out of Iconfont.stories.tsx into Iconfont.apidoc.md, imported with Vite ?raw. - Add .storybook/vite-env.d.ts referencing vite/client so *?raw is typed. - Preserves the existing autodocs render pipeline and EN/CN language toggle (parameters.docs.description.component content is unchanged at runtime).
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe Iconfont Storybook story now supports configurable script URLs, optional icon settings, external bilingual documentation, and updated TypeScript inclusion for ChangesIconfont Storybook experience
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant StorybookControls
participant IconfontPlayground
participant createIconfont
participant IconComponent
StorybookControls->>IconfontPlayground: provide scriptUrl and icon settings
IconfontPlayground->>createIconfont: create icon component
createIconfont-->>IconfontPlayground: return IconComponent
IconfontPlayground->>IconComponent: render when values are available
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR enhances the Storybook documentation surface for the Iconfont component/factory by moving the long inline docs content into dedicated markdown files and wiring those files into the story, while also adjusting TypeScript/Storybook typing support for Vite raw imports.
Changes:
- Added
introduce.mdandapi-doc.mdand composed them into the Storybook docs description. - Improved the
IconfontStorybook story controls by exposingscriptUrland making several args optional for easier playground usage. - Updated TypeScript configuration and Storybook typings to better cover
.storybookfiles and Vite?rawimports.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Expands .storybook inclusion to ensure nested Storybook files are included for TS compilation. |
| .storybook/vite-env.d.ts | Adds vite/client type references so TS understands Vite features (e.g., ?raw imports). |
| .storybook/stories/components/Iconfont/introduce.md | New intro documentation for createIconfont (EN/CN). |
| .storybook/stories/components/Iconfont/api-doc.md | New API/reference documentation for createIconfont (EN/CN). |
| .storybook/stories/components/Iconfont/index.stories.tsx | Switches docs to markdown imports, fixes relative imports, and enhances story args/controls. |
Summary by CodeRabbit