-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
refactor(nuxt): move references addition to nitro:prepare:types hook
#33286
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
refactor(nuxt): move references addition to nitro:prepare:types hook
#33286
Conversation
|
|
@nuxt/kit
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
CodSpeed Performance ReportMerging #33286 will not alter performanceComparing Summary
Footnotes |
|
merged #33287. (you're on fire 🔥) |
Walkthrough
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
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.
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. Comment |
There was a problem hiding this 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 innitro: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
📒 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
danielroe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
🔗 Linked issue
📚 Description
Just for consistency. Further changes are required after #33287.