Skip to content

Conversation

@KazariEX
Copy link
Member

@KazariEX KazariEX commented Sep 21, 2025

🔗 Linked issue

📚 Description

Just for consistency. Further changes are required after #33287.

@KazariEX KazariEX requested a review from danielroe as a code owner September 21, 2025 18:01
@bolt-new-by-stackblitz
Copy link

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 21, 2025

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@33286

nuxt

npm i https://pkg.pr.new/nuxt@33286

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@33286

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@33286

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@33286

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@33286

commit: 24c59ef

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 21, 2025

CodSpeed Performance Report

Merging #33286 will not alter performance

Comparing KazariEX:refactor/nitro-types-references (24c59ef) with main (73627c9)1

Summary

✅ 10 untouched

Footnotes

  1. No successful run was found on main (c791676) during the generation of this report, so 73627c9 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@danielroe
Copy link
Member

merged #33287.

(you're on fire 🔥)

@coderabbitai
Copy link

coderabbitai bot commented Sep 23, 2025

Walkthrough

  • Added a nitro:prepare:types hook in packages/nuxt/src/core/nuxt.ts to push ./app.config.d.ts and ./runtime-config.d.ts into Nitro’s type references.
  • The same hook logic appears twice in nuxt.ts, each pushing the same two references.
  • Removed two triple-slash reference pragmas (./app.config.d.ts and ./runtime-config.d.ts) from the Nitro schema template output in packages/nuxt/src/core/templates.ts.
  • No changes to exported or public entity signatures.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly and accurately describes the primary change — moving the addition of type references into the nitro:prepare:types hook for Nuxt — and matches the PR objectives and file-level summaries.
Description Check ✅ Passed The description is brief but related to the changeset, stating the intent (consistency) and noting follow-up work after #33287, so it is not off-topic.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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

❤️ Share

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

Copy link

@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 (1)
packages/nuxt/src/core/nuxt.ts (1)

272-277: Guard against duplicate references in nitro:prepare:types.

If other hooks/modules add the same paths, duplicates may accumulate. Add a small guard.

-  // Add nitro types
-  nuxt.hook('nitro:prepare:types', (opts) => {
-    opts.references.push({ path: resolve(nuxt.options.buildDir, 'types/app.config.d.ts') })
-    opts.references.push({ path: resolve(nuxt.options.buildDir, 'types/runtime-config.d.ts') })
-  })
+  // Add nitro types
+  nuxt.hook('nitro:prepare:types', (opts) => {
+    const addRef = (rel: string) => {
+      const p = resolve(nuxt.options.buildDir, rel)
+      if (!opts.references.some(r => 'path' in r && r.path === p)) {
+        opts.references.push({ path: p })
+      }
+    }
+    addRef('types/app.config.d.ts')
+    addRef('types/runtime-config.d.ts')
+  })
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 73627c9 and 24c59ef.

📒 Files selected for processing (2)
  • packages/nuxt/src/core/nuxt.ts (1 hunks)
  • packages/nuxt/src/core/templates.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • packages/nuxt/src/core/templates.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Follow standard TypeScript conventions and best practices

Files:

  • packages/nuxt/src/core/nuxt.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: code
  • GitHub Check: codeql (javascript-typescript)
  • GitHub Check: build

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

🙏

@danielroe danielroe merged commit a57f7fb into nuxt:main Sep 23, 2025
81 of 84 checks passed
@KazariEX KazariEX deleted the refactor/nitro-types-references branch September 23, 2025 11:32
@github-actions github-actions bot mentioned this pull request Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants