pinia icon indicating copy to clipboard operation
pinia copied to clipboard

docs(zh): 同步中文文档与英文官方文档在Nuxt -> Auto imports小节的内容

Open longmaobure opened this issue 1 month ago • 2 comments

发现中文文档在Nuxt -> 自动引入部分的内容, 与英文官方文档不一致 并且对应的代码示例并不能正确运行 已参考官方英文文档翻译并更新中文文档对应部分 保持文档内容一致性, 有助于中文用户理解

Summary by CodeRabbit

  • Documentation
    • Updated Nuxt integration guide with clearer explanations of automatic imports for Pinia composables and stores.
    • Added guidance on automatic store discovery from designated directories.
    • Updated configuration examples with simplified setup patterns and TypeScript approach.
    • Included documentation on customizing store directory paths through configuration options.

longmaobure avatar Nov 17 '25 15:11 longmaobure

Deploy Preview for pinia-official failed. Why did it fail? →

Name Link
Latest commit 82f1070b624ac692531697aec88b11e78f0fbbc5
Latest deploy log https://app.netlify.com/projects/pinia-official/deploys/691b41ab7657880007eb189a

netlify[bot] avatar Nov 17 '25 15:11 netlify[bot]

Walkthrough

This PR updates the Chinese Nuxt SSR documentation for Pinia, replacing explicit autoImports configuration with directory-based store auto-discovery via storesDirs. Configuration examples transition from nuxt.config.js to nuxt.config.ts, with new documentation on default auto-imports and store import patterns.

Changes

Cohort / File(s) Summary
Chinese Nuxt SSR Documentation
packages/docs/zh/ssr/nuxt.md
Adds new subsection detailing default auto-imports (usePinia, defineStore, storeToRefs, acceptHMRUpdate) and automatic store discovery. Updates configuration guidance from explicit autoImports array to simplified pinia.storesDirs option. Replaces nuxt.config.js example with nuxt.config.ts. Documents Nuxt 4's app/stores store location and storesDirs customization.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Documentation-only changes with straightforward configuration example updates
  • No logic or code behavior changes to verify
  • Examples are consistent and follow established patterns

Possibly related PRs

  • vuejs/pinia#3047: Modifies the same auto-imports documentation section and references Nuxt 4's app/stores location

Suggested reviewers

  • posva

Poem

🐰 In docs so fine, a rabbit did write, Where stores now bloom in directories bright, From configs old to nuxt.config.ts— Auto-imports gleaming, configurations blessed! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main objective: syncing the Chinese documentation with the English official documentation in the Nuxt Auto imports section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94cc16c0ed53ecf1e9b07b9b6a19e16e492d9639 and 82f1070b624ac692531697aec88b11e78f0fbbc5.

📒 Files selected for processing (1)
  • packages/docs/zh/ssr/nuxt.md (1 hunks)
🔇 Additional comments (3)
packages/docs/zh/ssr/nuxt.md (3)

31-42: Documentation structure looks well-integrated.

The new auto-imports documentation and configuration example fit well after the basic module setup. The progression from simple setup (lines 31-42) to detailed features (lines 70-89) is logical and clear.

Also applies to: 70-89


80-89: Configuration syntax verified as correct. The storesDirs option and glob pattern syntax (./stores/**, ./custom-folder/stores/**) are accurate and properly documented. No changes needed.


70-78: Documentation is accurate; all technical claims verified.

The four auto-imported functions (usePinia(), defineStore(), storeToRefs(), and acceptHMRUpdate()) are correctly listed as default auto-imports provided by @pinia/nuxt. The claim that nested subdirectories are not scanned by default is also accurate, and users can enable nested store imports by explicitly using glob patterns like ./stores/** or app/stores/** through the storesDirs configuration option.

[!TIP]

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example:

"Create a concise high-level summary as a bullet-point list. Then include a Markdown table showing lines added and removed by each contributing author."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

coderabbitai[bot] avatar Nov 17 '25 15:11 coderabbitai[bot]