Skip to content

Conversation

wobsoriano
Copy link
Member

@wobsoriano wobsoriano commented Oct 8, 2025

Description

Our Nuxt SDK supports Nuxt v3 and v4. This PR migrates the integration template to use Nuxt v4 directory structure.

Note: will investigate why the tests were failing in v3, likely due to a recent upstream Nuxt v3 change.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Copy link

changeset-bot bot commented Oct 8, 2025

🦋 Changeset detected

Latest commit: 354c516

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Oct 8, 2025

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

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Oct 8, 2025 4:22pm

Copy link
Contributor

coderabbitai bot commented Oct 8, 2025

Walkthrough

Updates Nuxt template dependency to Nuxt 4.1.2, adjusts Nuxt middleware test to use event.context.auth() instead of getAuth(), updates a page path to app/pages/me.vue, and adds a changeset metadata file. No public API in this repo altered; flow of auth check remains functionally equivalent.

Changes

Cohort / File(s) Summary
Release metadata
\.changeset/long-wolves-vanish.md
Adds a changeset entry with front‑matter separators; no code changes.
Nuxt template dependency bump
integration/templates/nuxt-node/package.json
Pins nuxt to version 4.1.2 (from ^3.15.0), removing caret; major version upgrade.
Nuxt middleware test + import updates
integration/tests/nuxt/middleware.test.ts
Switches from getAuth(event) to event.context.auth(); updates import list to exclude getAuth; adjusts client page path to app/pages/me.vue; maintains same auth check and 401 behavior.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client as Client
  participant Nuxt as Nuxt Server Middleware
  participant Auth as Auth Context (event.context.auth)

  Client->>Nuxt: Request /protected
  Nuxt->>Auth: auth() -> { userId | null }
  alt userId present
    Nuxt-->>Client: Proceed (200/route handler)
  else unauthorized
    Nuxt-->>Client: 401 Unauthorized
  end

  note over Nuxt,Auth: Change: getAuth(event) ➜ event.context.auth()
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nudge the nuxt to version four,
Hop-hop, new paths and auth restore.
Context whispers: “userId, please,”
Middleware checks with bunny ease.
Changeset tucked like clover leaves—
Commit burrowed, my heart believes. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly and accurately describes the primary change of migrating the Nuxt end-to-end testing template to version 4, aligning with the dependency and code updates present in this PR.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rob/nuxt-e2e-v4

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

pkg-pr-new bot commented Oct 8, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@6942

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@6942

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@6942

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@6942

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@6942

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@6942

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6942

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@6942

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@6942

@clerk/express

npm i https://pkg.pr.new/@clerk/express@6942

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@6942

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@6942

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@6942

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@6942

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@6942

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@6942

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6942

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@6942

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@6942

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@6942

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6942

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6942

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@6942

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@6942

commit: 354c516

Copy link
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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
integration/templates/nuxt-node/package.json (1)

13-13: Allow patch updates for Nuxt: set "nuxt": "^4.1.3" (latest) instead of "4.1.2" to auto-apply future patch releases; exact pinning only if required for E2E stability.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fe873dc and 354c516.

📒 Files selected for processing (3)
  • .changeset/long-wolves-vanish.md (1 hunks)
  • integration/templates/nuxt-node/package.json (1 hunks)
  • integration/tests/nuxt/middleware.test.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • integration/templates/nuxt-node/package.json
  • integration/tests/nuxt/middleware.test.ts
integration/**

📄 CodeRabbit inference engine (.cursor/rules/global.mdc)

Framework integration templates and E2E tests should be placed under the integration/ directory

Files:

  • integration/templates/nuxt-node/package.json
  • integration/tests/nuxt/middleware.test.ts
integration/**/*

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

End-to-end tests and integration templates must be located in the 'integration/' directory.

Files:

  • integration/templates/nuxt-node/package.json
  • integration/tests/nuxt/middleware.test.ts
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • integration/tests/nuxt/middleware.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • integration/tests/nuxt/middleware.test.ts
integration/**/*.{test,spec}.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Integration tests should use Playwright.

Files:

  • integration/tests/nuxt/middleware.test.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • integration/tests/nuxt/middleware.test.ts
.changeset/**

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Automated releases must use Changesets.

Files:

  • .changeset/long-wolves-vanish.md
⏰ 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). (31)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (tanstack-react-router, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
  • GitHub Check: Static analysis
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
integration/tests/nuxt/middleware.test.ts (2)

27-30: No changes needed: event.context.auth() is the official @clerk/nuxt (Nuxt 4) auth method and returns userId.


43-43: Align test page path with Nuxt 4 The updated path app/pages/me.vue correctly reflects Nuxt 4’s file-based routing under app/pages/.

@wobsoriano wobsoriano enabled auto-merge (squash) October 8, 2025 16:29
@wobsoriano wobsoriano merged commit 7edaa7a into main Oct 8, 2025
45 checks passed
@wobsoriano wobsoriano deleted the rob/nuxt-e2e-v4 branch October 8, 2025 17:26
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