-
-
Notifications
You must be signed in to change notification settings - Fork 3
Bringing Project Back Up to standard #62
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
Caution Review failedThe pull request is closed. WalkthroughThe changes span configuration updates, dependency refactoring, and comprehensive code reorganization across multiple repositories. Authentication has been refactored to use Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SignInUI as "SignIn Component"
participant AuthClient as "@amaxa/auth/client"
participant AuthServer as "Auth API"
User->>SignInUI: Click "Sign In with Google"
SignInUI->>AuthClient: Call signIn.social()
AuthClient->>AuthServer: Process authentication request
AuthServer-->>AuthClient: Return session token
AuthClient-->>SignInUI: Provide session data
SignInUI->>User: Update UI / Redirect
sequenceDiagram
participant Client
participant TRPCContext as "TRPC Provider"
participant QueryHook as "@tanstack/react-query"
participant TRPCServer as "TRPC Endpoint"
Client->>TRPCContext: Initiate data query
TRPCContext->>QueryHook: Trigger useSuspenseQuery / useMutation
QueryHook->>TRPCServer: Send request using queryOptions
TRPCServer-->>QueryHook: Return requested data
QueryHook-->>TRPCContext: Pass data to provider
TRPCContext-->>Client: Component renders with data
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 21
🔭 Outside diff range comments (4)
.nvmrc (1)
1-2
: 💡 Verification agent🧩 Analysis chain
Verify compatibility with the updated Node.js version
The Node.js version has been updated from 20.12 to 22.14, which is a significant version upgrade. Node.js 22 includes new features, performance improvements, and potentially breaking changes.
Make sure all dependencies in your project are compatible with Node 22. Run the following script to check for any potential issues:
🏁 Script executed:
#!/bin/bash # Check for any dependencies that might have compatibility issues with Node 22 npm ls | grep -i deprecated || echo "No deprecated packages found" npm outdatedLength of output: 604
Action Required: Address Missing Dependencies for Node 22 Compatibility
The
.nvmrc
file now correctly specifies Node 22.14. Our dependency checks (usingnpm outdated
) did not report any deprecated or outdated packages that would raise immediate compatibility concerns with Node 22. However, the output ofnpm ls
produced several "missing" dependency errors (e.g.,@amaxa/prettier-config
,@turbo/gen
,prettier
,turbo
, andtypescript
as required bycreate-t3-turbo
). These errors warrant further investigation to ensure that they are a result of workspace configuration and not an indication of unresolved issues that could impact runtime under Node 22.Please:
- Review the missing dependency errors and confirm whether these packages should be installed or handled differently in the workspace.
- Verify that any adjustments made for these dependencies do not introduce incompatibilities under Node 22.
apps/website/src/lib/constants/projects.tsx (1)
22-24
: 💡 Verification agent🧩 Analysis chain
Consider fixing typo in related component.
While not directly part of this PR, I noticed in the related code snippets that the
ProjectContentShell
component has a prop named "titile" instead of "title". You might want to fix this typo in a future update.
🏁 Script executed:
#!/bin/bash # Check if the typo exists in the component file cat apps/website/src/components/project-content/ProjectContentShell.tsx | grep -n "titile"Length of output: 190
Attention: Correct the Typo in the ProjectContentShell Component
I verified that in
apps/website/src/components/project-content/ProjectContentShell.tsx
the prop is indeed misspelled astitile
(line 10 and line 25). Please update the prop name totitle
to ensure consistency.output.txt (1)
1-618
:⚠️ Potential issueAddress critical linting issues affecting the build process.
The output shows numerous TypeScript errors and linting issues across multiple packages, resulting in build failures. The most critical areas to address are:
- TypeScript type errors in the API package related to missing exports in the auth module
- Unsafe type assertions and non-null assertions throughout the codebase
- Unused variables that need to be prefixed with
_
to match naming conventionsThese errors are preventing successful builds in 6 packages. Focus on fixing the errors in this order:
- First address the
@amaxa/auth
module errors since other packages depend on it- Fix the TypeScript errors in
@amaxa/api
related to missing exports- Address the unsafe type assertions that are causing most of the linting errors
For the auth module specifically, there seems to be an issue with loading the TypeScript-eslint rules:
TypeError: Error while loading rule '@typescript-eslint/no-unused-expressions': Cannot read properties of undefined (reading 'allowShortCircuit')
This might indicate an incompatibility between your ESLint version (9.5.0) and the TypeScript-eslint plugin. Consider updating your ESLint configuration or downgrading ESLint to a compatible version.
apps/website/src/app/(marketing)/who-we-are/page.tsx (1)
41-44
:⚠️ Potential issueSVG syntax error
There's a syntax error in the SVG where the
strokeLinecap="round"
attribute is floating outside of any element. It should be included within the path element on line 38.<path d="M1 41C1 41 54 10 81 41C108 72 162 10 189 41C216 72 270 41 270 41" stroke="#BCD96C" strokeWidth="8" + strokeLinecap="round" /> - strokeLinecap="round"
🧹 Nitpick comments (23)
packages/db/drizzle.config.ts (1)
13-13
: Using snake_case casing for database identifiers is a good practiceAdding
casing: "snake_case"
to the Drizzle configuration will enforce snake_case naming for database tables and columns, which is the standard convention for PostgreSQL databases.This ensures consistent naming across your database schema. Make sure that any existing SQL queries or ORM calls that might reference these database entities are updated to use the new snake_case format if they weren't already.
apps/website/src/components/project-content/ProjectContentShell.tsx (1)
9-10
: Typo in Header Property Name
It appears the property key"titile"
is used instead of"title"
. This could lead to confusion or integration issues when accessing the header information. Please rename"titile"
to"title"
for clarity and consistency.apps/website/src/components/project-content/Nyaka.tsx (1)
9-9
: Formatting improvements for consistencyThe removal of trailing spaces in paragraph tags improves code formatting consistency.
Consider implementing an automated formatter like Prettier to handle these kinds of formatting tasks consistently across the codebase, which would reduce the need for manual formatting changes in the future.
Also applies to: 20-20, 37-37
apps/website/src/app/_providers/pageview-tracker.tsx (1)
4-4
: Clean up of import orderingThe reordering of imports doesn't affect functionality but improves code organization.
For consistently maintaining import order across the project, consider using an automated import sorter tool like
eslint-plugin-import
with theimport/order
rule.apps/nextjs/src/app/(home)/_components/project-cards.tsx (1)
13-15
: Query implementation refactored and useless renameTwo issues to address:
- The destructuring contains a useless rename
const { data: data }
- The query has been properly refactored to use React Query's
useSuspenseQuery
Remove the useless rename:
- const { data: data } = useSuspenseQuery( + const { data } = useSuspenseQuery( api.projects.findAll.queryOptions({}), );🧰 Tools
🪛 Biome (1.9.4)
[error] 13-13: Useless rename.
Safe fix: Remove the renaming.
(lint/complexity/noUselessRename)
apps/nextjs/src/app/(home)/events/_components/CreateEvent.tsx (1)
52-64
: Refactored to use React Query's useMutationGood migration from the tRPC-specific mutation hook to the more standardized React Query approach. This change aligns with modern best practices and maintains the same functionality.
However, I notice that
trpc
is declared on line 48 but never used in this component. Consider removing it if it's not needed.- const trpc = useTRPC();
auth-schema.ts (2)
3-11
: Check alignment with existing user table.
These columns closely match a standard user table, but note that the snippet frompackages/db/src/schema.ts
includes additional fields such asstatus
androle
. If you aim to unify schemas, consider adding these fields here or renaming the table to avoid potential duplication.
44-51
: Consider default timestamps forcreatedAt
andupdatedAt
.
Including defaults can improve data consistency if values are not always set at insertion time.apps/nextjs/src/trpc/react.tsx (1)
35-43
: TRPC client configuration looks solid.
The combination ofloggerLink
andhttpBatchStreamLink
is a recommended pattern. Consider applyingtransformer: SuperJSON
at the top-level if you need serialization across all calls, though this is optional.apps/nextjs/src/app/(dashboard)/project/[id]/(root)/_components/ChartData.tsx (1)
42-42
:trpc
variable is unused.
Consider referencingtrpc
for these queries, or remove it if no longer needed.apps/nextjs/src/app/(home)/_components/create-project-dialog.tsx (1)
37-37
: Remove unused variableThe
trpc
constant is declared but never used in this component.- const trpc = useTRPC();
apps/website/src/app/(marketing)/newsletter/page.tsx (1)
137-137
: Fix contradictory font stylesThis line contains both
font-light
andfont-normal
which contradict each other. Choose one style for consistency.- <p className="text-sm font-light font-normal leading-relaxed text-[#3B3B3B] md:text-sm lg:text-sm"> + <p className="text-sm font-light leading-relaxed text-[#3B3B3B] md:text-sm lg:text-sm">apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/update-role-optimistic.tsx (2)
24-24
: Remove unused variableThe
trpc
constant is declared but never used in this component.- const trpc = useTRPC();
43-43
: Remove console.log statementThis debug statement should be removed before deploying to production.
- console.log(permission);
apps/website/src/components/ui/focus-cards.tsx (1)
15-15
: Consider using a proper type instead ofany
The
card
prop is typed asany
, which reduces type safety. Consider using a more specific type or leveraging theCard
interface defined on lines 53-57 for better type checking and autocompletion.- card: any; + card: Card;package.json (1)
6-8
: Consider aligning pnpm minimum version with packageManagerThere's a discrepancy between the minimum pnpm version requirement (>=9.6.0) and the actual packageManager version (10.6.3). Consider aligning these to avoid confusion.
- "pnpm": ">=9.6.0" + "pnpm": ">=10.6.3"apps/nextjs/src/app/(auth)/sign-in/page.tsx (2)
38-83
: Improved authentication flow with better UXThe implementation of the Google sign-in button with loading state and visual feedback is a significant improvement. The use of the SVG icon enhances the user experience.
Consider adding aria-label to the SVG icon for better accessibility:
<svg xmlns="http://www.w3.org/2000/svg" width="0.98em" height="1em" viewBox="0 0 256 262" + aria-label="Google logo" + role="img" >
41-57
: Ensure proper error handling during sign-inThe sign-in process handles the loading state but doesn't appear to handle potential errors. Consider adding error handling.
onClick={async () => { - await signIn.social( + try { + await signIn.social( { provider: "google", callbackURL: "/", }, { onRequest: () => { setLoading(true); }, onResponse: () => { setLoading(false); }, }, - ); + ); + } catch (error) { + setLoading(false); + // Add error handling here, e.g., toast notification + console.error("Sign-in failed:", error); + } }}apps/website/src/app/(marketing)/project/page.tsx (2)
29-54
: Add appropriate ARIA attributes to inline SVG for decorative elements.
If the SVG is purely decorative, consider addingaria-hidden="true"
orrole="presentation"
to improve accessibility.<svg + aria-hidden="true" + role="presentation" viewBox="0 0 325 500" ...
67-83
: Spelling fix suggestion: standardize "LBGTQ+" to "LGBTQ+".
Consider updating the text to match conventional usage.- ...focusing on {" "}<strong>mental health, feminism, and LBGTQ+ representation.</strong>... + ...focusing on {" "}<strong>mental health, feminism, and LGBTQ+ representation.</strong>...packages/db/src/schema.ts (1)
15-22
: Consider providing a default value foremailVerified
.
Currently,emailVerified
isnotNull()
with no default. If new user records typically start unverified, you might wantdefault(false)
to prevent insertion errors.-emailVerified: boolean("email_verified").notNull(), +emailVerified: boolean("email_verified").notNull().default(false),apps/website/src/app/layout.tsx (1)
80-80
: Consider error handling for the analytics providerWhile the PostHog integration looks good, it would be beneficial to ensure that the PostHogProvider handles potential initialization errors gracefully to prevent application crashes if the analytics service is unavailable.
apps/nextjs/src/app/(dashboard)/project/[id]/(root)/layout.tsx (1)
1-1
: Update ESLint disable commentSince you've removed most non-null assertions in this file, consider updating or removing this ESLint disable comment to make it more targeted or to remove it if no longer needed.
-/** eslint-disable @typescript-eslint/no-non-null-assertion */ +// Only disable for the avatar image which we ensure exists +/** eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
packages/api/.cache/tsbuildinfo.json
is excluded by!**/.cache/**
packages/db/.cache/tsbuildinfo.json
is excluded by!**/.cache/**
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (107)
.npmrc
(1 hunks).nvmrc
(1 hunks)apps/nextjs/package.json
(1 hunks)apps/nextjs/src/app/(auth)/sign-in/page.tsx
(1 hunks)apps/nextjs/src/app/(auth)/unverified/page.tsx
(1 hunks)apps/nextjs/src/app/(dashboard)/project/[id]/(root)/_components/ChartData.tsx
(2 hunks)apps/nextjs/src/app/(dashboard)/project/[id]/(root)/layout.tsx
(1 hunks)apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/add-user-form.tsx
(2 hunks)apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/table.tsx
(1 hunks)apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/update-role-optimistic.tsx
(1 hunks)apps/nextjs/src/app/(dashboard)/project/[id]/(root)/settings/_components/update-project-info.tsx
(3 hunks)apps/nextjs/src/app/(dashboard)/project/[id]/(tasks)/tasks/_actions.ts
(2 hunks)apps/nextjs/src/app/(home)/_components/create-project-dialog.tsx
(2 hunks)apps/nextjs/src/app/(home)/_components/project-cards.tsx
(1 hunks)apps/nextjs/src/app/(home)/_components/sidebar.tsx
(2 hunks)apps/nextjs/src/app/(home)/admin/_components/form.tsx
(2 hunks)apps/nextjs/src/app/(home)/admin/_components/table.tsx
(1 hunks)apps/nextjs/src/app/(home)/events/_components/CreateEvent.tsx
(1 hunks)apps/nextjs/src/app/(home)/guides/action-guides/_components/GuideCard.tsx
(2 hunks)apps/nextjs/src/app/(home)/guides/action-guides/_components/create-action-guide.tsx
(2 hunks)apps/nextjs/src/app/(home)/loading.tsx
(4 hunks)apps/nextjs/src/app/_components/flow-provider.tsx
(1 hunks)apps/nextjs/src/app/api/auth/[...all]/route.ts
(1 hunks)apps/nextjs/src/app/api/auth/[...nextauth]/route.ts
(0 hunks)apps/nextjs/src/app/api/trpc/[trpc]/route.ts
(3 hunks)apps/nextjs/src/components/UserMenu.tsx
(2 hunks)apps/nextjs/src/components/calendar-full.tsx
(3 hunks)apps/nextjs/src/components/layout-tabs.tsx
(0 hunks)apps/nextjs/src/lib/auth.ts
(1 hunks)apps/nextjs/src/middleware.ts
(1 hunks)apps/nextjs/src/trpc/query-client.ts
(1 hunks)apps/nextjs/src/trpc/react.tsx
(3 hunks)apps/nextjs/src/trpc/server.ts
(0 hunks)apps/nextjs/src/trpc/server.tsx
(1 hunks)apps/nextjs/tsconfig.json
(1 hunks)apps/nextjs/turbo.json
(1 hunks)apps/website/next.config.js
(1 hunks)apps/website/package.json
(2 hunks)apps/website/src/app/(marketing)/_sections/hero.tsx
(17 hunks)apps/website/src/app/(marketing)/_sections/project-shell.tsx
(6 hunks)apps/website/src/app/(marketing)/_sections/spotlight.tsx
(2 hunks)apps/website/src/app/(marketing)/_sections/take-action.tsx
(2 hunks)apps/website/src/app/(marketing)/layout.tsx
(1 hunks)apps/website/src/app/(marketing)/newsletter/page.tsx
(2 hunks)apps/website/src/app/(marketing)/page.tsx
(5 hunks)apps/website/src/app/(marketing)/program/page.tsx
(22 hunks)apps/website/src/app/(marketing)/project/[id]/page.tsx
(1 hunks)apps/website/src/app/(marketing)/project/page.tsx
(1 hunks)apps/website/src/app/(marketing)/who-we-are/_components/people.tsx
(1 hunks)apps/website/src/app/(marketing)/who-we-are/page.tsx
(4 hunks)apps/website/src/app/_providers/pageview-tracker.tsx
(1 hunks)apps/website/src/app/_providers/posthog-provider.tsx
(1 hunks)apps/website/src/app/layout.tsx
(1 hunks)apps/website/src/components/animated-list-landing.tsx
(1 hunks)apps/website/src/components/apply.tsx
(3 hunks)apps/website/src/components/bento-landing.tsx
(2 hunks)apps/website/src/components/footer.tsx
(3 hunks)apps/website/src/components/header.tsx
(2 hunks)apps/website/src/components/platform/beam-section.tsx
(1 hunks)apps/website/src/components/platform/platform-hero.tsx
(1 hunks)apps/website/src/components/project-content/Gaza.tsx
(3 hunks)apps/website/src/components/project-content/Nyaka.tsx
(3 hunks)apps/website/src/components/project-content/ProjectContentShell.tsx
(1 hunks)apps/website/src/components/project-content/_components/person-card.tsx
(1 hunks)apps/website/src/components/ui/apple-cards.tsx
(4 hunks)apps/website/src/components/ui/bento-grid.tsx
(1 hunks)apps/website/src/components/ui/focus-cards.tsx
(2 hunks)apps/website/src/components/ui/layout-grid.tsx
(1 hunks)apps/website/src/components/ui/linear-gradient.tsx
(1 hunks)apps/website/src/components/ui/magic-card.tsx
(2 hunks)apps/website/src/components/ui/marquee.tsx
(0 hunks)apps/website/src/components/ui/navigation-menu.tsx
(1 hunks)apps/website/src/components/ui/radial-graident.tsx
(1 hunks)apps/website/src/components/ui/shine-border.tsx
(1 hunks)apps/website/src/components/ui/span-cards.tsx
(2 hunks)apps/website/src/components/ui/sticky-scroll-reveal.tsx
(1 hunks)apps/website/src/components/ui/wobble-card.tsx
(1 hunks)apps/website/src/lib/constants/projects.tsx
(4 hunks)apps/website/src/lib/projects.ts
(11 hunks)apps/website/src/lib/utils.ts
(1 hunks)apps/website/tailwind.config.ts
(2 hunks)apps/website/tsconfig.json
(0 hunks)apps/website/turbo.json
(1 hunks)auth-schema.ts
(1 hunks)output.txt
(1 hunks)package.json
(2 hunks)packages/api/package.json
(1 hunks)packages/api/src/trpc.ts
(2 hunks)packages/api/tsconfig.json
(0 hunks)packages/auth/package.json
(2 hunks)packages/auth/src/actions.ts
(0 hunks)packages/auth/src/auth.ts
(1 hunks)packages/auth/src/client.ts
(1 hunks)packages/auth/src/config.ts
(0 hunks)packages/auth/src/index.rsc.ts
(1 hunks)packages/auth/src/index.ts
(1 hunks)packages/auth/src/middleware.ts
(1 hunks)packages/auth/src/permissions.ts
(0 hunks)packages/auth/src/types.ts
(1 hunks)packages/auth/tsconfig.json
(1 hunks)packages/auth/tsup.config.ts
(1 hunks)packages/db/drizzle.config.ts
(1 hunks)packages/db/package.json
(1 hunks)packages/db/src/client.ts
(1 hunks)packages/db/src/schema.ts
(5 hunks)packages/db/tsconfig.json
(0 hunks)packages/ui/package.json
(1 hunks)
⛔ Files not processed due to max files limit (24)
- packages/ui/src/button.tsx
- packages/ui/src/carousel.tsx
- packages/ui/src/chart.tsx
- packages/ui/src/command.tsx
- packages/ui/src/dialog.tsx
- packages/ui/src/navigation-menu.tsx
- packages/ui/src/sheet.tsx
- pnpm-workspace.yaml
- tooling/eslint/base.js
- tooling/eslint/package.json
- tooling/eslint/react.js
- tooling/eslint/tsconfig.json
- tooling/eslint/types.d.ts
- tooling/github/setup/action.yml
- tooling/prettier/index.js
- tooling/prettier/package.json
- tooling/prettier/tsconfig.json
- tooling/tailwind/package.json
- tooling/tailwind/tsconfig.json
- tooling/typescript/base.json
- tooling/typescript/internal-package.json
- turbo.json
- turbo/generators/templates/package.json.hbs
- turbo/generators/templates/tsconfig.json.hbs
💤 Files with no reviewable changes (10)
- packages/db/tsconfig.json
- apps/website/tsconfig.json
- packages/api/tsconfig.json
- apps/nextjs/src/components/layout-tabs.tsx
- apps/website/src/components/ui/marquee.tsx
- apps/nextjs/src/trpc/server.ts
- packages/auth/src/permissions.ts
- packages/auth/src/actions.ts
- packages/auth/src/config.ts
- apps/nextjs/src/app/api/auth/[...nextauth]/route.ts
🧰 Additional context used
🧬 Code Definitions (15)
packages/auth/src/types.ts (1)
packages/auth/src/auth.ts (1)
auth
(37-37)
auth-schema.ts (1)
packages/db/src/schema.ts (4)
user
(15-30)session
(38-49)account
(51-67)verification
(69-76)
apps/nextjs/src/middleware.ts (1)
packages/auth/src/middleware.ts (1)
authMiddleware
(7-24)
packages/auth/src/index.rsc.ts (2)
packages/auth/src/index.ts (1)
getSession
(4-7)packages/auth/src/auth.ts (1)
auth
(37-37)
apps/website/src/app/(marketing)/_sections/spotlight.tsx (1)
apps/website/src/lib/projects.ts (1)
SpotlightData
(1-9)
packages/auth/src/auth.ts (1)
apps/nextjs/src/middleware.ts (1)
config
(6-8)
apps/website/src/lib/constants/projects.tsx (1)
apps/website/src/components/project-content/ProjectContentShell.tsx (1)
ProjectContentShell
(8-63)
apps/website/src/app/(marketing)/newsletter/page.tsx (1)
apps/website/src/components/apply.tsx (1)
ApplyButton
(70-79)
apps/nextjs/src/components/UserMenu.tsx (3)
auth-schema.ts (2)
session
(13-24)user
(3-11)packages/auth/src/index.rsc.ts (1)
getSession
(5-8)packages/auth/src/index.ts (1)
getSession
(4-7)
apps/website/src/components/ui/apple-cards.tsx (2)
apps/website/src/components/ui/focus-cards.tsx (1)
Card
(8-49)apps/website/src/components/ui/span-cards.tsx (1)
Card
(42-61)
apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/update-role-optimistic.tsx (1)
apps/nextjs/src/lib/types/index.tsx (1)
ProjectRoles
(1-1)
apps/website/src/components/ui/focus-cards.tsx (2)
apps/website/src/lib/utils.ts (1)
cn
(42-44)apps/website/src/components/ui/apple-cards.tsx (1)
Card
(150-194)
apps/website/src/app/(marketing)/_sections/hero.tsx (1)
apps/website/src/components/apply.tsx (1)
ApplyButton
(70-79)
apps/nextjs/src/trpc/server.tsx (3)
apps/nextjs/src/trpc/react.tsx (1)
createTRPCContext
(30-30)packages/api/src/trpc.ts (1)
createTRPCContext
(28-36)apps/nextjs/src/trpc/query-client.ts (1)
createQueryClient
(7-33)
packages/db/src/schema.ts (1)
auth-schema.ts (4)
user
(3-11)account
(26-42)session
(13-24)verification
(44-51)
🪛 Biome (1.9.4)
apps/nextjs/src/app/(home)/_components/project-cards.tsx
[error] 13-13: Useless rename.
Safe fix: Remove the renaming.
(lint/complexity/noUselessRename)
🪛 GitHub Actions: CI
packages/auth/src/auth.ts
[error] 1-1: ESLint: Error while loading rule '@typescript-eslint/no-unused-expressions': Cannot read properties of undefined (reading 'allowShortCircuit')
🪛 GitHub Check: lint
apps/website/src/app/(marketing)/_sections/hero.tsx
[warning] 49-49:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong
[warning] 49-49:
Forbidden non-null assertion
[warning] 258-258:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong
[warning] 258-258:
Forbidden non-null assertion
[warning] 287-287:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong
[warning] 287-287:
Forbidden non-null assertion
[warning] 286-286:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong
[warning] 286-286:
Forbidden non-null assertion
[warning] 313-313:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong
[warning] 313-313:
Forbidden non-null assertion
🔇 Additional comments (195)
apps/website/src/app/(marketing)/layout.tsx (1)
2-2
: LGTM!This is a minor formatting change adding a blank line after the import statement, which improves readability.
apps/website/src/components/animated-list-landing.tsx (1)
73-73
: LGTM!This change removes a trailing whitespace in the className string, which is a good practice for code cleanliness.
apps/website/src/components/platform/beam-section.tsx (1)
31-31
: Clean formatting improvement.The extra space has been removed from the className attribute, improving code consistency.
packages/auth/src/types.ts (1)
1-3
: Good type export for enhanced type safety.Exporting the
Session
type from the auth module provides proper type definitions for session handling throughout the application, enhancing type safety when working with authentication.apps/nextjs/src/app/api/auth/[...all]/route.ts (1)
1-5
: Clean implementation of auth route handlers.The code effectively creates API route handlers for both GET and POST methods using the auth handlers from the authentication module. This is a standard pattern for Next.js API routes and follows best practices for route handling.
apps/website/src/components/platform/platform-hero.tsx (1)
54-54
: Clean formatting improvement.The extra space has been removed from the className attribute, improving code consistency.
apps/website/src/components/project-content/ProjectContentShell.tsx (1)
38-41
: Cosmetic Formatting Update in Paragraph Element
The trailing whitespace removal in the<p>
tag improves code consistency without affecting functionality.apps/website/src/components/ui/layout-grid.tsx (1)
32-32
: Cleaned Up ClassName Formatting
The adjustment to the<div>
element'sclassName
(removing an extra space) enhances consistency and readability without impacting functionality.packages/auth/src/client.ts (1)
1-4
: Solid Initialization of the Authentication Client
The new file cleanly imports and initializes the auth client usingcreateAuthClient
from"better-auth/react"
, and it neatly exports the key authentication methods (signIn
,signOut
,signUp
,useSession
). Confirm that any existing references in the codebase have been updated to use this new API.apps/website/src/app/_providers/posthog-provider.tsx (1)
5-6
: Improved Import Order for PostHog Modules
Reordering the imports to groupposthog
andPostHogProvider
together aids in code readability and reflects a clear separation of concerns. No functional changes are introduced.apps/website/src/components/ui/bento-grid.tsx (1)
1-1
: Adopting Type-Only Import for ReactNode
Switching to a type-only import forReactNode
is a best practice; it clarifies that the import is used solely for type checking and avoids unnecessary inclusion in the runtime bundle.apps/nextjs/src/trpc/query-client.ts (1)
20-27
: Well-documented error handling configuration for Next.js 15 compatibilityThe addition of
shouldRedactErrors
function with clear comments is excellent. This change correctly configures error handling for compatibility with Next.js 15's approach to detecting dynamic pages while letting Next.js handle error redaction with its own improved mechanisms.apps/website/src/app/(marketing)/project/[id]/page.tsx (1)
2-4
: Improved import organizationThe reordering of imports and adjustment of blank lines improves code readability without affecting functionality.
apps/website/src/components/ui/linear-gradient.tsx (1)
1-1
: Improved import syntax using type-only import.The change to a type-only import for
CSSProperties
is a good practice since this is only used for type checking. This helps clarify intent and may lead to slightly smaller bundle sizes as type imports are removed during transpilation.apps/website/turbo.json (1)
1-13
: Good addition of Turborepo configuration.This new file correctly configures Turborepo with:
- Proper schema reference
- Inheritance from base configuration
- Appropriate build dependencies and output definitions
- Correct persistent flag for dev task
This will improve build and development workflows in the monorepo.
apps/nextjs/src/app/(auth)/unverified/page.tsx (1)
12-12
:✅ Verification successful
Potential null reference issue by removing optional chaining.
The removal of optional chaining (
?.
) when accessingauth.user.status
could lead to runtime errors ifauth
orauth.user
is undefined.Verify that
auth.user
is guaranteed to be defined at this point or restore the optional chaining:-if (auth.user.status === "Unverified" || auth.user.status === "Pending") { +if (auth.user?.status === "Unverified" || auth.user?.status === "Pending") {
🏁 Script executed:
#!/bin/bash # Check if auth.user is guaranteed to be defined by checking the checkAuth implementation # First, let's look at the checkAuth implementation if [ -f "apps/nextjs/src/lib/auth.ts" ]; then echo "=== Checking auth implementation ===" cat "apps/nextjs/src/lib/auth.ts" fi # Let's also check if there are any other references to auth.user without optional chaining echo -e "\n=== Checking for other direct references to auth.user ===" rg -A 2 -B 2 "auth\.user" --no-ignore | grep -v "auth\.user\?"Length of output: 1282
Verification confirmed: Removal of optional chaining is safe in this context.
The check in the
checkAuth
implementation ensures that if no session is returned (i.e.auth
is null), a redirection to/sign-in
is triggered. This, along with similar usage patterns elsewhere (e.g., in the dashboard layout), indicates that when execution reaches this point,auth.user
is guaranteed to be defined, making the use ofauth.user.status
safe without optional chaining.apps/website/tailwind.config.ts (2)
3-3
: Added missing semicolon for consistent code style.Good change to maintain code style consistency.
95-95
: Added missing semicolon for consistent code style.Properly terminated the statement with a semicolon, which maintains consistency in the codebase.
apps/nextjs/turbo.json (1)
1-13
: Well-structured Turborepo configurationThis new configuration file properly sets up Turborepo for the Next.js application with appropriate task definitions for build and dev processes. The configuration correctly specifies build dependencies and output files, which will improve the build efficiency in the monorepo setup.
apps/website/next.config.js (1)
7-11
: Consistent string quote styleThe change from single quotes to double quotes for string properties maintains consistency with the project's coding style. This type of standardization improves code readability across the codebase.
apps/website/src/components/ui/wobble-card.tsx (1)
47-47
: Cleaned up className formattingThe removal of extra whitespace in the className string improves code cleanliness and consistency. This type of formatting standardization helps maintain a more readable codebase.
apps/nextjs/src/app/_components/flow-provider.tsx (1)
14-14
: Removed SessionProvider wrapperThe SessionProvider has been removed from the component hierarchy. This change aligns with the broader authentication refactoring mentioned in the PR summary, which now uses the new auth module instead of the previous session-based approach.
Make sure this change doesn't break authentication in the Flow components. Verify that any components using session data within the ReactFlow context can still access it through the new authentication mechanism.
apps/website/src/components/ui/radial-graident.tsx (1)
1-1
: Good use of type-only import.Changing to a type-only import is a TypeScript best practice as it clarifies that
CSSProperties
is only used for type checking and not at runtime, which can help with tree-shaking and bundle size optimization.apps/website/src/components/project-content/_components/person-card.tsx (1)
17-17
: Good cleanup of whitespace in className string.Removing the extra whitespace in the className string improves code consistency and readability without affecting functionality.
apps/nextjs/src/lib/auth.ts (2)
3-3
: Good authentication module refactoring.Importing
getSession
from the new auth module aligns with the PR objective of updating to the latest tech. This is part of a broader refactoring of authentication handling across the codebase.
6-6
:✅ Verification successful
Consistent implementation of new auth pattern.
Replacing
auth()
withgetSession()
maintains the same functionality while using the updated authentication pattern. This change should be applied consistently across all auth-related files.
🏁 Script executed:
#!/bin/bash # Verify that the auth to getSession migration is consistent across the codebase echo "Checking for remaining usage of the old auth() function:" rg "await auth\(\)" --type ts echo "\nChecking adoption of new getSession() function:" rg "await getSession\(\)" --type tsLength of output: 645
Verified Consistent Usage of Updated Auth Pattern
The shell script confirms that all usages of the old
auth()
have been replaced withgetSession()
across the codebase. Specifically, the following files correctly adopt the new auth pattern:
apps/nextjs/src/lib/auth.ts
apps/nextjs/src/components/UserMenu.tsx
apps/nextjs/src/app/(home)/_components/sidebar.tsx
apps/nextjs/src/app/(dashboard)/project/[id]/(tasks)/tasks/_actions.ts
No instances of the old
auth()
remain, so the updated authentication implementation is consistent.apps/nextjs/src/app/(home)/loading.tsx (4)
1-2
: Import statements have been formatted with semicolons.The import statements now include semicolons, providing consistent formatting throughout the codebase.
15-18
: Props formatting improves readability.The Card component props have been reformatted to place each prop on its own line, enhancing code readability and consistency with modern React formatting practices.
33-36
: Consistent prop formatting applied to second Card instance.Similar formatting improvements have been applied to the second Card component instance, maintaining consistency throughout the file.
49-49
: Function return statement formatting.The closing parenthesis for the return statement has been properly formatted, providing clean code structure.
apps/website/src/components/ui/navigation-menu.tsx (1)
72-72
: Removed trailing whitespace from className string.The trailing whitespace in the className string has been removed, improving code cleanliness. This is a good practice to maintain consistent formatting.
packages/db/src/client.ts (1)
6-10
:❓ Verification inconclusive
Updated drizzle initialization to use the new API format.
The drizzle client initialization has been updated to match the newer API format, using an object with
client
,schema
, andcasing
properties. This change aligns with the drizzle-orm upgrade from ^0.31.2 to ^0.41.0 mentioned in the package.json changes.The addition of
casing: "snake_case"
ensures consistent naming conventions between your database and code.
🏁 Script executed:
#!/bin/bash # Check if other places in the codebase are using the updated drizzle initialization pattern # Look for any other drizzle initializations that might need updating rg "drizzle\(.*\)" --type ts --not-file "packages/db/src/client.ts"Length of output: 509
Drizzle Initialization Update Verification
The drizzle client initialization in
packages/db/src/client.ts
(lines 6–10) now correctly uses the new API format with an object containing theclient
,schema
, andcasing
properties. This update aligns with the upgrade to drizzle-orm ^0.41.0 and ensures that snake_case naming is enforced between your database and code.To double-check that there aren’t any residual instances of the old initialization pattern elsewhere in the codebase, please run the following script manually:
#!/bin/bash # Verify that no deprecated drizzle initialization patterns are present outside of packages/db/src/client.ts rg "drizzle\s*\(" -g '!packages/db/src/client.ts' --type tsIf additional occurrences are found, please update them accordingly. Otherwise, you can proceed with approving the change.
apps/website/src/components/bento-landing.tsx (2)
44-44
: Removed trailing whitespace from Marquee className.The trailing whitespace in the Marquee component's className has been removed, improving code cleanliness.
58-58
: Removed trailing whitespace from figcaption className.The trailing whitespace in the figcaption element's className has been removed, maintaining consistent formatting.
apps/website/src/components/ui/shine-border.tsx (1)
41-41
: Code cleanup - good spacing adjustment.Removed an extra space in the className string which improves code formatting consistency.
apps/website/src/components/ui/sticky-scroll-reveal.tsx (2)
2-2
: Looks good.Proper spacing in the import section.
5-5
: Good import organization.Consolidated the motion-related imports into a single import statement, which improves code cleanliness and maintainability.
apps/website/src/components/project-content/Gaza.tsx (1)
11-11
: Good formatting cleanup.Removed trailing spaces in the paragraph opening tags, improving code consistency and cleanliness.
Also applies to: 24-24, 40-40
apps/website/src/components/ui/magic-card.tsx (2)
4-5
: Improved TypeScript imports.Changed to a type-only import for the React types and separated the runtime hooks import, which is a better practice that clearly distinguishes between type imports and runtime imports.
45-45
: More concise type declaration.Changed the type annotation from
Array<HTMLElement>
to the more conciseHTMLElement[]
syntax, which is the preferred TypeScript array type notation.packages/auth/tsup.config.ts (1)
1-12
: Configuration for TypeScript bundling looks well structured.This is a well-configured tsup setup for bundling the authentication module. The configuration properly defines the entry point, supports both ESM and CJS formats, and generates TypeScript declaration files.
apps/nextjs/src/middleware.ts (1)
1-3
: Good simplification of authentication middleware.Refactoring to use the centralized
authMiddleware
from the auth package is a positive change that improves maintainability and consistency. This aligns well with the project's goal of updating to the latest tech stack.apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/table.tsx (1)
8-16
: Good refactoring to separate React Query from TRPCThe migration from TRPC's built-in React Query hooks to using React Query directly with TRPC's query options is a good architectural improvement. It provides better separation of concerns and aligns with modern best practices.
apps/nextjs/tsconfig.json (2)
4-4
: Casing change in TypeScript lib optionThe casing change from "es2022" to "ES2022" is a minor standardization. This aligns with the official TypeScript documentation which uses uppercase for ECMAScript version names.
7-9
:❓ Verification inconclusive
Removed path alias may require import updates
The removal of the
"@/*"
path alias could affect existing import statements throughout the codebase. Ensure all imports have been updated to use the"~/*"
alias instead.Run this script to check if there are still imports using the removed alias pattern:
🏁 Script executed:
#!/bin/bash # Find any remaining imports using the @/* pattern echo "Checking for imports using the removed @/* pattern..." rg "from\s+['\"]@/" --type=tsx --type=tsLength of output: 189
Below is an updated review comment. It now includes instructions to run a revised verification script (using a glob pattern for both TS and TSX files) to ensure that no residual
@/*
imports remain. The tag has been appended since we now need further manual verification with the new script.
Action Required: Verify Removal of the
@/*
AliasFile: apps/nextjs/tsconfig.json (Lines 7-9)
Snippet:
"paths": { "~/*": ["./src/*"] },Comment:
The previous removal of the"@/*"
alias may still affect import statements if any instances remain in the codebase. The initial verification script encountered a file type error with TSX files. Please re-run the updated verification script below to search for any imports using the old alias:#!/bin/bash # Revised check for imports using the removed @/* pattern across TS and TSX files echo "Checking for imports using the removed @/* pattern in .ts and .tsx files..." rg "from\s+['\"]@/" -g "*.{ts,tsx}"If any imports are found that still reference
"@/*"
, update them to use"~/*"
instead.apps/nextjs/src/app/(home)/guides/action-guides/_components/GuideCard.tsx (2)
3-3
: Added "use client" directiveAdding the "use client" directive is good as it explicitly marks this component as a client component in Next.js, which is necessary when using hooks and client-side APIs.
19-25
: Good refactoring to separate React Query from TRPCThe migration from TRPC's built-in React Query hooks to using React Query directly with TRPC's query options is a good architectural improvement that provides better separation of concerns.
apps/nextjs/src/app/(dashboard)/project/[id]/(tasks)/tasks/_actions.ts (2)
6-6
: Authentication method updated to usegetSession
This change aligns with the broader refactoring to standardize authentication patterns across the application.
56-56
: Authentication implementation properly updatedThe implementation has been correctly updated to use
getSession()
instead ofauth()
while maintaining the same security check for user authentication.apps/nextjs/src/app/(home)/admin/_components/form.tsx (3)
29-29
: React Query import added correctlyThis aligns with the standardization to use React Query directly for data mutations.
41-44
: Type changed to interfaceThis is a minor styling change that doesn't affect functionality.
49-61
: Mutation implementation refactored to use React Query directlyThe code has been updated to use React Query's
useMutation
with TRPC'smutationOptions
. This is a good refactoring that maintains the same functionality while standardizing the approach to mutations.apps/nextjs/src/app/(home)/_components/project-cards.tsx (1)
9-9
: React Query import added correctlyThis aligns with the standardization to use React Query directly for data fetching.
apps/nextjs/src/app/(dashboard)/project/[id]/(root)/settings/_components/update-project-info.tsx (2)
30-30
: React Query import added correctlyThis aligns with the standardization to use React Query directly for data mutations.
62-72
: Mutation implementation refactored to use React Query directlyThe code has been updated to use React Query's
useMutation
with TRPC'smutationOptions
. This is a good refactoring that maintains the same functionality while standardizing the approach to mutations.apps/website/src/app/(marketing)/who-we-are/_components/people.tsx (1)
22-22
: Class name reorganization looks good!The restructuring of class names maintains the same styling while improving consistency with other components in the project.
Also applies to: 24-26, 29-32
packages/auth/tsconfig.json (1)
4-6
: TypeScript compiler options have been enhanced!The added compiler options improve the project's TypeScript configuration:
downlevelIteration
: Enables better array/iterable support in older JavaScript environmentsuseDefineForClassFields
: Ensures class fields follow ECMAScript standardsskipLibCheck
: Improves build performance by skipping type checking of declaration filesThese are beneficial changes that follow modern TypeScript best practices.
apps/nextjs/src/app/(home)/_components/sidebar.tsx (1)
6-6
: Auth module refactoring looks goodThe change from
auth()
togetSession()
is consistent with the broader authentication refactoring mentioned in the summary. The new approach maintains the same functional behavior while standardizing session management across the codebase.Also applies to: 19-19
apps/website/src/app/(marketing)/page.tsx (2)
5-9
: Import reorganization looks goodThe reordering of imports improves code readability and organization.
120-168
: Spotlight data structure improvedConverting the spotlight data to a structured array with consistent fields improves maintainability and makes the code more readable.
apps/website/src/lib/utils.ts (1)
1-2
: TypeScript type import improvementSeparating the type import from the value import follows TypeScript best practices. Using
import type
ensures that type information doesn't affect the runtime bundle.apps/nextjs/src/app/api/trpc/[trpc]/route.ts (2)
4-6
: Added Edge runtime and improved type safetyThe changes add proper TypeScript typing for the request parameter and explicitly set the Edge runtime, which should improve performance for this API route.
27-43
:✅ Verification successful
Authentication pattern updated
The
auth
wrapper has been removed from the handler function, which aligns with the broader authentication refactoring in the codebase. The authentication is now likely handled in thecreateTRPCContext
function instead.Let's verify that authentication is properly maintained in this new approach:
🏁 Script executed:
#!/bin/bash # Search for how createTRPCContext handles authentication now grep -rn "createTRPCContext" --include="*.ts" --include="*.tsx" . | head -10 cat $(find . -path "*packages/api/src/trpc*" -type f | head -1)Length of output: 4045
Authentication Refactoring Verified: Authentication is properly managed via the new context
The removal of the auth wrapper from the handler in
apps/nextjs/src/app/api/trpc/[trpc]/route.ts
is correct. The updatedcreateTRPCContext
inpackages/api/src/trpc.ts
now retrieves the session viaauth.api.getSession
using the request headers, and theprotectedProcedure
further ensures that only authenticated users are granted access. This confirms that the overall approach to authentication refactoring is sound.
- Verified that
createTRPCContext
correctly fetches the session using theauth.api.getSession
call.- Confirmed that the authentication check in
protectedProcedure
is appropriately implemented.apps/website/src/components/header.tsx (1)
2-17
: Improved import organizationThe imports have been reorganized to follow a more consistent pattern, with client-side React imports at the top, followed by UI component imports. This improves code readability and maintainability.
apps/nextjs/src/components/UserMenu.tsx (2)
4-4
: Authentication approach updatedImport changed from
auth
togetSession
, aligning with the codebase's authentication refactoring.
20-20
: Updated session retrieval methodThe session retrieval now uses the new
getSession()
function instead ofauth()
, which is part of the broader authentication refactoring.apps/website/src/components/apply.tsx (5)
2-8
: Improved import organizationThe imports have been reorganized for better readability, with React imports at the top, followed by next/navigation, then UI components. This follows best practices for import ordering.
34-34
: Reordered CSS classesThe CSS classes have been reordered but maintain the same styling. This is likely for consistency with the project's CSS class ordering conventions.
43-43
: Reordered CSS classesThe CSS classes have been reordered but maintain the same styling. This is likely for consistency with the project's CSS class ordering conventions.
51-55
: Reordered CSS classes and component propertiesThe CSS classes have been reordered and the
ArrowRight
component's className properties have been reordered fromw-5 h-5
toh-5 w-5
. This maintains the same styling but follows a more consistent pattern.
61-61
: Reordered CSS classesThe CSS classes have been reordered but maintain the same styling. This is likely for consistency with the project's CSS class ordering conventions.
auth-schema.ts (3)
1-2
: Imports look good.
Thedrizzle-orm/pg-core
import is correctly set up.
13-24
: Session table implementation looks consistent.
No immediate issues. Columns and foreign key constraints align well with a typical session design.
26-42
: Account table implementation is clear.
All references and optional tokens are well-defined.apps/nextjs/src/trpc/react.tsx (3)
6-11
: Imports updated to the new TRPC approach.
Switching fromunstable_httpBatchStreamLink
tohttpBatchStreamLink
and addingcreateTRPCContext
is correct for the new library structure.
30-30
: Context-based TRPC usage is appropriate.
Exporting{ useTRPC, TRPCProvider }
fromcreateTRPCContext
aligns with the new, more flexible API.
58-60
: Usage of<TRPCProvider>
is well-integrated.
Wrapping thequeryClient
andtrpcClient
is a clean approach for handling both React Query and TRPC contexts.apps/nextjs/src/app/(dashboard)/project/[id]/(root)/_components/ChartData.tsx (4)
32-32
: Correct import foruseSuspenseQuery
.
Ensures alignment with the new TanStack approach.
43-47
: Refactored query for task data is consistent.
CallinguseSuspenseQuery
withapi.tasks.getTasksOverTime.queryOptions(...)
is a clean approach for strongly typed data.
48-52
: Priority data fetching approach looks correct.
Matches the suspense query pattern introduced above.
53-57
: Status data loading is properly handled.
Once again, consistency in suspense query usage is beneficial for clarity and maintainability.packages/auth/src/index.rsc.ts (3)
2-3
: Imports for Next.js and localauth
module are valid.
No issues with theheaders
import or the localauth
reference.
5-8
: Caching session retrieval is a neat optimization.
Usingcache(auth.api.getSession)
can improve performance, but consider any edge cases where the session might expire or become invalid.
10-10
: Exporting everything from./auth
is straightforward.
This re-export approach helps centralize your auth functionality in one place.apps/website/src/lib/constants/projects.tsx (4)
33-34
: Improved title formatting for better readability.Breaking long titles into multiple lines improves code readability while maintaining the same functionality.
49-64
: Good restructuring of the Karina's Library project entry.The reformatting makes this entry consistent with the structure of other projects in the array.
104-105
: Consistent formatting improvement for LGBTQ+ project title.Breaking this long title across multiple lines matches the formatting style used for other projects.
121-122
: Consistent formatting improvement for Mental Health project title.The multi-line formatting improves readability and maintains consistency with other project titles.
apps/website/src/components/footer.tsx (6)
3-3
: Added helpful import comment.The added comment clarifies the purpose of the Link import, which is helpful for maintainability.
7-14
: Improved class name ordering and formatting.The reordering of class names and restructuring of elements makes the code more consistent and readable without changing functionality.
15-28
: Enhanced newsletter section formatting.The newsletter section has been reformatted with more consistent class name ordering and better indentation.
34-35
: Consistent formatting for container and navigation elements.The container and navigation elements have been reformatted with consistent class name ordering.
Also applies to: 41-43
62-77
: Improved Link component formatting.The Link components have been reformatted with consistent attributes and line breaks.
85-92
: Better comment formatting.The commented-out section has been formatted more consistently with the rest of the code.
apps/website/src/components/ui/span-cards.tsx (3)
22-22
: Removed extra spaces in className string.Removing unnecessary spaces in the className string improves code cleanliness without changing functionality.
27-27
: Consistent formatting for div element.The div element has been reformatted for consistency with the project's coding style.
52-52
: Removed extra spaces in MagicCard className string.Removing unnecessary spaces in the className string improves code cleanliness and readability.
apps/website/src/app/(marketing)/program/page.tsx (7)
8-46
: Improved header section formatting.The header section has been reformatted with more consistent class name ordering and better structure for the SVG element, improving readability while maintaining functionality.
91-92
: Enhanced section container formatting.Section containers have been reformatted with consistent class name ordering for better readability.
97-107
: Consistent heading and paragraph formatting.Headings and paragraphs have been reformatted with consistent class name ordering throughout the component.
158-207
: Standardized program sections formatting.The high school and college program sections have been reformatted with consistent class name ordering and spacing for better readability.
215-275
: Improved timeline section formatting.The timeline section with steps has been reformatted with consistent class name ordering for each step.
297-316
: Consistent section container and heading formatting.The section containers and headings have been reformatted with consistent class name ordering.
329-475
: Standardized feature sections formatting.All feature sections have been reformatted with consistent class name ordering and spacing between elements for better readability.
apps/nextjs/src/app/(home)/_components/create-project-dialog.tsx (1)
50-63
: LGTM! Good refactor to React QueryThe refactoring from TRPC's mutation hook to React Query's
useMutation
hook is a good change that decouples the mutation logic from TRPC's implementation. This will make the code more maintainable and consistent with other non-TRPC mutations.apps/website/src/app/(marketing)/newsletter/page.tsx (1)
80-84
: Good use of React.SuspenseThe addition of
React.Suspense
around theApplyButton
components is a good practice for handling loading states.Also applies to: 144-148
apps/website/src/app/(marketing)/_sections/spotlight.tsx (1)
1-48
: LGTM! Clean type imports and improved formattingThe changes in this file improve code quality in several ways:
- Using
import type
for type imports is a TypeScript best practice- The reordering of class names improves readability
- The component structure is better organized
These changes enhance code maintainability without changing functionality.
apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/update-role-optimistic.tsx (1)
29-39
: LGTM! Good refactor to React QueryThe refactoring from TRPC's mutation hook to React Query's
useMutation
hook is a good change that decouples the mutation logic from TRPC's implementation. This improves consistency with the rest of the codebase that's being updated to use direct React Query hooks.apps/website/src/app/(marketing)/_sections/take-action.tsx (4)
3-3
: Improved import organization.The import statement has been updated to combine React and useState into a single import, which follows best practices for React imports.
13-13
: Enhanced className organization.The class names have been reordered to follow a more logical grouping pattern (container, layout, styling), which improves readability and maintainability.
24-24
: Consistent className pattern.Class names have been reordered following the same pattern as other elements in the file, maintaining consistency throughout the component.
57-65
: Improved JSX formatting.The formatting of the text content within the motion.div has been simplified while preserving the same content and functionality. This improves code readability.
packages/ui/package.json (1)
63-67
:❓ Verification inconclusive
Standardized dependency management with catalog references.
Dependencies have been updated to use catalog references, which provides consistent versioning across the project. This is a good practice for maintaining version consistency in a monorepo.
Note that while devDependencies now use catalog references, peerDependencies still specify exact versions. Verify if this was intentional or if the peerDependencies should also use catalog references:
🏁 Script executed:
#!/bin/bash # Check for any other package.json files that might still use fixed versions instead of catalog references grep -r "\"react\": \"18.3.1\"" --include="package.json" . | grep -v "peerDependencies" # Check if there's documentation about the catalog approach find . -type f -name "*.md" | xargs grep -l "catalog:" || echo "No documentation found about catalog references"Length of output: 291
Action Required: Verify Consistency for React Dependency Versions
The update to use catalog references in devDependencies (as shown in lines 63–67 of
packages/ui/package.json
) is a strong move for enforcing version consistency. However, verification revealed that a fixed version for React ("react": "18.3.1"
) still exists in the same file. Additionally, no markdown documentation covering the catalog reference approach was found in the repository. Please confirm:
- Should peerDependencies (or any other dependency sections) also transition to catalog references instead of fixed versions?
- If the use of a fixed version (e.g.,
"18.3.1"
) for React was intentional, could we document the rationale to avoid confusion?- Can we add documentation outlining the catalog reference approach for future clarity?
apps/website/src/app/(marketing)/_sections/hero.tsx (2)
3-7
: Improved import organization.The import statements have been reordered to group related imports together, improving code organization.
18-20
: Simplified function parameters.Default parameters have been simplified by removing explicit type annotations while maintaining the default values, making the code cleaner.
packages/api/src/trpc.ts (2)
13-13
: Proper import of auth module.The import of the auth module from "@amaxa/auth" is correctly implemented, aligning with the PR's objective of updating authentication handling.
28-31
: Clean simplification of session handling.This change streamlines the session retrieval process by:
- Removing the need to pass session as a parameter
- Using the auth.api.getSession method directly
- Passing only the headers needed for authentication
This is a good architectural improvement that centralizes authentication logic.
apps/nextjs/src/components/calendar-full.tsx (3)
82-96
: Appropriate type to interface conversion.Changing from type to interface for
ContextType
is consistent with TypeScript best practices for objects that represent a clear entity with a stable structure. Interfaces are more extensible and better suited for object shapes that might be implemented or extended.
100-106
: Consistent type declaration approach.Converting
CalendarEvent
from type to interface maintains consistency with other type declarations in the file and aligns with the broader refactoring effort toward standardization.
108-118
: Standardized props interface declaration.Converting
CalendarProps
to an interface follows the same pattern applied to other type definitions, creating a more consistent codebase.apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/add-user-form.tsx (2)
50-51
: Add import for useMutation from React Query.Proper import for the React Query's useMutation hook, which is needed for the refactored mutation handling.
74-86
: Improved mutation pattern using React Query.The mutation implementation has been properly refactored to use React Query's
useMutation
with TRPC'smutationOptions
. This change:
- Makes the code more consistent with modern React Query patterns
- Maintains the same functionality with identical success and error handling
- Better separates concerns between data fetching and UI
This is a positive architectural improvement that aligns with the project's tech stack update goals.
apps/website/src/app/(marketing)/_sections/project-shell.tsx (4)
3-5
: Improved import organization.The import of
TakeActionSection
is now properly separated from other imports and placed in a logical position, improving code organization.
24-25
: Consistent className ordering.The className attributes in these elements now follow a consistent pattern with spacing-related classes first followed by sizing classes, improving readability.
91-114
: Well-structured media rendering component.The code now properly handles different types of media (video, image, or fallback) with appropriate conditional rendering. The JSX structure is clean with consistent className patterns.
116-171
: Improved conditional rendering pattern.The conditional rendering for
spotlightData1
has been refactored to use the ternary operator with anull
fallback, which is more idiomatic in React. The JSX structure within the condition is well-formatted with proper indentation and className consistency.apps/website/src/components/ui/focus-cards.tsx (4)
29-34
: Good improvement with absolute positioningThe Image component is now properly positioned using absolute positioning and the inset-0 class, which ensures it covers the entire card area. This is a cleaner approach than the previous implementation.
36-45
: Good enhancement to the hover effectThe opacity transition with absolute positioning for the content overlay provides a clean, consistent hover effect. The gradient background and transparent text create an appealing visual effect.
53-57
: Type declaration improvementChanging from a type alias to an interface is good practice for object types that might be extended later. This matches similar changes in apple-cards.tsx for consistency across the codebase.
63-63
: Improved grid layoutThe updated grid layout with consistent gap spacing and responsive columns provides a cleaner appearance.
apps/website/src/lib/projects.ts (5)
57-58
: Good formatting improvementBreaking the URL into separate lines improves readability without affecting functionality.
76-93
: Better paragraph formattingThe updated paragraph formatting with consistent indentation and line breaks makes the content easier to read and maintain. Removing the trailing comma on the last array item is also good practice.
98-102
: Improved array formattingThe formatting changes to the paragraphs array with consistent indentation improves readability.
124-128
: Content consolidation improvementConsolidating the paragraphs while maintaining proper formatting improves the structure and makes the content more maintainable.
138-139
: Consistent URL formatting across the fileAll URL properties now follow the same formatting pattern, which improves consistency and readability throughout the file.
Also applies to: 172-173, 208-209, 242-243, 275-276
apps/website/src/components/ui/apple-cards.tsx (5)
3-6
: Improved import organizationThe import statements have been reorganized with type imports separated from regular imports, which follows best practices for TypeScript code organization.
17-23
: Type declaration consistency improvementChanging from a type alias to an interface is consistent with similar changes in focus-cards.tsx, which helps maintain a uniform type declaration pattern across the codebase.
29-29
: Minor formatting improvementRemoving the space between parentheses and curly braces is a small but valid code style improvement.
158-162
: Code style consistency with semicolonsAdding semicolons at the end of statements improves code style consistency.
95-96
: Class name formatting consistencyThe class name formatting has been adjusted for better readability, which is a minor but welcome improvement.
Also applies to: 122-122
apps/nextjs/src/app/(home)/guides/action-guides/_components/create-action-guide.tsx (4)
29-31
: Good upgrade to React Query importsThe addition of React Query imports is part of the migration to use TanStack Query's more powerful hooks instead of direct TRPC mutations.
39-39
: TRPC hook initializationThis adds the TRPC hook which is necessary for the new mutation approach.
50-59
: Improved mutation handling with React QueryThe migration from direct TRPC mutation to React Query's
useMutation
hook follows modern best practices. This approach:
- Uses the query client for cache invalidation
- Maintains the same functionality with cleaner code
- Follows the pattern used in other updated components
This change aligns with the PR objective of updating to the latest tech.
51-59
:✅ Verification successful
Verify the mutation invalidation path
Ensure that
trpc.actionGuides.pathFilter()
returns the correct query key pattern that matches any queries that need to be invalidated when a new guide is created.
🏁 Script executed:
#!/bin/bash # Check for other invalidation patterns in the codebase for comparison rg -A 2 "invalidateQueries" | grep "actionGuides"Length of output: 207
Mutation Invalidation Path Verification Complete
The grep output confirms that the only invalidation call for action guides is:
void queryClient.invalidateQueries(trpc.actionGuides.pathFilter());There are no conflicting or additional invalidation patterns elsewhere in the codebase. Please ensure that the value returned by
trpc.actionGuides.pathFilter()
indeed matches the query key(s) for all queries that must be refreshed upon creating a new guide.package.json (2)
28-31
: LGTM - Consistent dependency management using catalog referencesThe switch to
catalog:
for dependencies like prettier and typescript is a good practice for maintaining consistent versions across the codebase.
5-6
:✅ Verification successful
Verify Node.js version compatibility
The Node.js requirement has been significantly increased from Node 20 to Node 22. Node 22 is relatively new and may not be widely adopted in production environments yet. This could create deployment challenges.
🌐 Web query:
Is Node.js 22 in LTS status?
💡 Result:
Yes, Node.js 22 is in Long-Term Support (LTS) status as of October 29, 2024[3][4]. Key details about its LTS phase:
- Active LTS Phase: Runs until October 2025[3][4]
- Maintenance LTS Phase: Continues until April 2027[3][4]
- Codename: 'Jod'[3][4]
This LTS designation occurred exactly 6 months after Node.js 22's initial release in April 2024[1][2], following the standard Node.js release lifecycle where even-numbered versions achieve LTS status[7][10]. As of April 2025, it remains in the Active LTS phase that prioritizes stability with security updates and critical bug fixes[3][4].
Production users should note that Node.js 18 reached end-of-life in April 2025[11], while Node.js 20 entered Maintenance LTS in October 2024[3][4]. Major cloud platforms like AWS Lambda and Heroku already support Node.js 22 for production workloads[5][9].
Citations:
- 1: https://nodejs.org/en/blog/announcements/v22-release-announce
- 2: https://openjsf.org/blog/nodejs-22-available
- 3: https://nodejs.org/en/blog/release/v22.11.0
- 4: https://nodesource.com/blog/Node.js-v22-Long-Term-Support-LTS
- 5: https://aws.amazon.com/blogs/compute/node-js-22-runtime-now-available-in-aws-lambda/
- 6: https://docs.redhat.com/en/documentation/red_hat_build_of_node.js/22/html-single/release_notes_for_node.js_22/index
- 7: https://nodejs.org/en/about/previous-releases
- 8: https://nodejs.org/en/blog/release/v22.9.0
- 9: https://devcenter.heroku.com/changelog-items/3047
- 10: https://www.nearform.com/digital-community/node-js-release-schedule-explained
- 11: https://www.herodevs.com/blog-posts/node-js-end-of-life-dates-you-should-be-aware-of
- 12: https://github.com/nodejs/Release
- 13: https://endoflife.date/nodejs
Node.js Version Requirement is Validated for Production Use
The current minimum version ("node": ">=22.14.0") is now acceptable since Node.js 22 is confirmed to be in Active LTS—with support until October 2025 and maintenance until April 2027—and is already adopted by major platforms (e.g., AWS Lambda, Heroku). There is no longer a significant deployment risk related to this update.
apps/nextjs/src/app/(home)/admin/_components/table.tsx (2)
24-25
: LGTM - Good switch to Tanstack React Query hooksMoving to direct React Query hook imports makes the code more maintainable and aligned with standard practices.
30-38
:❓ Verification inconclusive
Migration to React Query hooks looks good, but ensure proper typing
The transition from TRPC-specific hooks to more generic React Query hooks is good. However, ensure that type safety is maintained with the new approach.
🏁 Script executed:
#!/bin/bash # Check how useMutation is typed in other files to ensure consistency rg "useMutation.*mutationOptions" --type=tsx -A 3 -B 3Length of output: 84
Below is an updated verification step that re-runs the search using a glob pattern (since the previous command failed due to an unrecognized file type):
Once you run this command, please verify that the typing for
useMutation
is consistent with our expected patterns. The migration to React Query hooks looks solid; however, ensure that the new approach maintains proper type safety across all TSX files.Action:
- Manually review the output from the script above to confirm that all usages of
mutationOptions
inuseMutation
have the correct typing.If everything checks out, you can confirm that no further changes are needed. Otherwise, please update the code accordingly.
🏁 Script executed:
#!/bin/bash # Search for all instances of useMutation with mutationOptions across TSX files using a glob pattern. rg "useMutation.*mutationOptions" -g "*.tsx" -A 3 -B 3Length of output: 178
Manual Verification Needed: Confirm Type Safety for React Query Hooks
While the migration from TRPC-specific hooks to React Query looks solid, our automated search for consistent typing inuseMutation
withmutationOptions
did not yield any output. This outcome may indicate that the pattern isn’t present in a way that our script could detect, or that such usages are minimal in the codebase.Action Items:
- Manually verify the type safety of the new React Query hooks implementation in
apps/nextjs/src/app/(home)/admin/_components/table.tsx
and other relevant TSX files.- Look for any potential discrepancies in how the
mutationOptions
type is applied across the codebase.Please ensure that all usages maintain proper type safety as expected with the migration.
packages/api/package.json (3)
25-27
: LGTM - Improved dependency managementThe shift to catalog references for dependencies simplifies version management and ensures consistency across the project.
33-35
: LGTM - Consistent use of catalog references for dev dependenciesUsing catalog references for eslint, prettier, and typescript ensures consistent tooling across the project.
26-26
:❓ Verification inconclusive
Verify superjson compatibility with other dependencies
The superjson package was updated from 2.2.1 to 2.2.2. While this is a minor update, ensure it doesn't cause any compatibility issues with TRPC or other dependent packages.
🌐 Web query:
Are there any known issues with superjson 2.2.2 and TRPC?
💡 Result:
When using SuperJSON v2.2.2 with tRPC, several compatibility challenges and edge cases have been documented:
Backward Compatibility and Client Migration
The primary challenge occurs during migration where older clients (like React Native apps) encounter errors when a tRPC server switches to SuperJSON without client updates. Developers solved this by implementing conditional deserialization logic that checks for SuperJSON's signature
data.json
property before parsing[1].Example workaround code:
// Client-side transformer deserialize: (data: any) => { const isSuperJson = data.json !== undefined; return isSuperJson ? superjson.deserialize(data) : data; } // Server-side transformer deserialize: (data: any) => { if (!data) return data; return data.json ? superjson.deserialize(data) : data; }This requires temporarily disabling server-side serialization until all clients update[1].
Edge Runtime Compatibility
Recent reports highlight issues with Date deserialization in tRPC mutations when using edge runtimes like Vercel Edge Functions. The problem manifests when Date objects aren't properly reconstructed after serialization[5].
Technical Limitations
- Input Mapping Bugs: An open issue reports inconsistent behavior when mapping complex input types during serialization/deserialization cycles[5].
- Dependency Conflicts: Some environments encounter module resolution errors when combining tRPC, SuperJSON, and modern React/Next.js versions, particularly around ESM/CJS interoperability[7][10].
Version-Specific Considerations
While SuperJSON 2.2.2 itself has no critical vulnerabilities[15], its ES Module-only distribution since v2.x requires Node.js v16+ and proper TS configuration (
moduleResolution: "Node16"
or"Bundler"
)[12]. This can cause issues in older projects or those using CommonJS modules[10].Developers should test serialization boundaries thoroughly and consider phased rollouts when updating existing tRPC implementations. The tRPC community recommends using SuperJSON's custom transformer configuration to handle these edge cases systematically[4][8].
Citations:
- 1: https://discord-questions.trpc.io/m/1325729664496435231
- 2: https://bundlephobia.com/package/superjson
- 3: https://github.com/flightcontrolhq/superjson
- 4: https://www.youtube.com/watch?v=P1yADsDA5Xw
- 5: https://github.com/flightcontrolhq/superjson/issues
- 6: Badrequest using superjson transformer trpc/trpc#752
- 7: bug: Module not found: Can't resolve '@trpc/react-query/rsc' t3-oss/create-t3-app#2064
- 8: https://www.npmjs.com/package/superjson
- 9: https://www.gitlab.cs.ut.ee/eliisabk/interactive-online-exhibition-environment/-/blob/iteration4/pnpm-lock.yaml
- 10: https://discord-questions.trpc.io/m/1268037273895698432
- 11: https://gitlabext.wsl.ch/EnviDat/EnviDat-Frontend/-/blob/7e9b6b8bfe99184b75a00b8a95c92a1b072ad3b5/package-lock.json
- 12: https://github.com/blitz-js/superjson/releases
- 13: https://cve.mitre.org/cgi-bin/cvekey.cgi
- 14: https://www.npmjs.com/package/superjson?activeTab=dependents
- 15: https://snyk.io/test/npm/[email protected]
- 16: https://codesandbox.io/examples/package/superjson
- 17: https://labs.google/fx/third-party-licenses.txt
Action: Verify SuperJSON v2.2.2 Integration with tRPC & Dependent Packages
The update from SuperJSON v2.2.1 to 2.2.2 is minor but introduces several known compatibility challenges with tRPC. In particular, be aware of:
- Backward Compatibility & Client Migration: Older clients (e.g., React Native) might encounter errors if the server updates without corresponding client changes. Ensure that any custom transformer logic (conditional deserialization based on the presence of the
data.json
property) is correctly implemented.- Edge Runtime Considerations: Testing is needed for scenarios such as Date deserialization issues in environments like Vercel Edge Functions.
- ESM/CJS Interoperability: Verify that your Node.js version (v16+ required) and TypeScript configuration (e.g., setting
moduleResolution
to "Node16" or "Bundler") are compatible with SuperJSON's ES Module-only distribution.Please add tests or review configurations where needed to ensure these issues are addressed.
apps/nextjs/src/app/(auth)/sign-in/page.tsx (2)
16-16
: LGTM - Updated import path for auth client moduleThe import has been updated to use the more specific client-side module from the auth package.
18-19
: LGTM - Component renamed for clarity and loading state addedRenaming from
LoginForm
toSignIn
improves clarity, and adding the loading state is a good UX enhancement.apps/website/src/app/(marketing)/who-we-are/page.tsx (4)
1-3
: Code organization improvementMoving the React import to the top of the file follows best practices for import organization.
9-16
: Improved className organizationThe className attributes have been reorganized to follow a more consistent pattern, grouping related utility classes together (layout, sizing, styling). This improves code readability and maintainability.
82-111
: Improved className structure for better maintainabilityThe className attributes in this section have been reordered to group related properties, making the code more readable and maintainable. The spacing, sizing, and color properties are now organized in a more logical manner.
150-168
: Enhanced button styling and layout organizationThe className reorganization for the section and button elements improves readability while maintaining the same visual appearance. The button's className now groups related properties (layout, border, spacing, text) in a more logical order.
packages/auth/package.json (3)
11-13
: New module exports enhance package flexibilityAdding dedicated export paths for expo, middleware, and client components improves the package's modularity and allows for more targeted imports based on the context (mobile, server middleware, client-side).
36-39
: Standardized dependency management with catalog referencesMoving to catalog references for eslint, prettier, and typescript helps maintain consistent tooling versions across the project. Adding tsup as a build tool suggests changes in how the package is built and distributed.
26-30
:❓ Verification inconclusive
Major authentication library change
The package is migrating from
@auth/core
and@auth/drizzle-adapter
to a custombetter-auth
package. Additionally, Next.js has been updated from v14 to v15, which is a major version upgrade.Please verify that all components using the old auth library have been updated to use the new
better-auth
package. Major version upgrades of Next.js often introduce breaking changes that need to be addressed.
🏁 Script executed:
#!/bin/bash # Check if better-auth package exists and what it provides # Look for imports of better-auth in the codebase echo "Checking usage of better-auth in the codebase:" rg -A 2 "from ['\"]better-auth" --type ts # Check for migration documentation echo "Looking for migration documentation:" fd -t f "migration|upgrade|changelog" --exec grep -l "auth|better-auth" {} \;Length of output: 1144
Authentication and Next.js Upgrade Verification
- Verified that all components have been updated to use the new
better-auth
package (e.g., inpackages/auth/src/client.ts
,packages/auth/src/middleware.ts
, andpackages/auth/src/auth.ts
).- No traces of the old authentication libraries (such as
@auth/core
or@auth/drizzle-adapter
) were detected.- Note that the search for migration or upgrade documentation did not return any results; please ensure that any necessary migration notes or documentation regarding the new
better-auth
integration are provided.- Given that Next.js has been upgraded to v15—a major version update—please double-check that all potential breaking changes have been accounted for and thoroughly tested.
packages/db/package.json (2)
43-47
: Standardized tooling with catalog referencesShifting to catalog references for eslint, prettier, and typescript ensures consistent tooling versions across the project. The update to newer versions of dotenv-cli and drizzle-kit suggests improvements in the development workflow.
35-37
:❓ Verification inconclusive
Significant database library updates
Updating drizzle-orm from v0.31.2 to v0.41.0 and drizzle-zod from v0.5.1 to v0.7.0 represents major version jumps that may include breaking changes. The removal of the postgres dependency (mentioned in the AI summary) suggests a change in how database connections are managed.
Please ensure that all database access code has been updated to accommodate the breaking changes in these major version updates of drizzle-orm and drizzle-zod.
🏁 Script executed:
#!/bin/bash # Check for breaking changes in drizzle ORM updates # Look for drizzle-orm usage in the codebase echo "Checking usage patterns that might be affected by drizzle-orm updates:" rg -A 3 "from ['\"]drizzle-orm" --type ts # Check for database connection code that might have changed echo "Looking for database connection code:" rg -A 5 "postgres|createPool|connection" --type tsLength of output: 5398
Ensure All Database Connection Changes Align with Updated Drizzle Versions
The major version bumps for both drizzle-orm (v0.31.2 → v0.41.0) and drizzle-zod (v0.5.1 → v0.7.0) introduce potentially breaking changes. Verification indicates that:
drizzle-orm usage:
Key files such aspackages/db/src/index.ts
andpackages/db/src/schema.ts
now import and use types and functions from the updated modules (e.g."drizzle-orm"
,"drizzle-orm/pg-core"
, and"drizzle-orm/sql"
).Database connection updates:
The new connection configuration inpackages/db/drizzle.config.ts
(usingdialect: "postgresql"
and custom credentials) and the client code inpackages/db/src/client.ts
importing from"drizzle-orm/vercel-postgres"
reflect that the previous postgres dependency has been removed and replaced.Please verify manually that:
- All instances of database connection logic fully align with the new APIs.
- There aren’t any lingering dependencies or usage patterns tied to the previous postgres integration.
apps/nextjs/src/trpc/server.tsx (5)
1-11
: Well-structured imports for tRPC server integrationThe imports are organized logically, separating external dependencies from internal project imports. The use of type imports helps reduce bundle size by ensuring types are only used at compile time.
16-23
: Efficient context creation for server componentsUsing React's
cache
function for the context creation is a good practice as it ensures the context is only created once per request, improving performance. Setting the "x-trpc-source" header to "rsc" allows backend tracking of request sources.
27-31
: Clean tRPC setup with proper type safetyThe tRPC setup is well-structured, using the appropriate type parameters to ensure type safety throughout the application. Using the cached context and query client is a good performance optimization.
33-40
: Effective hydration boundary implementationThe
HydrateClient
component correctly implements hydration for the query client state, following best practices for React Server Components by providing a clear boundary between server and client hydration.
41-52
:❓ Verification inconclusive
Type-safety concerns in prefetch function
The function uses ESLint disable comments to bypass TypeScript's type checking in two places. While sometimes necessary for complex generic types, this could hide potential issues.
Consider exploring more type-safe alternatives to the
any
casting if possible. If this approach is necessary, add more detailed comments explaining why type safety needs to be bypassed here.
🏁 Script executed:
#!/bin/bash # Check if this pattern is used consistently across the codebase # Look for similar usage patterns of prefetchInfiniteQuery echo "Checking for similar patterns in the codebase:" rg -A 3 "prefetchInfiniteQuery.*as any" --type ts # Check for alternative approaches that might be more type-safe echo "Looking for alternative approaches to infinite query prefetching:" rg -A 5 "prefetchInfiniteQuery(?!.*as any)" --type tsLength of output: 867
Action Required: Revisit Type-Casting in
prefetch
Function
- The current implementation casts
queryOptions
toany
when callingprefetchInfiniteQuery
(in apps/nextjs/src/trpc/server.tsx at lines 41–52).- A codebase search confirms that this pattern appears only here, and no built-in or alternative type-safe approach has been identified.
- If refactoring to improve type safety isn’t feasible in the short term, please add a clear inline comment that explains why bypassing TypeScript’s checks is necessary (for example, due to complex generic types or limitations in the TRPC type definitions).
apps/website/src/app/(marketing)/project/page.tsx (9)
4-4
: No concerns with these new imports.
No issues or conflicts identified.Also applies to: 6-6, 9-9
19-19
: Background container changes appear consistent.
No functional impact. Preserving the invisible container for reference is valid.Also applies to: 21-25
58-58
: No concerns.
No functional changes or issues.
62-66
: Layout changes look good.
No performance or readability issues identified.
90-94
: No concerns.
The updated text is clear and grammatically sound.
98-99
: FocusCards usage is appropriate.
No issues with data binding or performance.
100-101
: No concerns.
Closing tags and structure remain consistent.
103-103
: Section background and spacing.
No concerns regarding the updated styles for the section.
106-106
: No concerns.
The heading is descriptive and well-placed.packages/db/src/schema.ts (8)
26-26
: No concerns.
Minor enumerated status field is properly typed.
32-35
: Relation definitions look correct.
The references toaccount
,tasks
, andproject_tracker
are consistent with the new schema.
38-49
: Session table adjustments look consistent.
The new references and usage ofonDelete: "cascade"
is appropriate, ensuring session cleanup when a user is removed.
51-67
: Account table updates align with the new user schema.
The additional token fields andonDelete: "cascade"
reference appear properly structured.
69-76
: New verification table is well-defined.
No concerns with the fields for storing verification details and timestamps.
122-122
: Task-assignee relation correctly references the newuser
table.
The updated reference ensures data consistency.
211-211
: Composite primary key introduced.
This effectively enforces uniqueness acrossuserId
andprojectId
.
222-224
: Relation touser
is updated.
The reference touser.id
is consistent with the renamed table.apps/website/package.json (2)
42-42
: Catalog references for devDependencies appear consistent.
No issues found; the shift tocatalog:
versioning aligns with the project's new approach.Also applies to: 43-43, 44-44, 45-45, 46-46, 48-48, 49-49, 50-50
24-24
:✅ Verification successful
Upgrading Next.js & React to new catalog references.
Ensure the move to Next ^15.2.3 andcatalog:react19
doesn't introduce breaking changes.To verify any potential breaking changes, you can run a script to search for deprecated APIs or known issues in your codebase:
Also applies to: 26-27
🏁 Script executed:
#!/bin/bash # Searching for Next.js and React 14/18 usage in code comments or config files rg -A 5 "next14|react18|deprecated"Length of output: 2681
Next.js & React Upgrade Verified
- The update in
apps/website/package.json
—with"next": "^15.2.3"
on line 24 and the corresponding React upgrade on lines 26-27 to usecatalog:react19
—has been checked.- A repository-wide search for outdated Next.js (e.g., "next14") and React (e.g., "react18") usages, as well as deprecated API notes, returned only unrelated deprecated warnings in the lockfile.
- No evidence of breaking changes stemming from these dependency updates was found. Standard integration tests are still recommended to confirm runtime behavior.
apps/nextjs/package.json (7)
25-25
: Standardize React Query dependency.
Changing@tanstack/react-query
to"catalog:"
reflects the new centralized dependency management strategy. Please ensure that this update integrates well with your workspace’s version resolution.
29-31
: Refactor TRPC dependencies.
The updates for@trpc/client
,@trpc/server
, and the addition of@trpc/tanstack-react-query
now use the"catalog:"
reference. This unifies dependency management and should simplify version maintenance. Confirm that any usage of these packages in your codebase remains compatible with the new sourcing.
38-38
: Upgrade Next.js version.
Updating Next.js from^14.2.14
to^15.2.3
unlocks the latest features and performance improvements. Please verify that all custom configurations and plugins are compatible with this new version.
41-42
: Migrate React dependencies.
Switching"react"
and"react-dom"
to"catalog:react19"
indicates a move to React 19. Make sure to test your application for any breaking changes or compatibility issues related to this major update.
47-47
: Apply Superjson patch.
The update ofsuperjson
to version2.2.2
should bring minor bug fixes or improvements. It is recommended to run your serialization and deserialization tests to ensure no regression occurs.
48-48
: Centralize Zod dependency management.
Changingzod
to use a"catalog:"
reference streamlines version control for validation schemas. Verify that this change does not impact any library-specific behaviors in your schema definitions.
56-64
: Standardize devDependencies versions.
The updates to dev dependencies—including@types/node
,@types/react
,@types/react-dom
,dotenv-cli
,eslint
,tailwindcss
, andtypescript
—now use either new version numbers or catalog references. This approach provides consistency in development tooling across the project. Please ensure that linting, formatting, and type-checking workflows are all functioning as expected after these changes.apps/website/src/app/layout.tsx (1)
5-6
: Analytics integration looks good!The PostHog analytics provider has been properly integrated into the application. This will enable tracking user interactions and gathering analytics data across the website.
Also applies to: 80-80
apps/nextjs/src/app/(dashboard)/project/[id]/(root)/layout.tsx (1)
57-59
: Verify components handle optional propertiesMake sure any components consuming the
name
and
@@ -1,3 +1,2 @@ | |||
node-linker=hoisted | |||
@tiptap-pro:registry=https://registry.tiptap.dev/ | |||
//registry.tiptap.dev/:_authToken=token-here | |||
link-workspace-packages=true |
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.
💡 Verification agent
🧩 Analysis chain
Good monorepo configuration update.
Setting link-workspace-packages=true
in pnpm makes local packages symlinked to node_modules, which improves the development experience by making changes to local packages immediately available without requiring rebuilds or reinstalls.
🏁 Script executed:
#!/bin/bash
# Verify if any remaining references to Tiptap registry exist in package.json files
echo "Checking for any remaining Tiptap registry references in package.json files:"
fd 'package.json' --type f | xargs grep -l "tiptap" || echo "No Tiptap references found in package.json files"
Length of output: 237
Actionable: Resolve Tiptap Registry Reference
Great update to the monorepo configuration with link-workspace-packages=true
, which will indeed improve your development workflow by symlinking local packages. However, the verification script found that apps/nextjs/package.json
still contains a Tiptap registry reference. Please confirm whether this reference is intentional. If it’s a leftover from a previous configuration, it should be removed or updated accordingly.
- File to review:
apps/nextjs/package.json
– verify the Tiptap reference. - File updated:
.npmrc
(Line 2 is correct).
Once the Tiptap reference issue is addressed, this update can be approved.
apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/table.tsx
Outdated
Show resolved
Hide resolved
const trpc = useTRPC(); | ||
const { data: actionGuides } = useSuspenseQuery( | ||
api.actionGuides.getActionGuides.queryOptions(), | ||
); |
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.
Missing import for useTRPC
The code references useTRPC()
but there's no import statement for this function. This will cause a runtime error.
Add the following import statement at the top of the file:
import { useSuspenseQuery } from "@tanstack/react-query";
+import { useTRPC } from "~/trpc/client";
📝 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.
const trpc = useTRPC(); | |
const { data: actionGuides } = useSuspenseQuery( | |
api.actionGuides.getActionGuides.queryOptions(), | |
); | |
import { useSuspenseQuery } from "@tanstack/react-query"; | |
import { useTRPC } from "~/trpc/client"; | |
// ... other imports (if any) | |
const trpc = useTRPC(); | |
const { data: actionGuides } = useSuspenseQuery( | |
api.actionGuides.getActionGuides.queryOptions(), | |
); | |
// ... rest of the file |
import { useMutation } from "@tanstack/react-query"; | ||
|
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.
Add the missing import for useTRPC
The code is importing useMutation
from React Query but missing the import for useTRPC
which is used on line 24.
import { useMutation } from "@tanstack/react-query";
+import { useTRPC } from "~/trpc/react";
📝 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.
import { useMutation } from "@tanstack/react-query"; | |
import { useMutation } from "@tanstack/react-query"; | |
import { useTRPC } from "~/trpc/react"; |
currentText?.substring(0, displayedText.length + 1)!, | ||
); |
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.
Replace non-null assertions with safer alternatives.
The use of non-null assertions (!
) with optional chaining (?.
) is flagged by the linter as unsafe. These could potentially lead to runtime errors if the values are undefined.
Consider replacing these non-null assertions with safer alternatives such as nullish coalescing or conditional rendering:
- currentText?.substring(0, displayedText.length + 1)!,
+ currentText?.substring(0, displayedText.length + 1) ?? "",
- src={content[prevIndex]?.image!}
+ src={content[prevIndex]?.image ?? defaultImage}
- src={content[activeIndex]?.image!}
- alt={content[activeIndex]?.statement!}
+ src={content[activeIndex]?.image ?? defaultImage}
+ alt={content[activeIndex]?.statement ?? ""}
- src={content[nextIndex]?.image!}
+ src={content[nextIndex]?.image ?? defaultImage}
Also applies to: 258-259, 286-288, 313-314
🧰 Tools
🪛 GitHub Check: lint
[warning] 49-49:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong
[warning] 49-49:
Forbidden non-null assertion
@@ -63,23 +64,26 @@ export default function AddUserForm({ | |||
label: string; | |||
}[]; | |||
}) { | |||
const trpc = useTRPC(); |
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.
Missing import for useTRPC.
The code is using useTRPC()
but there's no import statement for this function.
Add the missing import at the top of the file:
import { api } from "~/trpc/react";
+import { useTRPC } from "~/trpc/react";
import { useMutation } from "@tanstack/react-query";
📝 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.
const trpc = useTRPC(); | |
import { api } from "~/trpc/react"; | |
import { useTRPC } from "~/trpc/react"; | |
import { useMutation } from "@tanstack/react-query"; | |
// ... rest of the file's code ... | |
const trpc = useTRPC(); |
export function UserManagement() { | ||
const trpc = useTRPC(); |
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 undefined useTRPC reference
The code introduces useTRPC()
but doesn't import this function. This will cause a runtime error.
+import { api } from "~/trpc/react";
export function UserManagement() {
- const trpc = useTRPC();
+ // Remove if not needed, or properly import the hook
Committable suggestion skipped: line range outside the PR's diff.
name: auth.user.name, | ||
email: auth.user.email, | ||
avatar: auth.user.image!, |
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.
🛠️ Refactor suggestion
Inconsistent non-null assertion handling
You've removed non-null assertions for name
and email
properties, which is good for type safety, but image
still has a non-null assertion. Consider treating all user properties consistently by removing the remaining assertion or document why it's needed.
user={{
name: auth.user.name,
email: auth.user.email,
- avatar: auth.user.image!,
+ avatar: auth.user.image,
}}
📝 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.
name: auth.user.name, | |
email: auth.user.email, | |
avatar: auth.user.image!, | |
name: auth.user.name, | |
email: auth.user.email, | |
avatar: auth.user.image, |
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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
🧹 Nitpick comments (1)
packages/auth/src/middleware.ts (1)
1-33
: Consider adding configuration for customizable public paths.While the current implementation works well, consider making the public paths configurable through a parameter or environment variable. This would make the middleware more flexible for different applications without code changes.
-export const client = createAuthClient(); +export const client = createAuthClient(); + +// Default public paths that don't require authentication +export const DEFAULT_PUBLIC_PATHS = ["/sign-in", "/sign-up", "/api/auth"]; + -export async function authMiddleware(request: NextRequest) { +export async function authMiddleware( + request: NextRequest, + options?: { publicPaths?: string[] } +) { // Check if the request is for a public route const url = new URL(request.url); - const publicPaths = ["/sign-in", "/sign-up", "/api/auth"]; + const publicPaths = options?.publicPaths || DEFAULT_PUBLIC_PATHS;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/auth/src/middleware.ts
(1 hunks)
🔇 Additional comments (4)
packages/auth/src/middleware.ts (4)
1-5
: LGTM: Clean imports and client setup.The import statements are clean and focused, bringing in only what's needed. The
createAuthClient
usage looks correct for setting up the auth client.
7-14
: Proper handling of public routes implemented.The code correctly implements the public routes handling that was suggested in a previous review comment. This prevents redirect loops for paths like sign-in pages.
16-28
: Session retrieval implementation looks good.The session retrieval from request headers is properly implemented, with good documentation comments explaining the purpose.
29-33
: Authentication flow correctly returns responses.This implementation properly returns responses in all code paths, fixing the issue highlighted in a previous review. The code returns a redirect response for unauthenticated users and allows authenticated requests to proceed.
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
🔭 Outside diff range comments (2)
apps/nextjs/src/app/(scheduling)/schedule/[coachId]/_components/date-time-picker.tsx (1)
1-2
: 🛠️ Refactor suggestionConsider addressing the ts-nocheck directive.
The file has TypeScript checking disabled. This can hide type errors and make the codebase less robust. As part of bringing the project back up to standard, consider addressing the issues that required this directive to be added.
apps/nextjs/src/app/(home)/events/page.tsx (1)
24-28
:⚠️ Potential issuePotential runtime error with data mapping
The code assumes
data
is always an array that can be mapped over, but if validation fails,data
would be an error object.<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3"> - {data.map((event) => ( + {Array.isArray(data) && data.map((event) => ( <EventCard key={event.id} event={event} /> ))} </div>
🧹 Nitpick comments (7)
apps/nextjs/src/app/(scheduling)/schedule/[coachId]/_components/date-time-picker.tsx (2)
218-218
: Good change from||
to??
operator for Select value prop.The change from logical OR (
||
) to nullish coalescing (??
) improves the behavior. While||
would provide a fallback for any falsy value (including empty strings),??
only provides a fallback fornull
orundefined
, preserving other falsy values that might be intentionally set.Consider adding a brief comment explaining this intentional behavior:
- value={timezone ?? ""} // Added a fallback empty string + value={timezone ?? ""} // Using ?? instead of || to preserve empty string values as valid selections
217-217
: Typo in heading text "Avaliable".There's a typo in the heading text for available time slots.
- <h3 className="text-lg font-semibold">Avaliable Time Slots</h3> + <h3 className="text-lg font-semibold">Available Time Slots</h3>packages/api/src/router/users.ts (3)
21-25
: Migration to arktype validationThe change from Zod to arktype for input validation is consistent with other changes in the PR. The string literal type
"'admin' | 'coach' | 'student'"
should work but would be better expressed as a union type.Consider using a proper union type instead of a string literal:
- permission: "'admin' | 'coach' | 'student'", + permission: type.union(["admin", "coach", "student"]),
37-55
: Standardized function naming and updated joinsThe function name
findusersForProject
should be camelCase (findUsersForProject
) to maintain consistency with other function names.The join operation has been correctly updated to use the new lowercase
user
table.Correct the function name for consistency:
- findusersForProject: publicProcedure + findUsersForProject: publicProcedure
58-62
: Type definition inconsistencyThere's an inconsistency in how types are defined between this function and others. Here you're using string literals ("string") while elsewhere you use
type.string
.Standardize the type definitions for consistency:
- projectId: "string", - userId: "string", + projectId: type.string, + userId: type.string,packages/validators/src/index.ts (2)
25-26
: Synchronize naming of role constants with database definitions.You’re defining
role
as'User' | 'Admin'
anduserRoles
as'admin' | 'coach' | 'student'
, which may create confusion with the database table enums (role
vs.permission
). Consider consolidating or renaming them for clarity.
162-188
: Rename “assigneName” for clarity.“assigneName” may be a misspelling of “assigneeName,” especially since you have an “assigne” field. This can lead to confusion when referencing the property.
Apply this diff to rename the field:
- assigneName: "string | null", + assigneeName: "string | null",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
packages/api/.cache/tsbuildinfo.json
is excluded by!**/.cache/**
packages/db/.cache/tsbuildinfo.json
is excluded by!**/.cache/**
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (21)
apps/nextjs/package.json
(1 hunks)apps/nextjs/src/app/(auth)/sign-in/page.tsx
(2 hunks)apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/table.tsx
(1 hunks)apps/nextjs/src/app/(home)/events/page.tsx
(1 hunks)apps/nextjs/src/app/(home)/layout.tsx
(1 hunks)apps/nextjs/src/app/(home)/loading.tsx
(2 hunks)apps/nextjs/src/app/(scheduling)/schedule/[coachId]/_components/date-time-picker.tsx
(1 hunks)apps/nextjs/tsconfig.json
(1 hunks)packages/api/package.json
(1 hunks)packages/api/src/root.ts
(0 hunks)packages/api/src/router/auth.ts
(0 hunks)packages/api/src/router/events.ts
(2 hunks)packages/api/src/router/projects.ts
(2 hunks)packages/api/src/router/tasks.ts
(10 hunks)packages/api/src/router/users.ts
(2 hunks)packages/db/package.json
(1 hunks)packages/db/src/schema.ts
(5 hunks)packages/validators/package.json
(1 hunks)packages/validators/src/index.ts
(1 hunks)pnpm-workspace.yaml
(1 hunks)reset.sh
(1 hunks)
💤 Files with no reviewable changes (2)
- packages/api/src/root.ts
- packages/api/src/router/auth.ts
✅ Files skipped from review due to trivial changes (1)
- apps/nextjs/src/app/(home)/layout.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
- apps/nextjs/src/app/(home)/loading.tsx
- apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/table.tsx
- apps/nextjs/tsconfig.json
- packages/db/package.json
🧰 Additional context used
🧬 Code Definitions (6)
packages/api/src/router/events.ts (1)
packages/validators/src/index.ts (1)
eventsInsertSchema
(117-117)
packages/api/src/router/projects.ts (1)
packages/validators/src/index.ts (1)
projectsInsertSchema
(78-78)
packages/db/src/schema.ts (1)
auth-schema.ts (4)
user
(3-11)account
(26-42)session
(13-24)verification
(44-51)
packages/api/src/router/users.ts (2)
packages/db/src/schema.ts (2)
user
(13-28)project_tracker
(183-197)packages/validators/src/index.ts (1)
userUpdateSchema
(30-32)
packages/validators/src/index.ts (1)
packages/db/src/schema.ts (12)
user
(13-28)session
(36-47)account
(49-65)verification
(73-80)tasks
(81-120)edges
(134-147)Projects
(166-177)project_tracker
(183-197)skills
(216-225)skillsToGuide
(231-246)guides
(259-270)events
(276-293)
packages/api/src/router/tasks.ts (2)
packages/validators/src/index.ts (4)
tasksSelectSchema
(58-60)flowDataSchema
(199-203)tasksInsertSchema
(61-63)tasksUpdateSchema
(64-67)packages/db/src/schema.ts (1)
tasks
(81-120)
🪛 Shellcheck (0.10.0)
reset.sh
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
🔇 Additional comments (47)
packages/api/src/router/events.ts (2)
4-5
: Import updated to use centralized validation schemasThe code now imports the database schema and validation schema from dedicated packages, which is a good practice for maintaining consistent validation across the application.
25-25
: Standardized input validation using eventsInsertSchemaThe change from
createEventSchema
toeventsInsertSchema
aligns with the PR objective of standardizing validation schemas. This is a good refactoring that centralizes validation logic and ensures consistency.packages/api/src/router/projects.ts (2)
8-9
: Import updated to use centralized validation schemasThe imports have been updated to bring in the Projects schema from the database package and the projectsInsertSchema from the validators package. This is a good refactoring that promotes separation of concerns.
25-25
: Standardized input validation using projectsInsertSchemaThe change from
createProjectSchema
toprojectsInsertSchema
aligns with the PR's objective of standardizing validation. This centralization of validation schemas enhances maintainability and consistency across the application.packages/api/src/router/tasks.ts (13)
2-2
: Transitioning from zod to arktype for validationThe import of
type
from 'arktype' indicates the transition from zod to arktype for validation schemas. This aligns with the PR's objective of standardizing the codebase.
4-11
: Comprehensive import update for centralized validationThe imports have been significantly refactored to use dedicated schemas from the validators package instead of inline schema definitions. This is a good practice that enhances code organization and maintainability.
18-18
: Using tasksSelectSchema for consistent validationThe change to use
tasksSelectSchema
for input validation standardizes the approach to validating task selection operations. This schema includes proper type refinement for the position field, as seen in the validators package.
78-78
: Using flowDataSchema for save procedureThe change to use the specialized
flowDataSchema
for the save procedure provides proper validation for the complex structure required, including projectId, tasks, and edges. This improves type safety and code readability.
127-127
: Using tasksInsertSchema for create procedureThe change to
tasksInsertSchema
for the create procedure ensures consistent validation for task creation across the application. This schema properly refines the position field using the positionSchema.
137-137
: Using tasksUpdateSchema for update procedureThe change to
tasksUpdateSchema
for the update procedure is appropriate as it ensures the ID field is required for updates and properly refines the position field. This improves type safety during task updates.
143-145
: Improved input parameter naming and transition to arktypeThe change from
z.object({ id: z.string() })
totype({ projectId: "string" })
both transitions to arktype and improves parameter naming clarity. UsingprojectId
instead ofid
more accurately describes what the parameter represents.
161-161
: Updated query parameter to use projectIdThis change correctly updates the query to use
input.projectId
instead ofinput.id
, aligning with the parameter name change in the input schema.
171-173
: Consistent parameter naming and transition to arktypeSimilar to the previous schema change, this updates the input for the getPriorityData procedure to use arktype and the more descriptive
projectId
parameter name.
182-182
: Updated query parameter to use projectIdThis change correctly updates the query to use
input.projectId
instead ofinput.id
, maintaining consistency with the parameter name change.
188-190
: Consistent parameter naming and transition to arktypeThe input schema for getPositionData follows the same pattern, transitioning to arktype and using the more descriptive
projectId
parameter name.
199-199
: Updated query parameter to use projectIdThis change correctly updates the query to use
input.projectId
instead ofinput.id
, maintaining consistency with the parameter name changes.
205-205
: Consistent input schema pattern across proceduresThe getTasksOverTime, getTaskPriorities, and getTaskStatuses procedures all use the same standardized input schema pattern with arktype. This consistency improves code readability and maintainability.
Also applies to: 221-221, 236-236
packages/validators/package.json (2)
22-24
: New validation dependencies look goodAdding arktype, drizzle-arktype, and drizzle-zod aligns with the project's shift from using zod to arktype for validation.
28-28
: Appropriate workspace dependency addedAdding @amaxa/db as a workspace dependency makes sense since validators likely need access to database types and schemas.
pnpm-workspace.yaml (2)
6-28
: Well-organized catalog for centralized dependency managementThe catalog structure is well-organized with clear categorization of dependencies (Auth, Dev tooling, Misc, Tanstack & tRPC).
30-35
: React19 catalog for consistent React version managementGood approach to create a dedicated React19 catalog to standardize React and its type definitions across the project.
apps/nextjs/src/app/(home)/events/page.tsx (2)
1-1
: Import from arktype aligns with project's validation strategy shiftThe change from zod to arktype imports is consistent with the project-wide dependency updates.
6-8
: Schema definition updated to use arktypeThe schema definition has been updated to use arktype's type system instead of zod.
apps/nextjs/src/app/(auth)/sign-in/page.tsx (5)
1-4
: LGTM: Client-side directive and updated importsThe "use client" directive correctly marks this as a client component, and imports have been properly updated to use the new auth client module.
14-14
: Component renamed to better reflect its purposeRenaming from
LoginForm
toSignIn
improves clarity and aligns with the component's functionality.
16-17
: Improved layout with semantic HTMLGood change from
div
tomain
for better semantics, and the increased max-width (max-w-md
) provides a better user experience for the sign-in card.
19-22
: Updated component text for consistencyText changes from "Login" to "Sign In" maintain consistency with the component name and function.
26-67
: Simplified authentication with social loginThe removal of email/password form in favor of Google sign-in streamlines the authentication flow. The implementation using
signIn.social
with Google provider is correct, and the SVG icon enhances the visual experience.packages/api/package.json (2)
25-29
: Good dependency management improvementsSwitching to catalog references for
@trpc/server
,arktype
, andzod
ensures consistent versioning across the monorepo. Addingdrizzle-zod
(v0.7.1) supports schema validation between Drizzle ORM and Zod, which aligns with the database schema changes in this PR.The update to superjson 2.2.2 is also appropriate.
35-37
: Consistent dev dependenciesMoving dev dependencies to catalog references ensures development tools are consistent across the monorepo, reducing potential conflicts from mismatched versions.
packages/db/src/schema.ts (8)
13-28
: Good schema standardization for user tableThe user table refactoring follows modern naming conventions (lowercase) and aligns with auth provider expectations. The schema now includes important fields like
emailVerified
,createdAt
, andupdatedAt
for better user management.
30-34
: Updated relation definitionsRelations have been properly updated to reference the new lowercase table names, maintaining referential integrity in the database structure.
36-47
: Improved session management schemaThe session table refactoring adds important fields like
expiresAt
,token
, and user agent tracking, enabling better session management and security.
49-71
: Enhanced authentication provider supportThe account table changes introduce fields needed for modern OAuth providers (like Google sign-in implemented in the sign-in page), including proper token management and expiration tracking.
73-80
: Good addition of verification tableThe new verification table supports email verification workflows, which is essential for ensuring user identity and preventing spam accounts.
125-127
: Properly updated task relationsThe task relations correctly reference the new user table, maintaining data integrity for task assignments.
195-197
: Improved primary key definitionThe updated primary key definition for project_tracker uses a cleaner array syntax, which is more maintainable and follows modern Drizzle ORM best practices.
207-210
: Consistent relation definitionsThe project tracker relations correctly reference the new user table structure, ensuring data integrity between projects and users.
packages/api/src/router/users.ts (5)
1-6
: Updated imports for schema validationGood transition to use
arktype
alongsidezod
for schema validation, and proper updates to schema references from uppercaseUser
to lowercaseuser
.
14-17
: Updated table references in queryCorrectly updated references from
User
touser
in the select statement to align with the schema changes.
28-34
: Simplified permission handlingThe code now directly uses the permission value without additional validation checks. This assumes that the arktype validation is sufficient for ensuring valid permissions.
Verify that arktype properly validates the permission value before it's used in the database operation. If not, invalid values could be inserted into the database.
79-79
: Simplified user queryGood simplification of the user query to directly select from the user table.
83-89
: Using shared schema for user updatesGood practice to use the shared
userUpdateSchema
for validation, improving consistency across the codebase.apps/nextjs/package.json (2)
25-25
: Confirm that the custom “catalog:” references are recognized.It appears that multiple libraries (e.g., React) have been updated to reference a custom string literal “catalog:”. Verify that your package manager and build environment handle these references properly to avoid installation or resolution errors.
To confirm, you can run a dependency resolution script or attempt a fresh install and ensure no 404 or dependency resolution issues arise.
Also applies to: 29-31, 34-34, 42-43, 49-49, 58-59, 61-61, 64-65
39-39
: Check potential breaking changes in Next.js 15.2.3 upgrade.Next.js 15.x may introduce changes that could break existing functionality. Ensure you’ve tested critical paths and consulted the Next.js migration notes to prevent runtime issues.
Please do a local development run and confirm that there are no warnings or failures related to the Next.js upgrade.
packages/validators/src/index.ts (2)
1-205
: Overall schema definitions look consistent.Apart from the minor naming inconsistencies, all other uses of
createSelectSchema
,createInsertSchema
, andcreateUpdateSchema
appear correct and align with their respective Drizzle definitions.
186-186
:❓ Verification inconclusive
Verify Date object usage in ArkType schemas.
doneBy: "Date"
requires the caller to pass a Date object rather than a string. Confirm that all call sites correctly provide a Date object to avoid schema validation errors.You can search for references to “doneBy” in the codebase to check for string vs. Date usage:
🏁 Script executed:
#!/bin/bash # Searching codebase for doneBy references rg -A 3 "doneBy"Length of output: 2797
Action Required: Confirm Date Object Conversion for doneBy Usage
Based on the verification:
- In packages/validators/src/index.ts, the
doneBy
field is defined as"Date"
, implying that a Date object must be provided.- In apps/nextjs/src/lib/init.ts and apps/nextjs/src/app/(dashboard)/project/[id]/(tasks)/tasks/_components/flowchart.tsx, a Date object is explicitly constructed using
new Date()
.- In apps/nextjs/src/app/(dashboard)/project/[id]/(tasks)/tasks/_actions.ts and packages/api/src/router/tasks.ts, the schema is enforced via
z.date()
ornew Date()
in some cases.- However, there are instances where
doneBy
is directly passed fromtask.data.doneBy
without an explicit conversion.Please ensure that all such direct references (e.g.,
task.data.doneBy
) are validated to be Date objects and not strings to prevent schema validation errors.
pnpm clean:workspaces | ||
pnpm store prune, | ||
rm -rf .turbo | ||
pnpm i |
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.
🛠️ Refactor suggestion
Add shebang and improve script robustness
The script is missing a shebang line to specify which shell to use for execution.
+#!/bin/bash
+set -e # Exit immediately if a command exits with a non-zero status
pnpm clean:workspaces
-pnpm store prune,
+pnpm store prune
rm -rf .turbo
pnpm i
📝 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.
pnpm clean:workspaces | |
pnpm store prune, | |
rm -rf .turbo | |
pnpm i | |
#!/bin/bash | |
set -e # Exit immediately if a command exits with a non-zero status | |
pnpm clean:workspaces | |
pnpm store prune | |
rm -rf .turbo | |
pnpm i |
🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
export default function Home(props: { | ||
searchParams: Record<string, string | string[] | undefined>; | ||
}) { | ||
noStore(); | ||
const { name } = searchParamsSchema.parse(props.searchParams); | ||
|
||
const data = await api.events.all({ | ||
name: name, | ||
}); | ||
const data = searchParamsSchema(props.searchParams); | ||
if (data instanceof type.errors) { | ||
console.error(data); | ||
} |
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.
🛠️ Refactor suggestion
Improve error handling in arktype validation
The error handling logic logs to console but doesn't provide fallback behavior when validation fails.
export default function Home(props: {
searchParams: Record<string, string | string[] | undefined>;
}) {
const data = searchParamsSchema(props.searchParams);
if (data instanceof type.errors) {
console.error(data);
+ return (
+ <div className="min-h-screen w-full p-4 sm:p-6 lg:p-8">
+ <div className="mb-6 flex items-center justify-between">
+ <h1 className="text-3xl font-bold">Events</h1>
+ <CreateEvent />
+ </div>
+ <p>Error loading events. Please try again.</p>
+ </div>
+ );
}
📝 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.
export default function Home(props: { | |
searchParams: Record<string, string | string[] | undefined>; | |
}) { | |
noStore(); | |
const { name } = searchParamsSchema.parse(props.searchParams); | |
const data = await api.events.all({ | |
name: name, | |
}); | |
const data = searchParamsSchema(props.searchParams); | |
if (data instanceof type.errors) { | |
console.error(data); | |
} | |
export default function Home(props: { | |
searchParams: Record<string, string | string[] | undefined>; | |
}) { | |
const data = searchParamsSchema(props.searchParams); | |
if (data instanceof type.errors) { | |
console.error(data); | |
return ( | |
<div className="min-h-screen w-full p-4 sm:p-6 lg:p-8"> | |
<div className="mb-6 flex items-center justify-between"> | |
<h1 className="text-3xl font-bold">Events</h1> | |
<CreateEvent /> | |
</div> | |
<p>Error loading events. Please try again.</p> | |
</div> | |
); | |
} | |
// ...rest of the component's code | |
} |
deleteuser: protectedProcedure | ||
.input(z.object({ id: z.string() })) | ||
.mutation(async ({ ctx, input }) => { | ||
if (!isAdmin(ctx.session)) | ||
throw new TRPCError({ | ||
code: "UNAUTHORIZED", | ||
message: "You do not have permissions to delete this user", | ||
}); | ||
return await ctx.db.delete(User).where(eq(User.id, input.id)); | ||
return await ctx.db.delete(user).where(eq(user.id, input.id)); | ||
}), |
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.
🛠️ Refactor suggestion
Function naming inconsistency
The function has been renamed from deleteUser
to deleteuser
, which breaks the camelCase naming convention used throughout the codebase.
Correct the function name to maintain camelCase consistency:
- deleteuser: protectedProcedure
+ deleteUser: protectedProcedure
📝 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.
deleteuser: protectedProcedure | |
.input(z.object({ id: z.string() })) | |
.mutation(async ({ ctx, input }) => { | |
if (!isAdmin(ctx.session)) | |
throw new TRPCError({ | |
code: "UNAUTHORIZED", | |
message: "You do not have permissions to delete this user", | |
}); | |
return await ctx.db.delete(User).where(eq(User.id, input.id)); | |
return await ctx.db.delete(user).where(eq(user.id, input.id)); | |
}), | |
deleteUser: protectedProcedure | |
.input(z.object({ id: z.string() })) | |
.mutation(async ({ ctx, input }) => { | |
return await ctx.db.delete(user).where(eq(user.id, input.id)); | |
}), |
Summary by CodeRabbit
arktype
library.