Skip to content

Conversation

@aa900031
Copy link
Owner

@aa900031 aa900031 commented Jan 29, 2026

Summary by CodeRabbit

  • Documentation

    • Major rewrite and expansion across guides (introduction, data, forms, lists, auth, authorization, realtime, resources) with clearer concepts, examples, diagrams, and patterns.
  • New Features

    • Composables/controllers updated to return explicit mutation triggers and loading indicators (e.g., save/mutate, record, isLoading) for improved UI feedback.
  • Chores

    • Configuration and tooling updates: new review/config file, lint/skill ignore rules, Storybook static assets, and added skill references.

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

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Adds CodeRabbit config and ESLint ignores, registers several AI agent skill references, updates Storybook static dirs, tweaks a realtime query invalidate call, and performs large documentation rewrites across multiple guides including public return-shape changes for several composables (useCreate, useEdit, useShow, useDeleteOne).

Changes

Cohort / File(s) Summary
Config & Tooling
/.coderabbit.yaml, eslint.config.js
Adds CodeRabbit configuration and toggles; updates ESLint ignores to exclude .agents/skills/**/* and .opencode/skills/**/*.
AI Agent Skill References
.opencode/skills/...
/.opencode/skills/doc-coauthoring, /.opencode/skills/document-writer, /.opencode/skills/mermaid-diagrams, /.opencode/skills/nuxt, /.opencode/skills/nuxt-content, /.opencode/skills/nuxt-ui, /.opencode/skills/vue
Adds small manifest/reference files pointing to corresponding agent skill directories; no runtime logic changes.
Storybook
stories/root/.storybook/main.ts
Adds staticDirs: ['../public'] to serve public assets as static files.
Realtime small change
packages/core/src/query/realtime.ts
Single-line change: triggerInvalidate is now called with an additional undefined argument in the Auto mode branch.
Introduction & Core docs
docs/content/1.guides/0.introduction.md
Rewords introduction, renames sections, clarifies architecture and composition terminology.
Data guide (large)
docs/content/1.guides/1.data.md
Extensive expansion/rewrite: explicit Fetcher interface, CRUD composables, cache invalidation semantics, mutation modes, relationships, diagrams, and many examples (content-only).
Form guide & public API updates
docs/content/1.guides/2.form.md
Shifts to Controller-centric patterns; updates examples and documents public API return-shape changes for useCreate, useEdit, useShow, and useDeleteOne (now include `save
List guide
docs/content/1.guides/3.list.md
Adds permanent filters/sorters, custom sync field names/serialization hooks, field-level sync disabling, and structural renames (useList → List).
Authentication & Authorization
docs/content/1.guides/4.authentication.md, docs/content/1.guides/5.authorization.md
Adds error-handling strategies, refresh/401 patterns and detailed params docs plus policy examples for authorization.
Realtime docs
docs/content/1.guides/7.realtime.md
Expands realtime guide with Auto/Manual modes, examples for subscribe/publish, data flows, and collaborative scenarios.
Resources guide
docs/content/1.guides/8.resources.md
Replaces routing/resolution narrative with flat/hierarchical resource patterns, breadcrumb examples, custom URL parsing, and multi-fetcher usage.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • feat: invalidate by result data #102 – Updates triggerInvalidate/triggerInvalidates signatures and callers to accept a mutation result; directly related to the realtime call-site change here.
  • chore: docs #99 – Overlapping realtime documentation edits; likely edits to the same docs and examples.

Poem

🐇 I hopped through docs and left tiny tracks,

Linked up skills and tuned the linting stacks.
Forms now whisper "saving" in the night,
Data streams sparkle with realtime light,
Hooray — the rabbit fixed the map just right! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'docs: improve document content with ai' is vague and generic, using non-descriptive terms that don't convey meaningful information about the specific changes made to the documentation. Consider a more specific title that highlights the main documentation improvements, such as 'docs: expand guides with detailed examples and clarified terminology' or 'docs: rewrite data, form, and list guides with improved structure and examples'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 29, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing docs/improve-document-content-with-ai (3f214e3) with main (c0640ce)

Open in CodSpeed

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 29, 2026

Open in StackBlitz

@ginjou/core

npm i https://pkg.pr.new/@ginjou/core@103

@ginjou/nuxt

npm i https://pkg.pr.new/@ginjou/nuxt@103

@ginjou/vue

npm i https://pkg.pr.new/@ginjou/vue@103

@ginjou/with-directus

npm i https://pkg.pr.new/@ginjou/with-directus@103

@ginjou/with-rest-api

npm i https://pkg.pr.new/@ginjou/with-rest-api@103

@ginjou/with-supabase

npm i https://pkg.pr.new/@ginjou/with-supabase@103

@ginjou/with-vue-i18n

npm i https://pkg.pr.new/@ginjou/with-vue-i18n@103

@ginjou/with-vue-router

npm i https://pkg.pr.new/@ginjou/with-vue-router@103

commit: 3f214e3

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 29, 2026

Deploying ginjou with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3f214e3
Status: ✅  Deploy successful!
Preview URL: https://119b03aa.ginjou.pages.dev
Branch Preview URL: https://docs-improve-document-conten.ginjou.pages.dev

View logs

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.09%. Comparing base (c0640ce) to head (3f214e3).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #103   +/-   ##
=======================================
  Coverage   55.09%   55.09%           
=======================================
  Files         128      128           
  Lines        3142     3142           
  Branches      771      769    -2     
=======================================
  Hits         1731     1731           
  Misses       1252     1252           
  Partials      159      159           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 29, 2026

Deploying ginjou-storybook with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3f214e3
Status: ✅  Deploy successful!
Preview URL: https://114b8f99.ginjou-storybook.pages.dev
Branch Preview URL: https://docs-improve-document-conten.ginjou-storybook.pages.dev

View logs

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

🤖 Fix all issues with AI agents
In `@docs/content/1.guides/5.authorization.md`:
- Around line 165-178: In authz.access, the parameter named resource is being
shadowed by the local const resource = await getResource(params.id); rename one
of them (e.g., rename the parameter to resourceParam or the local variable to
fetchedResource) and update all uses in the function (including the getResource
call and the can check) so the function uses distinct, descriptive names; ensure
authz.access still calls getCurrentUser() and returns the same can expression
comparing user.department to the correctly named resource field and checking
action in ['read','edit'].

In `@docs/content/1.guides/8.resources.md`:
- Around line 136-163: The example references an undefined resourceMap inside
buildBreadcrumbs causing runtime errors; fix by providing a source for parent
lookups: either define a resourceMap (e.g., populate a Map keyed by resource id
from resolved.value.resources) or replace resourceMap.get(...) with a
composable/helper that resolves a parent by id (create and import a function
like findResourceById) and use it inside buildBreadcrumbs; ensure you reference
useResource/resolved and update buildBreadcrumbs to use the chosen parent-lookup
mechanism so current = <resourceMap or findResourceById>(current.meta?.parent)
is valid.

Comment on lines +165 to +178
const authz = {
access: async ({ resource, action, params }) => {
const user = await getCurrentUser()
const resource = await getResource(params.id)

return {
can: (
user.department === resource.department
&& ['read', 'edit'].includes(action)
),
}
},
}
```
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 | 🟡 Minor

Variable shadowing: resource parameter conflicts with local variable.

At line 168, the local variable const resource = await getResource(params.id) shadows the resource parameter from the function signature (line 166). This creates confusion and potential bugs.

🔧 Suggested fix
 const authz = {
 	access: async ({ resource, action, params }) => {
 		const user = await getCurrentUser()
-		const resource = await getResource(params.id)
+		const resourceData = await getResource(params.id)
 
 		return {
 			can: (
-				user.department === resource.department
+				user.department === resourceData.department
 				&& ['read', 'edit'].includes(action)
 			),
 		}
 	},
 }
📝 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 authz = {
access: async ({ resource, action, params }) => {
const user = await getCurrentUser()
const resource = await getResource(params.id)
return {
can: (
user.department === resource.department
&& ['read', 'edit'].includes(action)
),
}
},
}
```
const authz = {
access: async ({ resource, action, params }) => {
const user = await getCurrentUser()
const resourceData = await getResource(params.id)
return {
can: (
user.department === resourceData.department
&& ['read', 'edit'].includes(action)
),
}
},
}
🤖 Prompt for AI Agents
In `@docs/content/1.guides/5.authorization.md` around lines 165 - 178, In
authz.access, the parameter named resource is being shadowed by the local const
resource = await getResource(params.id); rename one of them (e.g., rename the
parameter to resourceParam or the local variable to fetchedResource) and update
all uses in the function (including the getResource call and the can check) so
the function uses distinct, descriptive names; ensure authz.access still calls
getCurrentUser() and returns the same can expression comparing user.department
to the correctly named resource field and checking action in ['read','edit'].

Comment on lines 136 to 163
```vue
<script setup lang="ts">
import { useResource } from '@ginjou/vue'

const resolved = useResource()

// resolved.value will contain:
// - resource: The matched ResourceDefinition
// - action: 'list' | 'create' | 'edit' | 'show'
// - id: The record ID (for 'edit' or 'show' actions)
function buildBreadcrumbs() {
const crumbs = []
let current = resolved.value?.resource

while (current) {
crumbs.unshift(current.name)
// Look up parent resource
current = resourceMap.get(current.meta?.parent)
}

return crumbs
}
</script>

<template>
<div>
<h1>Current Resource: {{ resolved?.resource.name }}</h1>
<p>Action: {{ resolved?.action }}</p>
<p v-if="resolved?.id">
ID: {{ resolved.id }}
</p>
</div>
<nav class="breadcrumbs">
<span v-for="crumb in buildBreadcrumbs()" :key="crumb">
{{ crumb }}
</span>
</nav>
</template>
```
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 | 🟡 Minor

Undefined variable resourceMap in breadcrumb example.

At line 149, the code references resourceMap.get(current.meta?.parent), but resourceMap is never defined, imported, or explained. Developers following this example will encounter a runtime error.

Consider one of these approaches:

💡 Option 1: Define resourceMap in the component
 <script setup lang="ts">
 import { useResource } from '@ginjou/vue'
 
 const resolved = useResource()
+// Assuming resources are available from context or props
+const resourceMap = new Map(resources.map(r => [r.name, r]))
 
 function buildBreadcrumbs() {
💡 Option 2: Use a composable
 <script setup lang="ts">
-import { useResource } from '@ginjou/vue'
+import { useResource, useResourceMap } from '@ginjou/vue'
 
 const resolved = useResource()
+const resourceMap = useResourceMap()
 
 function buildBreadcrumbs() {
🤖 Prompt for AI Agents
In `@docs/content/1.guides/8.resources.md` around lines 136 - 163, The example
references an undefined resourceMap inside buildBreadcrumbs causing runtime
errors; fix by providing a source for parent lookups: either define a
resourceMap (e.g., populate a Map keyed by resource id from
resolved.value.resources) or replace resourceMap.get(...) with a
composable/helper that resolves a parent by id (create and import a function
like findResourceById) and use it inside buildBreadcrumbs; ensure you reference
useResource/resolved and update buildBreadcrumbs to use the chosen parent-lookup
mechanism so current = <resourceMap or findResourceById>(current.meta?.parent)
is valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants