New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: improve dx for writing a docs component #2544
base: canary
Are you sure you want to change the base?
Conversation
Signed-off-by: Innei <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@Innei is attempting to deploy a commit to the NextUI Inc Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe update significantly changes how components in the documentation app are defined, moving from internal definitions to importing them from raw files. It also introduces the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yaml
Files selected for processing (9)
- apps/docs/content/components/accordion/bordered-variant.raw.tsx (1 hunks)
- apps/docs/content/components/accordion/bordered-variant.ts (1 hunks)
- apps/docs/content/components/accordion/compact.raw.tsx (1 hunks)
- apps/docs/content/components/accordion/compact.ts (1 hunks)
- apps/docs/contentlayer.config.js (6 hunks)
- apps/docs/package.json (1 hunks)
- apps/docs/tsconfig.json (1 hunks)
- apps/docs/types.d.ts (1 hunks)
- pnpm-lock.yaml (2 hunks)
Additional comments: 13
apps/docs/types.d.ts (1)
- 1-3: LGTM! This TypeScript module declaration is essential for the new approach to handling code snippets in documentation, aligning perfectly with the PR's objectives.
apps/docs/content/components/accordion/compact.ts (1)
- 1-4: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-8]
LGTM! The change to import
App
fromcompact.raw.tsx
using the raw string import method is a clear improvement, making the management of code snippets more straightforward.apps/docs/content/components/accordion/bordered-variant.ts (1)
- 1-4: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-8]
LGTM! Importing
App
frombordered-variant.raw.tsx
using the raw string import method is consistent with the project's new approach and improves the developer experience.apps/docs/tsconfig.json (1)
- 27-28: LGTM! Including
"types.d.ts"
in thetsconfig.json
file is necessary for the TypeScript compiler to recognize the custom module declaration for raw string imports, aligning with the PR's objectives.apps/docs/content/components/accordion/compact.raw.tsx (1)
- 1-20: LGTM! This file correctly implements the new approach for handling code snippets in documentation by providing the raw TSX code for the
compact
accordion variant. The code is well-structured and follows best practices.apps/docs/content/components/accordion/bordered-variant.raw.tsx (1)
- 1-20: LGTM! This file provides the raw TSX code for the
bordered-variant
accordion, aligning with the new approach for managing code snippets in documentation. The code is clean and follows best practices.apps/docs/contentlayer.config.js (3)
- 5-5: LGTM! Importing
RawPlugin
from 'esbuild-plugin-raw' is necessary for enabling raw string imports, aligning with the PR's objectives.- 18-18: LGTM! The addition of computed fields in the
Doc
document type is well-justified and aligns with the PR's objectives.- 83-88: LGTM! The
esbuildOptions
function is correctly configured to useRawPlugin
, facilitating the import of raw content. This change supports the new approach for handling code snippets in documentation.apps/docs/package.json (1)
- 121-121: LGTM! Adding
esbuild-plugin-raw
as a dependency is essential for enabling raw string imports, supporting the PR's objectives to improve the developer experience.pnpm-lock.yaml (3)
- 577-579: The addition of
esbuild-plugin-raw
with version0.1.8
and its specific dependency on[email protected]
aligns well with the PR objectives to improve the developer experience by enabling raw content import functionality. This change is correctly implemented.- 577-579: The update to
eslint-config-next
to version13.5.6
seems to be part of general dependency maintenance. It's important to ensure that this update does not introduce any breaking changes or conflicts with the current project setup.- 15391-15397: The detailed entry for
[email protected]
correctly specifies its resolution, peerDependencies, and direct dependency on[email protected]
. This ensures compatibility with a range ofesbuild
versions, aligning with the PR's goal to improve developer experience through raw content import functionality.
That's great, it's very easy to write docs component! |
@Innei |
Closes #
📝 Description
The component DX that writes docs now is very unfriendly and difficult to maintain.
Like this. What stringfiy code??
For now, I just refactor this and improve DX. And now we can write code in single tsx file, and import it.
And import it assert to raw.
💣 Is this a breaking change (Yes/No):
No
📝 Additional Information
Summary by CodeRabbit