Skip to content

Conversation

@ymc9
Copy link
Member

@ymc9 ymc9 commented Dec 1, 2025

Summary by CodeRabbit

  • Documentation
    • Added integration guides for Neon, PostgreSQL, and SQLite databases, including driver setup, client configuration examples, and best practices for serverless and edge runtime environments.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 1, 2025

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

Project Deployment Preview Comments Updated (UTC)
zenstack-new-site Ready Ready Preview Comment Dec 1, 2025 6:50am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Walkthrough

This 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

Cohort / File(s) Summary
Component formatting update
versioned_docs/version-3.x/_components/PackageInstall.tsx
Reorders and reformats the install command builder to output dependencies and devDependencies on separate lines instead of concatenated, preserving a newline between them
Database integration documentation
versioned_docs/version-3.x/recipe/databases/neon.md, versioned_docs/version-3.x/recipe/databases/postgres.md, versioned_docs/version-3.x/recipe/databases/sqlite.md
Adds three new documentation guides for database integrations with ZenStack ORM, including installation instructions, configuration examples, and usage patterns for Neon (serverless), PostgreSQL (pg driver), and SQLite (better-sqlite3)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • PackageInstall component change is a straightforward output formatting reorder with consistent pattern
  • Three new documentation files follow a similar structure and contain primarily example code with explanatory text; review focuses on technical accuracy and clarity

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'doc: v3 db recipes' accurately describes the main change: adding new database integration documentation pages for ZenStack v3 (SQLite, PostgreSQL, and Neon).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch doc/db-guides

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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: Clarify createClient usage in edge example

The edge-runtime snippet calls createClient() without showing or referencing its implementation. For readers, it would help to either:

  • inline a minimal createClient helper based on the previous ZenStackClient example, or
  • add a short note like “createClient is a helper that constructs ZenStackClient as 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 construction

Current template literal works but has a couple of quirks:

  • If only devDependencies are passed, the unconditional newline in the template string produces a leading blank line in the code block.
  • Props marks both arrays as required, but some usages (e.g. Neon) provide only dependencies, 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

📥 Commits

Reviewing files that changed from the base of the PR and between 245801a and 67a9555.

⛔ Files ignored due to path filters (1)
  • versioned_docs/version-3.x/recipe/databases/_category_.yml is 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 solid

The driver install and ZenStackClient + Pool configuration are clear and technically sound for a standard pg setup.

versioned_docs/version-3.x/recipe/databases/sqlite.md (1)

9-23: SQLite recipe is consistent and correct

The install instructions and SqliteDialect + better-sqlite3 example are consistent with typical SQLite usage and the other DB recipes.

@ymc9 ymc9 merged commit 8616368 into main Dec 1, 2025
4 checks passed
@ymc9 ymc9 deleted the doc/db-guides branch December 1, 2025 06:59
@coderabbitai coderabbitai bot mentioned this pull request Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants