From b3213045cec4ba1a426caac5c3c792290b5cca72 Mon Sep 17 00:00:00 2001 From: juan Date: Thu, 13 Nov 2025 18:25:47 +0100 Subject: [PATCH] remove unnecesary code --- package-lock.json | 38 +++++++++++++++++++++---- src/lib/hooks/user/useCreateUser.tsx | 38 ------------------------- src/lib/server/user.ts | 3 ++ src/routeTree.gen.ts | 23 ++------------- src/routes/_authed/register.tsx | 42 ---------------------------- 5 files changed, 38 insertions(+), 106 deletions(-) delete mode 100644 src/lib/hooks/user/useCreateUser.tsx delete mode 100644 src/routes/_authed/register.tsx diff --git a/package-lock.json b/package-lock.json index 3cc8032..7940d17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,8 +24,6 @@ "react": "^19.2.0", "react-dom": "^19.2.0", "sonner": "^2.0.7", - "tailwindcss": "^4.1.17", - "vite-tsconfig-paths": "^5.1.4", "zod": "^4.1.12" }, "devDependencies": { @@ -37,8 +35,10 @@ "@vitejs/plugin-react": "^5.1.1", "drizzle-kit": "^0.31.6", "jsdom": "^27.2.0", + "tailwindcss": "^4.1.17", "typescript": "^5.9.3", "vite": "^7.2.2", + "vite-tsconfig-paths": "^5.1.4", "web-vitals": "^5.1.0" } }, @@ -132,6 +132,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", @@ -801,6 +802,7 @@ } ], "license": "MIT", + "peer": true, "engines": { "node": ">=18" }, @@ -844,6 +846,7 @@ } ], "license": "MIT", + "peer": true, "engines": { "node": ">=18" } @@ -2825,6 +2828,7 @@ "resolved": "https://registry.npmjs.org/@heroui/system/-/system-2.4.23.tgz", "integrity": "sha512-kgYvfkIOQKM6CCBIlNSE2tXMtNrS1mvEUbvwnaU3pEYbMlceBtwA5v7SlpaJy/5dqKcTbfmVMUCmXnY/Kw4vaQ==", "license": "MIT", + "peer": true, "dependencies": { "@heroui/react-utils": "2.1.14", "@heroui/system-rsc": "2.3.20", @@ -2910,6 +2914,7 @@ "resolved": "https://registry.npmjs.org/@heroui/theme/-/theme-2.4.23.tgz", "integrity": "sha512-5hoaRWG+/d/t06p7Pfhz70DUP0Uggjids7/z2Ytgup4A8KAOvDIXxvHUDlk6rRHKiN1wDMNA5H+EWsSXB/m03Q==", "license": "MIT", + "peer": true, "dependencies": { "@heroui/shared-utils": "2.1.12", "clsx": "^1.2.1", @@ -5110,6 +5115,7 @@ "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.81.1.tgz", "integrity": "sha512-KSdY7xb2L0DlLmlYzIOghdw/na4gsMcqJ8u4sD6tOQJr+x3hLujU9s4R8N3ob84/1bkvpvlU5PYKa1ae+OICnw==", "license": "MIT", + "peer": true, "dependencies": { "@supabase/auth-js": "2.81.1", "@supabase/functions-js": "2.81.1", @@ -5431,6 +5437,7 @@ "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.8.tgz", "integrity": "sha512-4E0RP/0GJCxSNiRF2kAqE/LQkTJVlL/QNU7gIJSptaseV9HP6kOuA+N11y4bZKZxa3QopK3ZuewwutHx6DqDXQ==", "license": "MIT", + "peer": true, "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" @@ -5451,6 +5458,7 @@ "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.8.tgz", "integrity": "sha512-/3b9QGzkf4rE5/miL6tyhldQRlLXzMHcySOm/2Tm2OLEFE9P1ImkH0+OviDBSvyAvtAOJocar5xhd7vxdLi3aQ==", "license": "MIT", + "peer": true, "dependencies": { "@tanstack/query-core": "5.90.8" }, @@ -5484,6 +5492,7 @@ "resolved": "https://registry.npmjs.org/@tanstack/react-router/-/react-router-1.135.2.tgz", "integrity": "sha512-IzvCJ5bZ4dTEh65J1NrILF3Ab+ajRgsHYQYl/3du1sptRfQkUSsRYQGXffQQU3JH++plmO/tJXtRTmgrAp4inA==", "license": "MIT", + "peer": true, "dependencies": { "@tanstack/history": "1.133.28", "@tanstack/react-store": "^0.8.0", @@ -5686,6 +5695,7 @@ "resolved": "https://registry.npmjs.org/@tanstack/router-core/-/router-core-1.135.2.tgz", "integrity": "sha512-fhJSGmbqE78Ou6e+cnJ9exmjCzCZ9IXT2rApiPAgeItKj2yy1qmTEoR11n0x0fiNkkBxHL1us+QyG8JfNELiQA==", "license": "MIT", + "peer": true, "dependencies": { "@tanstack/history": "1.133.28", "@tanstack/store": "^0.8.0", @@ -6132,6 +6142,7 @@ "integrity": "sha512-tBFxBp9Nfyy5rsmefN+WXc1JeW/j2BpBHFdLZbEVfs9wn3E3NRFxwV0pJg8M1qQAexFpvz73hJXFofV0ZAu92A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "csstype": "^3.0.2" } @@ -6342,6 +6353,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.19", "caniuse-lite": "^1.0.30001751", @@ -6593,7 +6605,8 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/data-urls": { "version": "6.0.0", @@ -6905,6 +6918,7 @@ "integrity": "sha512-vVC0USHGtMi8+R4Kz8rt6JhEWLxsv9Rnu/lGYbPR8u47B+DCBksq9JarW0zOO7bs37hyOK1l2/oqtbciutL5+Q==", "hasInstallScript": true, "license": "MIT", + "peer": true, "bin": { "esbuild": "bin/esbuild" }, @@ -7019,6 +7033,7 @@ "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.23.12.tgz", "integrity": "sha512-6e78rdVtnBvlEVgu6eFEAgG9v3wLnYEboM8I5O5EXvfKC8gxGQB8wXJdhkMy10iVcn05jl6CNw7/HTsTCfwcWg==", "license": "MIT", + "peer": true, "dependencies": { "motion-dom": "^12.23.12", "motion-utils": "^12.23.6", @@ -7092,6 +7107,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", + "dev": true, "license": "MIT" }, "node_modules/goober": { @@ -7867,6 +7883,7 @@ "resolved": "https://registry.npmjs.org/postgres/-/postgres-3.4.7.tgz", "integrity": "sha512-Jtc2612XINuBjIl/QTWsV5UvE8UHuNblcO3vVADSrKsrc6RqGX6lOW1cEo3CM2v0XG4Nat8nI+YM7/f26VxXLw==", "license": "Unlicense", + "peer": true, "engines": { "node": ">=12" }, @@ -7905,6 +7922,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -7914,6 +7932,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz", "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==", "license": "MIT", + "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -8097,6 +8116,7 @@ "resolved": "https://registry.npmjs.org/seroval/-/seroval-1.3.2.tgz", "integrity": "sha512-RbcPH1n5cfwKrru7v7+zrZvjLurgHhGyso3HTyGtRivGWgYjbOmGuivCQaORNELjNONoK35nj28EoWul9sb1zQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=10" } @@ -8213,6 +8233,7 @@ "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.3.1.tgz", "integrity": "sha512-gBXpgUm/3rp1lMZZrM/w7D8GKqshif0zAymAhbCyIt8KMe+0v9DQ7cdYLR4FHH/cKpdTXb+A/tKKU3eolfsI+g==", "license": "MIT", + "peer": true, "funding": { "type": "github", "url": "https://github.com/sponsors/dcastil" @@ -8260,7 +8281,8 @@ "version": "1.3.3", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/tiny-warning": { "version": "1.0.3", @@ -8306,6 +8328,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -8375,6 +8398,7 @@ "version": "3.1.6", "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.6.tgz", "integrity": "sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==", + "dev": true, "license": "MIT", "bin": { "tsconfck": "bin/tsconfck.js" @@ -8420,8 +8444,9 @@ "version": "5.9.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "devOptional": true, + "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8567,6 +8592,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.2.2.tgz", "integrity": "sha512-BxAKBWmIbrDgrokdGZH1IgkIk/5mMHDreLDmCJ0qpyJaAteP8NvMhkwr/ZCQNqNH97bw/dANTE9PDzqwJghfMQ==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -8640,6 +8666,7 @@ "version": "5.1.4", "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-5.1.4.tgz", "integrity": "sha512-cYj0LRuLV2c2sMqhqhGpaO3LretdtMn/BVX4cPLanIZuwwrkVl+lK84E/miEXkCHWXuq65rhNN4rXsBcOB3S4w==", + "dev": true, "license": "MIT", "dependencies": { "debug": "^4.1.1", @@ -8677,6 +8704,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, diff --git a/src/lib/hooks/user/useCreateUser.tsx b/src/lib/hooks/user/useCreateUser.tsx deleted file mode 100644 index 5af033b..0000000 --- a/src/lib/hooks/user/useCreateUser.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { useMutation } from "@tanstack/react-query" -import { toast } from "sonner" -import type z from "zod" -import { profileFormSchema } from "@/lib/validation/user" -import { useValidation } from "../useValidation" - -type TProfileForm = z.infer - -export const useProfile = () => { - const { validate, errors } = useValidation({ - defaultSchema: profileFormSchema - }) - const signup = useMutation({ - mutationKey: ["create-profile"], - mutationFn: async (data: TProfileForm) => {}, - onSuccess: () => { - toast.success("Your profile is created..", { - id: "create-profile" - }) - } - }) - - const validateSignup = (formData: TProfileForm) => { - const isValid = validate({ formData }) - if (!isValid) { - toast.error("Don't create", { - id: "create-profile" - }) - } - signup.mutate(formData) - } - - return { - profile: validateSignup, - errors, - isPending: signup.isPending - } -} diff --git a/src/lib/server/user.ts b/src/lib/server/user.ts index 04e6c78..dbea281 100644 --- a/src/lib/server/user.ts +++ b/src/lib/server/user.ts @@ -72,6 +72,7 @@ export const signupUser = createServerFn({ method: "POST" }) email: data.email, password: data.password, options: { + // Estos son los metadatos data: { name: data.name, location: data.location @@ -89,3 +90,5 @@ export const signupUser = createServerFn({ method: "POST" }) href: data.redirectUrl || "/" }) }) + +// TODO: Add resend confirmation email function diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index 826d053..92d4cf9 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -14,7 +14,6 @@ import { Route as LogoutRouteImport } from './routes/logout' import { Route as LoginRouteImport } from './routes/login' import { Route as AuthedRouteImport } from './routes/_authed' import { Route as IndexRouteImport } from './routes/index' -import { Route as AuthedRegisterRouteImport } from './routes/_authed/register' import { Route as AuthedDashboardRouteImport } from './routes/_authed/dashboard' const SignupRoute = SignupRouteImport.update({ @@ -41,11 +40,6 @@ const IndexRoute = IndexRouteImport.update({ path: '/', getParentRoute: () => rootRouteImport, } as any) -const AuthedRegisterRoute = AuthedRegisterRouteImport.update({ - id: '/register', - path: '/register', - getParentRoute: () => AuthedRoute, -} as any) const AuthedDashboardRoute = AuthedDashboardRouteImport.update({ id: '/dashboard', path: '/dashboard', @@ -58,7 +52,6 @@ export interface FileRoutesByFullPath { '/logout': typeof LogoutRoute '/signup': typeof SignupRoute '/dashboard': typeof AuthedDashboardRoute - '/register': typeof AuthedRegisterRoute } export interface FileRoutesByTo { '/': typeof IndexRoute @@ -66,7 +59,6 @@ export interface FileRoutesByTo { '/logout': typeof LogoutRoute '/signup': typeof SignupRoute '/dashboard': typeof AuthedDashboardRoute - '/register': typeof AuthedRegisterRoute } export interface FileRoutesById { __root__: typeof rootRouteImport @@ -76,13 +68,12 @@ export interface FileRoutesById { '/logout': typeof LogoutRoute '/signup': typeof SignupRoute '/_authed/dashboard': typeof AuthedDashboardRoute - '/_authed/register': typeof AuthedRegisterRoute } export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath - fullPaths: '/' | '/login' | '/logout' | '/signup' | '/dashboard' | '/register' + fullPaths: '/' | '/login' | '/logout' | '/signup' | '/dashboard' fileRoutesByTo: FileRoutesByTo - to: '/' | '/login' | '/logout' | '/signup' | '/dashboard' | '/register' + to: '/' | '/login' | '/logout' | '/signup' | '/dashboard' id: | '__root__' | '/' @@ -91,7 +82,6 @@ export interface FileRouteTypes { | '/logout' | '/signup' | '/_authed/dashboard' - | '/_authed/register' fileRoutesById: FileRoutesById } export interface RootRouteChildren { @@ -139,13 +129,6 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } - '/_authed/register': { - id: '/_authed/register' - path: '/register' - fullPath: '/register' - preLoaderRoute: typeof AuthedRegisterRouteImport - parentRoute: typeof AuthedRoute - } '/_authed/dashboard': { id: '/_authed/dashboard' path: '/dashboard' @@ -158,12 +141,10 @@ declare module '@tanstack/react-router' { interface AuthedRouteChildren { AuthedDashboardRoute: typeof AuthedDashboardRoute - AuthedRegisterRoute: typeof AuthedRegisterRoute } const AuthedRouteChildren: AuthedRouteChildren = { AuthedDashboardRoute: AuthedDashboardRoute, - AuthedRegisterRoute: AuthedRegisterRoute, } const AuthedRouteWithChildren = diff --git a/src/routes/_authed/register.tsx b/src/routes/_authed/register.tsx deleted file mode 100644 index 5c1a665..0000000 --- a/src/routes/_authed/register.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { Button, Form, Input, Slider, Textarea } from "@heroui/react" -import { createFileRoute } from "@tanstack/react-router" -import type { FormEvent } from "react" -import { useProfile } from "@/lib/hooks/user/useCreateUser" - -export const Route = createFileRoute("/_authed/register")({ - component: RouteComponent -}) - -function RouteComponent() { - const { errors, isPending, profile } = useProfile() - const handleSubmit = (e: FormEvent) => { - e.preventDefault() - const formData = new FormData(e.currentTarget) - profile({ - id: "e6472b9d-01a9-4e2e-8bdc-0ddaa9baf5d8", - firstName: formData.get("firstName") as string, - lastName: formData.get("lastName") as string - }) - } - return ( -
-
- - - -