Skip to content

Conversation

@AmanVarshney01
Copy link
Owner

@AmanVarshney01 AmanVarshney01 commented Dec 17, 2025

Damn there are too many changesss

Summary by CodeRabbit

  • New Features

    • New styled UI component set (Base UI / shadcn) and refreshed auth templates with improved token-aware flows and server/client helpers.
  • Updates

    • Bumped tooling and libs (notably oxlint and better-auth); Next dev now runs on explicit port.
    • CLI package metadata and public exports clarified for publishing.
  • Chores

    • Added OxFMT configuration and broad formatting adjustments.
  • Documentation

    • Multiple docs and READMEs refined for clarity and usage.

✏️ Tip: You can customize this high-level summary in your review settings.

@cursor
Copy link

cursor bot commented Dec 17, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on January 7.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@vercel
Copy link

vercel bot commented Dec 17, 2025

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

Project Deployment Review Updated (UTC)
create-better-t-stack-web Ready Ready Preview, Comment Dec 20, 2025 11:54am
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

Walkthrough

Centralizes better-auth factory usage across templates, bumps several dependency versions, migrates UI primitives to @base-ui/react, adds token-aware provider flows and SSR config, restructures dropdown triggers/groups, updates many templates/packages metadata, and introduces formatting/config files.

Changes

Cohort / File(s) Summary
Dependency updates
apps/cli/src/constants.ts, package.json, apps/cli/package.json
Bumped oxlint and @convex-dev/better-auth versions; added/updated dev deps and @clack/prompts; package metadata/exports added in CLI packages.
Better‑auth setup & constants
apps/cli/src/helpers/core/auth-setup.ts, apps/cli/src/helpers/core/env-setup.ts, apps/cli/src/helpers/core/post-installation.ts
Updated better-auth pins and customDependencies; conditional SITE_URL emission; changed getNativeInstructions signature to accept frontend array and runCmd.
Auth templates & factory API
apps/cli/templates/auth/better-auth/.../auth.config.ts.hbs, .../auth.ts.hbs, .../convex/backend/convex/http.ts.hbs
Switched to getAuthConfigProvider() and AuthConfig typing; simplified createAuth signature; adjusted plugin wiring and CORS route branches.
Auth server adapters (Next/TanStack/React)
apps/cli/templates/auth/better-auth/convex/web/react/*/src/lib/auth-server.ts.hbs, .../next/src/app/api/auth/[...all]/route.ts.hbs, .../tanstack-start/src/routes/api/auth/$.ts.hbs, .../fullstack/tanstack-start/src/routes/api/auth/$.ts.hbs
Replaced per-template setup with factory-produced exports (e.g., handler, getToken, fetchAuth*); routes now call handler(request).
Frontend token flow & providers
apps/cli/templates/frontend/react/next/src/app/layout.tsx.hbs, .../components/providers.tsx.hbs, .../tanstack-start/src/routes/__root.tsx.hbs, .../tanstack-start/src/router.tsx.hbs, .../tanstack-start/vite.config.ts.hbs
Async RootLayout for convex+better-auth awaiting getToken; Providers accepts initialToken?; ConvexQueryClient created with { expectAuth: true } when better-auth; SSR noExternal for better-auth.
User-menu & dropdowns
multiple apps/cli/templates/**/user-menu.tsx.hbs, .../mode-toggle.tsx.hbs
Replaced DropdownMenuTrigger asChild with render-prop pattern, added DropdownMenuGroup, reorganized account items and sign-out flows; component signatures preserved.
UI primitives migration
apps/cli/templates/frontend/react/web-base/src/components/ui/*
Removed Radix-based files and added @base-ui/react-based replacements (Button, Card, Checkbox, DropdownMenu, Input, Label, Skeleton, Sonner Toaster) with new variant APIs and data-slot patterns.
Theming & CSS
apps/cli/templates/frontend/react/web-base/src/index.css.hbs, apps/web/src/app/global.css
Added shadcn import, reorganized CSS tokens (OKLCH), added radius tokens, changed dark-mode selector, applied font-sans; large theming reorganizations.
Package metadata & publishing
apps/cli/package.json, packages/create-bts/package.json, packages/types/package.json, packages/backend/package.json
Added homepage/license/author/bin/files/type/exports maps and reorganized package entry points for CLI and libraries.
Formatting, config & docs
.oxfmtrc.json, many tsconfig.json/.github/*, docs under apps/web/content/docs/**
Added .oxfmtrc.json; numerous formatting/whitespace changes across tsconfigs, manifests, docs, and README snippets (functions → convex/myFunctions.ts).

Sequence Diagram(s)

mermaid
sequenceDiagram
autonumber
participant Client as Frontend (Browser/Server)
participant AuthFactory as better-auth Factory
participant API as Server Route
participant Convex as Convex Backend

Client->>AuthFactory: initialize factory({ convexUrl, convexSiteUrl })
AuthFactory-->>Client: returns { handler, getToken, fetchAuth* }
Client->>API: request -> API (calls handler)
API->>AuthFactory: handler(request)
AuthFactory->>Convex: validate token / perform authenticated query
Convex-->>AuthFactory: response
AuthFactory-->>API: auth response / set cookies
API-->>Client: final response
Client->>AuthFactory: getToken() or fetchAuthQuery(...)
AuthFactory->>Convex: authenticated requests

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Pay particular attention to:
    • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs — createAuth signature and plugin/trusted origins changes.
    • All auth-server factory outputs vs. route adapters — ensure exported names and shapes match template usages.
    • UI primitive replacements in web-base — confirm props/exports match consumers.
    • Large CSS/token rework — potential visual regressions and dark-mode differences.
    • package.json exports/module type changes — publishing and import resolution.

Possibly related PRs

Suggested labels

canary

Poem

🐰 In fields of templates, I hop and sing,

Factories hum and tokens spring,
Buttons bloom and dropdowns dance,
Versions bumped — a tiny prance,
Hooray! The rabbit stamps its ring. 🥕✨

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(cli): update convex + better auth templates' clearly describes the main change: updating convex and better-auth related templates in the CLI package.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-better-auth-convex-1.4.7

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
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: 3

🧹 Nitpick comments (1)
apps/cli/templates/auth/better-auth/convex/backend/convex/auth.config.ts.hbs (1)

1-6: Good refactoring to dynamic provider configuration.

The refactoring to use getAuthConfigProvider() with satisfies AuthConfig is a clean pattern that improves type safety and configuration flexibility. This import and pattern are documented in the official @convex-dev/better-auth framework guides as the recommended approach.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3d95a04 and d02dd60.

📒 Files selected for processing (5)
  • apps/cli/src/constants.ts (1 hunks)
  • apps/cli/src/helpers/core/auth-setup.ts (3 hunks)
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.config.ts.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/fullstack/tanstack-start/src/routes/api/auth/$.ts.hbs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/cli/src/helpers/core/auth-setup.ts
  • apps/cli/src/constants.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/cli/src/helpers/core/auth-setup.ts
  • apps/cli/src/constants.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/cli/src/helpers/core/auth-setup.ts
  • apps/cli/src/constants.ts
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/cli/src/helpers/core/auth-setup.ts
  • apps/cli/src/constants.ts
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/cli/src/helpers/core/auth-setup.ts
  • apps/cli/src/constants.ts
**/*.hbs

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.hbs: In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle
Escape the '{{' in Handlebars templates like '{{'

Files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.config.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
  • apps/cli/templates/auth/better-auth/fullstack/tanstack-start/src/routes/api/auth/$.ts.hbs
🧠 Learnings (11)
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/schema.ts : Always define your schema in convex/schema.ts and import schema definition functions from convex/server 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.config.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use query, mutation, and action to define public functions; use internalQuery, internalMutation, and internalAction to define private, internal functions 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the api object from convex/_generated/api.ts to call public functions registered with query, mutation, or action 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the internal object from convex/_generated/api.ts to call internal/private functions registered with internalQuery, internalMutation, or internalAction 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Try to use as few calls from actions to queries and mutations as possible to reduce race condition risks from multiple transactions 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use query, mutation, and action to register public functions that are part of the public API; do NOT use these for sensitive internal functions 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.{html,tsx,ts,jsx,js} : Use HTML imports with `Bun.serve()` for frontend instead of Vite 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use internalQuery, internalMutation, and internalAction to register private internal functions; these are only callable by other Convex functions 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ALWAYS include argument and return validators for all Convex functions (query, internalQuery, mutation, internalMutation, action, internalAction) 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Thoughtfully organize files with public query, mutation, or action functions within the convex/ directory using file-based routing 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ONLY call an action from another action if you need to cross runtimes; otherwise, pull out shared code into a helper async function and call that directly 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
🧬 Code graph analysis (1)
apps/cli/src/helpers/core/auth-setup.ts (1)
apps/cli/src/utils/add-package-deps.ts (1)
  • addPackageDependency (6-57)
🔇 Additional comments (2)
apps/cli/templates/auth/better-auth/fullstack/tanstack-start/src/routes/api/auth/$.ts.hbs (1)

1-11: LGTM! Clean refactoring to centralized handler.

The refactoring to use a centralized handler from @/lib/auth-server simplifies the auth route implementation and improves maintainability.

apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs (1)

1-12: Update the version constraint to match the currently available release.

The API convexBetterAuthReactStart from @convex-dev/better-auth/react-start is confirmed to exist and the code pattern is correct for TanStack Start integration. However, the latest available version is 0.9.11, not @^0.10.4. Update the version constraint to @^0.9.11 or verify if 0.10.4 is the intended target version for this template.

@oscabriel
Copy link
Contributor

It really is a lot of changes 😬 On my initial test of updating everything in a test project, I don't think the new version of convex-better-auth works deploying to cloudflare? Curious if you're able to get it working!

@AmanVarshney01
Copy link
Owner Author

@oscabriel I haven’t worked much on this yet. I’ll come back to it in two days. I don’t have much time right now.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

PR Preview Release

A preview version has been published for this PR.

Package Version NPM Tag
create-better-t-stack 3.9.0-pr730.0ee9844 pr730
create-bts 3.9.0-pr730.0ee9844 pr730
@better-t-stack/types 3.9.0-pr730.0ee9844 pr730

Commit: 0ee9844

Install

# Using the PR tag (always gets latest for this PR) bunx create-better-t-stack@pr730 npx create-better-t-stack@pr730 # Using exact version bunx create-better-t-stack@3.9.0-pr730.0ee9844 npx create-better-t-stack@3.9.0-pr730.0ee9844 # Using the alias bunx create-bts@pr730 npx create-bts@pr730

NPM Links


To publish a new preview after more commits, remove and re-add the preview label.

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: 3

🧹 Nitpick comments (4)
apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1)

30-38: Verify the full page reload approach for sign-out UX.

Replacing client-side navigation with location.reload() ensures complete state cleanup but degrades the user experience:

  • Full page reload is slower than client-side navigation
  • Causes a brief loading flash
  • User remains on the current page after reload (which may be a protected route)

If the goal is to ensure clean auth state, consider these alternatives:

  • window.location.href = "/" to redirect to the home page
  • Use TanStack Router's navigation with proper state cleanup
  • Clear auth state manually and navigate client-side

Is the full page reload intentional for this auth architecture, or could we achieve the same state cleanup with a better UX?

apps/cli/templates/auth/better-auth/convex/native/base/lib/auth-client.ts.hbs (1)

8-11: Consider validating the required environment variable.

The baseURL relies on process.env.EXPO_PUBLIC_CONVEX_SITE_URL without validation. If this environment variable is undefined, the auth client will be misconfigured and fail at runtime in non-obvious ways.

🔎 Optional validation to add
+if (!process.env.EXPO_PUBLIC_CONVEX_SITE_URL) { + throw new Error("EXPO_PUBLIC_CONVEX_SITE_URL environment variable is required"); +} + export const authClient = createAuthClient({ baseURL: process.env.EXPO_PUBLIC_CONVEX_SITE_URL,
apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs (1)

62-68: Consider using a proper return validator instead of v.any().

The getCurrentUser query correctly follows Convex's new function syntax with explicit args, returns, and handler properties (as per learnings). However, using v.any() for the return type loses type safety benefits.

Consider defining a proper validator for the user object structure to maintain type safety throughout the application.

Example structure (adjust based on actual user schema):

// Define user validator const userValidator = v.union( v.null(), v.object({ id: v.string(), email: v.string(), // ... other user fields }) ); export const getCurrentUser = query({ args: {}, returns: userValidator, handler: async function (ctx, args) { return authComponent.getAuthUser(ctx); }, });

Based on learnings, Convex functions should include argument and return validators for type safety.

apps/cli/templates/frontend/react/tanstack-start/src/routes/__root.tsx.hbs (1)

44-46: Consider error handling for token retrieval.

The getAuth function calls getToken() but doesn't handle potential errors. If token retrieval fails, the error will propagate to the route loading phase without context.

🔎 Suggested error handling
 const getAuth = createServerFn({ method: "GET" }).handler(async () => { - return await getToken(); + try { + return await getToken(); + } catch (error) { + console.error("Failed to retrieve auth token:", error); + return null; + } });
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 233ccf3 and cd99890.

📒 Files selected for processing (12)
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs (4 hunks)
  • apps/cli/templates/auth/better-auth/convex/native/base/lib/auth-client.ts.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/app/api/auth/[...all]/route.ts.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/routes/api/auth/$.ts.hbs (1 hunks)
  • apps/cli/templates/frontend/react/next/package.json.hbs (3 hunks)
  • apps/cli/templates/frontend/react/next/src/app/layout.tsx.hbs (3 hunks)
  • apps/cli/templates/frontend/react/next/src/components/providers.tsx.hbs (3 hunks)
  • apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/tanstack-start/src/routes/__root.tsx.hbs (3 hunks)
  • apps/cli/templates/frontend/react/tanstack-start/vite.config.ts.hbs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.hbs

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.hbs: In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle
Escape the '{{' in Handlebars templates like '{{'

Files:

  • apps/cli/templates/frontend/react/tanstack-start/vite.config.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs
  • apps/cli/templates/frontend/react/next/src/app/layout.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/native/base/lib/auth-client.ts.hbs
  • apps/cli/templates/frontend/react/next/src/components/providers.tsx.hbs
  • apps/cli/templates/frontend/react/tanstack-start/src/routes/__root.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/app/api/auth/[...all]/route.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/routes/api/auth/$.ts.hbs
  • apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbs
  • apps/cli/templates/frontend/react/next/package.json.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
🧠 Learnings (16)
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.{html,tsx,ts,jsx,js} : Use HTML imports with `Bun.serve()` for frontend instead of Vite 

Applied to files:

  • apps/cli/templates/frontend/react/tanstack-start/vite.config.ts.hbs
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `Bun.serve()` which supports WebSockets, HTTPS, and routes instead of `express` 

Applied to files:

  • apps/cli/templates/frontend/react/tanstack-start/vite.config.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/routes/api/auth/$.ts.hbs
📚 Learning: 2025-12-03T07:47:42.038Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/better-t-stack-repo.mdc:0-0 Timestamp: 2025-12-03T07:47:42.038Z Learning: Applies to **/*.hbs : In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle 

Applied to files:

  • apps/cli/templates/frontend/react/next/src/app/layout.tsx.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the api object from convex/_generated/api.ts to call public functions registered with query, mutation, or action 

Applied to files:

  • apps/cli/templates/frontend/react/next/src/components/providers.tsx.hbs
  • apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Convex uses file-based routing; a public function defined in convex/example.ts named f has function reference api.example.f 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/app/api/auth/[...all]/route.ts.hbs
  • apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Try to use as few calls from actions to queries and mutations as possible to reduce race condition risks from multiple transactions 

Applied to files:

  • apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Thoughtfully organize files with public query, mutation, or action functions within the convex/ directory using file-based routing 

Applied to files:

  • apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the internal object from convex/_generated/api.ts to call internal/private functions registered with internalQuery, internalMutation, or internalAction 

Applied to files:

  • apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use query, mutation, and action to define public functions; use internalQuery, internalMutation, and internalAction to define private, internal functions 

Applied to files:

  • apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ALWAYS include argument and return validators for all Convex functions (query, internalQuery, mutation, internalMutation, action, internalAction) 

Applied to files:

  • apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use internalQuery, internalMutation, and internalAction to register private internal functions; these are only callable by other Convex functions 

Applied to files:

  • apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use ctx.runQuery to call a query from a query, mutation, or action; use ctx.runMutation to call a mutation from a mutation or action; use ctx.runAction to call an action from an action 

Applied to files:

  • apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use query, mutation, and action to register public functions that are part of the public API; do NOT use these for sensitive internal functions 

Applied to files:

  • apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ALWAYS use the new function syntax for Convex functions with explicit args, returns, and handler properties 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-06-08T17:57:33.083Z
Learnt from: Vijayabaskar56 Repo: AmanVarshney01/create-better-t-stack PR: 310 File: apps/cli/templates/frontend/angular/src/app.component.html:1-7 Timestamp: 2025-06-08T17:57:33.083Z Learning: The Angular frontend template uses Tailwind CSS v4, which doesn't require a traditional tailwind.config.js configuration file. 

Applied to files:

  • apps/cli/templates/frontend/react/next/package.json.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/schema.ts : Always define your schema in convex/schema.ts and import schema definition functions from convex/server 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
🔇 Additional comments (15)
apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/routes/api/auth/$.ts.hbs (2)

2-2: LGTM! Centralized handler import.

The switch from reactStartHandler to a centralized handler from @/lib/auth-server is a good refactoring practice that improves maintainability and consistency across the auth implementation.


4-10: No issues found.

The handler invocation pattern is correct for TanStack Start's server handlers. Both GET and POST handlers properly call handler(request), following the framework conventions.

apps/cli/templates/auth/better-auth/convex/native/base/lib/auth-client.ts.hbs (1)

1-6: No code changes required for crossDomainClient import.

The crossDomainClient import from @convex-dev/better-auth/client/plugins is properly documented for Expo configurations, where it's conditionally used for web builds alongside expoClient for native platforms. The imports and usage pattern match the official integration documentation.

apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs (2)

52-55: Clarify purpose and necessity of jwksRotateOnTokenGenerationError configuration.

The convex plugin now includes jwksRotateOnTokenGenerationError: true, but this option is not documented in the official Better Auth or Convex integration guides. Verify whether:

  1. This is the recommended default configuration
  2. It was added specifically to address Cloudflare deployment issues or for another reason
  3. It should be environment-specific or can remain hardcoded for all targets

27-27: The function signature simplification to function createAuth(ctx: GenericCtx<DataModel>) is correct. The optionsOnly parameter removal is safe and aligns with current Better Auth API standards. The parameter was previously optional and used only to disable logging when generating options, but the updated API no longer requires it. All official Convex + Better Auth documentation shows the simplified signature, and the function is invoked solely with the context parameter through both registerRoutes and getAuth methods.

apps/cli/templates/frontend/react/tanstack-start/vite.config.ts.hbs (1)

17-21: LGTM! SSR configuration is appropriate.

The conditional noExternal configuration for @convex-dev/better-auth ensures the package is properly bundled during SSR when using Convex with better-auth, which is necessary for server-side token handling.

apps/cli/templates/auth/better-auth/convex/web/react/next/src/app/api/auth/[...all]/route.ts.hbs (1)

1-3: LGTM! Clean API route handler.

The centralized handler import from @/lib/auth-server simplifies the API route and follows Next.js App Router conventions correctly.

apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs (1)

38-44: LGTM! Proper authentication configuration.

Setting expectAuth: true for better-auth correctly signals that authentication is required for Convex queries, aligning with the token-based authentication flow introduced in this PR.

apps/cli/templates/frontend/react/next/package.json.hbs (2)

6-6: Explicit port configuration improves clarity.

Specifying --port 3001 explicitly prevents port conflicts when running multiple services and makes the development setup more predictable.


16-19: Ensure Next.js 16.1.0 and React 19.2.3 are properly configured for target deployment environments.

The specified dependency versions (Next.js 16.1.0, React 19.2.3) are compatible and include recent security patches. If deploying to Cloudflare, note that Next.js 16's default Turbopack bundler requires using next build instead of next build --turbo for OpenNext compatibility. Verify that your deployment adapter and environment configuration are explicitly tested in your target environment.

apps/cli/templates/frontend/react/tanstack-start/src/routes/__root.tsx.hbs (1)

146-150: LGTM! Token propagation is correct.

The initialToken prop correctly passes the token from the route context to ConvexBetterAuthProvider, enabling authenticated Convex queries during SSR.

apps/cli/templates/frontend/react/next/src/components/providers.tsx.hbs (2)

34-43: LGTM! Proper prop typing for initialToken.

The conditional initialToken prop is correctly typed as optional (string | null) and properly scoped to the convex/better-auth configuration path.


58-62: LGTM! Token forwarding is correct.

The initialToken prop is properly passed to ConvexBetterAuthProvider, enabling server-side token initialization for authenticated Convex queries.

apps/cli/templates/frontend/react/next/src/app/layout.tsx.hbs (2)

5-7: Handlebars template syntax issue: escape opening braces.

According to the coding guidelines, opening braces in Handlebars templates should be escaped. The current syntax may cause parsing issues.

🔎 Proposed fix
-{{#if (eq auth "clerk")}}{{#if (eq backend "convex")}}import { ClerkProvider } from "@clerk/nextjs"; -{{/if}}{{/if}}{{#if (and (eq backend "convex") (eq auth "better-auth"))}} +\{{#if (eq auth "clerk")}}\{{#if (eq backend "convex")}}import { ClerkProvider } from "@clerk/nextjs"; +\{{/if}}\{{/if}}\{{#if (and (eq backend "convex") (eq auth "better-auth"))}} import { getToken } from "@/lib/auth-server"; -{{/if}} +\{{/if}}

Note: Apply this pattern consistently if the template processor requires escaped braces. Based on coding guidelines for **/*.hbs files.

⛔ Skipped due to learnings
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/better-t-stack-repo.mdc:0-0 Timestamp: 2025-12-03T07:47:42.038Z Learning: Applies to **/*.hbs : Escape the '{{' in Handlebars templates like '\{{' 
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/better-t-stack-repo.mdc:0-0 Timestamp: 2025-12-03T07:47:42.038Z Learning: Applies to **/*.hbs : In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle 
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the api object from convex/_generated/api.ts to call public functions registered with query, mutation, or action 
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the internal object from convex/_generated/api.ts to call internal/private functions registered with internalQuery, internalMutation, or internalAction 

27-27: Async root layout is fully supported in Next.js 16.1.0.

Async layouts are standard in Next.js App Router, with support for async functions like export default async function Layout. Next.js 16 includes improved async server components, and there are no documented hydration issues specific to async root layouts. Server components can safely access cookies and other server-side APIs, making authentication token flow fully compatible with async root layouts.

Comment on lines 12 to 20
...(Platform.OS === "web"
? [crossDomainClient()]
: [
expoClient({
scheme: Constants.expoConfig?.scheme as string,
storagePrefix: Constants.expoConfig?.scheme as string,
storage: SecureStore,
}),
]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix unsafe type casting that may cause runtime errors.

Lines 16 and 17 use as string to cast Constants.expoConfig?.scheme, which may be undefined. The optional chaining (?.) indicates the value can be undefined, but the type assertion bypasses this, creating a type-unsafe situation. If scheme is undefined at runtime, this will cause the auth client to be misconfigured and likely crash.

🔎 Proposed fix with proper validation
 ...(Platform.OS === "web" ? [crossDomainClient()] : [ expoClient({ - scheme: Constants.expoConfig?.scheme as string, - storagePrefix: Constants.expoConfig?.scheme as string, + scheme: Constants.expoConfig?.scheme ?? "app", + storagePrefix: Constants.expoConfig?.scheme ?? "app", storage: SecureStore, }), ]),

Or, if the scheme is truly required and should not have a fallback:

+const scheme = Constants.expoConfig?.scheme; +if (!scheme && Platform.OS !== "web") { + throw new Error("expoConfig.scheme is required for native platforms"); +} + export const authClient = createAuthClient({ baseURL: process.env.EXPO_PUBLIC_CONVEX_SITE_URL, plugins: [ convexClient(), ...(Platform.OS === "web" ? [crossDomainClient()] : [ expoClient({ - scheme: Constants.expoConfig?.scheme as string, - storagePrefix: Constants.expoConfig?.scheme as string, + scheme: scheme!, + storagePrefix: scheme!, storage: SecureStore, }), ]),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
...(Platform.OS === "web"
? [crossDomainClient()]
: [
expoClient({
scheme: Constants.expoConfig?.scheme as string,
storagePrefix: Constants.expoConfig?.scheme as string,
storage: SecureStore,
}),
]),
...(Platform.OS === "web"
? [crossDomainClient()]
: [
expoClient({
scheme: Constants.expoConfig?.scheme ?? "app",
storagePrefix: Constants.expoConfig?.scheme ?? "app",
storage: SecureStore,
}),
]),
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: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/cli/package.json (1)

67-67: Use bun run build instead of npm run build.

The prepublishOnly script uses npm run build, but per coding guidelines, bun run <script> should be used instead.

🔎 Proposed fix
- "prepublishOnly": "npm run build" + "prepublishOnly": "bun run build"
♻️ Duplicate comments (1)
apps/cli/templates/frontend/react/tanstack-start/package.json.hbs (1)

11-12: Same dependency issues as tanstack-router template.

This template has identical dependency changes to apps/cli/templates/frontend/react/tanstack-router/package.json.hbs. Please refer to the review comments on that file regarding:

  1. The suspicious "shadcn": "^3.6.2" package name
  2. @base-ui/react React 19 compatibility verification

Ensure these issues are resolved consistently across both templates.

🧹 Nitpick comments (6)
apps/web/content/docs/cli/compatibility.mdx (1)

137-137: Minor wording refinement for conciseness (optional).

Lines 137 and 187 use "Not compatible" which could be shortened to "incompatible" for brevity. This is a stylistic preference and low-priority.

- | `postgres`, `mysql`, `mongodb` | Not compatible with `sqlite` or Workers + | `postgres`, `mysql`, `mongodb` | Incompatible with `sqlite` or Workers - Not compatible with Nuxt, Svelte, or Solid + Incompatible with Nuxt, Svelte, or Solid

Also applies to: 187-187

apps/cli/templates/frontend/react/web-base/src/components/ui/button.tsx.hbs (1)

2-2: Minor: Remove extra whitespace in import.

There's an extra space in the cva import.

🔎 Proposed fix
-import { cva } from 'class-variance-authority' +import { cva } from 'class-variance-authority'
apps/cli/templates/frontend/react/web-base/src/components/ui/dropdown-menu.tsx.hbs (2)

152-179: Remove duplicate pointer-events-none class.

Line 169 contains pointer-events-none twice in the className string.

🔎 Proposed fix
 <span - className="pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none" + className="pointer-events-none absolute right-2 flex items-center justify-center" data-slot="dropdown-menu-checkbox-item-indicator" >

190-215: Remove duplicate pointer-events-none class.

Line 205 contains pointer-events-none twice in the className string.

🔎 Proposed fix
 <span - className="pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none" + className="pointer-events-none absolute right-2 flex items-center justify-center" data-slot="dropdown-menu-radio-item-indicator" >
apps/web/src/app/global.css (1)

144-160: Consider removing self-referential CSS variable definitions.

Several variables reference themselves without fallbacks (e.g., --tracking-normal: var(--tracking-normal), --shadow-2xl: var(--shadow-2xl)). Self-referential custom properties resolve to their guaranteed-invalid value, which may cause unexpected behavior.

If these are intended to inherit from a parent scope or external source, consider adding explicit fallbacks:

- --tracking-normal: var(--tracking-normal); + --tracking-normal: var(--tracking-normal, 0em);

This appears to be a pre-existing issue rather than something introduced by this formatting change.

apps/cli/templates/frontend/react/web-base/src/components/ui/sonner.tsx.hbs (1)

17-17: Type assertion can be avoided.

The type assertion theme as ToasterProps['theme'] works but could be more type-safe. Since useTheme() returns string | undefined and you provide a default of 'system', the assertion may mask potential type mismatches.

🔎 Safer typing approach
-const Toaster = ({ ...props }: ToasterProps) => { - const { theme = 'system' } = useTheme() +const Toaster = ({ ...props }: ToasterProps) => { + const { theme } = useTheme() + const toasterTheme = (theme ?? 'system') as ToasterProps['theme'] return ( <Sonner - theme={theme as ToasterProps['theme']} + theme={toasterTheme}

This makes the fallback logic and type conversion more explicit.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd99890 and 5dc66c6.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (57)
  • .github/CONTRIBUTING.md (7 hunks)
  • .github/workflows/pr-preview.yaml (1 hunks)
  • .oxfmtrc.json (1 hunks)
  • apps/cli/README.md (2 hunks)
  • apps/cli/package.json (1 hunks)
  • apps/cli/templates/frontend/react/next/package.json.hbs (2 hunks)
  • apps/cli/templates/frontend/react/react-router/package.json.hbs (1 hunks)
  • apps/cli/templates/frontend/react/tanstack-router/package.json.hbs (1 hunks)
  • apps/cli/templates/frontend/react/tanstack-start/package.json.hbs (1 hunks)
  • apps/cli/templates/frontend/react/web-base/components.json (1 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/button.tsx (0 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/button.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/card.tsx (0 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/card.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/checkbox.tsx (0 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/checkbox.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/dropdown-menu.tsx (0 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/dropdown-menu.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/input.tsx (0 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/input.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/label.tsx (0 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/label.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/skeleton.tsx (0 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/skeleton.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/sonner.tsx (0 hunks)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/sonner.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/web-base/src/index.css.hbs (4 hunks)
  • apps/cli/tsconfig.json (1 hunks)
  • apps/web/.eslintrc.json (1 hunks)
  • apps/web/components.json (1 hunks)
  • apps/web/content/docs/analytics.mdx (0 hunks)
  • apps/web/content/docs/bts-config.mdx (1 hunks)
  • apps/web/content/docs/cli/compatibility.mdx (8 hunks)
  • apps/web/content/docs/cli/index.mdx (1 hunks)
  • apps/web/content/docs/cli/meta.json (1 hunks)
  • apps/web/content/docs/cli/options.mdx (4 hunks)
  • apps/web/content/docs/cli/programmatic-api.mdx (1 hunks)
  • apps/web/content/docs/cli/prompts.mdx (0 hunks)
  • apps/web/content/docs/contributing.mdx (2 hunks)
  • apps/web/content/docs/guides/index.mdx (1 hunks)
  • apps/web/content/docs/guides/meta.json (1 hunks)
  • apps/web/content/docs/index.mdx (1 hunks)
  • apps/web/content/docs/meta.json (1 hunks)
  • apps/web/content/docs/project-structure.mdx (7 hunks)
  • apps/web/package.json (1 hunks)
  • apps/web/public/favicon/site.webmanifest (1 hunks)
  • apps/web/src/app/global.css (2 hunks)
  • apps/web/tsconfig.json (1 hunks)
  • package.json (1 hunks)
  • packages/backend/convex/tsconfig.json (1 hunks)
  • packages/backend/package.json (1 hunks)
  • packages/create-bts/README.md (0 hunks)
  • packages/create-bts/package.json (1 hunks)
  • packages/types/package.json (2 hunks)
  • packages/types/tsconfig.json (0 hunks)
  • tsconfig.json (1 hunks)
  • turbo.json (1 hunks)
💤 Files with no reviewable changes (12)
  • apps/cli/templates/frontend/react/web-base/src/components/ui/checkbox.tsx
  • apps/cli/templates/frontend/react/web-base/src/components/ui/button.tsx
  • apps/web/content/docs/cli/prompts.mdx
  • apps/cli/templates/frontend/react/web-base/src/components/ui/sonner.tsx
  • apps/cli/templates/frontend/react/web-base/src/components/ui/card.tsx
  • apps/cli/templates/frontend/react/web-base/src/components/ui/label.tsx
  • apps/web/content/docs/analytics.mdx
  • apps/cli/templates/frontend/react/web-base/src/components/ui/skeleton.tsx
  • apps/cli/templates/frontend/react/web-base/src/components/ui/input.tsx
  • packages/types/tsconfig.json
  • packages/create-bts/README.md
  • apps/cli/templates/frontend/react/web-base/src/components/ui/dropdown-menu.tsx
✅ Files skipped from review due to trivial changes (16)
  • apps/web/content/docs/cli/options.mdx
  • apps/web/content/docs/meta.json
  • apps/web/content/docs/cli/meta.json
  • apps/web/content/docs/project-structure.mdx
  • apps/web/content/docs/index.mdx
  • turbo.json
  • apps/web/content/docs/guides/meta.json
  • apps/cli/README.md
  • .github/workflows/pr-preview.yaml
  • apps/web/components.json
  • apps/web/content/docs/bts-config.mdx
  • apps/web/.eslintrc.json
  • apps/web/content/docs/cli/programmatic-api.mdx
  • apps/web/public/favicon/site.webmanifest
  • apps/web/content/docs/cli/index.mdx
  • apps/web/content/docs/guides/index.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/cli/templates/frontend/react/next/package.json.hbs
🧰 Additional context used
📓 Path-based instructions (4)
**/*.hbs

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.hbs: In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle
Escape the '{{' in Handlebars templates like '{{'

Files:

  • apps/cli/templates/frontend/react/web-base/src/components/ui/label.tsx.hbs
  • apps/cli/templates/frontend/react/react-router/package.json.hbs
  • apps/cli/templates/frontend/react/tanstack-router/package.json.hbs
  • apps/cli/templates/frontend/react/web-base/src/components/ui/button.tsx.hbs
  • apps/cli/templates/frontend/react/web-base/src/components/ui/sonner.tsx.hbs
  • apps/cli/templates/frontend/react/web-base/src/components/ui/input.tsx.hbs
  • apps/cli/templates/frontend/react/web-base/src/index.css.hbs
  • apps/cli/templates/frontend/react/web-base/src/components/ui/skeleton.tsx.hbs
  • apps/cli/templates/frontend/react/tanstack-start/package.json.hbs
  • apps/cli/templates/frontend/react/web-base/src/components/ui/card.tsx.hbs
  • apps/cli/templates/frontend/react/web-base/src/components/ui/dropdown-menu.tsx.hbs
  • apps/cli/templates/frontend/react/web-base/src/components/ui/checkbox.tsx.hbs
package.json

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

Always add @types/node to your package.json when using any Node.js built-in modules

Use bun run <script> instead of npm run <script>, yarn run <script>, or pnpm run <script>

Files:

  • package.json
{package.json,bun.lockb}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun install instead of npm install, yarn install, or pnpm install

Files:

  • package.json
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/web/src/app/global.css
🧠 Learnings (27)
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.{ts,tsx,js,jsx,css} : Use `bun build <file>` instead of `webpack` or `esbuild` for bundling TypeScript, JavaScript, and CSS files 

Applied to files:

  • apps/web/tsconfig.json
  • apps/cli/tsconfig.json
  • tsconfig.json
  • apps/cli/package.json
  • package.json
  • .github/CONTRIBUTING.md
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.{ts,tsx,js,jsx} : Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling 

Applied to files:

  • apps/web/tsconfig.json
  • apps/web/package.json
  • apps/cli/tsconfig.json
  • tsconfig.json
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.html : HTML files can import .tsx, .jsx or .js files directly; Bun will transpile and bundle automatically 

Applied to files:

  • apps/web/tsconfig.json
  • apps/cli/tsconfig.json
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.{ts,tsx,js,jsx} : Run server with `bun --hot <file>` to enable hot reloading during development 

Applied to files:

  • apps/web/tsconfig.json
  • apps/cli/tsconfig.json
  • tsconfig.json
  • .github/CONTRIBUTING.md
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun <file>` instead of `node <file>` or `ts-node <file>` for running TypeScript/JavaScript files 

Applied to files:

  • apps/web/tsconfig.json
  • apps/cli/tsconfig.json
  • apps/cli/package.json
  • package.json
  • .github/CONTRIBUTING.md
📚 Learning: 2025-06-08T17:57:33.083Z
Learnt from: Vijayabaskar56 Repo: AmanVarshney01/create-better-t-stack PR: 310 File: apps/cli/templates/frontend/angular/src/app.component.html:1-7 Timestamp: 2025-06-08T17:57:33.083Z Learning: For NgxSonnerToaster in the Angular template, it's sufficient to import it directly in the app-root component's imports array rather than in a module, following the standalone component approach. 

Applied to files:

  • apps/cli/templates/frontend/react/web-base/src/components/ui/sonner.tsx.hbs
📚 Learning: 2025-06-08T17:57:33.083Z
Learnt from: Vijayabaskar56 Repo: AmanVarshney01/create-better-t-stack PR: 310 File: apps/cli/templates/frontend/angular/src/app.component.html:1-7 Timestamp: 2025-06-08T17:57:33.083Z Learning: The Angular frontend template uses Tailwind CSS v4, which doesn't require a traditional tailwind.config.js configuration file. 

Applied to files:

  • apps/cli/templates/frontend/react/web-base/src/index.css.hbs
  • apps/cli/templates/frontend/react/web-base/components.json
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the internal object from convex/_generated/api.ts to call internal/private functions registered with internalQuery, internalMutation, or internalAction 

Applied to files:

  • packages/backend/convex/tsconfig.json
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Convex uses file-based routing; a public function defined in convex/example.ts named f has function reference api.example.f 

Applied to files:

  • packages/backend/convex/tsconfig.json
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/schema.ts : Always define your schema in convex/schema.ts and import schema definition functions from convex/server 

Applied to files:

  • packages/backend/convex/tsconfig.json
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : A private function defined in convex/example.ts named g has function reference internal.example.g; nested files follow the directory structure 

Applied to files:

  • packages/backend/convex/tsconfig.json
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ALWAYS include argument and return validators for all Convex functions (query, internalQuery, mutation, internalMutation, action, internalAction) 

Applied to files:

  • packages/backend/convex/tsconfig.json
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ALWAYS use the new function syntax for Convex functions with explicit args, returns, and handler properties 

Applied to files:

  • packages/backend/convex/tsconfig.json
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Always use as const for string literals in discriminated union types 

Applied to files:

  • packages/backend/convex/tsconfig.json
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/crons.ts : You can register Convex functions within crons.ts just like any other file 

Applied to files:

  • packages/backend/convex/tsconfig.json
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Always add 'use node'; to the top of files containing actions that use Node.js built-in modules 

Applied to files:

  • packages/backend/convex/tsconfig.json
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : When using the Array type, always define your arrays as const array: Array<T> = [...] 

Applied to files:

  • packages/backend/convex/tsconfig.json
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the api object from convex/_generated/api.ts to call public functions registered with query, mutation, or action 

Applied to files:

  • packages/backend/convex/tsconfig.json
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Use `bun test` instead of `jest` or `vitest` for running tests 

Applied to files:

  • apps/cli/tsconfig.json
  • apps/cli/package.json
  • .github/CONTRIBUTING.md
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.{ts,tsx,js,jsx} : Bun automatically loads .env files, so don't use the dotenv package 

Applied to files:

  • apps/cli/tsconfig.json
  • apps/cli/package.json
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun:sqlite` module for SQLite instead of `better-sqlite3` 

Applied to files:

  • apps/cli/tsconfig.json
  • apps/cli/package.json
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Use `bun:test` module with `test` and `expect` functions for writing tests 

Applied to files:

  • apps/cli/package.json
  • .github/CONTRIBUTING.md
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `Bun.$` template literal syntax instead of `execa` for shell command execution 

Applied to files:

  • apps/cli/package.json
  • .github/CONTRIBUTING.md
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to package.json : Use `bun run <script>` instead of `npm run <script>`, `yarn run <script>`, or `pnpm run <script>` 

Applied to files:

  • apps/cli/package.json
  • package.json
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to package.json : Always add types/node to your package.json when using any Node.js built-in modules 

Applied to files:

  • packages/types/package.json
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to {package.json,bun.lockb} : Use `bun install` instead of `npm install`, `yarn install`, or `pnpm install` 

Applied to files:

  • package.json
  • .github/CONTRIBUTING.md
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `Bun.serve()` which supports WebSockets, HTTPS, and routes instead of `express` 

Applied to files:

  • .github/CONTRIBUTING.md
🧬 Code graph analysis (2)
apps/cli/templates/frontend/react/web-base/src/components/ui/skeleton.tsx.hbs (1)
apps/cli/templates/frontend/react/web-base/src/components/ui/skeleton.tsx (1)
  • Skeleton (3-11)
apps/cli/templates/frontend/react/web-base/src/components/ui/checkbox.tsx.hbs (1)
apps/cli/templates/frontend/react/web-base/src/components/ui/checkbox.tsx (1)
  • Checkbox (7-28)
🪛 LanguageTool
apps/web/content/docs/cli/compatibility.mdx

[style] ~137-~137: Consider using “incompatible” to avoid wordiness.
Context: ... | postgres, mysql, mongodb | Not compatible with sqlite or Workers ...

(NOT_ABLE_PREMIUM)


[style] ~187-~187: Consider using “incompatible” to avoid wordiness.
Context: ...s, TanStack Start, native frameworks) - Not compatible with Nuxt, Svelte, or Solid ### Paymen...

(NOT_ABLE_PREMIUM)

🪛 markdownlint-cli2 (0.18.1)
.github/CONTRIBUTING.md

86-86: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (41)
apps/web/content/docs/cli/compatibility.mdx (1)

1-263: Documentation content is comprehensive and accurate.

The compatibility rules, tables, examples, and error messages are well-organized and align with the PR's goal of updating auth templates and CLI scaffolding. Tables are clearly formatted, and restriction/requirement sections provide good clarity for users.

apps/web/content/docs/contributing.mdx (1)

42-48: LGTM! Clear documentation improvement.

The added explanation clarifies that the create-better-t-stack command will execute the locally linked CLI from the bun link step. This helps contributors understand the connection between the setup and testing steps.

.github/CONTRIBUTING.md (1)

25-187: Formatting improvements enhance readability.

The formatting changes throughout the file—adding consistent blank lines after list items and code blocks—improve visual separation and readability without altering the content or accuracy of the contribution guidelines.

apps/cli/templates/frontend/react/web-base/src/components/ui/label.tsx.hbs (1)

1-20: LGTM! Well-structured UI primitive component.

This Label component follows common shadcn/ui-style patterns and is appropriately implemented as a flexible, low-level primitive. The TypeScript typing, className composition, and accessibility-aware state handling (disabled states via group-data and peer-disabled) are all well done.

Note: This is a static Handlebars template with no template variables, which appears intentional for this use case.

apps/cli/templates/frontend/react/web-base/src/components/ui/checkbox.tsx.hbs (1)

1-26: LGTM!

The Checkbox component is well-structured, wrapping the @base-ui/react/checkbox primitive with appropriate styling. The implementation includes proper accessibility attributes (data-slot, aria-invalid states), dark mode support, and disabled state handling.

.oxfmtrc.json (1)

1-4: LGTM!

The OxFMT configuration appropriately excludes Handlebars templates and the CLI templates directory from formatting. This prevents the formatter from potentially breaking template syntax.

apps/cli/templates/frontend/react/web-base/src/components/ui/input.tsx.hbs (1)

1-20: LGTM!

The Input component properly wraps the @base-ui/react/input primitive with comprehensive styling. The implementation correctly handles the type prop explicitly and includes appropriate states for accessibility (aria-invalid), dark mode, focus visibility, and disabled states.

apps/cli/templates/frontend/react/web-base/src/index.css.hbs (3)

1-3: LGTM!

The CSS imports are properly structured for Tailwind CSS v4, including the new shadcn/tailwind.css integration.


29-33: Identical chart colors in light and dark modes.

The chart color variables (--chart-1 through --chart-5) are now identical between :root (light) and .dark themes. If this is intentional for design consistency, this is fine. Otherwise, you may want to adjust the dark mode values for better contrast.

Also applies to: 64-68


79-119: LGTM on the @theme inline block.

The theme configuration properly maps CSS custom properties to Tailwind color tokens and adds the extended radius scale (2xl, 3xl, 4xl). The --font-sans definition with 'Inter Variable' fallback is well-configured for Tailwind v4. Based on learnings, this aligns with Tailwind CSS v4's CSS-first configuration approach.

apps/cli/templates/frontend/react/web-base/src/components/ui/button.tsx.hbs (2)

7-40: LGTM! Well-structured variant configuration.

The buttonVariants definition is comprehensive and properly structured with appropriate Tailwind v4 classes for all variants and sizes.


42-57: LGTM! Button component properly implements variant composition.

The component correctly applies variants via cva, forwards all props, and uses the data-slot attribute for composition.

apps/cli/templates/frontend/react/web-base/src/components/ui/card.tsx.hbs (1)

5-103: LGTM! Well-structured Card component system.

The Card components are properly structured with:

  • Consistent data-slot attributes for all subcomponents
  • Proper TypeScript typing with React.ComponentProps
  • Size-aware styling with data attributes
  • Clean class composition using cn utility

The implementation follows a clear slot-based composition pattern that aligns with the broader UI refactoring evident in this PR.

apps/cli/templates/frontend/react/web-base/src/components/ui/dropdown-menu.tsx.hbs (4)

7-51: LGTM! Core dropdown menu components properly implemented.

The root components (DropdownMenu, Portal, Trigger, Content) correctly wrap the base UI primitives and compose positioning/styling appropriately.


53-98: LGTM! Menu items and grouping components well-structured.

The Group, Label, and Item components properly support inset positioning and variants, with appropriate data attributes and styling.


100-150: LGTM! Submenu components correctly implemented.

The submenu components (Sub, SubTrigger, SubContent) properly handle nested menus with appropriate positioning and icons.


217-262: LGTM! Separator and Shortcut components complete the API.

The remaining utility components properly round out the dropdown menu API with appropriate styling and data attributes. The exports list is comprehensive.

apps/web/src/app/global.css (4)

1-13: LGTM! Correct Tailwind v4 syntax usage.

The important modifier placement (bg-fd-background!, border-none!, etc.) correctly follows Tailwind CSS v4 conventions where ! comes at the end of the utility name.


164-276: LGTM!

The theme variable definitions for both light and dark modes are well-structured. The use of oklch() color space in the light theme and hex values (Catppuccin palette) in the dark theme provides good color consistency.


33-96: LGTM!

The animation keyframes and utility classes are well-defined. The shiny-text animation, scrollbar hiding utilities, and other visual effects follow standard CSS patterns.


288-381: LGTM!

The terminal-themed styling (cursor blink, scanlines, hover effects) and file browser animations are cleanly implemented with appropriate transitions and pointer-events handling.

apps/web/package.json (1)

73-73: LGTM!

Trailing newline added for POSIX compliance. No functional changes.

apps/cli/tsconfig.json (1)

2-14: LGTM!

Formatting-only changes. The TypeScript configuration is appropriate for a CLI application using bundler module resolution.

packages/backend/package.json (1)

2-21: LGTM!

Field reordering only; no functional changes to dependencies or scripts.

tsconfig.json (1)

2-28: LGTM!

Formatting-only changes. The TypeScript configuration is well-organized with clear comment sections.

apps/cli/templates/frontend/react/react-router/package.json.hbs (1)

12-13: Package versions are valid and production-ready.

Both @base-ui/react version 1.0.0 (last published 8 days ago) and shadcn version 3.6.2 (last published 2 days ago) exist and are maintained. The migration from Radix UI is supported by shadcn/ui, which now allows developers to choose between Radix or Base UI when initializing projects.

packages/backend/convex/tsconfig.json (1)

1-25: LGTM!

The TypeScript configuration is correctly set up for Convex with appropriate compiler options. The formatting changes don't affect functionality.

apps/web/tsconfig.json (1)

1-37: LGTM!

The TypeScript configuration is properly set up for a Next.js project with appropriate paths, plugins, and compiler options. The formatting changes don't affect functionality.

packages/types/package.json (1)

1-52: LGTM!

The package metadata additions (keywords, homepage, repository, files) are well-structured for npm publishing. The prepublishOnly script correctly uses bun run build as per coding guidelines.

package.json (1)

32-50: LGTM!

The devDependencies version bumps and packageManager update to bun@1.3.5 look appropriate. Scripts correctly use bun run as per coding guidelines.

apps/cli/package.json (2)

31-55: LGTM!

The package metadata additions are well-structured for npm publishing:

  • bin correctly maps to the ESM CLI entry point
  • files properly includes both dist and templates
  • exports map provides clean type-safe entry points for ESM consumers
  • type: "module" is correctly set for ESM package

69-94: LGTM!

Dependencies are appropriate for a CLI tool. Notably, @types/node is correctly included in devDependencies as per coding guidelines for packages using Node.js built-in modules.

packages/create-bts/package.json (2)

5-31: LGTM! Comprehensive keyword coverage.

The expanded keywords accurately reflect the project's scope and ecosystem integration.


32-60: All referenced files are present and correctly configured.

The cli.js, index.js, and index.d.ts files exist in the packages/create-bts/ directory, and the package configuration properly references them in the bin, files, main, types, and exports fields. The package is ready for publishing.

apps/cli/templates/frontend/react/tanstack-router/package.json.hbs (2)

15-15: The @base-ui/react v1.0.0 dependency is compatible with React 19. The package includes fixes for inert prop compatibility in React <19, and recent releases include fixes for rendering in React Server Components, indicating active React 19 support. The package is actively maintained by the Material UI team and continues to receive updates for React 19 features.


15-16: Remove "shadcn": "^3.6.2" from production dependencies—this is a CLI tool meant for development.

The "shadcn" package (v3.6.2) is a real npm package, not a nonexistent package as initially suggested. However, the shadcn CLI is used to add components to projects and is typically invoked via npx shadcn@latest at development time, not bundled in production. Move this to devDependencies if it needs to be included at all, or remove it entirely since the CLI is usually run directly via npx.

Likely an incorrect or invalid review comment.

apps/cli/templates/frontend/react/web-base/components.json (1)

21-23: Remove unrecognized fields from components.json.

The fields menuColor and menuAccent are not valid configuration options in shadcn/ui's components.json. These appear to be initialization parameters used during CLI setup (e.g., via query parameters in preset URLs), but should not be included in the final configuration file. Remove them to avoid potential CLI warnings or unexpected behavior. The registries field is valid and should be kept.

Likely an incorrect or invalid review comment.

apps/cli/templates/frontend/react/web-base/src/components/ui/sonner.tsx.hbs (4)

19-19: Handlebars escaping is correct.

The escaped braces \{{ on lines 19 and 34 correctly prevent Handlebars from interpreting them as template variables, as per coding guidelines.

Also applies to: 34-34


44-44: LGTM!

The named export follows standard React conventions.


1-1: Verify framework scope before using next-themes.

next-themes provides theme switching functionality specifically for Next.js applications. If this web-base template is used for non-Next.js React projects (e.g., Vite, Create React App), the useTheme hook will fail at runtime. Either clarify that this template is Next.js-only, or add Handlebars conditionals to use framework detection for alternative theme solutions in non-Next.js environments.


26-33: No changes needed. The CSS variables (--popover, --popover-foreground, --border, --radius) are properly defined in the project's global styles at src/index.css.hbs, with support for both light and dark themes.

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: 13

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (6)
apps/cli/templates/frontend/react/tanstack-router/src/components/mode-toggle.tsx.hbs (1)

17-23: Critical: Nested button structure violates HTML spec and breaks accessibility.

Removing asChild causes DropdownMenuTrigger to render its own button element, which now wraps the Button component (another button). This creates invalid HTML with nested buttons, breaking accessibility and potentially causing click/focus issues.

🔎 Proposed fixes

Option 1 (Recommended): Restore asChild prop

- <DropdownMenuTrigger> + <DropdownMenuTrigger asChild> <Button variant="outline" size="icon">

Option 2: Remove Button component and style DropdownMenuTrigger directly

- <DropdownMenuTrigger> - <Button variant="outline" size="icon"> + <DropdownMenuTrigger className="inline-flex items-center justify-center rounded-md border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 w-10"> <Sun className="h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" /> <Moon className="absolute h-[1.2rem] w-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" /> <span className="sr-only">Toggle theme</span> - </Button> </DropdownMenuTrigger>
apps/cli/templates/frontend/react/react-router/src/components/mode-toggle.tsx.hbs (1)

17-23: Critical: Nested button structure violates HTML spec and breaks accessibility.

Removing asChild causes DropdownMenuTrigger to render its own button element, which now wraps the Button component (another button). This creates invalid HTML with nested buttons, breaking accessibility and potentially causing click/focus issues.

🔎 Proposed fixes

Option 1 (Recommended): Restore asChild prop

- <DropdownMenuTrigger> + <DropdownMenuTrigger asChild> <Button variant="outline" size="icon">

Option 2: Remove Button component and style DropdownMenuTrigger directly

- <DropdownMenuTrigger> - <Button variant="outline" size="icon"> + <DropdownMenuTrigger className="inline-flex items-center justify-center rounded-md border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 w-10"> <Sun className="h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" /> <Moon className="absolute h-[1.2rem] w-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" /> <span className="sr-only">Toggle theme</span> - </Button> </DropdownMenuTrigger>
apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs (1)

40-56: Invalid HTML: DropdownMenuItem creates nested interactive elements.

Without asChild, the DropdownMenuItem renders its default div with role="menuitem", then wraps the Button inside it. This creates nested interactive elements that confuse screen readers and break keyboard navigation patterns.

🔎 Fix: Restore asChild prop
- <DropdownMenuItem> + <DropdownMenuItem asChild> <Button

This merges the menu item's props with the Button, maintaining proper accessibility semantics.

apps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs (1)

28-46: Invalid HTML: DropdownMenuItem creates nested interactive elements.

Without asChild, the menu item's default div role="menuitem" wraps the Button, creating nested interactive elements that break accessibility and keyboard navigation.

🔎 Fix: Restore asChild prop
- <DropdownMenuItem> + <DropdownMenuItem asChild> <Button
apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs (1)

28-44: Invalid HTML: DropdownMenuItem creates nested interactive elements.

Without asChild, the menu item renders a default div with role="menuitem" that wraps the Button, creating improper nesting of interactive elements.

🔎 Fix: Restore asChild prop
-<DropdownMenuItem> +<DropdownMenuItem asChild>	<Button
apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1)

26-42: Invalid HTML: DropdownMenuItem creates nested interactive elements.

The missing asChild prop causes the menu item to render a div with role="menuitem" that wraps the Button, breaking accessibility patterns.

🔎 Fix: Restore asChild prop
- <DropdownMenuItem> + <DropdownMenuItem asChild> <Button
♻️ Duplicate comments (1)
apps/cli/templates/frontend/react/web-base/components.json (1)

3-3: Verify the shadcn/ui style value "base-lyra".

A previous review flagged "base-lyra" as an invalid shadcn/ui style value, suggesting the correct format should be "lyra". Using an invalid style value may cause CLI configuration errors when initializing projects from this template.

Please verify the valid style values in the current shadcn/ui schema:

What are the valid style values for shadcn/ui components.json configuration schema? 
🧹 Nitpick comments (3)
apps/web/src/app/(home)/new/_components/yolo-toggle.tsx (1)

9-12: Use type alias instead of interface per coding guidelines.

As per coding guidelines, TypeScript type aliases should be used instead of interface declarations in .tsx files.

🔎 Proposed refactor
-interface YoloToggleProps { +type YoloToggleProps = { stack: StackState; onToggle: (yolo: string) => void; -} +};
apps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs (1)

40-56: Reconsider Button inside DropdownMenuItem.

Nesting a full <Button> inside a <DropdownMenuItem> creates an unusual interaction pattern. The sign-out action can be handled directly on the menu item, improving consistency with the dropdown's expected behavior.

🔎 Proposed refactor
- <DropdownMenuItem> - <Button - variant="destructive" - className="w-full" - onClick={() => { - authClient.signOut({ - fetchOptions: { - onSuccess: () => { - router.push("/"); - }, - }, - }); - }} - > - Sign Out - </Button> - </DropdownMenuItem> + <DropdownMenuItem + className="text-destructive focus:text-destructive cursor-pointer" + onClick={() => { + authClient.signOut({ + fetchOptions: { + onSuccess: () => { + router.push("/"); + }, + }, + }); + }} + > + Sign Out + </DropdownMenuItem>
apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1)

34-34: Prefer navigation API over location.reload().

Using location.reload() triggers a full page reload, which is less efficient than using the framework's navigation API. Other similar templates in this PR use navigate() or router.push() for smoother transitions.

🔎 Alternative: Use TanStack Router's navigation

First, add the navigate hook at the top of the component:

const navigate = useNavigate();

Then update the sign-out handler:

 onSuccess: () => { - location.reload(); + navigate({ to: "/" }); },
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5dc66c6 and 90b145f.

📒 Files selected for processing (11)
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbs (2 hunks)
  • apps/cli/templates/auth/better-auth/web/react/tanstack-start/src/components/user-menu.tsx.hbs (2 hunks)
  • apps/cli/templates/frontend/react/react-router/src/components/mode-toggle.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/tanstack-router/src/components/mode-toggle.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/web-base/components.json (2 hunks)
  • apps/web/src/app/(home)/new/_components/yolo-toggle.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.hbs

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.hbs: In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle
Escape the '{{' in Handlebars templates like '{{'

Files:

  • apps/cli/templates/frontend/react/react-router/src/components/mode-toggle.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/web/react/tanstack-start/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbs
  • apps/cli/templates/frontend/react/tanstack-router/src/components/mode-toggle.tsx.hbs
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/web/src/app/(home)/new/_components/yolo-toggle.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/web/src/app/(home)/new/_components/yolo-toggle.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/web/src/app/(home)/new/_components/yolo-toggle.tsx
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/web/src/app/(home)/new/_components/yolo-toggle.tsx
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/web/src/app/(home)/new/_components/yolo-toggle.tsx
🧠 Learnings (1)
📚 Learning: 2025-06-08T17:57:33.083Z
Learnt from: Vijayabaskar56 Repo: AmanVarshney01/create-better-t-stack PR: 310 File: apps/cli/templates/frontend/angular/src/app.component.html:1-7 Timestamp: 2025-06-08T17:57:33.083Z Learning: The Angular frontend template uses Tailwind CSS v4, which doesn't require a traditional tailwind.config.js configuration file. 

Applied to files:

  • apps/cli/templates/frontend/react/web-base/components.json
🔇 Additional comments (3)
apps/web/src/app/(home)/new/_components/yolo-toggle.tsx (1)

21-21: LGTM: Valid Tailwind utility simplification.

The change from flex-shrink-0 to shrink-0 is a valid modernization using Tailwind's shorter utility class. Both are functionally equivalent.

apps/cli/templates/frontend/react/web-base/components.json (2)

8-8: No action needed. The CSS path configuration is correct—src/index.css in components.json properly corresponds to the template file src/index.css.hbs.


13-13: No action needed. All configuration fields (iconLibrary, menuColor, menuAccent, and registries) are valid and officially supported in the current shadcn/ui schema.

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

♻️ Duplicate comments (6)
apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1)

20-22: Invalid HTML: DropdownMenuTrigger creates nested buttons.

Without asChild, the trigger renders its default button element wrapping the custom Button, creating invalid nested button HTML.

🔎 Fix: Restore asChild prop
- <DropdownMenuTrigger> + <DropdownMenuTrigger asChild> <Button variant="outline">{user?.name}</Button> </DropdownMenuTrigger>
apps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs (2)

26-28: Nested interactive elements: <Link> inside <Button> is invalid HTML.

Without asChild, the Button renders a <button> element containing an <a> element, which violates HTML spec and causes accessibility issues.

🔎 Proposed fix
- <Button variant="outline"> + <Button variant="outline" asChild> <Link href="/login">Sign In</Link> </Button>

34-36: Nested buttons: <Button> inside <DropdownMenuTrigger> without asChild.

DropdownMenuTrigger renders a button by default. Wrapping another <Button> inside it creates nested <button> elements, which is invalid HTML and breaks keyboard navigation.

🔎 Proposed fix
- <DropdownMenuTrigger> + <DropdownMenuTrigger asChild> <Button variant="outline">{session.user.name}</Button> </DropdownMenuTrigger>
apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs (2)

26-28: Invalid HTML: Button should not wrap Link.

Wrapping a Link inside a Button creates invalid HTML and accessibility issues. Use asChild to merge Button's props with the Link element.

🔎 Fix: Use asChild to compose Button with Link
- <Button variant="outline"> + <Button variant="outline" asChild> <Link to="/login">Sign In</Link> </Button>

34-36: Invalid HTML: DropdownMenuTrigger creates nested buttons.

Removing asChild from DropdownMenuTrigger causes it to render its default button element, which then wraps the custom Button component, creating invalid HTML.

🔎 Fix: Restore asChild prop
- <DropdownMenuTrigger> + <DropdownMenuTrigger asChild> <Button variant="outline">{session.user.name}</Button> </DropdownMenuTrigger>
apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs (1)

22-24: Invalid HTML: DropdownMenuTrigger creates nested buttons.

The missing asChild prop causes the trigger to render its default button element that wraps your custom Button component, resulting in invalid nested button HTML.

🔎 Fix: Restore asChild prop
-<DropdownMenuTrigger> +<DropdownMenuTrigger asChild>	<Button variant="outline">{user?.name}</Button>	</DropdownMenuTrigger>
🧹 Nitpick comments (2)
apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1)

13-13: Handlebars variable should be escaped.

Per coding guidelines, the {{ in Handlebars templates should be escaped as \{{ to prevent template processing issues.

🔎 Proposed fix
-import { api } from "@{{projectName}}/backend/convex/_generated/api"; +import { api } from "@\{{projectName}}/backend/convex/_generated/api";
apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs (1)

14-14: Handlebars variable should be escaped.

Per coding guidelines, the {{ in Handlebars templates should be escaped as \{{ to prevent template processing issues.

🔎 Proposed fix
-import { api } from "@{{projectName}}/backend/convex/_generated/api"; +import { api } from "@\{{projectName}}/backend/convex/_generated/api";
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ad996e and f05a9fe.

📒 Files selected for processing (5)
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs (2 hunks)
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs (2 hunks)
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs (2 hunks)
  • apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.hbs

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.hbs: In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle
Escape the '{{' in Handlebars templates like '{{'

Files:

  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs
🔇 Additional comments (4)
apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1)

24-45: DropdownMenuGroup structure looks good.

The reorganization into a grouped layout with label, separator, email display, and sign-out button improves semantic structure.

apps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs (1)

38-59: DropdownMenuGroup structure is consistent.

The grouped layout with account label, separator, email, and sign-out button aligns with other template variants.

apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs (1)

38-59: DropdownMenuGroup structure is well organized.

The grouped layout with label, separator, email display, and sign-out action is consistent with other template variants.

apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs (1)

26-47: DropdownMenuGroup structure is consistent with other templates.

The grouped layout organizing account information and sign-out action improves readability and semantic structure.

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: 2

🧹 Nitpick comments (1)
apps/cli/src/helpers/core/env-setup.ts (1)

290-302: Clarify "For Expo Web" comment.

The comments on lines 297 and 300 reference "For Expo Web," but port 8081 is the standard Expo dev server port used for all Expo apps (not specific to Expo Web). This could be confusing since Expo Web support doesn't require a separate port. Consider clarifying whether this refers to the Expo dev server generally or if there's a specific Expo Web use case.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f05a9fe and b317e2f.

📒 Files selected for processing (3)
  • apps/cli/src/helpers/core/env-setup.ts (3 hunks)
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs (3 hunks)
  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.hbs

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.hbs: In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle
Escape the '{{' in Handlebars templates like '{{'

Files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/cli/src/helpers/core/env-setup.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/cli/src/helpers/core/env-setup.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/cli/src/helpers/core/env-setup.ts
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/cli/src/helpers/core/env-setup.ts
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/cli/src/helpers/core/env-setup.ts
🧠 Learnings (8)
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/http.ts : HTTP endpoints must be defined in convex/http.ts and require an httpAction decorator 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Convex uses file-based routing; a public function defined in convex/example.ts named f has function reference api.example.f 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ALWAYS use the new function syntax for Convex functions with explicit args, returns, and handler properties 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/schema.ts : Always define your schema in convex/schema.ts and import schema definition functions from convex/server 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the internal object from convex/_generated/api.ts to call internal/private functions registered with internalQuery, internalMutation, or internalAction 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the api object from convex/_generated/api.ts to call public functions registered with query, mutation, or action 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Be strict with types, particularly around id's of documents; if a function takes in an id for a document in the 'users' table, take in Id<'users'> rather than string 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ONLY call an action from another action if you need to cross runtimes; otherwise, pull out shared code into a helper async function and call that directly 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
🔇 Additional comments (7)
apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs (1)

6-14: CORS conditional logic is sound.

The two-tier conditional correctly handles all frontend combinations:

  • Web-only (tanstack-start/next): No CORS needed (same-origin/SSR requests)
  • Web + Native hybrid: CORS enabled for native app requests
  • Native-only or other frontends: CORS enabled

The explicit includes and or helpers align with the coding guideline for explicit conditions in Handlebars templates.

apps/cli/src/helpers/core/env-setup.ts (2)

318-332: LGTM! Conditional environment variable logic is sound.

The logic correctly handles different frontend combinations:

  • When both web and native are present, NATIVE_SITE_URL is used for native authentication
  • When only native is present, SITE_URL serves the native authentication purpose

This aligns well with the comment construction on lines 290-302 and maintains consistency across the configuration.


347-347: Clear comment improvement.

The updated comment explicitly states the authentication purpose, improving code documentation.

apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs (4)

3-9: LGTM! Import structure is clean and conditional.

The conditional imports of crossDomain are properly aligned with their usage in the plugin configuration, importing only when needed for specific frontend combinations.


35-45: LGTM! Trusted origins correctly handle web and native URL combinations.

The conditional logic properly includes:

  • Both web and native site URLs when both frontends are present
  • Only the native site URL when native is the sole frontend
  • Appropriate inclusion of nativeAppUrl for native app deep linking

68-74: LGTM! Convex function syntax is correct.

The getCurrentUser query properly uses the new Convex function syntax with explicit args, returns, and handler properties.

Based on learnings: Uses the required Convex function declaration pattern.


31-31: No changes needed. The createAuth function signature in the template correctly matches current Convex + Better Auth documentation. The official API shows (ctx: GenericCtx<DataModel>) as the standard signature, and the optional optionsOnly parameter exists for advanced use cases to disable logging. The template follows the recommended pattern and requires no verification of call sites.

Likely an incorrect or invalid review comment.

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: 0

♻️ Duplicate comments (1)
apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs (1)

56-59: Verify that jwksRotateOnTokenGenerationError is a supported option.

The past review flagged jwksRotateOnTokenGenerationError: true as an unsupported configuration option for the convex plugin. If still unsupported, only authConfig should be passed.

@convex-dev/better-auth convex plugin jwksRotateOnTokenGenerationError option 
🧹 Nitpick comments (1)
apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs (1)

5-9: Consider using explicit condition instead of generic {{else}}.

Per coding guidelines, prefer explicit conditions in Handlebars templates. The {{else}} block implicitly handles tanstack-start and next frontends.

🔎 Proposed fix
 {{else if (or (includes frontend "tanstack-router") (includes frontend "react-router") (includes frontend "nuxt") (includes frontend "svelte") (includes frontend "solid"))}} import { convex, crossDomain } from "@convex-dev/better-auth/plugins"; -{{else}} +{{else if (or (includes frontend "tanstack-start") (includes frontend "next"))}} import { convex } from "@convex-dev/better-auth/plugins"; {{/if}}
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b317e2f and 0ee9844.

📒 Files selected for processing (2)
  • apps/cli/src/helpers/core/env-setup.ts (2 hunks)
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs (3 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/cli/src/helpers/core/env-setup.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/cli/src/helpers/core/env-setup.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/cli/src/helpers/core/env-setup.ts
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/cli/src/helpers/core/env-setup.ts
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/cli/src/helpers/core/env-setup.ts
**/*.hbs

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.hbs: In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle
Escape the '{{' in Handlebars templates like '{{'

Files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
🧠 Learnings (9)
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the internal object from convex/_generated/api.ts to call internal/private functions registered with internalQuery, internalMutation, or internalAction 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/schema.ts : Always define your schema in convex/schema.ts and import schema definition functions from convex/server 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the api object from convex/_generated/api.ts to call public functions registered with query, mutation, or action 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ALWAYS use the new function syntax for Convex functions with explicit args, returns, and handler properties 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ALWAYS include argument and return validators for all Convex functions (query, internalQuery, mutation, internalMutation, action, internalAction) 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Be strict with types, particularly around id's of documents; if a function takes in an id for a document in the 'users' table, take in Id<'users'> rather than string 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use query, mutation, and action to define public functions; use internalQuery, internalMutation, and internalAction to define private, internal functions 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Convex uses file-based routing; a public function defined in convex/example.ts named f has function reference api.example.f 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ONLY call an action from another action if you need to cross runtimes; otherwise, pull out shared code into a helper async function and call that directly 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
🔇 Additional comments (5)
apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs (2)

29-43: LGTM!

The createAuth function signature correctly uses GenericCtx<DataModel> typing, and the trustedOrigins configuration properly handles all frontend combinations by including the appropriate URLs (siteUrl, nativeSiteUrl, nativeAppUrl) for each scenario.


66-72: LGTM!

The getCurrentUser query follows Convex patterns with proper args/returns validators and correctly uses authComponent.getAuthUser(ctx) to retrieve the authenticated user.

apps/cli/src/helpers/core/env-setup.ts (3)

290-300: LGTM! Conditional comment construction is well-structured.

The conditional building of siteUrlComments based on hasWeb and hasNative correctly generates platform-specific setup instructions. The port numbers (3001 for web, 8081 for native) are consistent with the actual environment variable values configured below.


307-320: LGTM! Native environment variables properly configured.

The addition of NATIVE_SITE_URL alongside EXPO_PUBLIC_CONVEX_SITE_URL correctly supports native platform authentication. The values and comments clearly distinguish between the Convex .site URL and the local Expo Web authentication URL.


335-335: LGTM! Clarifying comment improves developer understanding.

The explicit comment distinguishing the web authentication purpose of SITE_URL provides helpful context and mirrors the commenting pattern used for the native configuration.

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: 2

♻️ Duplicate comments (1)
apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs (1)

54-57: Remove the unsupported jwksRotateOnTokenGenerationError option.

This option was previously flagged as unsupported for the convex plugin. Only authConfig should be passed.

🔎 Proposed fix
- convex({ - authConfig, - jwksRotateOnTokenGenerationError: true, - }), + convex({ authConfig }),
🧹 Nitpick comments (1)
apps/cli/src/helpers/core/post-installation.ts (1)

224-228: Good addition for Unistyles support.

The conditional block appropriately detects the native-unistyles frontend option and provides development build instructions.

💡 Optional: Consider clarifying the command sequence

The instruction text on line 227 mixes a shell command with descriptive text. While acceptable, you could make it more explicit:

- instructions += `\n${pc.yellow( - "NOTE:", - )} Unistyles requires a development build.\n cd apps/native and run ${runCmd} android or ${runCmd} ios\n`; + instructions += `\n${pc.yellow( + "NOTE:", + )} Unistyles requires a development build.\n Run: cd apps/native && ${runCmd} android (or ${runCmd} ios)\n`;

This makes it clearer that users can copy-paste the command.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ee9844 and 54a3de2.

📒 Files selected for processing (8)
  • apps/cli/src/helpers/core/env-setup.ts (2 hunks)
  • apps/cli/src/helpers/core/post-installation.ts (3 hunks)
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs (4 hunks)
  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs (1 hunks)
  • apps/cli/templates/backend/convex/packages/backend/convex/README.md (4 hunks)
  • apps/cli/templates/backend/convex/packages/backend/convex/tsconfig.json.hbs (1 hunks)
  • packages/backend/convex/README.md (4 hunks)
  • packages/backend/convex/tsconfig.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/cli/templates/backend/convex/packages/backend/convex/tsconfig.json.hbs
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/cli/src/helpers/core/env-setup.ts
  • packages/backend/convex/tsconfig.json
🧰 Additional context used
📓 Path-based instructions (6)
**/*.hbs

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.hbs: In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle
Escape the '{{' in Handlebars templates like '{{'

Files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/cli/src/helpers/core/post-installation.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/cli/src/helpers/core/post-installation.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/cli/src/helpers/core/post-installation.ts
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/cli/src/helpers/core/post-installation.ts
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/cli/src/helpers/core/post-installation.ts
🧠 Learnings (18)
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the api object from convex/_generated/api.ts to call public functions registered with query, mutation, or action 

Applied to files:

  • apps/cli/templates/backend/convex/packages/backend/convex/README.md
  • packages/backend/convex/README.md
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use the internal object from convex/_generated/api.ts to call internal/private functions registered with internalQuery, internalMutation, or internalAction 

Applied to files:

  • apps/cli/templates/backend/convex/packages/backend/convex/README.md
  • packages/backend/convex/README.md
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use query, mutation, and action to define public functions; use internalQuery, internalMutation, and internalAction to define private, internal functions 

Applied to files:

  • apps/cli/templates/backend/convex/packages/backend/convex/README.md
  • packages/backend/convex/README.md
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use query, mutation, and action to register public functions that are part of the public API; do NOT use these for sensitive internal functions 

Applied to files:

  • apps/cli/templates/backend/convex/packages/backend/convex/README.md
  • packages/backend/convex/README.md
  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use internalQuery, internalMutation, and internalAction to register private internal functions; these are only callable by other Convex functions 

Applied to files:

  • apps/cli/templates/backend/convex/packages/backend/convex/README.md
  • packages/backend/convex/README.md
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ALWAYS use the new function syntax for Convex functions with explicit args, returns, and handler properties 

Applied to files:

  • apps/cli/templates/backend/convex/packages/backend/convex/README.md
  • packages/backend/convex/README.md
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Convex uses file-based routing; a public function defined in convex/example.ts named f has function reference api.example.f 

Applied to files:

  • apps/cli/templates/backend/convex/packages/backend/convex/README.md
  • packages/backend/convex/README.md
  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ALWAYS include argument and return validators for all Convex functions (query, internalQuery, mutation, internalMutation, action, internalAction) 

Applied to files:

  • apps/cli/templates/backend/convex/packages/backend/convex/README.md
  • packages/backend/convex/README.md
  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Do NOT try to pass the callee function directly into ctx.runQuery, ctx.runMutation, or ctx.runAction; use FunctionReference instead 

Applied to files:

  • apps/cli/templates/backend/convex/packages/backend/convex/README.md
  • packages/backend/convex/README.md
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : When using ctx.runQuery, ctx.runMutation, or ctx.runAction to call a function in the same file, specify a type annotation on the return value to work around TypeScript circularity limitations 

Applied to files:

  • apps/cli/templates/backend/convex/packages/backend/convex/README.md
  • packages/backend/convex/README.md
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Use ctx.runQuery to call a query from a query, mutation, or action; use ctx.runMutation to call a mutation from a mutation or action; use ctx.runAction to call an action from an action 

Applied to files:

  • apps/cli/templates/backend/convex/packages/backend/convex/README.md
  • packages/backend/convex/README.md
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Thoughtfully organize files with public query, mutation, or action functions within the convex/ directory using file-based routing 

Applied to files:

  • packages/backend/convex/README.md
  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : A private function defined in convex/example.ts named g has function reference internal.example.g; nested files follow the directory structure 

Applied to files:

  • packages/backend/convex/README.md
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/schema.ts : Always define your schema in convex/schema.ts and import schema definition functions from convex/server 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : ONLY call an action from another action if you need to cross runtimes; otherwise, pull out shared code into a helper async function and call that directly 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0 Timestamp: 2025-12-03T07:48:26.419Z Learning: Applies to **/*.{html,tsx,ts,jsx,js} : Use HTML imports with `Bun.serve()` for frontend instead of Vite 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs
  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/http.ts : HTTP endpoints must be defined in convex/http.ts and require an httpAction decorator 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR Repo: AmanVarshney01/create-better-t-stack PR: 0 File: .cursor/rules/convex_rules.mdc:0-0 Timestamp: 2025-12-03T07:48:14.714Z Learning: Applies to convex/**/*.ts : Try to use as few calls from actions to queries and mutations as possible to reduce race condition risks from multiple transactions 

Applied to files:

  • apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs
🔇 Additional comments (8)
apps/cli/templates/backend/convex/packages/backend/convex/README.md (1)

9-9: Documentation updates correctly reflect Convex file-based routing conventions.

The changes update module paths and API references to align with the new file-based routing pattern where convex/myFunctions.ts maps to api.myFunctions. All examples are internally consistent and follow Convex best practices with explicit args/returns/handler properties.

Also applies to: 39-39, 48-48, 76-76

packages/backend/convex/README.md (1)

9-9: Duplicate file entry: identical to previous README.

This file appears identical to the previous one. If this is intentional (template + actual package documentation), ensure both stay in sync during future updates. Otherwise, consider consolidating.

Can you clarify whether both file paths (apps/cli/templates/backend/convex/packages/backend/convex/README.md and packages/backend/convex/README.md) are intentional, or if one is a template that gets copied during project generation?

Also applies to: 39-39, 48-48, 76-76

apps/cli/src/helpers/core/post-installation.ts (1)

53-53: LGTM! Improved type safety and extensibility.

The function signature changes add explicit typing for frontend as string[] and accept runCmd to enable dynamic instruction generation. The call site appropriately uses frontend || [] as a defensive fallback.

Also applies to: 197-202

apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs (4)

1-15: LGTM!

Import structure is clean with explicit conditional branches for each frontend type. The new authConfig import aligns with the updated auth configuration pattern.


17-24: URL configuration is correct.

The conditional blocks correctly define siteUrl for web frontends and nativeAppUrl for native frontends. The mutually exclusive branches ensure proper variable scoping.


30-42: Conditional baseURL/trustedOrigins logic handles all frontend combinations correctly.

The branching properly sets:

  • baseURL for server-rendered frontends (tanstack-start/next)
  • trustedOrigins appropriately for each combination of native and web frontends

64-70: Query follows Convex best practices.

The getCurrentUser query correctly uses the explicit function syntax with args, returns, and handler properties as required by Convex conventions. Based on learnings.

apps/cli/templates/auth/better-auth/convex/backend/convex/http.ts.hbs (1)

6-10: The CORS configuration is correct as-is; no changes needed.

The current setup properly distinguishes between framework types:

  • Client-only SPAs (tanstack-router, react-router, nuxt, svelte, solid) require CORS because they make direct HTTP requests from the browser to the Convex backend
  • Server-side frameworks (Next.js, Tanstack Start) do not require CORS since they proxy requests through their own server
  • Native frameworks use a different mechanism with custom URL schemes

Tanstack Start, Next.js, and native frameworks were never in the CORS-enabled branch—they are correctly separated by architecture. Convex + Better Auth supports these frameworks with appropriate configuration patterns, and the current conditional properly routes each to the right setup.

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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/cli/templates/frontend/react/next/src/components/mode-toggle.tsx.hbs (1)

19-25: Add asChild prop to DropdownMenuTrigger to avoid nested button elements.

Removing asChild causes DropdownMenuTrigger to render its own <button> element with the <Button> component nested inside, creating invalid nested buttons. Restore the asChild prop on line 19: <DropdownMenuTrigger asChild>.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 54a3de2 and 6a5a1d2.

📒 Files selected for processing (1)
  • apps/cli/templates/frontend/react/next/src/components/mode-toggle.tsx.hbs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.hbs

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.hbs: In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle
Escape the '{{' in Handlebars templates like '{{'

Files:

  • apps/cli/templates/frontend/react/next/src/components/mode-toggle.tsx.hbs
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: 3

♻️ Duplicate comments (5)
apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1)

28-44: Verify proper composition for interactive Button inside DropdownMenuItem.

Nesting a Button directly inside DropdownMenuItem creates nested interactive elements, which violates accessibility guidelines. Verify the correct Base UI composition pattern for this use case.

What is the correct way to use a button as a DropdownMenuItem in @base-ui/react without creating nested interactive elements? 
apps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs (1)

38-40: Incorrect redirect destination after sign-out.

Redirecting to /dashboard after signing out will likely fail or show an error since the user is no longer authenticated. Redirect to a public route such as / instead.

🔎 Proposed fix
 onSuccess: () => { - navigate({ - to: "/dashboard", - }); + navigate({ + to: "/", + }); },
apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs (1)

38-38: Incorrect redirect destination after sign-out.

Redirecting to /dashboard after signing out will likely fail since the user is no longer authenticated. Redirect to a public route such as / instead.

🔎 Proposed fix
 onSuccess: () => { - router.push("/dashboard"); + router.push("/"); },
apps/cli/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbs (2)

27-29: Invalid HTML: Link wrapping Button creates nested interactive elements.

Wrapping a Button with a Link produces invalid HTML (<a><button></button></a>) and breaks accessibility. The Button component should compose with Link instead.

🔎 Fix: Make Button wrap Link as child
- <Link to="/login"> - <Button variant="outline">Sign In</Button> - </Link> + <Button variant="outline"> + <Link to="/login">Sign In</Link> + </Button>

43-62: Invalid HTML: DropdownMenuItem wrapping Button creates nested interactive elements.

The DropdownMenuItem wraps a Button, creating nested interactive elements that break accessibility and produce invalid HTML structure. The menu item renders with role="menuitem" containing a button element.

🔎 Fix: Use Button as the menu item element

For Base UI, the Button should replace the menu item wrapper entirely:

- <DropdownMenuItem> - - <Button - variant="destructive" - className="w-full" - onClick={() => { + <Button + variant="destructive" + className="w-full" + role="menuitem" + onClick={() => { + authClient.signOut({ + fetchOptions: { + onSuccess: () => { + navigate({ + to: "/", + }); + }, + }, + }); + }} + > + Sign Out + </Button> - authClient.signOut({ - fetchOptions: { - onSuccess: () => { - navigate({ - to: "/", - }); - }, - }, - }); - }} - > - Sign Out - </Button> - </DropdownMenuItem>

Alternatively, if Base UI DropdownMenuItem supports a render prop (similar to DropdownMenuTrigger), use that composition pattern instead.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6a5a1d2 and 9242b78.

📒 Files selected for processing (11)
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs (2 hunks)
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs (2 hunks)
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/fullstack/tanstack-start/src/routes/api/auth/$.ts.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs (2 hunks)
  • apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs (2 hunks)
  • apps/cli/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/next/src/components/mode-toggle.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/react-router/src/components/mode-toggle.tsx.hbs (1 hunks)
  • apps/cli/templates/frontend/react/tanstack-router/src/components/mode-toggle.tsx.hbs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs
  • apps/cli/templates/frontend/react/tanstack-router/src/components/mode-toggle.tsx.hbs
  • apps/cli/templates/auth/better-auth/fullstack/tanstack-start/src/routes/api/auth/$.ts.hbs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.hbs

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.hbs: In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle
Escape the '{{' in Handlebars templates like '{{'

Files:

  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs
  • apps/cli/templates/frontend/react/react-router/src/components/mode-toggle.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/web/react/tanstack-start/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs
  • apps/cli/templates/frontend/react/next/src/components/mode-toggle.tsx.hbs
  • apps/cli/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbs
🔇 Additional comments (5)
apps/cli/templates/frontend/react/next/src/components/mode-toggle.tsx.hbs (1)

19-22: No changes needed—the render prop pattern is correct.

The DropdownMenuTrigger render={<Button ... />} structure properly handles children. In Base UI, children of the Trigger become children of the rendered Button element, so the icons and sr-only span will render inside the button as intended, not as siblings. The code follows the correct Base UI composition API.

apps/cli/templates/frontend/react/react-router/src/components/mode-toggle.tsx.hbs (1)

17-20: The DropdownMenuTrigger render prop usage and component structure are correct for Base UI. With Base UI's render prop pattern, children are direct children of Trigger alongside the rendered component, not nested inside it. This differs from Radix UI's asChild approach and is the intended Base UI composition pattern. The icons will render correctly with the button in the current structure.

Likely an incorrect or invalid review comment.

apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs (1)

35-37: The Base UI DropdownMenuTrigger uses a render prop for composition, not Radix UI's asChild. Radix UI uses an asChild prop, while Base UI uses a render prop. The code correctly implements this pattern: render={} with children text is the documented approach for Base UI.

apps/cli/templates/auth/better-auth/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1)

50-54: LGTM!

Correctly redirects to the home page (/) after sign-out, ensuring the user lands on a public route.

apps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs (1)

22-24: The render prop pattern on DropdownMenuTrigger is the correct Base UI composition API and requires no changes. Base UI uses render props (not asChild like Radix UI) to compose trigger elements with custom components, and the pattern shown—passing a component via render with separate children—is documented and working as intended.

Comment on lines 30 to 48
<DropdownMenuItem>
<Button
variant="destructive"
className="w-full"
onClick={() => {
authClient.signOut({
fetchOptions: {
onSuccess: () => {
navigate({
to: "/dashboard",
});
},
},
},
});
}}
>
Sign Out
</Button>
</DropdownMenuItem>
});
}}
>
Sign Out
</Button>
</DropdownMenuItem>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use Base UI's render prop to compose Button inside DropdownMenuItem.

Nesting a Button directly inside DropdownMenuItem creates nested interactive elements (a div wrapping a button), violating accessibility best practices. In Base UI, use the render prop on DropdownMenuItem to properly compose the Button component instead of nesting it as a child. This ensures correct semantic structure and accessible interactions.

🤖 Prompt for AI Agents
In apps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs around lines 30 to 48, the code nests a Button inside DropdownMenuItem which creates nested interactive elements; change DropdownMenuItem to use its render prop and return the Button from that render callback (forwarding the provided props to the Button, including ref/role/aria attributes), move the onClick handler to the Button and keep the signOut fetchOptions/onSuccess navigate logic intact, and preserve Button attributes (variant="destructive", className="w-full") so the Button is composed correctly by DropdownMenuItem rather than being a nested child. 
Comment on lines +27 to +29
<Link to="/login">
<Button variant="outline">Sign In</Button>
</Link>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Use Base UI's render prop instead of asChild to compose Button with Link.

Base UI uses a render prop, while Radix UI uses an asChild prop. The current Link wrapping Button creates nested interactive elements, which violates HTML semantics and accessibility guidelines. Since this PR migrates to Base UI, use the render prop pattern instead:

- <Link to="/login"> - <Button variant="outline">Sign In</Button> - </Link> + <Button variant="outline" render={<Link to="/login">Sign In</Link>} />

Alternatively, if Button supports href directly, use that approach instead. Use the render prop to compose a Base UI part with your own React components.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Link to="/login">
<Button variant="outline">Sign In</Button>
</Link>
<Button variant="outline" render={<Link to="/login">Sign In</Link>} />
🤖 Prompt for AI Agents
In apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs around lines 27-29, the code currently wraps a Button with a Link which nests interactive elements; replace that pattern by using Base UI Button's render-prop composition (render the Link from inside the Button so the Button delegates rendering to the Link and forwards props/ref), or if Button supports an href prop use that instead; ensure the Link receives the forwarded props/ref and remove the outer Link wrapper so there are no nested interactive elements. 
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

♻️ Duplicate comments (3)
apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs (2)

43-56: Verify that DropdownMenuItem supports the variant prop.

The variant="destructive" prop is used on DropdownMenuItem. Please verify that your UI component library's DropdownMenuItem implementation supports this prop, as it's not a standard Base UI feature.

See the verification script in the review comment for lines 29-42 in apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs.


27-29: Invalid HTML: Link wrapping Button creates nested interactive elements.

Wrapping a Button inside a Link creates nested interactive elements, which violates HTML semantics and breaks accessibility. With Base UI, use the render prop to compose the Button with the Link:

🔎 Fix: Use Base UI render prop to compose Button with Link
- <Link to="/login"> - <Button variant="outline">Sign In</Button> - </Link> + <Button variant="outline" render={<Link to="/login" />}> + Sign In + </Button>

This renders a single anchor element with button styling and props, avoiding nested interactive elements.

apps/cli/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbs (1)

43-58: Verify that DropdownMenuItem supports the variant prop.

The variant="destructive" prop is used on DropdownMenuItem. Please verify that your UI component library's DropdownMenuItem implementation supports this prop, as it's not a standard Base UI feature.

See the verification script in the review comment for lines 29-42 in apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9242b78 and c7711fc.

📒 Files selected for processing (7)
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs (3 hunks)
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs (2 hunks)
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1 hunks)
  • apps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs (3 hunks)
  • apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs (3 hunks)
  • apps/cli/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbs (3 hunks)
  • apps/cli/templates/auth/better-auth/web/react/tanstack-start/src/components/user-menu.tsx.hbs (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • apps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/web/react/tanstack-start/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.hbs

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.hbs: In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle
Escape the '{{' in Handlebars templates like '{{'

Files:

  • apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbs
  • apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs
🔇 Additional comments (3)
apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs (1)

21-23: LGTM! Correct Base UI render prop pattern.

The DropdownMenuTrigger correctly uses the render prop to compose with the Button component, avoiding nested interactive elements. This is the proper Base UI pattern.

apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs (1)

35-37: LGTM! Correct Base UI render prop pattern.

The DropdownMenuTrigger correctly uses the render prop to compose with the Button component, avoiding nested interactive elements.

apps/cli/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbs (1)

35-37: LGTM! Correct Base UI render prop pattern.

The DropdownMenuTrigger correctly uses the render prop to compose with the Button component, avoiding nested interactive elements.

@AmanVarshney01 AmanVarshney01 merged commit b6faf38 into main Dec 20, 2025
4 checks passed
@AmanVarshney01 AmanVarshney01 deleted the update-better-auth-convex-1.4.7 branch December 20, 2025 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants