Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.5k
feat(schema): add global tsconfig options#33795
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
feat(schema): add global tsconfig options#33795
Conversation
- Add appTsConfig and serverTsConfig options- Make tsConfig apply globally to all generated tsconfig files- Add JSDoc documentationClosesnuxt#33678
|
coderabbitaibot commentedDec 1, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
WalkthroughAdds two public TypeScript config properties — Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip ✨ Issue Enrichment is now available for GitHub issues!CodeRabbit can now help you manage issues more effectively:
Disable automatic issue enrichmentTo disable automatic issue enrichment, add the following to your issue_enrichment:auto_enrich:enabled:false Thanks for usingCodeRabbit! 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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/kit/src/template.ts(1 hunks)packages/nitro-server/src/index.ts(3 hunks)packages/schema/src/config/typescript.ts(1 hunks)packages/schema/src/types/schema.ts(14 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Follow standard TypeScript conventions and best practices
Files:
packages/nitro-server/src/index.tspackages/kit/src/template.tspackages/schema/src/config/typescript.tspackages/schema/src/types/schema.ts
**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx,js,jsx,vue}: Use clear, descriptive variable and function names
Add comments only to explain complex logic or non-obvious implementations
Keep functions focused and manageable (generally under 50 lines), and extract complex logic into separate domain-specific files
Remove code that is not used or needed
Use error handling patterns consistently
Files:
packages/nitro-server/src/index.tspackages/kit/src/template.tspackages/schema/src/config/typescript.tspackages/schema/src/types/schema.ts
🧠 Learnings (7)
📓 Common learnings
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,vue} : Follow standard TypeScript conventions and best practices📚 Learning: 2024-11-05T15:22:54.759Z
Learnt from: GalacticHypernovaRepo: nuxt/nuxt PR: 26468File: packages/nuxt/src/components/plugins/loader.ts:24-24Timestamp: 2024-11-05T15:22:54.759ZLearning: In `packages/nuxt/src/components/plugins/loader.ts`, the references to `resolve` and `distDir` are legacy code from before Nuxt used the new unplugin VFS and will be removed.Applied to files:
packages/nitro-server/src/index.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,vue} : Follow standard TypeScript conventions and best practicesApplied to files:
packages/nitro-server/src/index.tspackages/kit/src/template.tspackages/schema/src/types/schema.ts
📚 Learning: 2024-11-28T21:22:40.496Z
Learnt from: GalacticHypernovaRepo: nuxt/nuxt PR: 29661File: packages/kit/src/template.ts:227-229Timestamp: 2024-11-28T21:22:40.496ZLearning: In `packages/kit/src/template.ts`, when updating the `EXTENSION_RE` regular expression for TypeScript configuration, avoid using patterns like `(\.\w+)+$` as they can result in catastrophic backtracking.Applied to files:
packages/kit/src/template.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.vue : Use `<script setup lang="ts">` and the composition API when creating Vue componentsApplied to files:
packages/kit/src/template.tspackages/schema/src/types/schema.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,js,jsx,vue} : Remove code that is not used or neededApplied to files:
packages/kit/src/template.ts
📚 Learning: 2024-12-12T12:36:34.871Z
Learnt from: huang-julienRepo: nuxt/nuxt PR: 29366File: packages/nuxt/src/app/components/nuxt-root.vue:16-19Timestamp: 2024-12-12T12:36:34.871ZLearning: In `packages/nuxt/src/app/components/nuxt-root.vue`, when optimizing bundle size by conditionally importing components based on route metadata, prefer using inline conditional imports like:```jsconst IsolatedPage = route?.meta?.isolate ? defineAsyncComponent(() => import('#build/isolated-page.mjs')) : null```instead of wrapping the import in a computed property or importing the component unconditionally.Applied to files:
packages/schema/src/types/schema.ts
🧬 Code graph analysis (2)
packages/nitro-server/src/index.ts (1)
packages/nitro-server/src/utils.ts (1)
distDir(11-11)
packages/kit/src/template.ts (1)
test/fixtures/basic-types/nuxt.config.ts (1)
tsConfig(110-112)
🪛 GitHub Check: build
packages/nitro-server/src/index.ts
[failure] 204-204:
Type '(Omit<Partial, "include" | "exclude" | "compilerOptions"> & Omit<{ compilerOptions: { lib: string[]; skipLibCheck: boolean; }; include: string[]; exclude: string[]; }, "include" | ... 1 more ... | "compilerOptions"> & { ...; }) | (Omit<...> & ... 1 more ... & { ...; })' is not assignable to type 'Partial | { compilerOptions?: StripEnums | { [x: string]: any; allowImportingTsExtensions?: any; allowJs?: any; ... 106 more ...; useDefineForClassFields?: any; } | undefined; ... 6 more ...; references?: { ...; }[] | ... 1 more ... | undefined; } | undefined'.
⏰ 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). (1)
- GitHub Check: code
🔇 Additional comments (4)
packages/schema/src/config/typescript.ts (1)
51-52:LGTM!The default empty object values for the new
appTsConfigandserverTsConfigoptions are appropriate.packages/schema/src/types/schema.ts (1)
1641-1685:Well-documented API surface.The documentation clearly articulates that
tsConfigapplies globally to all generated TypeScript configuration files, withappTsConfigandserverTsConfigproviding context-specific overrides. The examples and type definitions are clear and helpful.Note: The implementation in
packages/kit/src/template.tsdoes not fully honour this contract fornodeTsConfigandsharedTsConfig(see review comment on that file).packages/nitro-server/src/index.ts (2)
573-573:Minor formatting adjustment in empty catch blocks.The addition of a space within the empty catch blocks (
catch(() => { })) is a non-functional formatting change.Also applies to: 731-731
204-230:No action required—defuproperly maintains TypeScript type safety.The
defufunction is designed with full TypeScript support, including a genericDefuutility type that correctly models merged configuration objects. The composition strategy prioritizes Nitro-specific, server-specific, then globaltsConfigsettings, and the updatedincludeandexcludepaths provide appropriate coverage of module runtime and layer-specific directories. No type incompatibility exists for this merging pattern.
Uh oh!
There was an error while loading.Please reload this page.
Addresses review feedback to ensure global typescript.tsConfig applies to nodeTsConfig and sharedTsConfig
Resolves CI type check failure where compileOnSave was inferred as boolean | nullish
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/nitro-server/src/index.ts (1)
9-9:TSConfig merge layering matches the new API; note array behaviour and consider tightening the typingThe
defuorder here gives the intended precedence ofnuxt.options.nitro.typescript.tsConfig→nuxt.options.typescript.serverTsConfig→nuxt.options.typescript.tsConfig→ the local defaults, so Nitro-specific settings win over server-specific, which win over global, with your baselinecompilerOptions,includeandexcludeacting as fallbacks. One behavioural gotcha to be aware of is thatdefudoes not deep-merge arrays, so if a user setsinclude/excludein any of these configs they will completely replace the built-in globs (including the Nitro types/includes) rather than extend them; if that is not desired, you would need to concatenate those arrays manually instead of relying ondefualone. The explicitas unknown as TSConfigcast is acceptable, but if you want to align more closely with TypeScript best practices you could optionally wrap this merge in a small helper returningTSConfig, or assert the default object withsatisfies TSConfigto avoid theunknownhop.Also applies to: 204-231
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/nitro-server/src/index.ts(4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Follow standard TypeScript conventions and best practices
Files:
packages/nitro-server/src/index.ts
**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx,js,jsx,vue}: Use clear, descriptive variable and function names
Add comments only to explain complex logic or non-obvious implementations
Keep functions focused and manageable (generally under 50 lines), and extract complex logic into separate domain-specific files
Remove code that is not used or needed
Use error handling patterns consistently
Files:
packages/nitro-server/src/index.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,vue} : Follow standard TypeScript conventions and best practices📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,vue} : Follow standard TypeScript conventions and best practicesApplied to files:
packages/nitro-server/src/index.ts
📚 Learning: 2024-11-05T15:22:54.759Z
Learnt from: GalacticHypernovaRepo: nuxt/nuxt PR: 26468File: packages/nuxt/src/components/plugins/loader.ts:24-24Timestamp: 2024-11-05T15:22:54.759ZLearning: In `packages/nuxt/src/components/plugins/loader.ts`, the references to `resolve` and `distDir` are legacy code from before Nuxt used the new unplugin VFS and will be removed.Applied to files:
packages/nitro-server/src/index.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). (1)
- GitHub Check: code
🔇 Additional comments (1)
packages/nitro-server/src/index.ts (1)
573-573:Empty-catch formatting normalisation keeps the existing best-effort behaviourChanging
.catch(() => {})to.catch(() => { })for the prerender cache removal anddistsymlink creation is purely stylistic; the "ignore all errors in these non-critical cleanup paths" behaviour is preserved, which is reasonable here.Also applies to: 731-731
packages/schema/src/types/schema.ts Outdated
| sharedTsConfig:TSConfig | ||
| /** | ||
| * You can extend the generated `.nuxt/tsconfig.app.json` (and legacy `.nuxt/tsconfig.json`) using this option. |
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.
I think we can drop the mention
| *Youcanextendthegenerated`.nuxt/tsconfig.app.json`(andlegacy`.nuxt/tsconfig.json`)usingthisoption. | |
| *Youcanextendthegenerated`.nuxt/tsconfig.app.json` usingthisoption. |
packages/schema/src/types/schema.ts Outdated
| /** | ||
| * You can extend the generated `.nuxt/tsconfig.app.json` (and legacy `.nuxt/tsconfig.json`) using this option. | ||
| * | ||
| * This allows app-specific TypeScript configuration that will be merged with the global `typescript.tsConfig`. |
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.
maybe we could make it clearer that the globaltypescript.tsConfig options will be overridden by these context-specific options (i.e., they have higher priority)
I'd put the mention in all thedescriptions (node, shared, app, server).
pkg-pr-newbot commentedDec 1, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@nuxt/kit@nuxt/nitro-servernuxt@nuxt/rspack-builder@nuxt/schema@nuxt/vite-builder@nuxt/webpack-buildercommit: |
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: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/nitro-server/src/index.ts(12 hunks)packages/schema/src/types/schema.ts(13 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Follow standard TypeScript conventions and best practices
Files:
packages/schema/src/types/schema.tspackages/nitro-server/src/index.ts
**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx,js,jsx,vue}: Use clear, descriptive variable and function names
Add comments only to explain complex logic or non-obvious implementations
Keep functions focused and manageable (generally under 50 lines), and extract complex logic into separate domain-specific files
Remove code that is not used or needed
Use error handling patterns consistently
Files:
packages/schema/src/types/schema.tspackages/nitro-server/src/index.ts
🧠 Learnings (6)
📓 Common learnings
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,vue} : Follow standard TypeScript conventions and best practices📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,js,jsx,vue} : Remove code that is not used or neededApplied to files:
packages/schema/src/types/schema.tspackages/nitro-server/src/index.ts
📚 Learning: 2024-12-12T12:36:34.871Z
Learnt from: huang-julienRepo: nuxt/nuxt PR: 29366File: packages/nuxt/src/app/components/nuxt-root.vue:16-19Timestamp: 2024-12-12T12:36:34.871ZLearning: In `packages/nuxt/src/app/components/nuxt-root.vue`, when optimizing bundle size by conditionally importing components based on route metadata, prefer using inline conditional imports like:```jsconst IsolatedPage = route?.meta?.isolate ? defineAsyncComponent(() => import('#build/isolated-page.mjs')) : null```instead of wrapping the import in a computed property or importing the component unconditionally.Applied to files:
packages/schema/src/types/schema.tspackages/nitro-server/src/index.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.vue : Use `<script setup lang="ts">` and the composition API when creating Vue componentsApplied to files:
packages/schema/src/types/schema.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,vue} : Follow standard TypeScript conventions and best practicesApplied to files:
packages/schema/src/types/schema.tspackages/nitro-server/src/index.ts
📚 Learning: 2024-11-05T15:22:54.759Z
Learnt from: GalacticHypernovaRepo: nuxt/nuxt PR: 26468File: packages/nuxt/src/components/plugins/loader.ts:24-24Timestamp: 2024-11-05T15:22:54.759ZLearning: In `packages/nuxt/src/components/plugins/loader.ts`, the references to `resolve` and `distDir` are legacy code from before Nuxt used the new unplugin VFS and will be removed.Applied to files:
packages/nitro-server/src/index.ts
🧬 Code graph analysis (1)
packages/schema/src/types/schema.ts (1)
packages/schema/src/index.ts (1)
RouterConfigSerializable(12-12)
🪛 GitHub Actions: autofix.ci
packages/nitro-server/src/index.ts
[error] 9-9: ESLint: 'TSConfig' is defined but never used. (no-unused-vars)
🪛 GitHub Check: code
packages/nitro-server/src/index.ts
[failure] 9-9:
'TSConfig' is defined but never used
⏰ 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). (20)
- GitHub Check: test-fixtures (ubuntu-latest, dev, vite, async, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, built, vite, async, manifest-off, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, built, webpack, default, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, built, rspack, async, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, built, vite-env-api, default, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (ubuntu-latest, built, vite, default, manifest-off, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, built, vite-env-api, async, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, dev, vite-env-api, default, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, dev, vite, async, manifest-off, json, lts/-1)
- GitHub Check: test-fixtures (ubuntu-latest, built, webpack, default, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (ubuntu-latest, dev, vite, default, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (ubuntu-latest, built, vite, default, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (ubuntu-latest, dev, vite, async, manifest-off, json, lts/-1)
- GitHub Check: test-fixtures (ubuntu-latest, built, vite, async, manifest-off, json, lts/-1)
- GitHub Check: test-fixtures (ubuntu-latest, dev, vite, async, manifest-on, js, lts/-1)
- GitHub Check: test-fixtures (ubuntu-latest, dev, vite-env-api, default, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (ubuntu-latest, dev, vite-env-api, async, manifest-on, json, lts/-1)
- GitHub Check: release-pkg-pr-new
- GitHub Check: test-benchmark
- GitHub Check: typecheck (windows-latest, bundler)
🔇 Additional comments (2)
packages/schema/src/types/schema.ts (1)
1608-1698:Global + context-specific TypeScript config surface looks consistentThe
typescript.tsConfigdocs plus the newappTsConfig/serverTsConfig(and updatednodeTsConfig/sharedTsConfig) clearly describe the global‑then‑override precedence and match how Nitro composestsconfig.server.jsonin this PR. I don’t see any type or naming issues here; the API shape should solve the duplication problem while remaining backwards compatible.packages/nitro-server/src/index.ts (1)
200-231:NitrotsConfigmerge order matches documented precedenceThe defu merge for
typescript.tsConfig:
nuxt.options.nitro.typescript?.tsConfig- then
nuxt.options.typescript?.serverTsConfig- then global
nuxt.options.typescript?.tsConfig- then the internal defaults (lib/skipLibCheck/include/exclude)
gives the intended precedence of nitro‑specific > server‑specific > global > defaults, which lines up with the schema comments for
tsConfigandserverTsConfig. This should make the new global + per‑context TS config surface effective for Nitro as well.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
codspeed-hqbot commentedDec 1, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
CodSpeed Performance ReportMerging#33795 willimprove performances by 10.25%Comparing Summary
Benchmarks breakdown
Footnotes |
- Remove unused TSConfig import from nitro-server- Fix transpile callback typing to include isModern and isLegacy
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 (2)
packages/schema/src/types/schema.ts (1)
1677-1689:Consider clarifying override priority in all context-specific tsConfig documentation.The documentation for
appTsConfigandserverTsConfigmentions they "will be merged with the globaltypescript.tsConfig(which it overrides)", but the phrasing could be clearer about precedence. Consider using more explicit language across all four context-specific configs (app, node, shared, server).For consistency, you might update the phrasing to:
/** * You can extend the generated `.nuxt/tsconfig.app.json` using this option. *- * This allows app-specific TypeScript configuration that will be merged with the global `typescript.tsConfig` (which it overrides).+ * This allows app-specific TypeScript configuration that will override the global `typescript.tsConfig` when merged. */Apply the same pattern to
nodeTsConfig,sharedTsConfig, andserverTsConfigfor consistency.Based on past review comments suggesting clearer override documentation.
packages/nitro-server/src/index.ts (1)
204-230:Type casting could be avoided with explicit typing.The
as anycast on line 230 bypasses TypeScript's type checking. While this may be necessary due to defu's return type, consider extracting the configuration object to a typed variable first.You could refactor like this:
constbaseTsConfigOptions={compilerOptions:{lib:['esnext','webworker','dom.iterable'],skipLibCheck:true,},include:[join(nuxt.options.buildDir,'types/nitro-nuxt.d.ts'), ...modules.flatMap((m)=>{constmoduleDir=relativeWithDot(nuxt.options.buildDir,m)return[join(moduleDir,'runtime/server'),join(moduleDir,'dist/runtime/server'),]}), ...layerDirs.map(dirs=>relativeWithDot(nuxt.options.buildDir,join(dirs.server,'**/*'))), ...layerDirs.map(dirs=>relativeWithDot(nuxt.options.buildDir,join(dirs.shared,'**/*.d.ts'))),],exclude:[ ...nuxt.options.modulesDir.map(m=>relativeWithDot(nuxt.options.buildDir,m)),relativeWithDot(nuxt.options.buildDir,resolve(nuxt.options.rootDir,'dist')),],}satisfiesPartial<TSConfig>typescript:{tsConfig:defu(nuxt.options.nitro.typescript?.tsConfig,nuxt.options.typescript?.serverTsConfig,nuxt.options.typescript?.tsConfig,baseTsConfigOptions,),}However, this is a minor refactoring and the current implementation is functional.
As per coding guidelines, following TypeScript best practices.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/nitro-server/src/index.ts(11 hunks)packages/schema/src/types/schema.ts(13 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Follow standard TypeScript conventions and best practices
Files:
packages/schema/src/types/schema.tspackages/nitro-server/src/index.ts
**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx,js,jsx,vue}: Use clear, descriptive variable and function names
Add comments only to explain complex logic or non-obvious implementations
Keep functions focused and manageable (generally under 50 lines), and extract complex logic into separate domain-specific files
Remove code that is not used or needed
Use error handling patterns consistently
Files:
packages/schema/src/types/schema.tspackages/nitro-server/src/index.ts
🧠 Learnings (6)
📓 Common learnings
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,vue} : Follow standard TypeScript conventions and best practices📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,js,jsx,vue} : Remove code that is not used or neededApplied to files:
packages/schema/src/types/schema.tspackages/nitro-server/src/index.ts
📚 Learning: 2024-12-12T12:36:34.871Z
Learnt from: huang-julienRepo: nuxt/nuxt PR: 29366File: packages/nuxt/src/app/components/nuxt-root.vue:16-19Timestamp: 2024-12-12T12:36:34.871ZLearning: In `packages/nuxt/src/app/components/nuxt-root.vue`, when optimizing bundle size by conditionally importing components based on route metadata, prefer using inline conditional imports like:```jsconst IsolatedPage = route?.meta?.isolate ? defineAsyncComponent(() => import('#build/isolated-page.mjs')) : null```instead of wrapping the import in a computed property or importing the component unconditionally.Applied to files:
packages/schema/src/types/schema.tspackages/nitro-server/src/index.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.vue : Use `<script setup lang="ts">` and the composition API when creating Vue componentsApplied to files:
packages/schema/src/types/schema.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,vue} : Follow standard TypeScript conventions and best practicesApplied to files:
packages/schema/src/types/schema.tspackages/nitro-server/src/index.ts
📚 Learning: 2024-11-05T15:22:54.759Z
Learnt from: GalacticHypernovaRepo: nuxt/nuxt PR: 26468File: packages/nuxt/src/components/plugins/loader.ts:24-24Timestamp: 2024-11-05T15:22:54.759ZLearning: In `packages/nuxt/src/components/plugins/loader.ts`, the references to `resolve` and `distDir` are legacy code from before Nuxt used the new unplugin VFS and will be removed.Applied to files:
packages/nitro-server/src/index.ts
🧬 Code graph analysis (2)
packages/schema/src/types/schema.ts (3)
packages/nitro-server/build.config.ts (1)
ctx(12-14)packages/nuxt/build.config.ts (1)
ctx(25-27)packages/schema/src/index.ts (1)
RouterConfigSerializable(12-12)
packages/nitro-server/src/index.ts (1)
packages/nitro-server/src/utils.ts (1)
distDir(11-11)
⏰ 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). (2)
- GitHub Check: build
- GitHub Check: code
🔇 Additional comments (1)
packages/nitro-server/src/index.ts (1)
204-230:LGTM! TSConfig composition correctly implements the feature.The defu-based merge strategy correctly prioritises configuration sources:
- Nitro-specific (
nuxt.options.nitro.typescript?.tsConfig) — highest priority- Server-specific (
nuxt.options.typescript?.serverTsConfig)- Global (
nuxt.options.typescript?.tsConfig)- Base configuration — lowest priority
The include/exclude arrays properly gather paths from modules, layers, and directories. This aligns perfectly with the PR objectives to provide global tsConfig options with context-specific overrides.
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/nitro-server/src/index.ts (1)
204-230:TypeScript configuration composition looks good; consider improving type safety.The defu-based merge correctly prioritises nitro-specific over server-specific over global configuration, which aligns well with the PR objectives for hierarchical TypeScript configuration. The dynamic include/exclude path generation properly covers module runtime/server directories and layer patterns.
However, the
as anycast on line 230 bypasses type safety. Consider using a more specific type assertion or refining the type definitions to avoid the cast.If the cast is unavoidable due to defu's type inference limitations, consider adding a brief comment explaining why it's necessary.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/nitro-server/src/index.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Follow standard TypeScript conventions and best practices
Files:
packages/nitro-server/src/index.ts
**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx,js,jsx,vue}: Use clear, descriptive variable and function names
Add comments only to explain complex logic or non-obvious implementations
Keep functions focused and manageable (generally under 50 lines), and extract complex logic into separate domain-specific files
Remove code that is not used or needed
Use error handling patterns consistently
Files:
packages/nitro-server/src/index.ts
🧠 Learnings (4)
📓 Common learnings
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,vue} : Follow standard TypeScript conventions and best practices📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,vue} : Follow standard TypeScript conventions and best practicesApplied to files:
packages/nitro-server/src/index.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,js,jsx,vue} : Remove code that is not used or neededApplied to files:
packages/nitro-server/src/index.ts
📚 Learning: 2024-11-05T15:22:54.759Z
Learnt from: GalacticHypernovaRepo: nuxt/nuxt PR: 26468File: packages/nuxt/src/components/plugins/loader.ts:24-24Timestamp: 2024-11-05T15:22:54.759ZLearning: In `packages/nuxt/src/components/plugins/loader.ts`, the references to `resolve` and `distDir` are legacy code from before Nuxt used the new unplugin VFS and will be removed.Applied to files:
packages/nitro-server/src/index.ts
🧬 Code graph analysis (1)
packages/nitro-server/src/index.ts (1)
packages/nitro-server/src/utils.ts (1)
distDir(11-11)
⏰ 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). (2)
- GitHub Check: build
- GitHub Check: code
Subham-KRLX commentedDec 1, 2025
I have addressed all CodeRabbit feedback by removing the unused TSConfig import and fixing the transpile callback typing to include isModern and isLegacy Regarding the failing CI checks the typecheck failures in bundler mode appear to be pre-existing dependency issues unrelated to this PR—all errors originate from node_modules packages (Vite, Nitropack, optional dependencies) rather than the modified code The rspack test timeout also seems to be test flakiness Local typecheck passes successfully with all changes applied. |
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/nitro-server/src/index.ts (1)
200-231:Good merge precedence, but avoidas anyontsConfigif possible.The
defu(...)order (nitro override →serverTsConfig→ globaltsConfig→ defaults) matches the PR intent and should give the right override behaviour. The trailingas any(Line 230) drops type guarantees; consider typing the merge result explicitly (e.g.TSConfigorNitroConfig['typescript']['tsConfig']) so future edits don’t silently drift.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/kit/src/template.ts(2 hunks)packages/nitro-server/src/index.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Follow standard TypeScript conventions and best practices
Files:
packages/nitro-server/src/index.tspackages/kit/src/template.ts
**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx,js,jsx,vue}: Use clear, descriptive variable and function names
Add comments only to explain complex logic or non-obvious implementations
Keep functions focused and manageable (generally under 50 lines), and extract complex logic into separate domain-specific files
Remove code that is not used or needed
Use error handling patterns consistently
Files:
packages/nitro-server/src/index.tspackages/kit/src/template.ts
🧠 Learnings (11)
📓 Common learnings
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,vue} : Follow standard TypeScript conventions and best practices📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,js,jsx,vue} : Remove code that is not used or neededApplied to files:
packages/nitro-server/src/index.tspackages/kit/src/template.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,vue} : Follow standard TypeScript conventions and best practicesApplied to files:
packages/nitro-server/src/index.tspackages/kit/src/template.ts
📚 Learning: 2024-11-05T15:22:54.759Z
Learnt from: GalacticHypernovaRepo: nuxt/nuxt PR: 26468File: packages/nuxt/src/components/plugins/loader.ts:24-24Timestamp: 2024-11-05T15:22:54.759ZLearning: In `packages/nuxt/src/components/plugins/loader.ts`, the references to `resolve` and `distDir` are legacy code from before Nuxt used the new unplugin VFS and will be removed.Applied to files:
packages/nitro-server/src/index.ts
📚 Learning: 2024-11-28T21:22:40.496Z
Learnt from: GalacticHypernovaRepo: nuxt/nuxt PR: 29661File: packages/kit/src/template.ts:227-229Timestamp: 2024-11-28T21:22:40.496ZLearning: In `packages/kit/src/template.ts`, when updating the `EXTENSION_RE` regular expression for TypeScript configuration, avoid using patterns like `(\.\w+)+$` as they can result in catastrophic backtracking.Applied to files:
packages/kit/src/template.ts
📚 Learning: 2024-11-11T12:34:22.648Z
Learnt from: TofandelRepo: nuxt/nuxt PR: 0File: :0-0Timestamp: 2024-11-11T12:34:22.648ZLearning: Ensure that AI-generated summaries accurately reflect the key changes in the PR, focusing on notable changes such as the removal of unused imports and variables starting with underscores.Applied to files:
packages/kit/src/template.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,js,jsx,vue} : Use error handling patterns consistentlyApplied to files:
packages/kit/src/template.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,js,jsx,vue} : Keep functions focused and manageable (generally under 50 lines), and extract complex logic into separate domain-specific filesApplied to files:
packages/kit/src/template.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.vue : Use `<script setup lang="ts">` and the composition API when creating Vue componentsApplied to files:
packages/kit/src/template.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,js,jsx,vue} : Add comments only to explain complex logic or non-obvious implementationsApplied to files:
packages/kit/src/template.ts
📚 Learning: 2025-11-25T11:42:16.132Z
Learnt from: CRRepo: nuxt/nuxt PR: 0File: .github/copilot-instructions.md:0-0Timestamp: 2025-11-25T11:42:16.132ZLearning: Applies to **/*.{ts,tsx,js,jsx,vue} : Use clear, descriptive variable and function namesApplied to files:
packages/kit/src/template.ts
🧬 Code graph analysis (1)
packages/nitro-server/src/index.ts (1)
packages/nitro-server/src/utils.ts (1)
distDir(11-11)
⏰ 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). (18)
- GitHub Check: test-fixtures (windows-latest, built, rspack, async, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, dev, vite, async, manifest-off, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, dev, vite, default, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, built, webpack, default, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, built, vite, async, manifest-off, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, dev, vite-env-api, async, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, built, vite, default, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (windows-latest, dev, vite, default, manifest-off, json, lts/-1)
- GitHub Check: test-fixtures (ubuntu-latest, built, vite, async, manifest-on, js, lts/-1)
- GitHub Check: test-fixtures (ubuntu-latest, built, vite-env-api, default, manifest-on, json, lts/-1)
- GitHub Check: test-fixtures (ubuntu-latest, built, vite, async, manifest-off, json, lts/-1)
- GitHub Check: test-fixtures (ubuntu-latest, dev, vite, async, manifest-off, json, lts/-1)
- GitHub Check: test-benchmark
- GitHub Check: typecheck (ubuntu-latest, bundler)
- GitHub Check: release-pkg-pr-new
- GitHub Check: typecheck (windows-latest, bundler)
- GitHub Check: test-size
- GitHub Check: code
🔇 Additional comments (3)
packages/nitro-server/src/index.ts (1)
573-573:No-opcatchis OK here—please just ensure “best-effort” is intended.Both operations (cache dir cleanup; optional symlink) swallowing errors is reasonable if failures shouldn’t block build, and the change is behaviour-preserving. Worth a quick sanity check that you don’t need debug logging for diagnosing permissions/filesystem issues.
Also applies to: 731-731
packages/kit/src/template.ts (2)
367-415:appTsConfig→ globaltsConfig→ defaults merge order looks right.This matches the desired override model: app-specific config can override global settings while still inheriting the shared baseline.
418-442:Node/shared now inherit globaltsConfig—please verify intended inheritance scope.This implements the “apply global tsConfig everywhere” behaviour for
tsconfig.node.jsonandtsconfig.shared.json. Please confirm whetheronlynodeTsConfig/sharedTsConfig + tsConfigshould apply here (current behaviour), or whetherappTsConfigshould also be inherited by node/shared (since the issue discussion mentioned additional per-context keys likenodeTsConfig/sharedTsConfig).
🔗 Linked issue
Closes#33678
📚 Description
Makes it easier to define global TypeScript configuration options without duplication.
Problem: Users must duplicate TS config across multiple files since moving to Project References.
Solution:
typescript.tsConfignow applies globally to all generated tsconfig filestypescript.appTsConfigandtypescript.serverTsConfigfor context-specific overridesExample: