Skip to content

Commit

Permalink
feat: Atualiza dependências, React 19 e Next 15
Browse files Browse the repository at this point in the history
  • Loading branch information
ErickCReis committed Jun 7, 2024
1 parent 26facc0 commit 635055a
Show file tree
Hide file tree
Showing 23 changed files with 1,608 additions and 1,367 deletions.
1 change: 1 addition & 0 deletions apps/nextjs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const config = {

experimental: {
typedRoutes: true,
reactCompiler: true,
},
};

Expand Down
33 changes: 17 additions & 16 deletions apps/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,24 @@
"@acme/db": "workspace:*",
"@acme/ui": "workspace:*",
"@acme/validators": "workspace:*",
"@hookform/resolvers": "^3.3.4",
"@hookform/resolvers": "^3.6.0",
"@t3-oss/env-nextjs": "^0.10.1",
"@tanstack/react-query": "^5.36.0",
"@tanstack/react-query": "^5.40.1",
"@trpc/client": "11.0.0-rc.334",
"@trpc/react-query": "11.0.0-rc.334",
"@trpc/server": "11.0.0-rc.334",
"@ts-react/form": "^1.1.3",
"@vercel/analytics": "^1.2.2",
"@vercel/speed-insights": "^1.0.10",
"@vercel/analytics": "^1.3.1",
"@vercel/speed-insights": "^1.0.11",
"babel-plugin-react-compiler": "0.0.0-experimental-938cd9a-20240601",
"clsx": "^2.1.1",
"dayjs": "^1.11.11",
"geist": "^1.3.0",
"lucide-react": "^0.378.0",
"next": "^14.2.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "^7.51.4",
"lucide-react": "^0.390.0",
"next": "15.0.0-rc.0",
"react": "19.0.0-rc-827cbea417-20240606",
"react-dom": "19.0.0-rc-827cbea417-20240606",
"react-hook-form": "^7.51.5",
"superjson": "2.2.1",
"zod": "^3.23.8"
},
Expand All @@ -44,15 +45,15 @@
"@acme/prettier-config": "workspace:*",
"@acme/tailwind-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"@types/node": "^20.12.11",
"@types/react": "^18.3.2",
"@types/node": "^20.14.2",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"dotenv-cli": "^7.4.2",
"eslint": "^9.2.0",
"jiti": "^1.21.0",
"prettier": "^3.2.5",
"tailwindcss": "^3.4.3",
"eslint": "^9.4.0",
"jiti": "^1.21.3",
"prettier": "^3.3.1",
"tailwindcss": "^3.4.4",
"typescript": "^5.4.5"
},
"prettier": "@acme/prettier-config"
}
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
},
"devDependencies": {
"@acme/prettier-config": "workspace:*",
"@turbo/gen": "^1.13.3",
"prettier": "^3.2.5",
"turbo": "^1.13.3",
"@turbo/gen": "^2.0.3",
"prettier": "^3.3.1",
"turbo": "^2.0.3",
"typescript": "^5.4.5"
},
"prettier": "@acme/prettier-config"
Expand Down
4 changes: 2 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"eslint": "^9.2.0",
"prettier": "^3.2.5",
"eslint": "^9.4.0",
"prettier": "^3.3.1",
"typescript": "^5.4.5"
},
"prettier": "@acme/prettier-config"
Expand Down
14 changes: 7 additions & 7 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@
},
"dependencies": {
"@acme/db": "workspace:*",
"@auth/drizzle-adapter": "^1.1.0",
"@auth/drizzle-adapter": "^1.2.0",
"@t3-oss/env-nextjs": "^0.10.1",
"next": "^14.2.3",
"next": "15.0.0-rc.0",
"next-auth": "5.0.0-beta.18",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "19.0.0-rc-827cbea417-20240606",
"react-dom": "19.0.0-rc-827cbea417-20240606",
"zod": "^3.23.8"
},
"devDependencies": {
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"eslint": "^9.2.0",
"prettier": "^3.2.5",
"eslint": "^9.4.0",
"prettier": "^3.3.1",
"typescript": "^5.4.5"
},
"prettier": "@acme/prettier-config"
}
}
10 changes: 5 additions & 5 deletions packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@
"dependencies": {
"@neondatabase/serverless": "^0.9.3",
"@t3-oss/env-core": "^0.10.1",
"drizzle-orm": "^0.30.10",
"drizzle-orm": "^0.31.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"dotenv-cli": "^7.4.2",
"drizzle-kit": "^0.21.1",
"eslint": "^9.2.0",
"pg": "^8.11.5",
"prettier": "^3.2.5",
"drizzle-kit": "^0.22.4",
"eslint": "^9.4.0",
"pg": "^8.12.0",
"prettier": "^3.3.1",
"typescript": "^5.4.5"
},
"prettier": "@acme/prettier-config"
Expand Down
18 changes: 9 additions & 9 deletions packages/db/src/schema/team.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { relations, sql } from "drizzle-orm";
import {
index,
pgEnum,
serial,
text,
timestamp,
unique,
uuid,
Expand All @@ -16,7 +16,7 @@ export const timeRecord = pgSqlTable(
"time_record",
{
id: serial("id").primaryKey(),
userId: text("user_id").notNull(),
userId: uuid("user_id").notNull(),
teamId: uuid("team_id").notNull(),
time: timestamp("time")
.default(sql`CURRENT_TIMESTAMP`)
Expand All @@ -25,10 +25,10 @@ export const timeRecord = pgSqlTable(
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
},
// (timeRecord) => ({
// userIdIdx: index("user_id_idx").on(timeRecord.userId),
// teamIdIdx: index("team_id_idx").on(timeRecord.teamId),
// }),
(timeRecord) => ({
userIdIdx: index("user_id_idx").on(timeRecord.userId),
teamIdIdx: index("team_id_idx").on(timeRecord.teamId),
}),
);

export const timeRecordRelations = relations(timeRecord, ({ one }) => ({
Expand Down Expand Up @@ -56,7 +56,7 @@ export const teamMember = pgSqlTable(
{
id: serial("id").primaryKey(),
teamId: uuid("team_id").notNull(),
userId: text("user_id").notNull(),
userId: uuid("user_id").notNull(),
role: roleEnum("role").notNull(),
dailyWorkload: serial("daily_workload").notNull(),
initialBalanceInMinutes: serial("initial_balance_in_minutes").notNull(),
Expand All @@ -67,8 +67,8 @@ export const teamMember = pgSqlTable(
},
(teamMember) => ({
unique: unique().on(teamMember.teamId, teamMember.userId),
// teamIdIdx: index("team_id_idx").on(teamMember.teamId),
// userIdIdx: index("user_id_idx").on(teamMember.userId),
teamIdIdx: index("team_id_idx").on(teamMember.teamId),
userIdIdx: index("user_id_idx").on(teamMember.userId),
}),
);

Expand Down
16 changes: 8 additions & 8 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"ui-add": "pnpm dlx shadcn-ui add && prettier src --write --list-different"
},
"dependencies": {
"@hookform/resolvers": "^3.3.4",
"@hookform/resolvers": "^3.6.0",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-icons": "^1.3.0",
Expand All @@ -30,7 +30,7 @@
"date-fns": "^3.6.0",
"next-themes": "^0.3.0",
"react-day-picker": "^8.10.1",
"react-hook-form": "^7.51.4",
"react-hook-form": "^7.51.5",
"sonner": "^1.4.41",
"tailwind-merge": "^2.2.2",
"tailwindcss-animate": "^1.0.7"
Expand All @@ -40,11 +40,11 @@
"@acme/prettier-config": "workspace:*",
"@acme/tailwind-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"@types/react": "^18.3.2",
"eslint": "^9.2.0",
"prettier": "^3.2.5",
"react": "18.3.1",
"tailwindcss": "^3.4.3",
"@types/react": "^18.3.3",
"eslint": "^9.4.0",
"prettier": "^3.3.1",
"react": "19.0.0-rc-827cbea417-20240606",
"tailwindcss": "^3.4.4",
"typescript": "^5.4.5",
"zod": "^3.23.8"
},
Expand All @@ -53,4 +53,4 @@
"zod": "^3.22.4"
},
"prettier": "@acme/prettier-config"
}
}
32 changes: 18 additions & 14 deletions packages/ui/src/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,27 @@ const buttonVariants = cva(
);

interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
extends React.ComponentPropsWithRef<"button">,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
}

const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
);
},
);
Button.displayName = "Button";
const Button = ({
className,
variant,
size,
ref,
asChild = false,
...props
}: ButtonProps) => {
const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
);
};

export { Button, buttonVariants };
57 changes: 31 additions & 26 deletions packages/ui/src/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,28 @@ const DialogPortal = DialogPrimitive.Portal;

const DialogClose = DialogPrimitive.Close;

const DialogOverlay = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
>(({ className, ...props }, ref) => (
const DialogOverlay = ({
className,
ref,
...props
}: React.ComponentPropsWithRef<typeof DialogPrimitive.Overlay>) => (
<DialogPrimitive.Overlay
ref={ref}
className={cn(
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
className,
)}
{...props}
/>
));
);
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;

const DialogContent = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
>(({ className, children, ...props }, ref) => (
const DialogContent = ({
className,
children,
ref,
...props
}: React.ComponentPropsWithRef<typeof DialogPrimitive.Content>) => (
<DialogPortal>
<DialogOverlay />
<DialogPrimitive.Content
Expand All @@ -50,7 +53,7 @@ const DialogContent = React.forwardRef<
</DialogPrimitive.Close>
</DialogPrimitive.Content>
</DialogPortal>
));
);
DialogContent.displayName = DialogPrimitive.Content.displayName;

const DialogHeader = ({
Expand Down Expand Up @@ -81,10 +84,11 @@ const DialogFooter = ({
);
DialogFooter.displayName = "DialogFooter";

const DialogTitle = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Title>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
>(({ className, ...props }, ref) => (
const DialogTitle = ({
className,
ref,
...props
}: React.ComponentPropsWithRef<typeof DialogPrimitive.Title>) => (
<DialogPrimitive.Title
ref={ref}
className={cn(
Expand All @@ -93,30 +97,31 @@ const DialogTitle = React.forwardRef<
)}
{...props}
/>
));
);
DialogTitle.displayName = DialogPrimitive.Title.displayName;

const DialogDescription = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Description>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
>(({ className, ...props }, ref) => (
const DialogDescription = ({
className,
ref,
...props
}: React.ComponentPropsWithRef<typeof DialogPrimitive.Description>) => (
<DialogPrimitive.Description
ref={ref}
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
));
);
DialogDescription.displayName = DialogPrimitive.Description.displayName;

export {
Dialog,
DialogPortal,
DialogOverlay,
DialogTrigger,
DialogClose,
DialogContent,
DialogHeader,
DialogDescription,
DialogFooter,
DialogHeader,
DialogOverlay,
DialogPortal,
DialogTitle,
DialogDescription,
DialogTrigger,
};
Loading

0 comments on commit 635055a

Please sign in to comment.