Skip to content

chore(deps): upgrade to nuxt v4.4#2221

Merged
danielroe merged 2 commits intomainfrom
chore/nuxt-v4
Apr 1, 2026
Merged

chore(deps): upgrade to nuxt v4.4#2221
danielroe merged 2 commits intomainfrom
chore/nuxt-v4

Conversation

@danielroe
Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

this bumps us to nuxt v4.4

@danielroe danielroe requested a review from atinux as a code owner April 1, 2026 12:12
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nuxt Ready Ready Preview, Comment Apr 1, 2026 1:13pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 1, 2026

📝 Walkthrough

Walkthrough

Bumped nuxt dependency in package.json from ^4.3.1 to ^4.4.2. Updated app/pages/docs/[...slug].vue to pass version.value.path as a third argument when computing titleTemplate. Modified app/utils/content.ts to change findTitleTemplate signature to accept versionPath: string and removed its internal useDocsVersion() usage in favor of the passed versionPath. Updated tests in test/nuxt/content.spec.ts to call findTitleTemplate with the new third argument '/docs/4.x'. No public API exports were added or removed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the primary change: upgrading the Nuxt dependency from v4.3.1 to v4.4.2, which is the main objective of the pull request.
Description check ✅ Passed The description is directly related to the changeset, stating that the PR bumps the project to Nuxt v4.4, which aligns with the dependency version update and code adjustments in the provided changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/nuxt-v4

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
Copy Markdown
Contributor

@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.

🧹 Nitpick comments (2)
test/nuxt/content.spec.ts (1)

123-155: Add one non-v4 test case to validate versionPath branching.

Right now only '/docs/4.x' is covered. A '/docs/5.x' (or '/docs/3.x') case would lock expected behavior and prevent regressions.

Suggested test addition
+    it('should keep non-v4 version paths unmodified', () => {
+      const page = { value: { path: '/docs/5.x/api/composables/use-fetch' } } as any
+      const navigation = {
+        value: [
+          {
+            title: 'Docs',
+            path: '/docs/5.x',
+            stem: 'docs/5.x',
+            children: [
+              {
+                title: 'API',
+                titleTemplate: '%s · Nuxt API v5',
+                path: '/docs/5.x/api',
+                stem: 'docs/5.x/4.api'
+              }
+            ]
+          }
+        ]
+      } as any
+      const result = findTitleTemplate(page, navigation, '/docs/5.x')
+      expect(result).toBe('%s · Nuxt API v5')
+    })
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/nuxt/content.spec.ts` around lines 123 - 155, Add a second test case
that exercises the non-v4 branch of findTitleTemplate by duplicating the
existing spec but using a different versionPath (e.g., '/docs/5.x' or
'/docs/3.x') for both the page.value.path and all navigation.path/stem entries,
then call findTitleTemplate(page, navigation, '/docs/5.x') and assert the same
expected title template ('%s · Nuxt Composables'); this will validate the
versionPath branching in findTitleTemplate and prevent regressions.
app/utils/content.ts (1)

39-41: Gate path normalization by isV4 to keep versionPath behavior explicit.

At Line 39-41, isV4 is computed but normalization still runs unconditionally. Making cleaning conditional keeps behavior aligned with the new versionPath parameter and avoids accidental cross-version path collapsing.

Proposed refactor
 function cleanNavigationPaths(navigation: ContentNavigationItem[], isV4: boolean): ContentNavigationItem[] {
   return navigation.map(item => ({
     ...item,
-    path: item.path ? cleanV4Path(item.path) : item.path,
+    path: item.path ? (isV4 ? cleanV4Path(item.path) : item.path) : item.path,
     children: item.children ? cleanNavigationPaths(item.children, isV4) : undefined
   }))
 }
@@
   const isV4 = versionPath === '/docs/4.x'
-  const searchPath = cleanV4Path(page.value.path)
+  const searchPath = isV4 ? cleanV4Path(page.value.path) : page.value.path
   const cleanNavigation = cleanNavigationPaths(navigation.value, isV4)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/utils/content.ts` around lines 39 - 41, The code always applies V4
normalization even when versionPath isn't '/docs/4.x'; change the behavior so
normalization is gated by isV4: compute isV4 as before, then only call
cleanV4Path(page.value.path) when isV4 is true (otherwise use page.value.path
directly) and only call cleanNavigationPaths(navigation.value, isV4) when isV4
is true (otherwise use navigation.value as-is); update the searchPath and
cleanNavigation variables accordingly so cross-version path collapsing is
avoided.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/utils/content.ts`:
- Around line 39-41: The code always applies V4 normalization even when
versionPath isn't '/docs/4.x'; change the behavior so normalization is gated by
isV4: compute isV4 as before, then only call cleanV4Path(page.value.path) when
isV4 is true (otherwise use page.value.path directly) and only call
cleanNavigationPaths(navigation.value, isV4) when isV4 is true (otherwise use
navigation.value as-is); update the searchPath and cleanNavigation variables
accordingly so cross-version path collapsing is avoided.

In `@test/nuxt/content.spec.ts`:
- Around line 123-155: Add a second test case that exercises the non-v4 branch
of findTitleTemplate by duplicating the existing spec but using a different
versionPath (e.g., '/docs/5.x' or '/docs/3.x') for both the page.value.path and
all navigation.path/stem entries, then call findTitleTemplate(page, navigation,
'/docs/5.x') and assert the same expected title template ('%s · Nuxt
Composables'); this will validate the versionPath branching in findTitleTemplate
and prevent regressions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e38c1c52-0f61-45fc-8a45-39db2f92c4f9

📥 Commits

Reviewing files that changed from the base of the PR and between 88ee074 and 2c46222.

📒 Files selected for processing (3)
  • app/pages/docs/[...slug].vue
  • app/utils/content.ts
  • test/nuxt/content.spec.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant