feat(kit): export Nuxt major version type
๐ Linked issue
N/A.
๐ Description
Export Nuxt major version type, which can be consumed in downstream, eg: checking for Nuxt major version.
Run & review this pull request in StackBlitz Codeflow.
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 bc1ff9018ef5532f77d9299a02f9626f3e3f0876 and a700c010de489a2c31fefc61b8aff74545d69930.
๐ 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
NuxtMajorVersiontype 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
NuxtMajorVersionimproves 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.
Comment @coderabbitai help to get the list of available commands and usage tips.
@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 Performance Report
Merging #33700 will not alter performance
Comparing HigherOrderLogic:main (a700c01) with main (7b83538)[^unexpected-base]
[^unexpected-base]: 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.
Summary
โ
10 untouched