Skip to content

docs: v3 docs structure #479

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

docs: v3 docs structure #479

wants to merge 9 commits into from

Conversation

ymc9
Copy link
Member

@ymc9 ymc9 commented Aug 1, 2025

Summary by CodeRabbit

  • New Features

    • Introduced comprehensive documentation for ZenStack version 3, including an overview, quick start guide, migration, ORM, modeling, and reference sections.
    • Added new React components for embedding StackBlitz projects, displaying GitHub code blocks, and rendering callouts within documentation.
    • Added detailed guides on schema constructs such as models, relations, attributes, enums, custom types, mixins, plugins, polymorphism, strongly typed JSON, and multi-file schemas.
    • Provided CLI reference documentation and outlined system limitations.
    • Included sample projects catalog and FAQ section.
    • Added interactive package installation and command execution components for enhanced documentation experience.
  • Documentation

    • Added numerous new documentation pages covering ORM API methods, database client setup, plugin development, utilities, and upgrade guidance.
    • Introduced placeholder and overview pages for future content expansion.
    • Expanded documentation with detailed explanations on access control, computed fields, query builder, data validation, runtime API, and ZModel language reference.
    • Included extensive examples and embedded live code samples for practical learning.

Copy link

vercel bot commented Aug 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zenstack-new-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 5, 2025 3:17pm

Copy link
Contributor

coderabbitai bot commented Aug 1, 2025

Walkthrough

This change introduces ZenStack documentation for version 3.x, adding a new version entry in the Docusaurus config and a comprehensive set of new markdown and React component files. The additions include detailed guides, API references, migration instructions, and numerous supporting components for interactive documentation and schema/code examples.

Changes

Cohort / File(s) Change Summary
Docusaurus Config
docusaurus.config.js
Added a new documentation version entry "3.0 Alpha" (3.x) to the Docusaurus versions configuration.
Interactive Embeds Components
src/components/StackBlitzEmbed.tsx, src/components/StackBlitzGithubEmbed.tsx, src/components/GithubCodeBlock.tsx
Introduced new React components for embedding StackBlitz projects and GitHub repos interactively, supporting configurable props for project/repo, height, file, and loading behavior, including plain code views and mobile detection.
Version 3.x Custom Components
versioned_docs/version-3.x/_components/PackageExec.tsx, versioned_docs/version-3.x/_components/PackageInstall.tsx, versioned_docs/version-3.x/_components/ZModelVsPSL.tsx, versioned_docs/version-3.x/_components/ZenStackVsPrisma.tsx
Added React components for displaying package manager commands, installation instructions, and callouts comparing ZModel/ZenStack with Prisma.
Version 3.x ZModel Example
versioned_docs/version-3.x/_components/_zmodel-starter.md
Added a ZModel schema example with SQLite datasource, User and Post models, and relations.
Version 3.x Documentation: Overview and Modeling
versioned_docs/version-3.x/modeling/index.md, versioned_docs/version-3.x/modeling/model.md, versioned_docs/version-3.x/modeling/attribute.md, versioned_docs/version-3.x/modeling/custom-type.md, versioned_docs/version-3.x/modeling/datasource.md, versioned_docs/version-3.x/modeling/enum.md, versioned_docs/version-3.x/modeling/mixin.md, versioned_docs/version-3.x/modeling/multi-file.md, versioned_docs/version-3.x/modeling/plugin.md, versioned_docs/version-3.x/modeling/polymorphism.md, versioned_docs/version-3.x/modeling/relation.md, versioned_docs/version-3.x/modeling/strong-typed-json.md, versioned_docs/version-3.x/modeling/conclusion.md
Added extensive documentation covering ZModel schema language: overview, model syntax, attributes, custom types, datasource config, enums, mixins, multi-file schemas, plugins, polymorphism, relations, strongly typed JSON, and a modeling section conclusion.
Version 3.x Documentation: ORM
versioned_docs/version-3.x/orm/index.md, versioned_docs/version-3.x/orm/quick-start.md, versioned_docs/version-3.x/orm/database-client.md, versioned_docs/version-3.x/orm/cli.md, versioned_docs/version-3.x/orm/access-control/introduction.md, versioned_docs/version-3.x/orm/api/aggregate.md, versioned_docs/version-3.x/orm/api/count.md, versioned_docs/version-3.x/orm/api/create.md, versioned_docs/version-3.x/orm/api/delete.md, versioned_docs/version-3.x/orm/api/find.md, versioned_docs/version-3.x/orm/api/filter.md, versioned_docs/version-3.x/orm/api/_select-include-omit.md, versioned_docs/version-3.x/orm/api/update.md, versioned_docs/version-3.x/orm/api/transaction.md, versioned_docs/version-3.x/orm/inferred-types.md, versioned_docs/version-3.x/orm/plugins/index.md, versioned_docs/version-3.x/orm/query-builder.md, versioned_docs/version-3.x/orm/validation.md, versioned_docs/version-3.x/orm/computed-fields.md
Added full ORM documentation: overview, quick start, client creation, CLI usage, access control, API references (aggregate, count, create, delete, find, filter, select/include/omit, update, transaction), inferred types, plugins, query builder, validation, and computed fields.
Version 3.x Migration, Service, and Samples
versioned_docs/version-3.x/migration/index.md, versioned_docs/version-3.x/service/index.md, versioned_docs/version-3.x/samples.md
Added migration overview, service section placeholder, and a catalog of sample projects.
Version 3.x Reference Documentation
versioned_docs/version-3.x/reference/cli.md, versioned_docs/version-3.x/reference/limitations.md, versioned_docs/version-3.x/reference/plugin-dev.md, versioned_docs/version-3.x/reference/runtime-api.md, versioned_docs/version-3.x/reference/zmodel-language.md
Added CLI reference, limitations, plugin development guide, runtime API reference, and ZModel language reference.
Version 3.x Utilities Documentation
versioned_docs/version-3.x/utilities/zod.md, versioned_docs/version-3.x/utilities/tanstack-query.md
Added documentation stubs for Zod and TanStack Query integration.
Version 3.x Welcome and Upgrade
versioned_docs/version-3.x/welcome.md, versioned_docs/version-3.x/upgrade.md
Added welcome page for v3 and upgrade guide.
Version 3.x FAQ
versioned_docs/version-3.x/faq.md
Added FAQ document for ZenStack v3.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DocsSite
    participant ReactComponent
    participant StackBlitzSDK

    User->>DocsSite: Navigates to documentation page
    DocsSite->>ReactComponent: Renders StackBlitzEmbed or StackBlitzGithubEmbed
    ReactComponent->>StackBlitzSDK: Calls embedProjectId/embedGithubProject with config
    StackBlitzSDK-->>ReactComponent: Embeds interactive project in container
    ReactComponent-->>DocsSite: Displays embedded project
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related PRs

  • Update samples.md #474: Both PRs modify the samples.md file to document sample projects, indicating a direct connection in sample project documentation.
  • blog: typing json fields #383: Both PRs introduce or document the strongly typed JSON fields feature in ZenStack, connecting through feature documentation and explanation.
  • Update polymorphism.md #371: Both PRs add or update the polymorphism.md documentation for version 3.x, focusing on polymorphic models in ZModel.

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/v3

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 15

🔭 Outside diff range comments (5)
versioned_docs/version-3.x/migration/introduction.md (1)

1-7: Placeholder intro needs substance

This page is the first stop for users looking to migrate, yet it contains only a header. At minimum, outline:

  • Target audience & prerequisites
  • A high-level overview of the migration path (v2 ➜ v3 breaking changes, tooling updates, timelines)
  • Links to subsequent migration chapters
 # Introduction
+
+ZenStack 3.x introduces several breaking changes and new capabilities.  
+This section helps you **upgrade an existing 2.x project** or **start a green-field 3.x project** safely.
+
+## What’s covered
+* Breaking schema changes
+* CLI compatibility matrix
+* Step-by-step upgrade checklist
+
+> Looking for a quick start instead? Head over to the **Getting Started** guide.
versioned_docs/version-3.x/orm/zmodel/datasource.md (1)

1-8: Inconsistent naming & stray character; add content outline

  1. Front-matter uses “Datasource” (one word) while the H1 uses “Data Source” (two words). Pick one to avoid broken anchor links.
  2. There’s an orphan 8 on Line 8 – likely a copy-paste artefact.
  3. Page is otherwise empty; consider at least listing the directive syntax (datasource <name> { provider = … url = … }).
-description: Datasource in ZModel
+# description: Datasource in ZModel
---
 
-# Data Source
+# Datasource
+
+<!-- TODO: Explain provider/url, env(), supported databases, examples -->
-
-8
versioned_docs/version-3.x/orm/validation.md (1)

1-9: Validation doc missing narrative and examples

Given how often users trip over validation rules, an empty page is worse than no page. Either populate with:

  1. Declarative validators syntax
  2. Runtime API (validate() / safeValidate())
  3. Error objects & typical patterns

…or exclude from the published set until ready.

versioned_docs/version-3.x/orm/plugins/introduction.md (1)

1-7: Introduce plugins concept, goals, and hello-world sample

A bare heading does not help users understand why or how to write plugins. At minimum, outline:
• What problems plugins solve
• Lifecycle hooks diagram
• Simple “logger” plugin example
• Link to API reference

Happy to provide a draft if useful.

docusaurus.config.js (1)

38-51: Version entry added without generated sidebars – build may fail
Adding '3.x' here requires:

  1. versioned_docs/version-3.x/ (done)
  2. versioned_sidebars/version-3.x-sidebars.json

Docusaurus will crash at build time if the sidebar file is missing. Generate it via pnpm docs:version 3.x or add a handcrafted JSON.

♻️ Duplicate comments (2)
src/components/StackBlitzGithubEmbed.tsx (1)

1-2: Verify StackBlitz SDK dependency is installed.

Same issue as in StackBlitzEmbed - ensure '@stackblitz/sdk' is properly listed as a dependency.

versioned_docs/version-3.x/reference/server-adapters/express.mdx (1)

7-9: Verify imported component file paths exist.

Same shared components as Hono adapter - ensure these files exist.

🧹 Nitpick comments (60)
versioned_docs/version-3.x/service/introduction.md (1)

1-3: Avoid releasing docs with placeholder content

The page is visible in the sidebar yet only contains “Coming soon 🚧”. Either hide it (e.g. _draft: true or prefix file/dir name with _) or land a minimal meaningful introduction before publishing.

versioned_docs/version-3.x/orm/access-control/introduction.md (1)

1-3: Same placeholder issue as the Service intro

Consider hiding this doc or adding at least a 1-paragraph overview so readers aren’t met with an empty page.

versioned_docs/version-3.x/reference/server-adapters/_error-handling.md (1)

1-3: Heading level & relative links

  1. Using ### Error Handling makes this an H3 while the page has no H1/H2. Change to # Error Handling for hierarchy consistency.
  2. Verify the relative links (./api-handlers/rpc, ./api-handlers/rest) resolve from this file’s location (reference/server-adapters). If the target path is actually reference/server-adapters/api-handlers/..., the links are correct; otherwise they’ll 404.
versioned_docs/version-3.x/orm/zmodel/models.md (1)

1-8: Populate stub or hide

The front-matter is fine, but the page has no body beyond the H1. Either flesh out a short description of ZModel models (fields, id, relations) or hide until content is ready.

versioned_docs/version-3.x/orm/query-builder.md (1)

1-6: Add at least a skeletal outline

Given this is linked from the sidebar, readers expect guidance. Suggest adding a brief overview (purpose, key concepts, example snippet) or keep the file hidden until ready.

versioned_docs/version-3.x/reference/server-adapters/api-handlers/_data_type_serialization.md (1)

1-16: Expand content and harmonise formatting for better readability

The file currently lists the serialization formats but gives no background, rationale, or concrete examples. Consider:

  1. Adding a brief preamble explaining why these formats are chosen (e.g. alignment with superjson, cross-language compatibility, precision, etc.).
  2. Converting the list into a table so readers can scan the information faster.
  3. Providing at least one concrete request/response JSON snippet for each type.

Example patch:

- - `DateTime`
-
-     ISO 8601 string
+| Type      | Serialized form | Example |
+|-----------|-----------------|---------|
+| `DateTime`| ISO-8601 string | `"2025-08-12T10:43:21.123Z"` |

Applying the same pattern to the remaining rows keeps the doc self-contained and actionable.

versioned_docs/version-3.x/orm/zmodel/components.md (1)

1-7: Add overview & navigation pointers

components.md is set as sidebar position 1 but offers no narrative content. Recommend:

  • A short paragraph describing what “schema components” means in the context of ZModel.
  • A bullet list linking out to the deeper pages (models, datasource, attributes, etc.) so readers understand the structure.

Doing so also prevents an empty page from appearing at the top of the ZModel section.

versioned_docs/version-3.x/orm/zmodel/custom-types.md (1)

1-7: Document usage semantics & sample declaration

Custom types are a powerful feature but the page is currently blank. Consider including:

  • When to create a custom type vs. using built-ins
  • Syntax recap (type <Name> { ... })
  • Limitations (e.g., not supported in certain adapters)
  • End-to-end example showing definition, model usage, generated TS type

This will turn the placeholder into actionable documentation.

versioned_docs/version-3.x/orm/zmodel/builtin-types.md (1)

1-7: Provide exhaustive list with notes on cross-adapter behaviour

Readers expect this page to enumerate every built-in scalar (String, Int, BigInt, DateTime, Bytes, Decimal, Boolean, Json) plus any composite types, each with:

  • Prisma equivalence (if any)
  • Default value support
  • Caveats per database adapter

A table format similar to:

| Type | Prisma scalar | Default allowed | Notes |
|------|---------------|-----------------|-------|
| String | `String` | ✅ | — |

would greatly improve usability.

versioned_docs/version-3.x/utilities/zod.md (1)

5-6: Add integration details or hide the page

Readers will expect examples such as:

import { getZodSchema } from '@zenstackhq/runtime';
const userSchema = getZodSchema(prisma).user;

and guidance on server-side validation vs. client-side inference. Add these sections or set draft: true.

versioned_docs/version-3.x/orm/cli.md (1)

5-6: Bare heading only – link or import from reference doc

Given you already have a full CLI reference under reference/cli.md, consider:

• Converting this file to an index that links there, or
• Importing that file via MDX import Doc from '../../reference/cli.md'; <Doc />.

Leaving an empty page hurts navigation UX.

versioned_docs/version-3.x/orm/api/create.md (1)

1-6: Documentation skeleton is empty – flesh out before publishing

The file currently contains only front-matter and a heading. Before this ships, please add at least:
• A short intro sentence (what “create” does, link to spec)
• Signature / options table
• Minimum working example
• Common pitfalls / FAQ

Otherwise the published docs will look broken.

versioned_docs/version-3.x/orm/api/find.md (1)

1-6: Add substantive content to avoid blank “Find” page

Same issue as create.md: heading without body will surface as an empty page in the sidebar. Consider copying the 2.x content as a starting point or mark the file _draft.md until ready.

versioned_docs/version-3.x/orm/zmodel/attributes.md (1)

1-7: Add minimum front-matter metadata and placeholder content

The page is currently an empty stub.
At least add a title field in the front-matter (keeps navigation labels consistent) and drop in a short intro paragraph so the page doesn’t look broken when published.

 ---
 sidebar_position: 4
 description: Attributes in ZModel
+title: Attributes
 ---
 
 # Attributes
 
+This page introduces ZModel attributes, explains how they’re declared,
+what built-in attributes are available, and how to create custom ones.
+See the “ZModel Language Reference” for the full grammar.
versioned_docs/version-3.x/orm/api/count.md (1)

1-6: Provide a title and a one-sentence description

Same as the other API stubs – without a title and a short paragraph the generated page is almost blank, which hurts discoverability.

 ---
 sidebar_position: 5
 description: Count API
+title: Count
 ---
 
 # Count
+
+Explain what the `count` operation does, which filters it accepts,
+and link to an example.
versioned_docs/version-3.x/orm/computed-fields.md (1)

1-8: Fill in basic content & front-matter

Add title and a short intro so the page is not empty.

 description: Computed fields in ZModel
+title: Computed Fields
@@
 # Computed Fields
 
+Describe how to declare computed fields, how recalculation works,
+and any limitations (e.g. no circular dependencies).
versioned_docs/version-3.x/orm/api/aggregate.md (1)

1-6: Stub needs a title and minimal guidance

 description: Aggregate API
+title: Aggregate
@@
 # Aggregate
+
+Outline supported aggregate functions (`sum`, `avg`, `min`, `max`, etc.)
+and link to query examples.
versioned_docs/version-3.x/samples.md (1)

6-9: Replace placeholder sentence with actual links

Listing the sample project series (and linking to their repositories) makes the page immediately useful.

-The ZenStack team maintains the following three series of sample projects.
+The ZenStack team maintains three sample-project series:
+
+- **Todo apps** – progressively showcase features from basic CRUD to multi-tenant auth.  
+- **AI assistants** – demonstrate streaming & function-calling with LangChain.  
+- **SaaS starter kits** – production-ready boilerplates with Next.js, tRPC, and Stripe.
+
+Each repo lives under `github.com/zenstackhq/samples` – link directly so readers can
+clone and run them.
versioned_docs/version-3.x/welcome.md (1)

1-7: Add explicit title to front-matter for consistency

Other files rely on the title key to drive the sidebar & page title; leaving it implicit may harm search / SEO.

 ---
+title: Welcome to ZenStack V3
 description: Welcome to ZenStack
 slug: /welcome
 sidebar_label: Welcome
 sidebar_position: 1
---
versioned_docs/version-3.x/orm/zmodel/reusing-fields.md (1)

1-6: Populate page and align metadata

Consider illustrating the @@include directive (or whichever mechanism exists in v3) with a concrete example showing how to reuse createdAt, updatedAt, etc.

 ---
+title: Reusing Common Fields
 sidebar_position: 8
 description: Reusing common fields across models in ZModel
---
versioned_docs/version-3.x/faq.md (1)

9-10: Document is an empty stub – add at least one FAQ entry before merging
Shipping an empty page degrades user experience and SEO. If content is not ready, mark the file draft: true or keep it on a working branch.

versioned_docs/version-3.x/orm/zmodel/multi-file.md (1)

6-10: Content placeholder only – readers get no value
Before publishing v3 docs, provide at least a short paragraph and one code snippet that demonstrates breaking a schema into two files. Otherwise mark as draft.

versioned_docs/version-3.x/upgrade.md (1)

9-10: Needs minimal upgrade instructions before release
An empty upgrade guide frustrates users migrating to v3. Provide at least a bullet list of breaking changes or link to a WIP PR before publishing.

docusaurus.config.js (1)

38-51: lastVersion still points to current (2.x)
If v3 is publicly available, consider switching lastVersion: '3.x' and marking 2.x as LTS to surface the new docs by default.

versioned_docs/version-3.x/_components/PackageExec.tsx (2)

9-14: Component/file naming mismatch causes confusion
File is PackageExec.tsx but exported component is PackageInstall. Either rename the file or the component for discoverability.

// Option 1 – rename component
-const PackageInstall = ({ command }: Props) => {
+const PackageExec = ({ command }: Props) => {

-export default PackageInstall;
+export default PackageExec;

16-26: Provide a default tab to avoid React key warnings
<Tabs> without defaultValue logs a warning in strict mode. Add:

-        <Tabs>
+        <Tabs defaultValue={pkgManagers[0].name}>
src/components/StackBlitzEmbed.tsx (2)

12-21: Consider adding error handling for SDK operations.

The useEffect doesn't handle potential errors from the StackBlitz SDK embedding operation. Consider wrapping the SDK call in a try-catch block.

 useEffect(() => {
     if (containerRef.current) {
-        sdk.embedProjectId(containerRef.current, projectId, {
-            openFile: 'main.ts',
-            height,
-            view: 'editor',
-            forceEmbedLayout: true,
-        });
+        try {
+            sdk.embedProjectId(containerRef.current, projectId, {
+                openFile: 'main.ts',
+                height,
+                view: 'editor',
+                forceEmbedLayout: true,
+            });
+        } catch (error) {
+            console.error('Failed to embed StackBlitz project:', error);
+        }
     }
 }, [projectId, height]);

15-15: Consider making openFile configurable.

The component hardcodes 'main.ts' as the file to open. Consider making this configurable via props for more flexibility.

 interface StackBlitzEmbedProps {
     projectId: string;
     height?: string;
+    openFile?: string;
 }

-const StackBlitzEmbed: React.FC<StackBlitzEmbedProps> = ({ projectId, height = '600px' }) => {
+const StackBlitzEmbed: React.FC<StackBlitzEmbedProps> = ({ projectId, height = '600px', openFile = 'main.ts' }) => {
     const containerRef = useRef<HTMLDivElement>(null);

     useEffect(() => {
         if (containerRef.current) {
             sdk.embedProjectId(containerRef.current, projectId, {
-                openFile: 'main.ts',
+                openFile,
                 height,
                 view: 'editor',
                 forceEmbedLayout: true,
             });
         }
-    }, [projectId, height]);
+    }, [projectId, height, openFile]);
src/components/StackBlitzGithubEmbed.tsx (1)

15-15: Consider making openFile configurable.

Same suggestion as StackBlitzEmbed - consider making the openFile prop configurable instead of hardcoding 'main.ts'.

versioned_docs/version-3.x/reference/limitations.md (1)

35-36: Consider more concise wording.

The phrase "Right now" could be replaced with "Currently" for more professional documentation tone.

-Right now, the focus of this project is SQL databases, and there's no plan to support MongoDB in the near future.
+Currently, the focus of this project is SQL databases, and there's no plan to support MongoDB in the near future.
versioned_docs/version-3.x/reference/server-adapters/nuxt.mdx (1)

44-45: Missing trailing newline.

The file should end with a newline character for consistency with standard formatting practices.

 You can find a fully working example [here](https://github.com/zenstackhq/sample-todo-nuxt).
+
versioned_docs/version-3.x/reference/server-adapters/elysia.mdx (2)

47-50: Improve placeholder code clarity.

The ellipsis (...) could be replaced with a more descriptive comment to better guide users.

 function getCurrentUser(context: Context) {
     // the implementation depends on your authentication mechanism
-    ...
+    // return user object based on your auth strategy
+    // e.g., return context.headers.authorization ? parseToken() : null;
 }

69-70: Missing trailing newline.

The file should end with a newline character for consistency.

 <ErrorHandling />
+
versioned_docs/version-3.x/_components/PackageInstall.tsx (2)

22-26: Consider improving template literal readability.

The nested template literal is functional but could be more readable with better formatting or extraction to helper functions.

                <TabItem key={pkg.name} value={pkg.name} label={pkg.name}>
                    <CodeBlock language="bash">
-                        {`${devDependencies?.length ? `${pkg.command} ${pkg.dev} ${devDependencies.join(' ')}\n` : ''}${
-                            dependencies?.length ? `${pkg.command} ${dependencies.join(' ')}` : ''
-                        }`}
+                        {[
+                            devDependencies?.length && `${pkg.command} ${pkg.dev} ${devDependencies.join(' ')}`,
+                            dependencies?.length && `${pkg.command} ${dependencies.join(' ')}`
+                        ].filter(Boolean).join('\n')}
                    </CodeBlock>
                </TabItem>

33-34: Missing trailing newline.

The file should end with a newline character for consistency.

 export default PackageInstall;
+
versioned_docs/version-3.x/reference/server-adapters/api-handlers/index.mdx (1)

31-32: Missing trailing newline.

The file should end with a newline character for consistency with standard formatting practices.

 - [RESTful API Handler](./rest)
+
versioned_docs/version-3.x/orm/database-client.mdx (2)

12-15: Fix two small grammar slips (“initialize” → “initialized”, “shows” → “show”)

-The `zen generate` command compiles the ZModel schema into TypeScript code, which we can in turn use to initialize a type-safe database client. ZenStack uses Kysely to handle the low-level database operations, so the client is initialize with a Kysely dialect - an object that encapsulates database details.
-
-The samples below only shows creating a client using SQLite (via ...
+The `zen generate` command compiles the ZModel schema into TypeScript code, which we can in turn use to initialize a type-safe database client. ZenStack uses Kysely to handle the low-level database operations, so the client is **initialized** with a Kysely dialect — an object that encapsulates database details.
+
+The samples below only **show** creating a client using SQLite (via ...

22-27: Mention the “@/” path alias prerequisite

The snippet relies on the @ path alias (import { schema } from '@/zenstack/schema';).
Readers who copy-paste this may hit a module-resolution error if they haven’t configured paths in tsconfig.json.
Consider adding a short note or foot-link pointing to the alias setup instructions.

versioned_docs/version-3.x/reference/server-adapters/_using-api.mdx (1)

14-16: Subject/verb agreement (“hooks assumes”)

-The generated client hooks assumes the server adapter uses [RPC-style API handler](./api-handlers/rpc) (which is the default setting).
+The generated client hooks **assume** the server adapter uses an [RPC-style API handler](./api-handlers/rpc) (which is the default setting).
versioned_docs/version-3.x/reference/error-handling.md (2)

13-14: Minor wording tweak – extra “is” after the link

-... a `PrismaClientKnownRequestError` is thrown with code [`P2004`](https://www.prisma.io/docs/reference/api-reference/error-reference#p2004) is used in such cases:
+... a `PrismaClientKnownRequestError` is thrown with code [`P2004`](https://www.prisma.io/docs/reference/api-reference/error-reference#p2004) in such cases:

23-23: “follow” → “following” (LanguageTool hint)

-... providing more information about the error. It contains the follow...
+... providing more information about the error. It contains the following...
versioned_docs/version-3.x/reference/server-adapters/sveltekit.mdx (2)

24-39: Example is missing the RequestEvent import

RequestEvent is referenced in the getPrisma signature but isn’t imported, which may confuse readers.

-import { getSessionUser } from '$lib/auth.ts';
+import { getSessionUser } from '$lib/auth.ts';
+import type { RequestEvent } from '@sveltejs/kit';

17-20: Package install command omits the sub-path hint

The installation block shows npm install @zenstackhq/server, yet the code uses @zenstackhq/server/sveltekit.
A quick parenthetical note (e.g. “the adapter is exported via a sub-path export”) can prevent confusion.

versioned_docs/version-3.x/reference/server-adapters/fastify.mdx (1)

34-39: Comment wording: the plugin mounts CRUD routes, not “serve OpenAPI”

The inline comment says “serve OpenAPI at /api/model” but the example config mounts CRUD API routes. Unless the plugin also auto-generates & serves OpenAPI docs at that path, tweak the comment to avoid misleading readers.

versioned_docs/version-3.x/reference/cli.md (2)

11-14: Add a language identifier to satisfy MD040 and enable syntax-highlighting

The fenced block that shows the basic CLI invocation lacks a language tag.
Adding bash (or text) will silence the markdown-lint warning and improve readability.

-```
+```bash
 zenstack [options] [command]
 ζ ZenStack is a Prisma power pack for building full-stack apps.
 ...

154-160: Minor style: convert sentence fragments in the options table to full sentences

The descriptions for --debug and --table start with a verb but miss a subject, triggering LanguageTool’s MISSING_IT_THERE rule.
Example:

“Enable debug output. Can be toggled …”

Consider merging into one sentence:

“Enables debug output, which can be toggled on the fly …”

Purely a wording issue; feel free to ignore if you prefer the current terse style.

versioned_docs/version-3.x/reference/server-adapters/next.mdx (1)

123-124: Consistent naming: use “App router” (singular) everywhere

Earlier in the doc the tab label is “App Router”, but the bullet list says “Apps router”.
Recommend singular form for consistency.

-- [Apps router](https://github.com/zenstackhq/docs-tutorial-nextjs-app-dir)
+- [App router](https://github.com/zenstackhq/docs-tutorial-nextjs-app-dir)
versioned_docs/version-3.x/orm/introduction.md (2)

8-10: Tone & wording

“learnt from the prior arts” → “learned from prior art” is more standard technical English.

-ZenStack ORM is a schema-first ORM for modern TypeScript applications. It learnt from the prior arts and aims to provide an awesome developer experience ...
+ZenStack ORM is a schema-first ORM for modern TypeScript applications. It has learned from prior art and aims to provide an exceptional developer experience ...

86-87: Grammar: subject–verb agreement

“Real-world applications often involves storing …”

Should be “often involve”.

versioned_docs/version-3.x/reference/server-adapters/api-handlers/rpc.mdx (1)

81-85: Minor wording – “Http” → “HTTP”
Use the conventional capitalisation for the acronym.

versioned_docs/version-3.x/reference/runtime-api.md (2)

31-35: Grammar nit – drop the extra “to”
The context to for evaluating …The context for evaluating …


83-90: Consider adding language identifiers to unlabeled fenced blocks
Some code blocks (e.g. within the options table) omit a language tag, triggering MD040 warnings. Add ts, json, etc., to keep markdown-lint clean.

versioned_docs/version-3.x/reference/zmodel-language.md (1)

211-215: Typo in fenced-block language tag
```prsima should be ```zmodel (or prisma) – typo breaks syntax highlighting.

versioned_docs/version-3.x/reference/server-adapters/api-handlers/rest.mdx (7)

15-16: Tighten wording in introduction

  • “transportation format” ➜ “transport format”
  • “can be created as the following” ➜ “can be created as follows”
-The RESTful-style API handler exposes CRUD APIs as RESTful endpoints using [JSON:API](https://jsonapi.org/) as transportation format. The API handler is not meant to be used directly; instead, you should use it together with a [server adapter](../../../category/server-adapters) which handles the request and response API for a specific framework.
+The RESTful-style API handler exposes CRUD APIs as RESTful endpoints using [JSON:API](https://jsonapi.org/) as the transport format. The API handler isn’t meant to be used directly; instead, use it with a [server adapter](../../../category/server-adapters) that handles the request/response API for a specific framework.

105-106: Remove duplicate word and clarify sentence

-The RESTful API handler conforms to the the [JSON:API](https://jsonapi.org/format/) v1.1 specification for its URL design and input/output format. The following sections list the endpoints and features are implemented.
+The RESTful API handler conforms to the [JSON:API](https://jsonapi.org/format/) v1.1 specification for its URL design and I/O format. The following sections list the implemented endpoints and features.

668-669: Reduce wordiness and fix plural agreement

-Both `PUT` and `PATCH` do partial update and has exactly the same behavior.
+Both `PUT` and `PATCH` perform partial updates and behave the same.

671-673: Grammar tweak – “it only replaces”

-Please note that this won't update the related resource; instead if only replaces the relationships.
+Note that this doesn’t update the related resource; it only replaces the relationships.

396-404: Spelling: “statisfying” ➜ “satisfying”; plural “comma” ➜ “commas”

-Multiple filter values can be separated by comma. Items statisfying any of the values will be returned.
+Multiple filter values can be separated by commas. Items satisfying any of the values are returned.
...
-Only items statisfying all filters will be returned.
+Only items satisfying all filters are returned.

804-804: Typo and wording

-`PUT` and `PATCH` has exactly the same behavior and both relace the existing relationships with the new ones entirely.
+`PUT` and `PATCH` behave the same and completely replace existing relationships with the new ones.

885-885: Spelling: “convension” ➜ “convention”

-You can use this ID value convension in places where an ID is needed
+You can use this ID value convention wherever an ID is required
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9f0855 and 29771e6.

⛔ Files ignored due to path filters (15)
  • package.json is excluded by !**/*.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !**/*.yaml
  • versioned_docs/version-3.x/migration/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/orm/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/orm/access-control/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/orm/api/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/orm/plugins/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/orm/zmodel/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/recipes/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/reference/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/reference/server-adapters/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/service/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/utilities/_category_.yml is excluded by !**/*.yml
  • versioned_sidebars/version-3.x-sidebars.json is excluded by !**/*.json
  • versions.json is excluded by !**/*.json
📒 Files selected for processing (60)
  • docusaurus.config.js (1 hunks)
  • src/components/StackBlitzEmbed.tsx (1 hunks)
  • src/components/StackBlitzGithubEmbed.tsx (1 hunks)
  • versioned_docs/version-3.x/_components/PackageExec.tsx (1 hunks)
  • versioned_docs/version-3.x/_components/PackageInstall.tsx (1 hunks)
  • versioned_docs/version-3.x/_components/_zmodel-starter.md (1 hunks)
  • versioned_docs/version-3.x/faq.md (1 hunks)
  • versioned_docs/version-3.x/migration/introduction.md (1 hunks)
  • versioned_docs/version-3.x/orm/access-control/introduction.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/aggregate.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/count.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/create.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/delete.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/find.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/transaction.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/update.md (1 hunks)
  • versioned_docs/version-3.x/orm/cli.md (1 hunks)
  • versioned_docs/version-3.x/orm/computed-fields.md (1 hunks)
  • versioned_docs/version-3.x/orm/database-client.mdx (1 hunks)
  • versioned_docs/version-3.x/orm/introduction.md (1 hunks)
  • versioned_docs/version-3.x/orm/plugins/introduction.md (1 hunks)
  • versioned_docs/version-3.x/orm/query-builder.md (1 hunks)
  • versioned_docs/version-3.x/orm/quick-start.mdx (1 hunks)
  • versioned_docs/version-3.x/orm/ts-types.md (1 hunks)
  • versioned_docs/version-3.x/orm/validation.md (1 hunks)
  • versioned_docs/version-3.x/orm/zmodel/attributes.md (1 hunks)
  • versioned_docs/version-3.x/orm/zmodel/builtin-types.md (1 hunks)
  • versioned_docs/version-3.x/orm/zmodel/components.md (1 hunks)
  • versioned_docs/version-3.x/orm/zmodel/custom-types.md (1 hunks)
  • versioned_docs/version-3.x/orm/zmodel/datasource.md (1 hunks)
  • versioned_docs/version-3.x/orm/zmodel/models.md (1 hunks)
  • versioned_docs/version-3.x/orm/zmodel/multi-file.md (1 hunks)
  • versioned_docs/version-3.x/orm/zmodel/polymorphism.md (1 hunks)
  • versioned_docs/version-3.x/orm/zmodel/relations.md (1 hunks)
  • versioned_docs/version-3.x/orm/zmodel/reusing-fields.md (1 hunks)
  • versioned_docs/version-3.x/reference/cli.md (1 hunks)
  • versioned_docs/version-3.x/reference/error-handling.md (1 hunks)
  • versioned_docs/version-3.x/reference/limitations.md (1 hunks)
  • versioned_docs/version-3.x/reference/runtime-api.md (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/_error-handling.md (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/_options.mdx (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/_using-api.mdx (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/api-handlers/_data_type_serialization.md (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/api-handlers/index.mdx (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/api-handlers/rest.mdx (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/api-handlers/rpc.mdx (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/elysia.mdx (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/express.mdx (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/fastify.mdx (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/hono.mdx (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/nestjs.mdx (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/next.mdx (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/nuxt.mdx (1 hunks)
  • versioned_docs/version-3.x/reference/server-adapters/sveltekit.mdx (1 hunks)
  • versioned_docs/version-3.x/reference/zmodel-language.md (1 hunks)
  • versioned_docs/version-3.x/samples.md (1 hunks)
  • versioned_docs/version-3.x/service/introduction.md (1 hunks)
  • versioned_docs/version-3.x/upgrade.md (1 hunks)
  • versioned_docs/version-3.x/utilities/zod.md (1 hunks)
  • versioned_docs/version-3.x/welcome.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
versioned_docs/version-3.x/reference/limitations.md

[style] ~35-~35: For conciseness, consider replacing this expression with an adverb.
Context: ... }); ``` ### MongoDB is not supported Right now, the focus of this project is SQL datab...

(AT_THE_MOMENT)

versioned_docs/version-3.x/orm/introduction.md

[style] ~8-~8: Consider using a more formal and expressive alternative to ‘awesome’.
Context: ...from the prior arts and aims to provide an awesome developer experience by combining the b...

(AWESOME)


[style] ~33-~33: Consider using a different adverb to strengthen your wording.
Context: ...atible Query API Although ZenStack has a completely different implementation (based on [Kys...

(COMPLETELY_ENTIRELY)


[style] ~33-~33: The phrase ‘pretty much’ can be informal. To strengthen your writing, consider removing it or replacing it with an adverb.
Context: ... ORM's query API so that you can use it pretty much as a drop-in replacement. Even if you'r...

(PRETTY_MUCH)

versioned_docs/version-3.x/reference/error-handling.md

[style] ~23-~23: Consider using a more formal alternative.
Context: ...error contains a meta field providing more information about the error. It contains the follow...

(MORE_INFO)

versioned_docs/version-3.x/reference/cli.md

[style] ~158-~158: To form a complete sentence, be sure to include a subject.
Context: ...---- | | --debug | Enable debug output. Can be toggled on the fly in the repl sessi...

(MISSING_IT_THERE)


[style] ~159-~159: To form a complete sentence, be sure to include a subject.
Context: ...alse | | --table | Enable table format. Can be toggled on the fly in the repl sessi...

(MISSING_IT_THERE)

versioned_docs/version-3.x/reference/server-adapters/api-handlers/rest.mdx

[style] ~596-~596: Consider a different adjective to strengthen your wording.
Context: ...?include=author 1. Including a deep relationship ts GET /api/po...

(DEEP_PROFOUND)


[style] ~668-~668: ‘exactly the same’ might be wordy. Consider a shorter alternative.
Context: ...andPATCH` do partial update and has exactly the same behavior. :::info Besides plain fields...

(EN_WORDINESS_PREMIUM_EXACTLY_THE_SAME)


[style] ~804-~804: ‘exactly the same’ might be wordy. Consider a shorter alternative.
Context: ...ship ``` :::info PUT and `PATCH` has exactly the same behavior and both relace the existing r...

(EN_WORDINESS_PREMIUM_EXACTLY_THE_SAME)

versioned_docs/version-3.x/reference/runtime-api.md

[style] ~86-~86: Consider using a different verb to strengthen your wording.
Context: ...be emitted with "info" level, so please make sure you [turn that level on](https://www.pr...

(MAKE_SURE_ENSURE)


[style] ~92-~92: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ... under update doesn't satisfy the rules prior to update, the update operation will fail ...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

versioned_docs/version-3.x/reference/zmodel-language.md

[style] ~26-~26: Consider replacing this phrase with the adverb “naturally” to avoid wordiness.
Context: ...us to build the functionalities we want in a natural way, so we made several extensions to the l...

(IN_A_X_MANNER)


[style] ~178-~178: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...AST representation than generators. - They have access to language features that Z...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1056-~1056: To form a complete sentence, be sure to include a subject.
Context: ...on`: The operation to check access for. Can be "read", "create", "update", or "dele...

(MISSING_IT_THERE)


[style] ~1188-~1188: To form a complete sentence, be sure to include a subject.
Context: ...tModel(casing: String?): String {} ``` Can only be used in access policy expressio...

(MISSING_IT_THERE)


[style] ~1198-~1198: To form a complete sentence, be sure to include a subject.
Context: ...ration(casing: String?): String {} ``` Can only be used in access policy expressio...

(MISSING_IT_THERE)


[style] ~1204-~1204: The contraction ‘Here’re’ is uncommon in written English.
Context: ... Defaults to "original". ### Examples Here're some examples on using field and model ...

(THERE_RE_CONTRACTION_UNCOMMON)


[style] ~1272-~1272: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ...*[FIELD_TYPE]** Type of the field. Can be a scalar type, a reference to anothe...

(MISSING_IT_THERE)


[style] ~1322-~1322: The contraction ‘There’re’ is uncommon in written English.
Context: ...Relations are connections among models. There're three types of relations: - One-to-o...

(THERE_RE_CONTRACTION_UNCOMMON)


[style] ~1605-~1605: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... true, the operation is rejected. - Otherwise, the operation is permitted. Please no...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1758-~1758: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...text: String, _ message: String?)` Validates a string field value ends with the give...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1762-~1762: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...text: String, _ message: String?)` Validates a string field value contains the given...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1766-~1766: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... - @email(_ message: String?) Validates a string field value is a valid email a...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1770-~1770: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...s. - @url(_ message: String?) Validates a string field value is a valid url. -...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1774-~1774: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... @datetime(_ message: String?) Validates a string field value is a valid ISO dat...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1778-~1778: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...egex: String, _ message: String?)` Validates a string field value matches a regex. ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1808-~1808: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ..._ value: Int, _ message: String?)` Validates a number field is less than the given v...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1812-~1812: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ..._ value: Int, _ message: String?)` Validates a number field is less than or equal to...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1834-~1834: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ion email(field: String): Boolean` Validates a string field value is a valid email a...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1838-~1838: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... datetime(field: String): Boolean` Validates a string field value is a valid ISO dat...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1842-~1842: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... - function url(field: String) Validates a string field value is a valid url. -...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1846-~1846: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...seInSensitive: Boolean?): Boolean` Validates a string field contains the search stri...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1850-~1850: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... String, search: String): Boolean` Validates a string field starts with the search s...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1854-~1854: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... String, search: String): Boolean` Validates a string field ends with the search str...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1858-~1858: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...eld: Any[], search: Any): Boolean` Validates a list field contains the search value....

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1862-~1862: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...d: Any[], search: Any[]): Boolean` Validates a list field contains every element in ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1866-~1866: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...d: Any[], search: Any[]): Boolean` Validates a list field contains some elements in ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~1870-~1870: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...on isEmpty(field: Any[]): Boolean` Validates a list field is null or empty. ### Exa...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🪛 markdownlint-cli2 (0.17.2)
versioned_docs/version-3.x/reference/limitations.md

11-11: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

versioned_docs/version-3.x/reference/error-handling.md

11-11: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

versioned_docs/version-3.x/reference/cli.md

11-11: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

versioned_docs/version-3.x/reference/runtime-api.md

11-11: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

versioned_docs/version-3.x/reference/zmodel-language.md

51-51: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


52-52: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


53-53: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


86-86: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


87-87: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


88-88: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


89-89: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


90-90: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


656-656: Spaces inside code span elements

(MD038, no-space-in-code)


671-671: Spaces inside code span elements

(MD038, no-space-in-code)


672-672: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe

(MD055, table-pipe-style)


881-881: Spaces inside code span elements

(MD038, no-space-in-code)


896-896: Spaces inside code span elements

(MD038, no-space-in-code)


907-907: Multiple headings with the same content

(MD024, no-duplicate-heading)


972-972: Heading levels should only increment by one level at a time
Expected: h4; Actual: h5

(MD001, heading-increment)


1053-1053: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1058-1058: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1276-1276: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1277-1277: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1278-1278: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1279-1279: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1280-1280: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1281-1281: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1282-1282: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1283-1283: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1284-1284: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1429-1429: Spaces inside code span elements

(MD038, no-space-in-code)


1442-1442: Spaces inside code span elements

(MD038, no-space-in-code)


1463-1463: Spaces inside code span elements

(MD038, no-space-in-code)


1484-1484: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


1554-1554: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


1562-1562: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


1570-1570: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


1818-1818: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


1917-1917: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1919-1919: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1923-1923: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1924-1924: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1934-1934: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1935-1935: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1938-1938: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


1939-1939: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

🔇 Additional comments (28)
versioned_docs/version-3.x/orm/api/update.md (1)

1-6: “Update” API page is currently blank

Replicate the structure you intend for the other CRUD docs (intro, parameters, example, gotchas). Otherwise users will find an empty page behind the sidebar link.

versioned_docs/version-3.x/orm/computed-fields.md (1)

1-8: No duplicate “Computed Fields” doc detected

Verified that only versioned_docs/version-3.x/orm/computed-fields.md contains the “# Computed Fields” heading. There are no other pages with the same slug, so no routing conflicts will occur.

versioned_docs/version-3.x/welcome.md (1)

3-5: Possible slug collision with existing V2 /welcome page

Because Docusaurus prefixes versioned docs with the version path only in routing, keeping the same /welcome slug in multiple versions will generate identical routes (e.g. /docs/welcome) and the build will warn / overwrite one of them. Confirm whether an earlier version already defines this slug and, if so, add a version-specific slug such as v3-welcome.

No code change proposed until the collision is confirmed.

versioned_docs/version-3.x/faq.md (1)

1-7: Front-matter looks fine but verify slug collision with existing versions
slug: /faq is already used in v2 docs. Duplicate absolute slugs across versions break Docusaurus routing (the first match wins). Either make the slug version-specific (e.g. /v3/faq) or remove the custom slug and rely on the default one.

versioned_docs/version-3.x/orm/zmodel/multi-file.md (1)

1-5: Same slug-duplication risk as above
No explicit slug, so the generated slug will be /orm/zmodel/multi-file. Make sure the same path doesn’t exist in older versions; otherwise add a version prefix.

versioned_docs/version-3.x/upgrade.md (1)

1-7: Check upgrade guide placement
sidebar_position: 8 puts the page above most ORM topics. Confirm that’s intentional; the upgrade guide is usually placed at the bottom of the sidebar to avoid distracting newcomers.

versioned_docs/version-3.x/reference/server-adapters/hono.mdx (3)

25-47: LGTM! Code example demonstrates proper Hono integration.

The code example correctly shows how to integrate ZenStack with Hono using the createHonoHandler middleware factory. The pattern of using enhance with user context and the middleware mounting approach is consistent with other server adapters.


7-9: Imported component file paths verified successfully

All referenced files exist in versioned_docs/version-3.x/reference/server-adapters/:

  • _error-handling.md
  • _options.mdx
  • _using-api.mdx

No further action required.


51-51: Verify Hono getPrisma Prop Signature in AdapterOptions

This MDX-driven component renders your callback type as a string, so you’ll need to confirm it by hand:

• File: versioned_docs/version-3.x/reference/server-adapters/hono.mdx (line 51)
• Make sure Context matches the Hono context type you’re importing.
• Ensure the return type (unknown | Promise<unknown>) reflects your actual PrismaClient initializer’s signature.
• Cross-check against other adapters (Express, Fastify, etc.) to keep the syntax uniform.

versioned_docs/version-3.x/orm/quick-start.mdx (4)

13-15: LGTM! Clear version information provided.

The info callout clearly communicates that v3 packages are under the "@next" tag, which is important for users to understand the pre-release nature.


64-67: LGTM! Comprehensive configuration options documented.

The documentation appropriately covers custom schema paths, output options, and source control considerations for generated files.


29-29: GitHub repository path verified

The zenstackhq/v3-doc-quick-start repository returns HTTP 200, so the StackBlitzGithubEmbed reference is valid and accessible.


6-9: All referenced components exist at their import paths

The following imports have been verified and correspond to actual files in the codebase:

  • src/components/StackBlitzGithubEmbed.tsx
  • versioned_docs/version-3.x/_components/_zmodel-starter.md
  • versioned_docs/version-3.x/_components/PackageInstall.tsx
  • versioned_docs/version-3.x/_components/PackageExec.tsx

No changes required.

src/components/StackBlitzEmbed.tsx (2)

4-7: LGTM! Well-defined TypeScript interface.

The interface properly defines required and optional props with appropriate types.


1-2: It appears no package.json file was found in the repository. Please confirm manually that:

  • A package.json exists at the project root (or appropriate workspace root).
  • The @stackblitz/sdk package is declared under dependencies or devDependencies.
src/components/StackBlitzGithubEmbed.tsx (1)

4-7: LGTM! Well-defined TypeScript interface.

The interface appropriately defines the repoPath prop for GitHub repository embedding.

versioned_docs/version-3.x/reference/server-adapters/express.mdx (4)

25-44: LGTM! Express.js integration example is accurate.

The code example correctly demonstrates Express middleware integration with proper request/response handling and Prisma enhancement patterns.


50-56: LGTM! Express-specific sendResponse option well documented.

The documentation clearly explains the sendResponse boolean option and its impact on middleware behavior, which is specific to Express.js patterns.


66-66: External GitHub repository link verified

The link to https://github.com/zenstackhq/docs-tutorial-express returns HTTP 200 and is accessible. No further action required.


48-48: Express AdapterOptions.getPrisma signature is correct

Verified in src/components/ZenStackInStack.tsx (line 83) that the Express adapter’s getPrisma is indeed defined as (req, res) => …. The documentation’s signature

<AdapterOptions getPrisma='(request: Request, response: Response) => unknown | Promise<unknown>' />

matches the actual interface. No changes required.

versioned_docs/version-3.x/reference/limitations.md (1)

1-41: Well-structured limitations documentation.

The documentation clearly outlines the current constraints and provides helpful workarounds. The code examples for transaction isolation levels are accurate and practical.

versioned_docs/version-3.x/reference/server-adapters/nuxt.mdx (1)

13-30: Excellent adapter documentation with clear examples.

The documentation provides a clear integration example with proper TypeScript typing and follows the established pattern for server adapters. The getPrisma function properly demonstrates user context enhancement.

versioned_docs/version-3.x/reference/server-adapters/elysia.mdx (1)

11-53: Well-structured Elysia adapter documentation.

The documentation effectively demonstrates the middleware pattern with proper TypeScript typing and includes helpful installation instructions for Bun users. The code example shows correct usage of the Elysia framework integration.

versioned_docs/version-3.x/_components/PackageInstall.tsx (1)

10-15: Comprehensive package manager support.

The package manager configuration correctly handles the different dev dependency flags across npm, pnpm, bun, and yarn. This provides excellent user experience for different development environments.

versioned_docs/version-3.x/reference/server-adapters/api-handlers/index.mdx (1)

10-16: Clear and comprehensive API styles explanation.

The documentation effectively distinguishes between RPC and REST API styles, providing users with a clear understanding of their options. The explanation of framework-agnostic handlers with server adapter translation is particularly helpful.

versioned_docs/version-3.x/reference/cli.md (1)

24-28: Command summary for generate is inconsistent with the detailed section

Line 25 claims the command “Generates RESTful API and Typescript client”, whereas the later generate section (Line 86+) explains it produces Prisma schema and runs plugins.
Please align the short description with the detailed one to avoid confusion for readers.

versioned_docs/version-3.x/_components/_zmodel-starter.md (1)

1-23: LGTM – concise, valid starter schema

The starter ZModel is syntactically correct, uses reasonable defaults, and demonstrates key features clearly.

versioned_docs/version-3.x/reference/server-adapters/nestjs.mdx (1)

124-131: Verify correct import style for REST handler
Here the REST handler is imported as a default export:

import RESTApiHandler from '@zenstackhq/server/api/rest';

Elsewhere in the docs (Next.js section) it’s imported as a named export { RestApiHandler }. Please confirm the actual library export and make the samples consistent.

Comment on lines +9 to +14
const pkgManagers = [
{ name: 'npm', command: 'npx' },
{ name: 'pnpm', command: 'pnpm' },
{ name: 'bun', command: 'bunx' },
{ name: 'yarn', command: 'npx' },
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Incorrect Yarn command; will copy-paste fail
yarn users need yarn dlx (Yarn ≥2) or yarn create (Yarn 1), not npx. Suggest:

-    { name: 'yarn', command: 'npx' },
+    { name: 'yarn', command: 'yarn dlx' },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const pkgManagers = [
{ name: 'npm', command: 'npx' },
{ name: 'pnpm', command: 'pnpm' },
{ name: 'bun', command: 'bunx' },
{ name: 'yarn', command: 'npx' },
];
const pkgManagers = [
{ name: 'npm', command: 'npx' },
{ name: 'pnpm', command: 'pnpm' },
{ name: 'bun', command: 'bunx' },
{ name: 'yarn', command: 'yarn dlx' },
];
🤖 Prompt for AI Agents
In versioned_docs/version-3.x/_components/PackageExec.tsx between lines 9 and
14, the command for the yarn package manager is incorrectly set to 'npx', which
will cause copy-paste failures. Update the yarn command to 'yarn dlx' for Yarn
version 2 or higher, or 'yarn create' for Yarn version 1, depending on the
target environment. Adjust the code to reflect the correct command for yarn
users instead of using 'npx'.

Comment on lines +5 to +6

# Delete
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Stub file needs actionable content or draft: true flag

The doc currently stops at the H1 heading. Either flesh it out with a short purpose statement (“Deletes one or many records …”), signature, examples, and return-value notes, or mark it as a draft so it doesn’t surface as an empty page.

---
 sidebar_position: 4
 description: Delete API
+# draft: true   # hides page until filled
 ---
 
 # Delete
 
+<!-- TODO: add overview, usage, options, examples -->
🤖 Prompt for AI Agents
In versioned_docs/version-3.x/orm/api/delete.md at lines 5 to 6, the file only
contains a heading and lacks any actionable content. Add a brief purpose
statement explaining what the Delete API does, include the function signature,
usage examples, and notes on the return value. Alternatively, if the content is
not ready, add a `draft: true` flag in the front matter to prevent it from
appearing as an empty page.

Comment on lines 1 to 6
---
sidebar_position: 7
description: Transaction API
---

# Transaction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Transaction API page is empty – add content or mark WIP

Transactions are non-trivial; before publishing, document:

• how to start / commit / rollback
• nested transactions support
• limitations per adapter (e.g., SQLite)
• code sample with db.$transaction

Add the title field as well:

 ---
+title: Transaction
 sidebar_position: 7
 description: Transaction API
---
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
---
sidebar_position: 7
description: Transaction API
---
# Transaction
---
title: Transaction
sidebar_position: 7
description: Transaction API
---
# Transaction
🤖 Prompt for AI Agents
In versioned_docs/version-3.x/orm/api/transaction.md at lines 1 to 6, the
Transaction API page is currently empty and lacks essential documentation. Add
detailed content explaining how to start, commit, and rollback transactions,
describe support for nested transactions, note any adapter-specific limitations
such as with SQLite, and include a code sample demonstrating usage of
db.$transaction. Also, add a title field in the front matter for proper page
metadata.

Comment on lines 66 to 70
model Post {
id String @id @default(cuid())
title. String @length(1, 256)
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Schema typo: stray dot after title breaks ZModel parsing

title.    String @length(1, 256)

The dot makes the field name invalid. Remove it:

-    title.    String @length(1, 256)
+    title     String @length(1, 256)
🤖 Prompt for AI Agents
In versioned_docs/version-3.x/orm/introduction.md around lines 66 to 70, there
is a typo in the schema where the field name "title." has an extra dot after it,
which breaks ZModel parsing. Remove the stray dot after "title" so the field
name is just "title" followed by the type declaration.

Comment on lines 67 to 70
export default createEventHandler({
handler: RestApiHandler({ endpoint: 'http://myhost/api/model' })
getPrisma
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Nuxt code snippet is syntactically invalid – missing comma between object properties

The example object passed to createEventHandler omits the comma after the handler property, making the snippet uncompilable/copypaste-unsafe.

-export default createEventHandler({
-    handler: RestApiHandler({ endpoint: 'http://myhost/api/model' })
-    getPrisma
-});
+export default createEventHandler({
+    handler: RestApiHandler({ endpoint: 'http://myhost/api/model' }),
+    getPrisma,
+});
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export default createEventHandler({
handler: RestApiHandler({ endpoint: 'http://myhost/api/model' })
getPrisma
});
export default createEventHandler({
handler: RestApiHandler({ endpoint: 'http://myhost/api/model' }),
getPrisma,
});
🤖 Prompt for AI Agents
In versioned_docs/version-3.x/reference/server-adapters/api-handlers/rest.mdx
around lines 67 to 70, the object passed to createEventHandler is missing a
comma between the handler and getPrisma properties. Add a comma after the
handler property to separate the object properties correctly and fix the syntax
error.

Comment on lines 181 to 184
"links": {
"related": "http://myhost/api/post/1/author/1",
"self": "http://myhost/api/post/1/relationships/author/1"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

self and related links in example violate JSON:API URL structure

/post/1/relationships/author/1 adds the resource id twice.
According to the spec and to your own endpoint list, the correct paths are:

-"related": "http://myhost/api/post/1/author/1",
-"self": "http://myhost/api/post/1/relationships/author/1"
+"related": "http://myhost/api/post/1/author",
+"self": "http://myhost/api/post/1/relationships/author"

Keeping example URLs spec-compliant avoids confusing readers and tooling implementors.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"links": {
"related": "http://myhost/api/post/1/author/1",
"self": "http://myhost/api/post/1/relationships/author/1"
}
"links": {
- "related": "http://myhost/api/post/1/author/1",
- "self": "http://myhost/api/post/1/relationships/author/1"
+ "related": "http://myhost/api/post/1/author",
+ "self": "http://myhost/api/post/1/relationships/author"
}
🤖 Prompt for AI Agents
In versioned_docs/version-3.x/reference/server-adapters/api-handlers/rest.mdx
around lines 181 to 184, the example URLs for "self" and "related" links
incorrectly include the resource ID twice, violating JSON:API URL structure.
Update the "self" link to use the correct path format without repeating the
resource ID, matching the spec and your endpoint list, so the URLs are
spec-compliant and clear for readers and tooling.

Comment on lines 25 to 33
```ts
import { enhance } from '@zenstackhq/runtime';
import { ZenStackFastifyPlugin } from '@zenstackhq/server/fastify';
import { prisma } from './db.ts';
import { getSessionUser } from './auth.ts';

const server = fastify();

// serve OpenAPI at /api/model
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Missing fastify import in sample code

The snippet instantiates fastify() without importing it:

-import { prisma } from './db.ts';
-import { getSessionUser } from './auth.ts';
+import fastify from 'fastify';
+import { prisma } from './db.ts';
+import { getSessionUser } from './auth.ts';

Without this, readers copy-pasting will run into a fastify is not defined error.

🤖 Prompt for AI Agents
In versioned_docs/version-3.x/reference/server-adapters/fastify.mdx around lines
25 to 33, the sample code uses fastify() to create a server instance but does
not import fastify itself. To fix this, add an import statement for fastify at
the top of the snippet, such as "import fastify from 'fastify';" so that the
fastify function is defined and the example runs without errors.

Comment on lines 280 to 287
The generated prisma file only contains one `User` model:
```zmodel
model User {
id String @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String @id
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Generated Prisma example shows duplicate @id – invalid schema
The name field is erroneously marked @id, producing two primary keys.

-    name String @id
+    name String
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The generated prisma file only contains one `User` model:
```zmodel
model User {
id String @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String @id
}
model User {
id String @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String
}
🤖 Prompt for AI Agents
In versioned_docs/version-3.x/reference/zmodel-language.md around lines 280 to
287, the Prisma schema example incorrectly marks both the `id` and `name` fields
with `@id`, which is invalid as a model can only have one primary key. Remove
the `@id` attribute from the `name` field to ensure only the `id` field is the
primary key.

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 (15)
versioned_docs/version-3.x/modeling/mixin.md (2)

10-12: Grammar: singular/plural mismatch in sentence

“Mixin is a ZModel concept and don't exist in PSL.” → should read “… and doesn't exist…”.

-Mixin is a ZModel concept and don't exist in PSL.
+Mixin is a ZModel concept and doesn't exist in PSL.

14-16: Use “formerly” instead of “previously” for smoother wording

The info call-out will read more naturally with “formerly”.

-Mixin was previously known as "abstract inheritance" in ZenStack v2.
+Mixin was formerly known as "abstract inheritance" in ZenStack v2.
versioned_docs/version-3.x/modeling/attribute.md (1)

29-33: Missing verb in sentence

“Parameters can named (default) or positional.” is missing “be”.

-Parameters can named (default) or positional.
+Parameters can be named (default) or positional.
versioned_docs/version-3.x/modeling/overview.md (1)

18-19: Typo: “Prima” → “Prisma”

-Don't worry if you've never used Prima before.
+Don't worry if you've never used Prisma before.
versioned_docs/version-3.x/welcome.md (1)

14-27: Heading-level jump inside list breaks MD001 rule

Using #### inside list items skips a level and triggers markdown-lint.
Switch to bold text or ### headings:

- - #### An intuitive schema language
+ - ### An intuitive schema language

Apply to all four list items for consistency.

versioned_docs/version-3.x/modeling/strong-typed-json.md (1)

14-18: Style: over-used phrase “in many cases”

Consider replacing with a less common alternative, e.g., “often” or “frequently”, to keep the prose fresh.

versioned_docs/version-3.x/modeling/model.md (3)

106-107: Fix broken intra-doc link

The target file is relations.md, but the link points to ./relation, which will 404.

- It'll then form a relation. We'll cover that topic [later](./relation).
+It'll then form a relation. We'll cover that topic [later](./relations).

166-171: Grammar polish: “give a field a type”

Minor wording issue that reads awkwardly.

-Besides giving field a type, you can also specify the native database type to use with the `@db.` series of attributes.
+Besides giving a field a type, you can also specify the native database type to use with the `@db.*` attributes.

180-182: Typo: “when generation queries” → “when generating queries”

-The ORM respects the mapping when generation queries, and the migration engine uses it to generate the DDL.
+The ORM respects the mapping when generating queries, and the migration engine uses it to generate the DDL.
versioned_docs/version-3.x/orm/overview.md (4)

8-15: Tone & grammar adjustments for the opener

The first paragraph contains informal wording and a grammar slip (“learnt from the prior arts”).

-ZenStack ORM is a schema-first ORM for modern TypeScript applications. It learnt from the prior arts and aims to provide an awesome developer experience by combining the best ingredients into a cohesive package.
+ZenStack ORM is a schema-first ORM for modern TypeScript applications. It builds on prior art and aims to provide an excellent developer experience by combining proven ideas into a cohesive package.

31-34: Replace informal phrase “pretty much”

-… so that you can use it pretty much as a drop-in replacement.
+… so that you can use it almost as a drop-in replacement.

66-70: Stray dot breaks the ZModel sample

title. (with a trailing dot) is invalid identifier syntax and will confuse readers.

-    title.    String @length(1, 256)
+    title     String @length(1, 256)

114-118: Grammar: subject-verb agreement

-Real-world applications often involves storing polymorphic data …
+Real-world applications often involve storing polymorphic data …
versioned_docs/version-3.x/modeling/relations.md (2)

8-10: Grammar fixes in introduction

-Relation is a fundamental concept in relational databases. It connect models into a graph, and allows you to query interconnected data efficiently.
+A relation is a fundamental concept in relational databases. It connects models into a graph and allows you to query interconnected data efficiently.

83-86: Tone: drop informal “pretty much”

-It's modeled pretty much the same way as one-to-one relations, except that…
+It's modeled in the same way as one-to-one relations, except that…
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a3bc18 and ae00828.

⛔ Files ignored due to path filters (6)
  • versioned_docs/version-3.x/migration/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/modeling/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/orm/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/reference/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/service/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/utilities/_category_.yml is excluded by !**/*.yml
📒 Files selected for processing (22)
  • versioned_docs/version-3.x/_components/ZModelVsPSL.tsx (1 hunks)
  • versioned_docs/version-3.x/migration/overview.md (1 hunks)
  • versioned_docs/version-3.x/modeling/attribute.md (1 hunks)
  • versioned_docs/version-3.x/modeling/custom-type.md (1 hunks)
  • versioned_docs/version-3.x/modeling/datasource.md (1 hunks)
  • versioned_docs/version-3.x/modeling/enum.md (1 hunks)
  • versioned_docs/version-3.x/modeling/mixin.md (1 hunks)
  • versioned_docs/version-3.x/modeling/model.md (1 hunks)
  • versioned_docs/version-3.x/modeling/multi-file.md (1 hunks)
  • versioned_docs/version-3.x/modeling/overview.md (1 hunks)
  • versioned_docs/version-3.x/modeling/plugin.md (1 hunks)
  • versioned_docs/version-3.x/modeling/polymorphism.md (1 hunks)
  • versioned_docs/version-3.x/modeling/relations.md (1 hunks)
  • versioned_docs/version-3.x/modeling/strong-typed-json.md (1 hunks)
  • versioned_docs/version-3.x/orm/overview.md (1 hunks)
  • versioned_docs/version-3.x/orm/quick-start.mdx (1 hunks)
  • versioned_docs/version-3.x/samples.md (1 hunks)
  • versioned_docs/version-3.x/service/overview.md (1 hunks)
  • versioned_docs/version-3.x/upgrade.md (1 hunks)
  • versioned_docs/version-3.x/utilities/tanstack-query.md (1 hunks)
  • versioned_docs/version-3.x/utilities/zod.md (1 hunks)
  • versioned_docs/version-3.x/welcome.md (1 hunks)
✅ Files skipped from review due to trivial changes (10)
  • versioned_docs/version-3.x/migration/overview.md
  • versioned_docs/version-3.x/utilities/tanstack-query.md
  • versioned_docs/version-3.x/service/overview.md
  • versioned_docs/version-3.x/modeling/multi-file.md
  • versioned_docs/version-3.x/modeling/plugin.md
  • versioned_docs/version-3.x/modeling/custom-type.md
  • versioned_docs/version-3.x/modeling/enum.md
  • versioned_docs/version-3.x/_components/ZModelVsPSL.tsx
  • versioned_docs/version-3.x/modeling/polymorphism.md
  • versioned_docs/version-3.x/modeling/datasource.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • versioned_docs/version-3.x/utilities/zod.md
  • versioned_docs/version-3.x/samples.md
  • versioned_docs/version-3.x/upgrade.md
  • versioned_docs/version-3.x/orm/quick-start.mdx
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
versioned_docs/version-3.x/welcome.md

16-16: Heading levels should only increment by one level at a time
Expected: h2; Actual: h4

(MD001, heading-increment)

🪛 LanguageTool
versioned_docs/version-3.x/modeling/mixin.md

[style] ~15-~15: Consider using “formerly” to strengthen your wording.
Context: ... PSL. :::info Mixin was previously known as "abstract inheritance" in ZenS...

(PREVIOUSLY_FORMERLY)

versioned_docs/version-3.x/modeling/overview.md

[style] ~10-~10: Consider shortening this phrase to avoid wordiness.
Context: ...nvince people to learn a new one. So we made the decision to design ZModel as a superset of the [...

(MAKE_THE_CHOICE_TO)


[style] ~19-~19: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...el, so no prior knowledge is required. A very simple ZModel schema looks like this: ```zmod...

(EN_WEAK_ADJECTIVE)

versioned_docs/version-3.x/modeling/relations.md

[style] ~84-~84: The phrase ‘pretty much’ can be informal. To strengthen your writing, consider removing it or replacing it with an adverb.
Context: ...) authorId Int } ``` It's modeled pretty much the same way as one-to-one relations, e...

(PRETTY_MUCH)

versioned_docs/version-3.x/modeling/strong-typed-json.md

[style] ~14-~14: The phrase ‘in many cases’ is used quite frequently. Consider using a less frequent alternative to set your writing apart.
Context: ... usage has become more common. However, in many cases your JSON fields still follow a specifi...

(IN_MANY_STYLE_CASES)

versioned_docs/version-3.x/orm/overview.md

[style] ~8-~8: Consider using a more formal and expressive alternative to ‘awesome’.
Context: ...from the prior arts and aims to provide an awesome developer experience by combining the b...

(AWESOME)


[style] ~33-~33: Consider using a different adverb to strengthen your wording.
Context: ...atible Query API Although ZenStack has a completely different implementation (based on [Kys...

(COMPLETELY_ENTIRELY)


[style] ~33-~33: The phrase ‘pretty much’ can be informal. To strengthen your writing, consider removing it or replacing it with an adverb.
Context: ... ORM's query API so that you can use it pretty much as a drop-in replacement. Even if you'r...

(PRETTY_MUCH)

🔇 Additional comments (1)
versioned_docs/version-3.x/modeling/overview.md (1)

28-43: Inconsistent types in example schema

authorId is declared as String, but it references User.id, which is Int.
Either change authorId to Int or adjust User.id accordingly to avoid confusion in docs examples.

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: 2

🧹 Nitpick comments (18)
versioned_docs/version-3.x/welcome.md (3)

16-27: Fix heading-level jump inside list items

Using #### directly after a top-level # violates MD001 (expected increment by one level).
Switching to ## (or restructuring the list to plain paragraphs) keeps the hierarchy clean and avoids markdown-lint noise.

- - #### An intuitive schema language
+ - ## An intuitive schema language
   That helps you model data, relation, access control, and more, in one place. [🔗](./modeling/)

- - #### A powerful ORM
+ - ## A powerful ORM
   With awesomely-typed API, built-in access control, and unmatched flexibility. [🔗](./orm/)

- - #### A Query-as-a-Service layer
+ - ## A Query-as-a-Service layer
   That provides a full-fledged data API without the need to code it up. [🔗](./service/)

- - #### Utilities
+ - ## Utilities
   For deriving artifacts like Zod schemas, frontend hooks, OpenAPI specs, etc., from the schema. [🔗](./category/utilities)

3-3: Drop the leading slash in slug for consistency

Docusaurus treats slug values starting with / as absolute.
For versioned docs it’s conventional to use a relative slug (welcome) so the final URL becomes /docs/3.x/welcome, aligning with other pages.

-slug: /welcome
+slug: welcome

28-28: Consider using a proper admonition block

Instead of a blockquote, use Docusaurus admonition for clearer styling and automatic theming.

-> *ZenStack originated ...
+:::note
+ZenStack originated as an extension to Prisma ORM. V3 is a complete rewrite that removed Prisma as a runtime dependency and replaced it with an implementation built from scratch (“scratch” = [Kysely](https://kysely.dev/) 😆). On its surface, it continues to use a “Prisma-superset” schema language and a query API compatible with PrismaClient.
+:::
versioned_docs/version-3.x/modeling/multi-file.md (3)

2-2: Duplicate sidebar_position may cause ordering collision

sidebar_position: 11 is also used by modeling/plugin.md. Docusaurus resolves identical positions unpredictably, so one of the pages may jump around when new items are inserted.

-sidebar_position: 11
+sidebar_position: 12   # pick a unique position

14-14: Minor grammar – plural pronoun doesn’t match singular antecedent

“break them down” refers back to the singular noun schema.

-When your schema grows large, you can break them down to smaller files
+When your schema grows large, you can break it down into smaller files

41-41: Wording – missing preposition

“before passed to” reads awkwardly.

-… merged into a single schema AST before passed to the downstream tools.
+… merged into a single schema AST before being passed on to downstream tools.
versioned_docs/version-3.x/modeling/plugin.md (2)

2-2: Duplicate sidebar_position with multi-file doc

Same ordering clash as noted in multi-file.md. Assign a unique value.


20-24: Example/description mismatch

Bullet 2 later references “@core/prisma” as if it were shown in the snippet, but the snippet’s provider is 'my-zenstack-plugin'.

Either change the snippet or adjust the wording:

-2. A `provider` field that specifies where to load the plugin from. It can be a built-in plugin (like `@core/prisma` here)…
+2. A `provider` field that specifies where to load the plugin from. It can be a built-in plugin (for example `@core/prisma`), a local folder, or an npm package.
versioned_docs/version-3.x/modeling/index.md (1)

10-10: Style – wordy phrasing

“To design ZModel as a superset” already implies a decision; “made the decision to” is redundant. Optional tightening:

-So we made the decision to design ZModel as a superset of the …
+Therefore, we designed ZModel as a superset of the …
versioned_docs/version-3.x/orm/index.md (3)

8-8: Tone – informal adjective

“Awe­some” feels promotional. Prefer neutral technical tone:

-… aims to provide an awesome developer experience …
+… aims to provide an excellent developer experience …

86-86: Grammar – subject-verb agreement

-Real-world applications often involves storing polymorphic data …
+Real-world applications often involve storing polymorphic data …

116-116: Word choice – “light-weighted”

The common adjective is “lightweight”.

-… v3 is more straightforward and light-weighted.
+… v3 is more straightforward and lightweight.
versioned_docs/version-3.x/modeling/polymorphism.md (2)

28-28: Article usage

-… having a in-database model of polymorphism …
+… having an in-database model of polymorphism …

72-100: Hard tabs violate MD010

The Mermaid ER diagram block contains literal tab characters that break some markdown linters and can shift rendering.

Replace tabs with 4 spaces (or whatever indentation you prefer) inside the diagram block.

versioned_docs/version-3.x/modeling/relation.md (4)

8-8: Grammar & style cleanup for opening paragraph
Minor wording issues slip in here (“Relation … connect …”, comma splice). Tightening this up improves readability without altering meaning.

-Relation is a fundamental concept in relational databases. It connect models into a graph, and allows you to query interconnected data efficiently.
+Relations are a fundamental concept in relational databases. They connect models into a graph and allow you to query interconnected data efficiently.

27-27: Singular/plural mismatch in ‘fields’ explanation
fields parameters specifies” mixes plural and singular; makes the sentence stumble.

-where the `fields` parameters specifies the foreign key field(s) and the `references` parameter specifies
+where the `fields` parameter specifies the foreign key field(s) and the `references` parameter specifies

48-48: Small wording tweak for composite-PK note
“In matching order” is the idiomatic phrasing.

-must be specified with those field tuples with matching order.
+must be specified with those field tuples in matching order.

84-84: Informal phrasing and typo in one-to-many section
Removes informal “pretty much” (flagged by LanguageTool) and fixes “is a of list …”.

-It's modeled pretty much the same way as one-to-one relations, except that the "non-owner" side (here `User.posts`) is a of list of the other side's model type.
+It’s modeled essentially the same way as one-to-one relations, except that the “non-owner” side (here `User.posts`) is a list of the other side’s model type.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae00828 and 2815551.

⛔ Files ignored due to path filters (6)
  • versioned_docs/version-3.x/migration/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/modeling/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/orm/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/orm/plugins/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/reference/plugins/_category_.yml is excluded by !**/*.yml
  • versioned_docs/version-3.x/service/_category_.yml is excluded by !**/*.yml
📒 Files selected for processing (14)
  • versioned_docs/version-3.x/_components/ZModelVsPSL.tsx (1 hunks)
  • versioned_docs/version-3.x/migration/index.md (1 hunks)
  • versioned_docs/version-3.x/modeling/index.md (1 hunks)
  • versioned_docs/version-3.x/modeling/multi-file.md (1 hunks)
  • versioned_docs/version-3.x/modeling/plugin.md (1 hunks)
  • versioned_docs/version-3.x/modeling/polymorphism.md (1 hunks)
  • versioned_docs/version-3.x/modeling/relation.md (1 hunks)
  • versioned_docs/version-3.x/orm/index.md (1 hunks)
  • versioned_docs/version-3.x/orm/inferred-types.md (1 hunks)
  • versioned_docs/version-3.x/orm/plugins/index.md (1 hunks)
  • versioned_docs/version-3.x/reference/plugin-dev.md (1 hunks)
  • versioned_docs/version-3.x/reference/runtime-api.md (1 hunks)
  • versioned_docs/version-3.x/service/index.md (1 hunks)
  • versioned_docs/version-3.x/welcome.md (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • versioned_docs/version-3.x/service/index.md
  • versioned_docs/version-3.x/orm/plugins/index.md
  • versioned_docs/version-3.x/reference/plugin-dev.md
  • versioned_docs/version-3.x/orm/inferred-types.md
  • versioned_docs/version-3.x/migration/index.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • versioned_docs/version-3.x/reference/runtime-api.md
  • versioned_docs/version-3.x/_components/ZModelVsPSL.tsx
🧰 Additional context used
🪛 LanguageTool
versioned_docs/version-3.x/modeling/index.md

[style] ~10-~10: Consider shortening this phrase to avoid wordiness.
Context: ...nvince people to learn a new one. So we made the decision to design ZModel as a superset of the [...

(MAKE_THE_CHOICE_TO)


[style] ~19-~19: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...el, so no prior knowledge is required. A very simple ZModel schema looks like this: ```zmod...

(EN_WEAK_ADJECTIVE)

versioned_docs/version-3.x/modeling/relation.md

[style] ~84-~84: The phrase ‘pretty much’ can be informal. To strengthen your writing, consider removing it or replacing it with an adverb.
Context: ...) authorId Int } ``` It's modeled pretty much the same way as one-to-one relations, e...

(PRETTY_MUCH)

versioned_docs/version-3.x/orm/index.md

[style] ~8-~8: Consider using a more formal and expressive alternative to ‘awesome’.
Context: ...from the prior arts and aims to provide an awesome developer experience by combining the b...

(AWESOME)


[style] ~33-~33: Consider using a different adverb to strengthen your wording.
Context: ...atible Query API Although ZenStack has a completely different implementation (based on [Kys...

(COMPLETELY_ENTIRELY)


[style] ~33-~33: The phrase ‘pretty much’ can be informal. To strengthen your writing, consider removing it or replacing it with an adverb.
Context: ... ORM's query API so that you can use it pretty much as a drop-in replacement. Even if you'r...

(PRETTY_MUCH)

🪛 markdownlint-cli2 (0.17.2)
versioned_docs/version-3.x/modeling/polymorphism.md

74-74: Hard tabs
Column: 1

(MD010, no-hard-tabs)


76-76: Hard tabs
Column: 1

(MD010, no-hard-tabs)


79-79: Hard tabs
Column: 1

(MD010, no-hard-tabs)

versioned_docs/version-3.x/welcome.md

16-16: Heading levels should only increment by one level at a time
Expected: h2; Actual: h4

(MD001, heading-increment)

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: 2

🧹 Nitpick comments (5)
versioned_docs/version-3.x/modeling/index.md (1)

10-10: Optional: Consider simplifying the phrase for better readability.

The phrase "made the decision to design" could be simplified to "decided to design" for more concise writing.

-So we made the decision to design ZModel as a superset of the [Prisma Schema Language (PSL)](https://www.prisma.io/docs/orm/prisma-schema), which is one of the best data modeling language out there.
+So we decided to design ZModel as a superset of the [Prisma Schema Language (PSL)](https://www.prisma.io/docs/orm/prisma-schema), which is one of the best data modeling language out there.
versioned_docs/version-3.x/orm/api/find.md (1)

1-32: Well-documented API methods with minor style improvement opportunity.

The find API methods are clearly documented. Consider varying the sentence beginnings for better readability:

 - `findFirst`
     
-    Find the first record that matches the query criteria.
+    Returns the first record that matches the query criteria.
versioned_docs/version-3.x/orm/api/create.md (1)

1-21: Clear API documentation with minor style improvement opportunity.

The create API methods are well-documented with accurate technical details and good use of the StackBlitz embed for interactive examples.

Consider simplifying "new records" to "records" for more concise writing:

-The `create` series of APIs are used to create new records in the database.
+The `create` series of APIs are used to create records in the database.
versioned_docs/version-3.x/orm/index.md (2)

97-103: Use the standard term “lightweight”
Both the heading and paragraph use “light-Weighted/light-weighted”, which feels awkward. Replace with the single word “lightweight”.

-### Straightforward and light-Weighted
+### Straightforward and lightweight
...
-Compared to Prisma and previous versions of ZenStack, v3 is more straightforward and light-weighted.
+Compared to Prisma and previous versions of ZenStack, v3 is more straightforward and lightweight.

10-17: Tighten informal language
Phrases like “awesome”, “completely different”, and “pretty much” read informally for technical docs. Consider trimming or replacing for a more professional tone.

-... strives to provide an awesome developer experience ...
+... strives to provide a great developer experience ...

-... has a completely different implementation ...
+... has an entirely different implementation ...

-... so that you can use it pretty much as a drop-in replacement.
+... so that you can use it almost as a drop-in replacement.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2815551 and a43c1d8.

📒 Files selected for processing (19)
  • src/components/StackBlitzGithubEmbed.tsx (1 hunks)
  • versioned_docs/version-3.x/_components/ZenStackVsPrisma.tsx (1 hunks)
  • versioned_docs/version-3.x/_components/_zmodel-starter.md (1 hunks)
  • versioned_docs/version-3.x/faq.md (1 hunks)
  • versioned_docs/version-3.x/modeling/conclusion.md (1 hunks)
  • versioned_docs/version-3.x/modeling/index.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/_select-include-omit.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/aggregate.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/count.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/create.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/delete.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/filter.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/find.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/transaction.md (1 hunks)
  • versioned_docs/version-3.x/orm/api/update.md (1 hunks)
  • versioned_docs/version-3.x/orm/cli.md (1 hunks)
  • versioned_docs/version-3.x/orm/database-client.md (1 hunks)
  • versioned_docs/version-3.x/orm/index.md (1 hunks)
  • versioned_docs/version-3.x/orm/quick-start.md (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • versioned_docs/version-3.x/orm/api/filter.md
  • versioned_docs/version-3.x/modeling/conclusion.md
  • versioned_docs/version-3.x/orm/database-client.md
  • versioned_docs/version-3.x/orm/api/_select-include-omit.md
🚧 Files skipped from review as they are similar to previous changes (9)
  • versioned_docs/version-3.x/orm/api/delete.md
  • versioned_docs/version-3.x/orm/api/count.md
  • versioned_docs/version-3.x/orm/api/update.md
  • versioned_docs/version-3.x/orm/api/transaction.md
  • versioned_docs/version-3.x/orm/api/aggregate.md
  • versioned_docs/version-3.x/faq.md
  • versioned_docs/version-3.x/orm/cli.md
  • versioned_docs/version-3.x/_components/_zmodel-starter.md
  • src/components/StackBlitzGithubEmbed.tsx
🧰 Additional context used
🪛 LanguageTool
versioned_docs/version-3.x/orm/api/find.md

[style] ~23-~23: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...nique criteria. - findFirst Find the first record that matches the query...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

versioned_docs/version-3.x/orm/api/create.md

[style] ~10-~10: ‘new records’ might be wordy. Consider a shorter alternative.
Context: ...eate` series of APIs are used to create new records in the database. It has the following m...

(EN_WORDINESS_PREMIUM_NEW_RECORDS)

versioned_docs/version-3.x/modeling/index.md

[style] ~10-~10: Consider shortening this phrase to avoid wordiness.
Context: ...nvince people to learn a new one. So we made the decision to design ZModel as a superset of the [...

(MAKE_THE_CHOICE_TO)


[style] ~19-~19: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...el, so no prior knowledge is required. A very simple ZModel schema looks like this: ```zmod...

(EN_WEAK_ADJECTIVE)

versioned_docs/version-3.x/orm/index.md

[style] ~10-~10: Consider using a more formal and expressive alternative to ‘awesome’.
Context: ...m the prior arts and strives to provide an awesome developer experience by combining the b...

(AWESOME)


[style] ~16-~16: Consider using a different adverb to strengthen your wording.
Context: ...v3 is inspired by Prisma ORM but it has a completely different implementation (based on [Kys...

(COMPLETELY_ENTIRELY)


[style] ~16-~16: The phrase ‘pretty much’ can be informal. To strengthen your writing, consider removing it or replacing it with an adverb.
Context: ... ORM's query API so that you can use it pretty much as a drop-in replacement. Even if you'r...

(PRETTY_MUCH)


[style] ~109-~109: Consider using a more formal and expressive alternative to ‘awesome’.
Context: ...ntainers](https://webcontainers.io/) is an awesome technology that allows you to run a Nod...

(AWESOME)

🔇 Additional comments (11)
versioned_docs/version-3.x/_components/ZenStackVsPrisma.tsx (1)

1-16: LGTM! Well-structured documentation component.

The component follows React and TypeScript best practices with proper typing, clean imports, and appropriate use of the Docusaurus Admonition theme component for consistent documentation styling.

versioned_docs/version-3.x/modeling/index.md (2)

1-7: LGTM! Proper document structure.

The frontmatter and imports are correctly configured for Docusaurus documentation.


22-52: Excellent schema example and explanation.

The ZModel schema example effectively demonstrates key concepts including datasource configuration, model definitions, attributes, and relations. The comparison with Prisma's generator concept provides valuable context for users transitioning from Prisma.

versioned_docs/version-3.x/orm/quick-start.md (4)

1-18: Well-structured introduction with clear guidance.

The document setup is excellent with proper imports and a helpful info callout about the @next tag for v3 packages. The introduction clearly outlines multiple approaches for getting started.


19-44: Clear and practical setup instructions.

Both approaches for new and existing projects are well-documented with appropriate use of interactive components. The StackBlitz embed provides immediate hands-on experience.


45-62: Comprehensive manual setup guide.

The three-step manual setup process is clear and well-organized. Proper separation of dev and runtime dependencies shows good understanding of the package structure.


63-68: Valuable operational guidance.

The explanation of path customization and source control considerations provides important practical information for real-world usage and deployment scenarios.

versioned_docs/version-3.x/orm/api/find.md (2)

33-52: Excellent use of interactive examples and logical progression.

The documentation effectively combines explanatory text with StackBlitz embeds, and the clickToLoad feature helps with page performance. The logical flow from basic usage to advanced features like sorting and pagination is well-structured.


53-66: Comprehensive coverage of advanced query features.

The field selection documentation using the SelectIncludeOmit component is well-integrated, and the distinct rows explanation with SQL implementation details provides valuable technical insight for developers.

versioned_docs/version-3.x/orm/api/create.md (2)

22-40: Comprehensive input documentation with clear technical details.

The input object documentation thoroughly covers all aspects including nested relations, batch operations, and the skipDuplicates flag. The reference to field selection documentation provides good cross-linking.


41-44: Accurate and concise output documentation.

The output section clearly distinguishes between the different return types of the create methods and appropriately references field selection options.

Comment on lines +48 to +49
```zmodel"
model Post {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix malformed code-block fence – remove stray quote
The extra double quote after zmodel breaks Markdown parsing and syntax highlighting.

-```zmodel"
+```zmodel
🤖 Prompt for AI Agents
In versioned_docs/version-3.x/orm/index.md at lines 48 to 49, the code block
fence for the zmodel code block is malformed due to an extra double quote after
zmodel. Remove the stray double quote so the fence reads ```zmodel instead of
```zmodel". This will fix Markdown parsing and syntax highlighting issues.

Comment on lines +88 to +92
const asset = await db.asset.findFirst();
if (asset.type === 'Post') {
// asset's type is narrowed down to `Post`
console.log(asset.content);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Incorrect model referenced in TypeScript example
The schema defines Content, yet the code queries db.asset. This will not compile and confuses readers.

-const asset = await db.asset.findFirst();
-if (asset.type === 'Post') {
-    // asset's type is narrowed down to `Post`
-    console.log(asset.content);
+const content = await db.content.findFirst();
+if (content?.type === 'Post') {
+    // `content` is now narrowed to `Post`
+    console.log(content.content);
 }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In versioned_docs/version-3.x/orm/index.md around lines 88 to 92, the TypeScript
example incorrectly queries db.asset instead of db.content as defined in the
schema. Update the code to query db.content.findFirst() to match the schema and
ensure the example compiles and is clear to readers.

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: 1

🧹 Nitpick comments (3)
src/components/GithubCodeBlock.tsx (2)

24-32: Consider expanding language support and using a more robust detection method.

The current language detection is quite limited and hardcoded. Consider using a library like linguist-js or maintaining a more comprehensive mapping for better syntax highlighting support.

 const getLanguage = (file: string): string => {
-    if (file.endsWith('.ts')) {
-        return 'typescript';
-    } else if (file.endsWith('.zmodel')) {
-        return 'zmodel';
-    } else {
-        return 'plaintext';
-    }
+    const extension = file.split('.').pop()?.toLowerCase();
+    const languageMap: Record<string, string> = {
+        'ts': 'typescript',
+        'tsx': 'typescript',
+        'js': 'javascript',
+        'jsx': 'javascript',
+        'json': 'json',
+        'md': 'markdown',
+        'yml': 'yaml',
+        'yaml': 'yaml',
+        'zmodel': 'zmodel',
+    };
+    return languageMap[extension || ''] || 'plaintext';
 };

9-11: Consider using a more descriptive initial loading state.

The current "Loading..." text is functional but could be more informative for better user experience.

-const [code, setCode] = useState<string>('Loading...');
+const [code, setCode] = useState<string>(`Loading ${file}...`);
versioned_docs/version-3.x/orm/api/find.md (1)

14-32: Address the style issue with repetitive sentence beginnings.

The static analysis tool correctly identified that three consecutive sentences begin with "Find". This affects readability.

 - `findMany`
     
-    Find multiple records that match the query criteria.
+    Retrieves multiple records that match the query criteria.

 - `findUnique`
     
-    Find a single record with a unique criteria.
+    Retrieves a single record with a unique criteria.

 - `findFirst`
     
-    Find the first record that matches the query criteria.
+    Returns the first record that matches the query criteria.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a43c1d8 and f649467.

⛔ Files ignored due to path filters (2)
  • package.json is excluded by !**/*.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !**/*.yaml
📒 Files selected for processing (3)
  • src/components/GithubCodeBlock.tsx (1 hunks)
  • src/components/StackBlitzGithubEmbed.tsx (1 hunks)
  • versioned_docs/version-3.x/orm/api/find.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/StackBlitzGithubEmbed.tsx
🧰 Additional context used
🪛 LanguageTool
versioned_docs/version-3.x/orm/api/find.md

[style] ~24-~24: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...nique criteria. - findFirst Find the first record that matches the query...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (4)
src/components/GithubCodeBlock.tsx (1)

1-7: LGTM: Clean imports and well-defined interface.

The imports are minimal and appropriate, and the props interface clearly defines the expected inputs with proper TypeScript typing.

versioned_docs/version-3.x/orm/api/find.md (3)

1-8: LGTM: Proper documentation structure with appropriate imports.

The frontmatter is well-structured with sidebar positioning and description. The component imports are correctly referenced and will provide good interactive documentation experience.


40-70: LGTM: Excellent use of interactive documentation components.

The integration of StackBlitzGithubEmbed components with appropriate configuration (clickToLoad for performance, proper file references) demonstrates thoughtful documentation design. The combination of live examples and static code blocks provides comprehensive learning resources.


36-36: Verified GitHub repository path and file accessibility

The referenced zenstackhq/v3-doc-orm-find repository and its zenstack/schema.zmodel file return HTTP 200 via jsDelivr, confirming they exist and are publicly accessible. No changes required.

Comment on lines +12 to +22
useEffect(() => {
(async function () {
const response = await fetch(`https://cdn.jsdelivr.net/gh/${repoPath}/${file}`);
if (!response.ok) {
setCode(`Unable to load "${repoPath}/${file}"`);
return;
}
const text = await response.text();
setCode(text);
})();
}, [repoPath, file]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling for network failures and consider loading states.

The current implementation has basic error handling for HTTP errors but lacks comprehensive error handling for network failures, timeouts, or other fetch-related issues.

 useEffect(() => {
-    (async function () {
+    (async function () {
+        try {
             const response = await fetch(`https://cdn.jsdelivr.net/gh/${repoPath}/${file}`);
             if (!response.ok) {
                 setCode(`Unable to load "${repoPath}/${file}"`);
                 return;
             }
             const text = await response.text();
             setCode(text);
-    })();
+        } catch (error) {
+            setCode(`Failed to fetch "${repoPath}/${file}": ${error instanceof Error ? error.message : 'Unknown error'}`);
+        }
+    })();
 }, [repoPath, file]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
useEffect(() => {
(async function () {
const response = await fetch(`https://cdn.jsdelivr.net/gh/${repoPath}/${file}`);
if (!response.ok) {
setCode(`Unable to load "${repoPath}/${file}"`);
return;
}
const text = await response.text();
setCode(text);
})();
}, [repoPath, file]);
useEffect(() => {
(async function () {
try {
const response = await fetch(`https://cdn.jsdelivr.net/gh/${repoPath}/${file}`);
if (!response.ok) {
setCode(`Unable to load "${repoPath}/${file}"`);
return;
}
const text = await response.text();
setCode(text);
} catch (error) {
setCode(
`Failed to fetch "${repoPath}/${file}": ${
error instanceof Error ? error.message : 'Unknown error'
}`
);
}
})();
}, [repoPath, file]);
🤖 Prompt for AI Agents
In src/components/GithubCodeBlock.tsx around lines 12 to 22, the fetch call
lacks error handling for network failures and does not manage loading states.
Wrap the fetch logic inside a try-catch block to catch network errors and update
the state accordingly. Additionally, introduce a loading state variable to
indicate when the fetch is in progress and update it before and after the fetch
operation to reflect the loading status.

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/orm/api/find.md (2)

1-4: Add title to the front-matter for improved navigation & SEO

Most docs in this folder specify an explicit title in the front-matter. Omitting it falls back to the filename, which renders as “find” (lower-case) in the sidebar and HTML <title>. Adding a proper title keeps style consistent and helps search engines.

 ---
+title: Find
 sidebar_position: 2
 description: Find API
 ---

14-32: Rephrase bullet descriptions to avoid repetitive sentence starts

LanguageTool flagged three consecutive sentences beginning with “Find”. Consider sleeker phrasing:

 - `findMany`
-    
-    Find multiple records that match the query criteria.
+    
+    Returns multiple records matching the specified criteria.
 
 - `findUnique`
-    
-    Find a single record with a unique criteria.
+    
+    Retrieves a single record identified by a unique field.
 
 - `findFirst`
-    
-    Find the first record that matches the query criteria.
+    
+    Returns the first record that satisfies the query criteria.

This improves readability without altering the meaning.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f649467 and 2c526ff.

📒 Files selected for processing (2)
  • src/components/StackBlitzGithubEmbed.tsx (1 hunks)
  • versioned_docs/version-3.x/orm/api/find.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/StackBlitzGithubEmbed.tsx
🧰 Additional context used
🪛 LanguageTool
versioned_docs/version-3.x/orm/api/find.md

[style] ~24-~24: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...nique criteria. - findFirst Find the first record that matches the query...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (2)
versioned_docs/version-3.x/orm/api/find.md (2)

6-8: Double-check MDX import paths and extensions

  1. ./_select-include-omit.md is imported as a React component. Docusaurus requires the target to be processed as MDX, so the file should have a .mdx extension, or you should rename the import accordingly.
  2. Verify that both @site/src/components/StackBlitzGithubEmbed and @site/src/components/GithubCodeBlock exist on the v3 docs site build path; broken imports will fail the build.

48-50: Confirm the parameter name sort is correct

In earlier ZenStack examples (and in Prisma) the option is commonly called orderBy. If the actual client still expects orderBy, the examples here will confuse users.

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.

1 participant