From 54fa5ccc3ba65a1693e680a8feb9379ceec91888 Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 06:20:28 +0200 Subject: [PATCH] =?UTF-8?q?feat(router-phase10):=20App=20+=20routes/index?= =?UTF-8?q?=20f=C3=BCr=20/project-templates=20[tsc:fail]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .phase10-state.json | 5 +++-- GENERATION_LOG.md | 19 +++++++++++++++++++ apps/api/src/routes/index.ts | 2 ++ apps/web/src/App.tsx | 24 ++++++++++++++++++------ 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/.phase10-state.json b/.phase10-state.json index 293e5f6..83ec4bb 100644 --- a/.phase10-state.json +++ b/.phase10-state.json @@ -1,12 +1,13 @@ { "completed_features": [], - "current_feature": "api-client-phase10", + "current_feature": "router-phase10", "started_at": "2026-05-23T06:10:51.530595", "attempted_features": [ "markdown-notes-time-entry", "customer-tags", "project-templates", "language-toggle", - "keyboard-help-modal" + "keyboard-help-modal", + "api-client-phase10" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 1daed87..ab0dd0d 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -1265,3 +1265,22 @@ src/index.ts(27,25): error TS2769: No overload matches this call. Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy +- `06:19:32` **INFO** Committed feature api-client-phase10 +- `06:19:33` **INFO** Pushed: rc=0 + +## Phase-3 Feature: router-phase10 (2026-05-23 06:19:33) + +- `06:19:33` **INFO** Description: App + routes/index für /project-templates +- `06:19:33` **INFO** Generating apps/api/src/routes/index.ts (ERWEITERT — füge projectTemplateRoutes ('/api/project-templates').…) +- `06:19:43` **INFO** wrote 1246 chars in 9.8s (attempt 1) +- `06:19:43` **INFO** Generating apps/web/src/App.tsx (ERWEITERT — füge /project-templates (admin-only). Behalte alles.…) +- `06:20:26` **INFO** wrote 5241 chars in 43.8s (attempt 1) +- `06:20:26` **INFO** Running tsc --noEmit on api… +- `06:20:28` **WARN** tsc errors: +src/index.ts(27,25): error TS2769: No overload matches this call. + Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. + Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTypeProvider>, opts: { ...; }, done: (err?: Error | undefined) => void): void'. + Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. + Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy diff --git a/apps/api/src/routes/index.ts b/apps/api/src/routes/index.ts index c45b048..eca3975 100644 --- a/apps/api/src/routes/index.ts +++ b/apps/api/src/routes/index.ts @@ -2,6 +2,7 @@ import { FastifyInstance } from "fastify" import authRoutes from "./auth" import customerRoutes from "./customers" import projectRoutes from "./projects" +import projectTemplateRoutes from "./project-templates" import timeEntryRoutes from "./time-entries" import userRoutes from "./users" import settingsRoutes from "./settings" @@ -15,6 +16,7 @@ export async function setupRoutes(server: FastifyInstance) { server.register(timeEntryRoutes, { prefix: "/api/time-entries" }) server.register(customerRoutes, { prefix: "/api/customers" }) server.register(projectRoutes, { prefix: "/api/projects" }) + server.register(projectTemplateRoutes, { prefix: "/api/project-templates" }) server.register(userRoutes, { prefix: "/api/users" }) server.register(settingsRoutes, { prefix: "/api/settings" }) server.register(auditLogRoutes, { prefix: "/api/audit-log" }) diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index fea2053..185f2e3 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -16,6 +16,7 @@ import Webhooks from "./pages/Webhooks" import TwoFactorAuth from "./pages/TwoFactorAuth" import Billing from "./pages/Billing" import Integrations from "./pages/Integrations" +import ProjectTemplates from "./pages/ProjectTemplates" import Nav from "./components/Nav" import CommandPalette from "./components/CommandPalette" import KeyboardHelp from "./components/KeyboardHelp" @@ -159,6 +160,13 @@ const adminRoute = createRoute({ component: AdminUsers }) +const projectTemplatesRoute = createRoute({ + getParentRoute: () => rootRoute, + path: "/project-templates", + beforeLoad: adminCheck, + component: ProjectTemplates +}) + const auditLogRoute = createRoute({ getParentRoute: () => rootRoute, path: "/audit-log", @@ -180,7 +188,7 @@ const webhooksRoute = createRoute({ component: Webhooks }) -const routeTree = rootRoute.addChildren([ +const routeTree = [ loginRoute, indexRoute, timeEntriesRoute, @@ -195,12 +203,16 @@ const routeTree = rootRoute.addChildren([ billingRoute, integrationsRoute, adminRoute, + projectTemplatesRoute, auditLogRoute, settingsRoute, webhooksRoute -]) +] -const router = createRouter({ routeTree }) +const router = createRouter({ + routeTree, + defaultPreload: 'intent' +}) declare module "@tanstack/react-router" { interface Register { @@ -210,8 +222,8 @@ declare module "@tanstack/react-router" { export default function App() { return ( - - - + + + ) } \ No newline at end of file