diff --git a/bun.lockb b/bun.lockb index 5dbf326..3e0773e 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/index.html b/index.html deleted file mode 100644 index bff1342..0000000 --- a/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - flash.comma.ai - - -
- - - - diff --git a/package.json b/package.json index 067f6ce..ae67038 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,9 @@ "private": true, "type": "module", "scripts": { - "dev": "node server", - "build": "npm run build:client && npm run build:server", - "build:client": "vite build --outDir dist/client", - "build:server": "vite build --outDir dist/server --ssr src/entry-server.jsx", - "serve": "NODE_ENV=production node server", - "start": "vite preview", + "dev": "vite", + "build": "vite build", + "start": "vite build && vite preview", "lint": "eslint . --ext js,jsx --report-unused-disable-directives", "test": "vitest" }, @@ -38,14 +35,12 @@ "eslint-plugin-react": "^7.34.2", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-refresh": "^0.4.7", - "express": "^4.19.2", "jsdom": "^22.1.0", "postcss": "^8.4.38", - "react-router-dom": "^6.24.1", "tailwindcss": "^3.4.3", + "vike": "^0.4.179", + "vike-react": "^0.4.17", "vite": "^5.2.12", - "vite-plugin-ssr": "^0.4.142", - "vite-plugin-style-import": "^2.0.0", "vite-svg-loader": "^5.1.0", "vitest": "^1.6.0" } diff --git a/src/app/favicon.ico b/public/favicon.ico similarity index 100% rename from src/app/favicon.ico rename to public/favicon.ico diff --git a/src/app/icon.png b/public/icon.png similarity index 100% rename from src/app/icon.png rename to public/icon.png diff --git a/src/app/icon.svg b/public/icon.svg similarity index 100% rename from src/app/icon.svg rename to public/icon.svg diff --git a/server.js b/server.js deleted file mode 100644 index e0b0a62..0000000 --- a/server.js +++ /dev/null @@ -1,53 +0,0 @@ -import fs from 'fs' -import path from 'path' -import { fileURLToPath } from 'url' -import express from 'express' -import { createServer as createViteServer } from 'vite' - -const __dirname = path.dirname(fileURLToPath(import.meta.url)) - -async function createServer() { - const app = express() - - const vite = await createViteServer({ - server: { middlewareMode: true }, - appType: 'custom' - }) - - app.use(vite.middlewares) - - app.use('*', async (req, res) => { - const url = req.originalUrl - - try { - let template = fs.readFileSync( - path.resolve(__dirname, 'index.html'), - 'utf-8' - ) - - const styleModule = await vite.ssrLoadModule('/src/index.css') - const css = styleModule.default - - template = await vite.transformIndexHtml(url, template) - template = template.replace( - '', - `` - ) - - const { render } = await vite.ssrLoadModule('/src/entry-server.jsx') - const appHtml = await render(url) - - let html = template.replace(``, appHtml) - - res.status(200).set({ 'Content-Type': 'text/html' }).end(html) - } catch (e) { - vite.ssrFixStacktrace(e) - console.error(e) - res.status(500).end(e.message) - } - }) - - app.listen(5173) -} - -createServer() diff --git a/src/app/Flash.client.jsx b/src/components/Flash.jsx similarity index 99% rename from src/app/Flash.client.jsx rename to src/components/Flash.jsx index 614fa09..4c8ce09 100644 --- a/src/app/Flash.client.jsx +++ b/src/components/Flash.jsx @@ -237,12 +237,8 @@ export default function Flash() {
- - {title} - - - {description} - + {title} + {description} {error && (