Ganti Image Logo
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -33,6 +33,9 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
|||||||
# Finder (MacOS) folder config
|
# Finder (MacOS) folder config
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
# Dashboard-MD
|
||||||
|
Dashboard-MD
|
||||||
|
|
||||||
# Playwright artifacts
|
# Playwright artifacts
|
||||||
test-results/
|
test-results/
|
||||||
playwright-report/
|
playwright-report/
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "bun run gen:api && REACT_EDITOR=antigravity bun --hot src/index.ts",
|
"dev": "lsof -ti:3000 | xargs kill -9 2>/dev/null || true; bun run gen:api && REACT_EDITOR=antigravity bun --hot src/index.ts",
|
||||||
"lint": "biome check .",
|
"lint": "biome check .",
|
||||||
"check": "biome check --write .",
|
"check": "biome check --write .",
|
||||||
"format": "biome format --write .",
|
"format": "biome format --write .",
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"test": "bun test __tests__/api",
|
"test": "bun test __tests__/api",
|
||||||
"test:ui": "bun test --ui __tests__/api",
|
"test:ui": "bun test --ui __tests__/api",
|
||||||
"test:e2e": "bun run build && playwright test",
|
"test:e2e": "bun run build && playwright test",
|
||||||
"build": "bun build ./src/index.html --outdir=dist --sourcemap --target=browser --minify --define:process.env.NODE_ENV='\"production\"' --env='VITE_*'",
|
"build": "bun build ./src/index.html --outdir=dist --sourcemap --target=browser --minify --define:process.env.NODE_ENV='\"production\"' --env='VITE_*' && cp -r public/* dist/ 2>/dev/null || true",
|
||||||
"start": "NODE_ENV=production bun src/index.ts",
|
"start": "NODE_ENV=production bun src/index.ts",
|
||||||
"seed": "bun prisma/seed.ts"
|
"seed": "bun prisma/seed.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
BIN
public/logo-desa-plus.png
Normal file
BIN
public/logo-desa-plus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -1,13 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
Badge,
|
|
||||||
Box,
|
Box,
|
||||||
Collapse,
|
Collapse,
|
||||||
Group,
|
Image,
|
||||||
Input,
|
Input,
|
||||||
NavLink as MantineNavLink,
|
NavLink as MantineNavLink,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
useMantineColorScheme
|
||||||
useMantineColorScheme,
|
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useLocation, useNavigate } from "@tanstack/react-router";
|
import { useLocation, useNavigate } from "@tanstack/react-router";
|
||||||
import { ChevronDown, ChevronUp, Search } from "lucide-react";
|
import { ChevronDown, ChevronUp, Search } from "lucide-react";
|
||||||
@@ -66,30 +64,7 @@ export function Sidebar({ className }: SidebarProps) {
|
|||||||
return (
|
return (
|
||||||
<Box className={className}>
|
<Box className={className}>
|
||||||
{/* Logo */}
|
{/* Logo */}
|
||||||
<Box
|
<Image src={"/logo-desa-plus.png"} width={201} height={84} />
|
||||||
p="md"
|
|
||||||
style={{ borderBottom: "1px solid var(--mantine-color-gray-3)" }}
|
|
||||||
>
|
|
||||||
<Group gap="xs">
|
|
||||||
<Badge
|
|
||||||
color="dark"
|
|
||||||
variant="filled"
|
|
||||||
size="xl"
|
|
||||||
radius="md"
|
|
||||||
py="xs"
|
|
||||||
px="md"
|
|
||||||
style={{ fontSize: "1.5rem", fontWeight: "bold" }}
|
|
||||||
>
|
|
||||||
DESA
|
|
||||||
</Badge>
|
|
||||||
<Badge color="green" variant="filled" size="md" radius="md">
|
|
||||||
+
|
|
||||||
</Badge>
|
|
||||||
</Group>
|
|
||||||
<Text size="xs" c="dimmed" mt="xs">
|
|
||||||
Digitalisasi Desa Transparansi Kerja
|
|
||||||
</Text>
|
|
||||||
</Box>
|
|
||||||
|
|
||||||
{/* Search */}
|
{/* Search */}
|
||||||
<Box p="md">
|
<Box p="md">
|
||||||
|
|||||||
BIN
src/components/ui/logo-desa-plus.png
Normal file
BIN
src/components/ui/logo-desa-plus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
34
src/index.ts
34
src/index.ts
@@ -95,10 +95,27 @@ if (!isProduction) {
|
|||||||
getHeader(name: string) {
|
getHeader(name: string) {
|
||||||
return this.headers[name.toLowerCase()];
|
return this.headers[name.toLowerCase()];
|
||||||
},
|
},
|
||||||
|
writeHead(code: number, headers: Record<string, string>) {
|
||||||
|
this.statusCode = code;
|
||||||
|
Object.assign(this.headers, headers);
|
||||||
|
},
|
||||||
|
write(chunk: any, callback?: () => void) {
|
||||||
|
// Collect chunks for streaming responses
|
||||||
|
if (!this._chunks) this._chunks = [];
|
||||||
|
this._chunks.push(chunk);
|
||||||
|
if (callback) callback();
|
||||||
|
return true; // Indicate we can accept more data
|
||||||
|
},
|
||||||
headers: {} as Record<string, string>,
|
headers: {} as Record<string, string>,
|
||||||
end(data: any) {
|
end(data: any) {
|
||||||
// Handle potential Buffer or string data from Vite
|
// Handle potential Buffer or string data from Vite
|
||||||
let body = data;
|
let body = data;
|
||||||
|
|
||||||
|
// If we have collected chunks from write() calls, combine them
|
||||||
|
if (this._chunks && this._chunks.length > 0) {
|
||||||
|
body = Buffer.concat(this._chunks);
|
||||||
|
}
|
||||||
|
|
||||||
if (data instanceof Uint8Array) {
|
if (data instanceof Uint8Array) {
|
||||||
body = data;
|
body = data;
|
||||||
} else if (typeof data === "string") {
|
} else if (typeof data === "string") {
|
||||||
@@ -158,6 +175,11 @@ if (!isProduction) {
|
|||||||
if (fs.existsSync(srcPath)) {
|
if (fs.existsSync(srcPath)) {
|
||||||
filePath = srcPath;
|
filePath = srcPath;
|
||||||
}
|
}
|
||||||
|
// Check public folder for static assets
|
||||||
|
const publicPath = path.join("public", pathname);
|
||||||
|
if (fs.existsSync(publicPath)) {
|
||||||
|
filePath = publicPath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. If not found and looks like an asset (has extension), try root of dist or src
|
// 2. If not found and looks like an asset (has extension), try root of dist or src
|
||||||
@@ -173,8 +195,18 @@ if (!isProduction) {
|
|||||||
) {
|
) {
|
||||||
filePath = fallbackDistPath;
|
filePath = fallbackDistPath;
|
||||||
}
|
}
|
||||||
|
// Try public folder
|
||||||
|
else {
|
||||||
|
const fallbackPublicPath = path.join("public", filename);
|
||||||
|
if (
|
||||||
|
fs.existsSync(fallbackPublicPath) &&
|
||||||
|
fs.statSync(fallbackPublicPath).isFile()
|
||||||
|
) {
|
||||||
|
filePath = fallbackPublicPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
// Special handling for PWA files in src
|
// Special handling for PWA files in src
|
||||||
else if (pathname.includes("assetlinks.json")) {
|
if (pathname.includes("assetlinks.json")) {
|
||||||
const srcFilename = pathname.includes("assetlinks.json")
|
const srcFilename = pathname.includes("assetlinks.json")
|
||||||
? ".well-known/assetlinks.json"
|
? ".well-known/assetlinks.json"
|
||||||
: filename;
|
: filename;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { createServer as createViteServer } from "vite";
|
|||||||
export async function createVite() {
|
export async function createVite() {
|
||||||
return createViteServer({
|
return createViteServer({
|
||||||
root: process.cwd(),
|
root: process.cwd(),
|
||||||
|
publicDir: "public",
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"@": path.resolve(process.cwd(), "./src"),
|
"@": path.resolve(process.cwd(), "./src"),
|
||||||
|
|||||||
Reference in New Issue
Block a user