-
- Notifications
You must be signed in to change notification settings - Fork 238
fix(cli): update convex + better auth templates #730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 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. |
| The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughCentralizes better-auth factory usage across templates, bumps several dependency versions, migrates UI primitives to Changes
Sequence Diagram(s)mermaid Client->>AuthFactory: initialize factory({ convexUrl, convexSiteUrl }) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this 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()withsatisfies AuthConfigis 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
📒 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.tsapps/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.tsapps/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}: Usebun <file>instead ofnode <file>orts-node <file>for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
UseBun.serve()which supports WebSockets, HTTPS, and routes instead ofexpress
Usebun:sqlitemodule for SQLite instead ofbetter-sqlite3
UseBun.redisfor Redis instead ofioredis
UseBun.sqlfor Postgres instead ofpgorpostgres.js
Use built-inWebSocketinstead of thewspackage
PreferBun.fileovernode:fsreadFile/writeFile methods
UseBun.$template literal syntax instead ofexecafor shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server withbun --hot <file>to enable hot reloading during development
Files:
apps/cli/src/helpers/core/auth-setup.tsapps/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 ofwebpackoresbuildfor bundling TypeScript, JavaScript, and CSS files
Files:
apps/cli/src/helpers/core/auth-setup.tsapps/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.tsapps/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.hbsapps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbsapps/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.hbsapps/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-serversimplifies 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
convexBetterAuthReactStartfrom@convex-dev/better-auth/react-startis 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.
apps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs Show resolved Hide resolved
| 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! |
| @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. |
PR Preview ReleaseA preview version has been published for this PR.
Commit: 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@pr730NPM Links
To publish a new preview after more commits, remove and re-add the |
There was a problem hiding this 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
baseURLrelies onprocess.env.EXPO_PUBLIC_CONVEX_SITE_URLwithout 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
getCurrentUserquery correctly follows Convex's new function syntax with explicitargs,returns, andhandlerproperties (as per learnings). However, usingv.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
getAuthfunction callsgetToken()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
📒 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.hbsapps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbsapps/cli/templates/frontend/react/next/src/app/layout.tsx.hbsapps/cli/templates/auth/better-auth/convex/native/base/lib/auth-client.ts.hbsapps/cli/templates/frontend/react/next/src/components/providers.tsx.hbsapps/cli/templates/frontend/react/tanstack-start/src/routes/__root.tsx.hbsapps/cli/templates/auth/better-auth/convex/web/react/next/src/app/api/auth/[...all]/route.ts.hbsapps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/routes/api/auth/$.ts.hbsapps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbsapps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbsapps/cli/templates/frontend/react/next/package.json.hbsapps/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.hbsapps/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.hbsapps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbsapps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbsapps/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.hbsapps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbsapps/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.hbsapps/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.hbsapps/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.hbsapps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbsapps/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.hbsapps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbsapps/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.hbsapps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbsapps/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.hbsapps/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.hbsapps/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.hbsapps/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
reactStartHandlerto a centralizedhandlerfrom@/lib/auth-serveris 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
crossDomainClientimport from@convex-dev/better-auth/client/pluginsis properly documented for Expo configurations, where it's conditionally used for web builds alongsideexpoClientfor 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 ofjwksRotateOnTokenGenerationErrorconfiguration.The convex plugin now includes
jwksRotateOnTokenGenerationError: true, but this option is not documented in the official Better Auth or Convex integration guides. Verify whether:
- This is the recommended default configuration
- It was added specifically to address Cloudflare deployment issues or for another reason
- It should be environment-specific or can remain hardcoded for all targets
27-27: The function signature simplification tofunction createAuth(ctx: GenericCtx<DataModel>)is correct. TheoptionsOnlyparameter 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 bothregisterRoutesandgetAuthmethods.apps/cli/templates/frontend/react/tanstack-start/vite.config.ts.hbs (1)
17-21: LGTM! SSR configuration is appropriate.The conditional
noExternalconfiguration for@convex-dev/better-authensures 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-serversimplifies 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: truefor 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 3001explicitly 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 buildinstead ofnext build --turbofor 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
initialTokenprop correctly passes the token from the route context toConvexBetterAuthProvider, 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
initialTokenprop 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
initialTokenprop is properly passed toConvexBetterAuthProvider, 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
**/*.hbsfiles.⛔ 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 DrizzleLearnt 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 actionLearnt 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.
| ...(Platform.OS === "web" | ||
| ? [crossDomainClient()] | ||
| : [ | ||
| expoClient({ | ||
| scheme: Constants.expoConfig?.scheme as string, | ||
| storagePrefix: Constants.expoConfig?.scheme as string, | ||
| storage: SecureStore, | ||
| }), | ||
| ]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| ...(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, | |
| }), | |
| ]), |
apps/cli/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbs Show resolved Hide resolved
There was a problem hiding this 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: Usebun run buildinstead ofnpm run build.The
prepublishOnlyscript usesnpm 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:
- The suspicious
"shadcn": "^3.6.2"package name- @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 SolidAlso 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 duplicatepointer-events-noneclass.Line 169 contains
pointer-events-nonetwice 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 duplicatepointer-events-noneclass.Line 205 contains
pointer-events-nonetwice 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. SinceuseTheme()returnsstring | undefinedand 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
⛔ Files ignored due to path filters (1)
bun.lockis 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.hbsapps/cli/templates/frontend/react/react-router/package.json.hbsapps/cli/templates/frontend/react/tanstack-router/package.json.hbsapps/cli/templates/frontend/react/web-base/src/components/ui/button.tsx.hbsapps/cli/templates/frontend/react/web-base/src/components/ui/sonner.tsx.hbsapps/cli/templates/frontend/react/web-base/src/components/ui/input.tsx.hbsapps/cli/templates/frontend/react/web-base/src/index.css.hbsapps/cli/templates/frontend/react/web-base/src/components/ui/skeleton.tsx.hbsapps/cli/templates/frontend/react/tanstack-start/package.json.hbsapps/cli/templates/frontend/react/web-base/src/components/ui/card.tsx.hbsapps/cli/templates/frontend/react/web-base/src/components/ui/dropdown-menu.tsx.hbsapps/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 ofnpm run <script>,yarn run <script>, orpnpm 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 installinstead ofnpm install,yarn install, orpnpm 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 ofwebpackoresbuildfor 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.jsonapps/cli/tsconfig.jsontsconfig.jsonapps/cli/package.jsonpackage.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.jsonapps/web/package.jsonapps/cli/tsconfig.jsontsconfig.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.jsonapps/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.jsonapps/cli/tsconfig.jsontsconfig.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.jsonapps/cli/tsconfig.jsonapps/cli/package.jsonpackage.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.hbsapps/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.jsonapps/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.jsonapps/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.jsonapps/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.jsonpackage.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-stackcommand will execute the locally linked CLI from thebun linkstep. 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-dataandpeer-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/checkboxprimitive with appropriate styling. The implementation includes proper accessibility attributes (data-slot,aria-invalidstates), 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/inputprimitive with comprehensive styling. The implementation correctly handles thetypeprop 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.cssintegration.
29-33: Identical chart colors in light and dark modes.The chart color variables (
--chart-1through--chart-5) are now identical between:root(light) and.darkthemes. 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-sansdefinition 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-textanimation, 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
prepublishOnlyscript correctly usesbun run buildas per coding guidelines.package.json (1)
32-50: LGTM!The devDependencies version bumps and
packageManagerupdate tobun@1.3.5look appropriate. Scripts correctly usebun runas per coding guidelines.apps/cli/package.json (2)
31-55: LGTM!The package metadata additions are well-structured for npm publishing:
bincorrectly maps to the ESM CLI entry pointfilesproperly includes bothdistandtemplatesexportsmap provides clean type-safe entry points for ESM consumerstype: "module"is correctly set for ESM package
69-94: LGTM!Dependencies are appropriate for a CLI tool. Notably,
@types/nodeis 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, andindex.d.tsfiles exist in thepackages/create-bts/directory, and the package configuration properly references them in thebin,files,main,types, andexportsfields. 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@latestat development time, not bundled in production. Move this todevDependenciesif 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
menuColorandmenuAccentare 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. Theregistriesfield 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-basetemplate is used for non-Next.js React projects (e.g., Vite, Create React App), theuseThemehook 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 atsrc/index.css.hbs, with support for both light and dark themes.
apps/cli/templates/frontend/react/web-base/src/components/ui/skeleton.tsx.hbs Show resolved Hide resolved
There was a problem hiding this 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
asChildcausesDropdownMenuTriggerto render its own button element, which now wraps theButtoncomponent (another button). This creates invalid HTML with nested buttons, breaking accessibility and potentially causing click/focus issues.🔎 Proposed fixes
Option 1 (Recommended): Restore
asChildprop- <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
asChildcausesDropdownMenuTriggerto render its own button element, which now wraps theButtoncomponent (another button). This creates invalid HTML with nested buttons, breaking accessibility and potentially causing click/focus issues.🔎 Proposed fixes
Option 1 (Recommended): Restore
asChildprop- <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, theDropdownMenuItemrenders 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> <ButtonThis 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> <Buttonapps/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> <Buttonapps/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
asChildprop 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
.tsxfiles.🔎 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 usenavigate()orrouter.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
📒 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.hbsapps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbsapps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbsapps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbsapps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbsapps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbsapps/cli/templates/auth/better-auth/web/react/tanstack-start/src/components/user-menu.tsx.hbsapps/cli/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbsapps/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}: Usebun <file>instead ofnode <file>orts-node <file>for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
UseBun.serve()which supports WebSockets, HTTPS, and routes instead ofexpress
Usebun:sqlitemodule for SQLite instead ofbetter-sqlite3
UseBun.redisfor Redis instead ofioredis
UseBun.sqlfor Postgres instead ofpgorpostgres.js
Use built-inWebSocketinstead of thewspackage
PreferBun.fileovernode:fsreadFile/writeFile methods
UseBun.$template literal syntax instead ofexecafor shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server withbun --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 ofwebpackoresbuildfor 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-0toshrink-0is 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.cssin components.json properly corresponds to the template filesrc/index.css.hbs.
13-13: No action needed. All configuration fields (iconLibrary,menuColor,menuAccent, andregistries) are valid and officially supported in the current shadcn/ui schema.
apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs Outdated Show resolved Hide resolved
...templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs Outdated Show resolved Hide resolved
.../templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs Outdated Show resolved Hide resolved
apps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs Outdated Show resolved Hide resolved
apps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs Outdated Show resolved Hide resolved
apps/cli/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbs Outdated Show resolved Hide resolved
apps/cli/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbs Outdated Show resolved Hide resolved
apps/cli/templates/auth/better-auth/web/react/tanstack-start/src/components/user-menu.tsx.hbs Outdated Show resolved Hide resolved
apps/cli/templates/auth/better-auth/web/react/tanstack-start/src/components/user-menu.tsx.hbs Outdated Show resolved Hide resolved
apps/cli/templates/auth/better-auth/web/react/tanstack-start/src/components/user-menu.tsx.hbs Outdated Show resolved Hide resolved
There was a problem hiding this 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 customButton, 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>withoutasChild.
DropdownMenuTriggerrenders 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
Linkinside aButtoncreates invalid HTML and accessibility issues. UseasChildto 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
asChildfromDropdownMenuTriggercauses it to render its default button element, which then wraps the customButtoncomponent, 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
asChildprop causes the trigger to render its default button element that wraps your customButtoncomponent, 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
📒 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.hbsapps/cli/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbsapps/cli/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbsapps/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.
apps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs Outdated Show resolved Hide resolved
There was a problem hiding this 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
📒 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.hbsapps/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}: Usebun <file>instead ofnode <file>orts-node <file>for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
UseBun.serve()which supports WebSockets, HTTPS, and routes instead ofexpress
Usebun:sqlitemodule for SQLite instead ofbetter-sqlite3
UseBun.redisfor Redis instead ofioredis
UseBun.sqlfor Postgres instead ofpgorpostgres.js
Use built-inWebSocketinstead of thewspackage
PreferBun.fileovernode:fsreadFile/writeFile methods
UseBun.$template literal syntax instead ofexecafor shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server withbun --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 ofwebpackoresbuildfor 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
includesandorhelpers 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_URLis used for native authentication- When only native is present,
SITE_URLserves the native authentication purposeThis 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
crossDomainare 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
nativeAppUrlfor native app deep linking
68-74: LGTM! Convex function syntax is correct.The
getCurrentUserquery properly uses the new Convex function syntax with explicitargs,returns, andhandlerproperties.Based on learnings: Uses the required Convex function declaration pattern.
31-31: No changes needed. ThecreateAuthfunction signature in the template correctly matches current Convex + Better Auth documentation. The official API shows(ctx: GenericCtx<DataModel>)as the standard signature, and the optionaloptionsOnlyparameter 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.
apps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs Outdated Show resolved Hide resolved
There was a problem hiding this 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 thatjwksRotateOnTokenGenerationErroris a supported option.The past review flagged
jwksRotateOnTokenGenerationError: trueas an unsupported configuration option for the convex plugin. If still unsupported, onlyauthConfigshould 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 handlestanstack-startandnextfrontends.🔎 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
📒 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}: Usebun <file>instead ofnode <file>orts-node <file>for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
UseBun.serve()which supports WebSockets, HTTPS, and routes instead ofexpress
Usebun:sqlitemodule for SQLite instead ofbetter-sqlite3
UseBun.redisfor Redis instead ofioredis
UseBun.sqlfor Postgres instead ofpgorpostgres.js
Use built-inWebSocketinstead of thewspackage
PreferBun.fileovernode:fsreadFile/writeFile methods
UseBun.$template literal syntax instead ofexecafor shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server withbun --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 ofwebpackoresbuildfor 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
createAuthfunction signature correctly usesGenericCtx<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
getCurrentUserquery follows Convex patterns with proper args/returns validators and correctly usesauthComponent.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
siteUrlCommentsbased onhasWebandhasNativecorrectly 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_URLalongsideEXPO_PUBLIC_CONVEX_SITE_URLcorrectly 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_URLprovides helpful context and mirrors the commenting pattern used for the native configuration.
There was a problem hiding this 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 unsupportedjwksRotateOnTokenGenerationErroroption.This option was previously flagged as unsupported for the convex plugin. Only
authConfigshould 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-unistylesfrontend 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
📒 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.hbsapps/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}: Usebun <file>instead ofnode <file>orts-node <file>for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
UseBun.serve()which supports WebSockets, HTTPS, and routes instead ofexpress
Usebun:sqlitemodule for SQLite instead ofbetter-sqlite3
UseBun.redisfor Redis instead ofioredis
UseBun.sqlfor Postgres instead ofpgorpostgres.js
Use built-inWebSocketinstead of thewspackage
PreferBun.fileovernode:fsreadFile/writeFile methods
UseBun.$template literal syntax instead ofexecafor shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server withbun --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 ofwebpackoresbuildfor 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.mdpackages/backend/convex/README.mdapps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbsapps/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.mdpackages/backend/convex/README.mdapps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbsapps/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.mdpackages/backend/convex/README.mdapps/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.mdpackages/backend/convex/README.mdapps/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.mdpackages/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.mdpackages/backend/convex/README.mdapps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbsapps/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.mdpackages/backend/convex/README.mdapps/cli/templates/auth/better-auth/convex/backend/convex/auth.ts.hbsapps/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.mdpackages/backend/convex/README.mdapps/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.mdpackages/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.mdpackages/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.mdpackages/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.mdapps/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.hbsapps/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.tsmaps toapi.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.mdandpackages/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
frontendasstring[]and acceptrunCmdto enable dynamic instruction generation. The call site appropriately usesfrontend || []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
authConfigimport aligns with the updated auth configuration pattern.
17-24: URL configuration is correct.The conditional blocks correctly define
siteUrlfor web frontends andnativeAppUrlfor 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:
baseURLfor server-rendered frontends (tanstack-start/next)trustedOriginsappropriately for each combination of native and web frontends
64-70: Query follows Convex best practices.The
getCurrentUserquery correctly uses the explicit function syntax withargs,returns, andhandlerproperties 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.
There was a problem hiding this 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: AddasChildprop to DropdownMenuTrigger to avoid nested button elements.Removing
asChildcauses DropdownMenuTrigger to render its own<button>element with the<Button>component nested inside, creating invalid nested buttons. Restore theasChildprop on line 19:<DropdownMenuTrigger asChild>.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 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
There was a problem hiding this 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
Buttondirectly insideDropdownMenuItemcreates 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
/dashboardafter 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
/dashboardafter 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
Buttonwith aLinkproduces 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
DropdownMenuItemwraps aButton, creating nested interactive elements that break accessibility and produce invalid HTML structure. The menu item renders withrole="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
renderprop (similar to DropdownMenuTrigger), use that composition pattern instead.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 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.hbsapps/cli/templates/frontend/react/react-router/src/components/mode-toggle.tsx.hbsapps/cli/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbsapps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbsapps/cli/templates/auth/better-auth/web/react/tanstack-start/src/components/user-menu.tsx.hbsapps/cli/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbsapps/cli/templates/frontend/react/next/src/components/mode-toggle.tsx.hbsapps/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 arenderprop for composition, not Radix UI'sasChild. 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: Therenderprop pattern onDropdownMenuTriggeris 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.
| <DropdownMenuItem> | ||
| <Button | ||
| variant="destructive" | ||
| className="w-full" | ||
| onClick={() => { | ||
| authClient.signOut({ | ||
| fetchOptions: { | ||
| onSuccess: () => { | ||
| navigate({ | ||
| to: "/dashboard", | ||
| }); | ||
| }, | ||
| }, | ||
| }, | ||
| }); | ||
| }} | ||
| > | ||
| Sign Out | ||
| </Button> | ||
| </DropdownMenuItem> | ||
| }); | ||
| }} | ||
| > | ||
| Sign Out | ||
| </Button> | ||
| </DropdownMenuItem> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. | <Link to="/login"> | ||
| <Button variant="outline">Sign In</Button> | ||
| </Link> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| <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. apps/cli/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs Outdated Show resolved Hide resolved
There was a problem hiding this 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 onDropdownMenuItem. Please verify that your UI component library'sDropdownMenuItemimplementation 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
Buttoninside aLinkcreates nested interactive elements, which violates HTML semantics and breaks accessibility. With Base UI, use therenderprop to compose theButtonwith theLink:🔎 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 onDropdownMenuItem. Please verify that your UI component library'sDropdownMenuItemimplementation 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
📒 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.hbsapps/cli/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbsapps/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
DropdownMenuTriggercorrectly uses therenderprop to compose with theButtoncomponent, 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
DropdownMenuTriggercorrectly uses therenderprop to compose with theButtoncomponent, 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
DropdownMenuTriggercorrectly uses therenderprop to compose with theButtoncomponent, avoiding nested interactive elements.
Damn there are too many changesss
Summary by CodeRabbit
New Features
Updates
Chores
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.