fix(cli): refresh scaffold dependency versions#982
fix(cli): refresh scaffold dependency versions#982AmanVarshney01 wants to merge 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds Better‑Auth Convex templates and auth client wiring, expands CLI config validation and Convex+Better‑Auth frontend compatibility rules, and bumps multiple dependency versions across apps, backend, and template generator files; increases generated template count and adds new React Router auth components/routes. Changes
Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
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.
🧹 Nitpick comments (5)
packages/template-generator/templates/auth/better-auth/convex/web/react/react-router/src/components/user-menu.tsx.hbs (1)
34-41: Consider navigating to/or a dedicated login route after sign-out.Navigating to
/dashboardafter sign-out works because the dashboard shows auth forms when unauthenticated, but this is unconventional UX. Users typically expect to land on a landing page or dedicated login page after signing out.💡 Suggested navigation change
authClient.signOut({ fetchOptions: { onSuccess: () => { - navigate("/dashboard"); + navigate("/"); }, }, });packages/template-generator/templates/auth/better-auth/convex/web/react/react-router/src/routes/dashboard.tsx.hbs (1)
13-16: Query runs for unauthenticated users.
useQuery(api.privateData.get)executes regardless of auth state. While the backend safely returns"Not authenticated", this results in unnecessary network requests for unauthenticated users.Consider moving the query inside the
Authenticatedblock or using a conditional query pattern if Convex supports it.packages/template-generator/templates/auth/better-auth/convex/web/react/react-router/src/components/sign-in-form.tsx.hbs (1)
72-76: Usingerror?.messageas React key may cause collisions.If multiple validation errors have identical messages, React will warn about duplicate keys. Consider using the array index or a unique identifier.
💡 Use index as key
- {field.state.meta.errors.map((error) => ( - <p key={error?.message} className="text-red-500"> + {field.state.meta.errors.map((error, index) => ( + <p key={index} className="text-red-500"> {error?.message} </p> ))}This same pattern appears at lines 95-99 for the password field.
packages/template-generator/templates/auth/better-auth/convex/web/react/react-router/src/components/sign-up-form.tsx.hbs (1)
74-78: Use stable keys for error messages.Using
error?.messageas a React key can cause duplicate key warnings if multiple errors share the same message or if message is undefined. Consider using the index or a combination of field name and index.♻️ Proposed fix
- {field.state.meta.errors.map((error) => ( - <p key={error?.message} className="text-red-500"> + {field.state.meta.errors.map((error, index) => ( + <p key={`name-error-${index}`} className="text-red-500"> {error?.message} </p> ))}Apply similar changes to the email field (lines 97-101) and password field (lines 120-124).
packages/template-generator/templates/frontend/react/react-router/src/root.tsx.hbs (1)
105-105: Consider moving ConvexReactClient instantiation outside the component.The
ConvexReactClientis created inside theAppcomponent body, which means a new instance is created on every render. While this is a pre-existing pattern in the template (not introduced by this PR), moving it outside the component would be more efficient.♻️ Suggested improvement (outside PR scope)
+const convex = new ConvexReactClient(env.VITE_CONVEX_URL); + {{`#if` (eq auth "clerk")}} export default function App({ loaderData }: Route.ComponentProps) { {{else if (eq auth "better-auth")}} export default function App() { {{else}} export default function App() { {{/if}} - const convex = new ConvexReactClient(env.VITE_CONVEX_URL);
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f8219790-cb3a-4cee-8055-8b96c6a76bb9
📒 Files selected for processing (11)
apps/cli/src/index.tsapps/cli/src/utils/compatibility-rules.tsapps/cli/src/utils/config-validation.tsapps/cli/test/auth.test.tspackages/template-generator/src/templates.generated.tspackages/template-generator/templates/auth/better-auth/convex/web/react/react-router/src/components/sign-in-form.tsx.hbspackages/template-generator/templates/auth/better-auth/convex/web/react/react-router/src/components/sign-up-form.tsx.hbspackages/template-generator/templates/auth/better-auth/convex/web/react/react-router/src/components/user-menu.tsx.hbspackages/template-generator/templates/auth/better-auth/convex/web/react/react-router/src/lib/auth-client.ts.hbspackages/template-generator/templates/auth/better-auth/convex/web/react/react-router/src/routes/dashboard.tsx.hbspackages/template-generator/templates/frontend/react/react-router/src/root.tsx.hbs
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/template-generator/src/templates.generated.ts
Summary
Verification
Summary by CodeRabbit
New Features
Chores
Tests