Skip to content

Conversation

@HigherOrderLogic
Copy link
Contributor

🔗 Linked issue

N/A.

📚 Description

Export Nuxt major version type, which can be consumed in downstream, eg: checking for Nuxt major version.

@bolt-new-by-stackblitz
Copy link

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

@coderabbitai
Copy link

coderabbitai bot commented Nov 12, 2025

Walkthrough

The PR adds a public type alias `NuxtMajorVersion` with values 2 | 3 | 4 in packages/kit/src/compatibility.ts, updates the signature of `isNuxtMajorVersion` to accept that alias, and re-exports the new type from packages/kit/src/index.ts. No runtime behavior changes were introduced.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Type extraction and re-export across two files
  • No functional or behavioural modifications

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarises the main change: exporting a Nuxt major version type from the kit package.
Description check ✅ Passed The description is related to the changeset, explaining that the PR exports a Nuxt major version type for downstream consumption.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 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 bc1ff90 and a700c01.

📒 Files selected for processing (1)
  • packages/kit/src/compatibility.ts (1 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/kit/src/compatibility.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/kit/src/compatibility.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: TheAlexLichter
Repo: nuxt/nuxt PR: 31812
File: packages/nuxt/src/components/plugins/islands-transform.ts:202-202
Timestamp: 2025-04-18T18:33:41.753Z
Learning: In Nuxt, using `rolldownVersion` (not `rollupVersion`) is intentional when detecting if rolldown-vite is being used, even though TypeScript may show an error because the property isn't in standard type definitions yet.
📚 Learning: 2025-04-18T18:33:41.753Z
Learnt from: TheAlexLichter
Repo: nuxt/nuxt PR: 31812
File: packages/nuxt/src/components/plugins/islands-transform.ts:202-202
Timestamp: 2025-04-18T18:33:41.753Z
Learning: In Nuxt, using `rolldownVersion` (not `rollupVersion`) is intentional when detecting if rolldown-vite is being used, even though TypeScript may show an error because the property isn't in standard type definitions yet.

Applied to files:

  • packages/kit/src/compatibility.ts
🧬 Code graph analysis (1)
packages/kit/src/compatibility.ts (3)
packages/kit/src/index.ts (3)
  • NuxtMajorVersion (26-26)
  • isNuxtMajorVersion (25-25)
  • useNuxt (30-30)
packages/nuxt/src/app/nuxt.ts (1)
  • nuxt (275-275)
packages/kit/src/context.ts (1)
  • useNuxt (30-37)
⏰ 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 (2)
packages/kit/src/compatibility.ts (2)

95-96: LGTM! Clean type export.

The NuxtMajorVersion type alias is well-defined and provides a clear, reusable type for downstream consumers to reference Nuxt major versions.


100-100: LGTM! Consistent type usage.

Updating the function signature to use NuxtMajorVersion improves maintainability and provides a single source of truth for major version values. The change is non-breaking and the implementation remains correct.


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/kit/src/compatibility.ts (1)

95-96: Consider adding JSDoc documentation for the exported type.

The new NuxtMajorVersion type lacks documentation, which is inconsistent with other public APIs in this file (e.g., functions at lines 22, 76, 87, 97). Adding a brief JSDoc comment would help consumers understand its purpose and usage.

Example:

+/**
+ * Supported Nuxt major versions
+ */
 export type NuxtMajorVersion = 2 | 3 | 4
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 51356a4 and bc1ff90.

📒 Files selected for processing (2)
  • packages/kit/src/compatibility.ts (1 hunks)
  • packages/kit/src/index.ts (1 hunks)
🧰 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/kit/src/compatibility.ts
  • packages/kit/src/index.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: TheAlexLichter
Repo: nuxt/nuxt PR: 31812
File: packages/nuxt/src/components/plugins/islands-transform.ts:202-202
Timestamp: 2025-04-18T18:33:41.753Z
Learning: In Nuxt, using `rolldownVersion` (not `rollupVersion`) is intentional when detecting if rolldown-vite is being used, even though TypeScript may show an error because the property isn't in standard type definitions yet.
📚 Learning: 2025-04-18T18:33:41.753Z
Learnt from: TheAlexLichter
Repo: nuxt/nuxt PR: 31812
File: packages/nuxt/src/components/plugins/islands-transform.ts:202-202
Timestamp: 2025-04-18T18:33:41.753Z
Learning: In Nuxt, using `rolldownVersion` (not `rollupVersion`) is intentional when detecting if rolldown-vite is being used, even though TypeScript may show an error because the property isn't in standard type definitions yet.

Applied to files:

  • packages/kit/src/compatibility.ts
  • packages/kit/src/index.ts
📚 Learning: 2024-11-05T15:22:54.759Z
Learnt from: GalacticHypernova
Repo: nuxt/nuxt PR: 26468
File: packages/nuxt/src/components/plugins/loader.ts:24-24
Timestamp: 2024-11-05T15:22:54.759Z
Learning: 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/kit/src/index.ts
🧬 Code graph analysis (1)
packages/kit/src/compatibility.ts (1)
packages/kit/src/index.ts (3)
  • NuxtMajorVersion (26-26)
  • isNuxtMajorVersion (25-25)
  • useNuxt (30-30)
⏰ 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 (windows-latest, built, webpack, 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 (windows-latest, built, vite, default, manifest-on, 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, 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-env-api, default, manifest-on, json, lts/-1)
  • GitHub Check: test-fixtures (ubuntu-latest, built, rspack, default, manifest-on, json, 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, default, manifest-on, 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, async, 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, dev, vite, async, manifest-on, js, lts/-1)
  • GitHub Check: release-pkg-pr-new
  • GitHub Check: test-size
  • GitHub Check: test-benchmark
  • GitHub Check: typecheck (windows-latest, bundler)
  • GitHub Check: typecheck (ubuntu-latest, bundler)
  • GitHub Check: code
🔇 Additional comments (2)
packages/kit/src/compatibility.ts (1)

100-100: LGTM!

The function signature correctly uses the new NuxtMajorVersion type. This refactor maintains backward compatibility whilst improving type reusability.

packages/kit/src/index.ts (1)

26-26: LGTM!

The type export is correctly placed and follows TypeScript conventions. This successfully makes NuxtMajorVersion available as part of the kit's public API.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 12, 2025

Open in StackBlitz

@nuxt/kit

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

@nuxt/nitro-server

npm i https://pkg.pr.new/@nuxt/nitro-server@33700

nuxt

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

@nuxt/rspack-builder

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

@nuxt/schema

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

@nuxt/vite-builder

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

@nuxt/webpack-builder

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

commit: a700c01

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 12, 2025

CodSpeed Performance Report

Merging #33700 will not alter performance

Comparing HigherOrderLogic:main (a700c01) with main (7b83538)1

Summary

✅ 10 untouched

Footnotes

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

@danielroe danielroe merged commit 754c35a into nuxt:main Dec 15, 2025
53 of 55 checks passed
@github-actions github-actions bot mentioned this pull request Dec 15, 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.

3 participants