-
-
Notifications
You must be signed in to change notification settings - Fork 37
doc: v3 db recipes #523
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
doc: v3 db recipes #523
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis pull request modifies the PackageInstall component to output npm/pnpm/bun/yarn install commands with dependencies and devDependencies on separate lines instead of concatenated together, and adds three new database integration documentation pages for Neon, PostgreSQL, and SQLite. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
versioned_docs/version-3.x/recipe/databases/neon.md (1)
15-42: ClarifycreateClientusage in edge exampleThe edge-runtime snippet calls
createClient()without showing or referencing its implementation. For readers, it would help to either:
- inline a minimal
createClienthelper based on the previousZenStackClientexample, or- add a short note like “
createClientis a helper that constructsZenStackClientas shown above.”This keeps the per-request pattern clear and self-contained.
versioned_docs/version-3.x/_components/PackageInstall.tsx (1)
5-25: Make props optional and simplify command string constructionCurrent template literal works but has a couple of quirks:
- If only
devDependenciesare passed, the unconditional newline in the template string produces a leading blank line in the code block.Propsmarks both arrays as required, but some usages (e.g. Neon) provide onlydependencies, relying on runtime?.behavior.You can make this more robust and readable by:
- Making props optional with defaults.
- Building lines and joining with
'\n'instead of embedding newlines in the template literal.Example refactor:
-interface Props { - devDependencies: string[]; - dependencies: string[]; -} +interface Props { + devDependencies?: string[]; + dependencies?: string[]; +} @@ -const PackageInstall = ({ devDependencies, dependencies }: Props) => { +const PackageInstall = ({ devDependencies = [], dependencies = [] }: Props) => { return ( <Tabs> {pkgManagers.map((pkg) => ( <TabItem key={pkg.name} value={pkg.name} label={pkg.name}> <CodeBlock language="bash"> -{`${dependencies?.length ? `${pkg.command} ${dependencies.join(' ')}` : ''} -${devDependencies?.length ? `${pkg.command} ${pkg.dev} ${devDependencies.join(' ')}\n` : ''}`} +{[ + dependencies.length + ? `${pkg.command} ${dependencies.join(' ')}` + : null, + devDependencies.length + ? `${pkg.command} ${pkg.dev} ${devDependencies.join(' ')}` + : null, +] + .filter(Boolean) + .join('\n')} </CodeBlock> </TabItem> ))} </Tabs> );This keeps the output exactly one command per line, with no leading/trailing blank lines, and aligns types with actual usage.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
versioned_docs/version-3.x/recipe/databases/_category_.ymlis excluded by!**/*.yml
📒 Files selected for processing (4)
versioned_docs/version-3.x/_components/PackageInstall.tsx(1 hunks)versioned_docs/version-3.x/recipe/databases/neon.md(1 hunks)versioned_docs/version-3.x/recipe/databases/postgres.md(1 hunks)versioned_docs/version-3.x/recipe/databases/sqlite.md(1 hunks)
🔇 Additional comments (2)
versioned_docs/version-3.x/recipe/databases/postgres.md (1)
9-27: PostgreSQL setup snippet looks solidThe driver install and
ZenStackClient+Poolconfiguration are clear and technically sound for a standardpgsetup.versioned_docs/version-3.x/recipe/databases/sqlite.md (1)
9-23: SQLite recipe is consistent and correctThe install instructions and
SqliteDialect+better-sqlite3example are consistent with typical SQLite usage and the other DB recipes.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.