From 64838e85ba28d7d00bc67f5bf4f34e38e613ec4c Mon Sep 17 00:00:00 2001 From: syntaxbullet Date: Thu, 2 Jul 2026 22:50:58 +0200 Subject: [PATCH] refactor: move frontend code into view --- build.ts | 2 +- components.json | 2 +- src/index.ts | 2 +- tsconfig.json | 4 +++- {src => view}/App.tsx | 0 {src => view}/components/ui/button.tsx | 0 {src => view}/frontend.tsx | 2 +- {src => view}/index.css | 2 +- {src => view}/index.html | 0 {src => view}/lib/utils.ts | 0 {styles => view/styles}/globals.css | 0 11 files changed, 8 insertions(+), 6 deletions(-) rename {src => view}/App.tsx (100%) rename {src => view}/components/ui/button.tsx (100%) rename {src => view}/frontend.tsx (92%) rename {src => view}/index.css (80%) rename {src => view}/index.html (100%) rename {src => view}/lib/utils.ts (100%) rename {styles => view/styles}/globals.css (100%) diff --git a/build.ts b/build.ts index 15778df..a53bcba 100644 --- a/build.ts +++ b/build.ts @@ -5,7 +5,7 @@ import path from "node:path"; const outdir = path.join(process.cwd(), "dist"); await rm(outdir, { recursive: true, force: true }); -const entrypoints = [...new Bun.Glob("src/**/*.html").scanSync()]; +const entrypoints = [...new Bun.Glob("view/**/*.html").scanSync()]; const result = await Bun.build({ entrypoints, diff --git a/components.json b/components.json index a084701..8c2f758 100644 --- a/components.json +++ b/components.json @@ -5,7 +5,7 @@ "tsx": true, "tailwind": { "config": "", - "css": "styles/globals.css", + "css": "view/styles/globals.css", "baseColor": "neutral", "cssVariables": true, "prefix": "" diff --git a/src/index.ts b/src/index.ts index a00c973..cae1c38 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import { serve } from "bun"; -import index from "./index.html"; +import index from "../view/index.html"; const server = serve({ routes: { diff --git a/tsconfig.json b/tsconfig.json index f4de897..5530418 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,7 +23,9 @@ "noImplicitOverride": true, "paths": { - "@/*": ["./src/*"] + "@/*": ["./view/*"], + "@view/*": ["./view/*"], + "@core/*": ["./core/*"] }, // Some stricter flags (disabled by default) diff --git a/src/App.tsx b/view/App.tsx similarity index 100% rename from src/App.tsx rename to view/App.tsx diff --git a/src/components/ui/button.tsx b/view/components/ui/button.tsx similarity index 100% rename from src/components/ui/button.tsx rename to view/components/ui/button.tsx diff --git a/src/frontend.tsx b/view/frontend.tsx similarity index 92% rename from src/frontend.tsx rename to view/frontend.tsx index cbfcf48..3443539 100644 --- a/src/frontend.tsx +++ b/view/frontend.tsx @@ -2,7 +2,7 @@ * This file is the entry point for the React app, it sets up the root * element and renders the App component to the DOM. * - * It is included in `src/index.html`. + * It is included in `view/index.html`. */ import { StrictMode } from "react"; diff --git a/src/index.css b/view/index.css similarity index 80% rename from src/index.css rename to view/index.css index 6f51a3b..7012ea1 100644 --- a/src/index.css +++ b/view/index.css @@ -1,4 +1,4 @@ -@import "../styles/globals.css"; +@import "./styles/globals.css"; @layer base { :root { diff --git a/src/index.html b/view/index.html similarity index 100% rename from src/index.html rename to view/index.html diff --git a/src/lib/utils.ts b/view/lib/utils.ts similarity index 100% rename from src/lib/utils.ts rename to view/lib/utils.ts diff --git a/styles/globals.css b/view/styles/globals.css similarity index 100% rename from styles/globals.css rename to view/styles/globals.css