diff --git a/apps/api/turbo.json b/apps/api/turbo.json index fe9b1a200..8e5097806 100644 --- a/apps/api/turbo.json +++ b/apps/api/turbo.json @@ -5,12 +5,7 @@ "build": { "dependsOn": ["@buster/database#build"], "outputs": ["target/release/**"], - "inputs": [ - "server/**/*", - "libs/**/*", - "Cargo.toml", - "Cargo.lock" - ] + "inputs": ["server/**/*", "libs/**/*", "Cargo.toml", "Cargo.lock"] }, "start": { "dependsOn": ["@buster/database#start", "build"], diff --git a/apps/momentic/package.json b/apps/momentic/package.json index 5ad328fc8..22771e40d 100644 --- a/apps/momentic/package.json +++ b/apps/momentic/package.json @@ -29,4 +29,4 @@ "momentic": "^2.16.0", "tsx": "catalog:" } -} \ No newline at end of file +} diff --git a/apps/web/src/components/features/auth/useAuthMutations.ts b/apps/web/src/components/features/auth/useAuthMutations.ts index 7a545dc31..1ae4b73aa 100644 --- a/apps/web/src/components/features/auth/useAuthMutations.ts +++ b/apps/web/src/components/features/auth/useAuthMutations.ts @@ -19,14 +19,23 @@ export const useOAuthMutation = ( setLastUsedMethod: (method: SignInTypes) => void ) => { return useMutation({ - mutationFn, + mutationFn: async () => { + const result = await mutationFn(); + if (!result.success) { + throw new Error(result.error || `${type} authentication failed`); + } + return result; + }, onSuccess: (data) => { if (data.success && data.url) { setLastUsedMethod(type); window.location.href = data.url; } }, - throwOnError: true, + retry: false, + onError: (error) => { + console.error(error); + }, }); }; @@ -85,34 +94,43 @@ export const useAuthMutations = (redirectTo?: string | null, onSignUpSuccess?: ( // Email/Password Mutations const emailSignInMutation = useMutation({ - mutationFn: ({ email, password }: { email: string; password: string }) => - signInWithEmailAndPassword({ data: { email, password, redirectUrl: redirectTo } }), - onSuccess: async (data) => { - if (!data.error) { - setLastUsedMethod('email'); - await navigate({ to: redirectTo || '/app/home' }); - } - if (data.error) { - throw new Error(data.message); + mutationFn: async ({ email, password }: { email: string; password: string }) => { + const result = await signInWithEmailAndPassword({ + data: { email, password, redirectUrl: redirectTo }, + }); + if (result.error) { + throw new Error(result.message); } + return result; + }, + onSuccess: async () => { + setLastUsedMethod('email'); + await navigate({ to: redirectTo || '/app/home' }); + }, + retry: false, + onError: (error) => { + console.error(error); }, - throwOnError: true, }); const emailSignUpMutation = useMutation({ - mutationFn: ({ email, password }: { email: string; password: string }) => - signUpWithEmailAndPassword({ data: { email, password, redirectTo } }), - onSuccess: (data) => { - if (data.error) { - throw new Error(data.error); + mutationFn: async ({ email, password }: { email: string; password: string }) => { + const result = await signUpWithEmailAndPassword({ data: { email, password, redirectTo } }); + if (!result.success) { + throw new Error(result.error || 'Sign up failed'); } - if (data.success) { - setLastUsedMethod('email'); - if (onSignUpSuccess) { - onSignUpSuccess(); - } + return result; + }, + onSuccess: () => { + setLastUsedMethod('email'); + if (onSignUpSuccess) { + onSignUpSuccess(); } }, + retry: false, + onError: (error) => { + console.error(error); + }, }); // Combined state diff --git a/package.json b/package.json index 1e87ef9e9..70f8d9934 100644 --- a/package.json +++ b/package.json @@ -64,12 +64,10 @@ "packageManager": "pnpm@10.17.1", "pnpm": { "peerDependencyRules": { - "ignoreMissing": [ - "shiki" - ], + "ignoreMissing": ["shiki"], "allowedVersions": { "shiki": "3" } } } -} \ No newline at end of file +} diff --git a/packages/access-controls/package.json b/packages/access-controls/package.json index 2cf1bc9ad..232bc84f4 100644 --- a/packages/access-controls/package.json +++ b/packages/access-controls/package.json @@ -16,8 +16,6 @@ "prebuild": "[ \"$SKIP_ENV_CHECK\" = \"true\" ] || tsx scripts/validate-env.ts", "build": "tsc", "build:dry-run": "tsc", - "build:commonjs": "tsc --module commonjs --moduleResolution node", - "build:commonjs:watch": "npm run build:commonjs && tsc --module commonjs --moduleResolution node --watch", "dev": "tsc --watch", "dev:fast": "tsc --watch", "lint": "biome check --write", diff --git a/packages/access-controls/turbo.json b/packages/access-controls/turbo.json index 698cd89aa..36a3f169c 100644 --- a/packages/access-controls/turbo.json +++ b/packages/access-controls/turbo.json @@ -2,17 +2,6 @@ "$schema": "https://turborepo.com/schema.json", "extends": ["//"], "tasks": { - "build:commonjs": { - "cache": false, - "persistent": false, - "dependsOn": ["@buster/database#build:commonjs"], - "outputs": ["dist/**"] - }, - "build:commonjs:watch": { - "cache": false, - "persistent": true, - "dependsOn": ["build:commonjs"] - }, "dev": { "cache": false, "persistent": true, diff --git a/packages/ai/turbo.json b/packages/ai/turbo.json index 27a9a15e4..4fec5444f 100644 --- a/packages/ai/turbo.json +++ b/packages/ai/turbo.json @@ -2,22 +2,6 @@ "$schema": "https://turbo.build/schema.json", "extends": ["//"], "tasks": { - "dev:mastra": { - "cache": false, - "persistent": true, - "dependsOn": [ - "@buster/database#build:commonjs", - "@buster/access-controls#build:commonjs", - "@buster/data-source#build:commonjs", - "@buster/search#build:commonjs" - ], - "with": [ - "@buster/database#build:commonjs:watch", - "@buster/access-controls#build:commonjs:watch", - "@buster/data-source#build:commonjs:watch", - "@buster/search#build:commonjs:watch" - ] - }, "dev": { "cache": false, "persistent": true, diff --git a/packages/data-source/package.json b/packages/data-source/package.json index 46de8951b..c84b8f6ac 100644 --- a/packages/data-source/package.json +++ b/packages/data-source/package.json @@ -16,8 +16,6 @@ "prebuild": "[ \"$SKIP_ENV_CHECK\" = \"true\" ] || tsx scripts/validate-env.ts", "build": "tsc", "build:dry-run": "tsc", - "build:commonjs": "tsc --module commonjs --moduleResolution node", - "build:commonjs:watch": "npm run build:commonjs && tsc --module commonjs --moduleResolution node --watch", "lint": "biome check --write", "lint:fix": "biome check --write", "test": "vitest run", diff --git a/packages/data-source/turbo.json b/packages/data-source/turbo.json index 290ae3804..3c452b6ad 100644 --- a/packages/data-source/turbo.json +++ b/packages/data-source/turbo.json @@ -1,16 +1,5 @@ { "$schema": "https://turborepo.com/schema.json", "extends": ["//"], - "tasks": { - "build:commonjs": { - "cache": false, - "persistent": false, - "outputs": ["dist/**"] - }, - "build:commonjs:watch": { - "cache": false, - "persistent": true, - "dependsOn": ["build:commonjs"] - } - } + "tasks": {} } diff --git a/turbo.json b/turbo.json index 211d3eb45..fa7c42efa 100644 --- a/turbo.json +++ b/turbo.json @@ -4,25 +4,13 @@ "concurrency": "20", "tasks": { "build": { - "dependsOn": [ - "^build" - ], - "outputs": [ - "dist/**", - ".next/**" - ] + "dependsOn": ["^build"], + "outputs": ["dist/**", ".next/**"] }, "build:dry-run": { - "dependsOn": [ - "^build:dry-run" - ], - "outputs": [ - "dist/**", - ".next/**" - ], - "env": [ - "SKIP_ENV_CHECK" - ] + "dependsOn": ["^build:dry-run"], + "outputs": ["dist/**", ".next/**"], + "env": ["SKIP_ENV_CHECK"] }, "dev": { "cache": false, @@ -37,29 +25,19 @@ "persistent": true }, "lint": { - "dependsOn": [ - "^lint" - ] + "dependsOn": ["^lint"] }, "typecheck": { - "dependsOn": [ - "^build" - ] + "dependsOn": ["^build"] }, "test": { - "dependsOn": [ - "^build" - ] + "dependsOn": ["^build"] }, "test:unit": { - "dependsOn": [ - "^test:unit" - ] + "dependsOn": ["^test:unit"] }, "test:integration": { - "dependsOn": [ - "^build" - ] + "dependsOn": ["^build"] }, "test:watch": { "cache": false, @@ -74,53 +52,23 @@ "persistent": true }, "test:coverage": { - "dependsOn": [ - "^build" - ], - "outputs": [ - "coverage/**" - ] - }, - "build:commonjs": { - "cache": false, - "persistent": false, - "outputs": [ - "dist/**" - ] - }, - "build:commonjs:watch": { - "cache": false, - "persistent": true, - "dependsOn": [ - "build:commonjs" - ] + "dependsOn": ["^build"], + "outputs": ["coverage/**"] }, "db:migrate": { - "cache": false, - "env": [ - "NODE_TLS_REJECT_UNAUTHORIZED" - ] + "cache": false }, "db:seed": { - "cache": false, - "env": [ - "DATABASE_URL", - "ENVIRONMENT", - "NODE_ENV" - ] + "cache": false }, "db:init": { "cache": false, - "dependsOn": ["db:migrate"], - "env": [ - "DATABASE_URL", - "ENVIRONMENT", - "NODE_ENV" - ] + "dependsOn": ["db:migrate"] } }, "globalEnv": [ "NODE_ENV", + "NODE_TLS_REJECT_UNAUTHORIZED", "CI", "VERCEL", "VERCEL_ENV", @@ -181,4 +129,4 @@ "NODE_TLS_REJECT_UNAUTHORIZED" ], "envMode": "strict" -} \ No newline at end of file +}