refactor: convert to bun-workspaces monorepo (desktop/ + www/)

- Move the Tauri app (React frontend + Rust backend) into desktop/ via
  git mv — configs unchanged (relative paths: tauri.conf.json, vite.config.ts)
- Root package.json becomes a private bun workspace container with
  orchestration scripts; desktop package renamed gridline-desktop
- Scaffold www/ with Astro 7 + Tailwind v4 (hand-wired vite plugin,
  static output, ready for Dokploy)
- Update release.yml for the new layout: projectPath: desktop,
  desktop/src-tauri resource paths, rust-cache workspace path
- Update README + AGENTS.md structure trees and dev commands
- Verified: vitest (1074), cargo test (354), desktop build, tauri dev
  (window launches), tauri build (dmg + app bundles), Astro build
This commit is contained in:
2026-08-16 19:31:53 +08:00
parent d752642b4d
commit 6854d889c5
400 changed files with 857 additions and 149 deletions
+97
View File
@@ -0,0 +1,97 @@
import { siPostgresql, siMysql, siSqlite, siRedis, siSupabase, siNeon } from "simple-icons";
import type { DbType } from "./types";
// Brand colors from simple-icons
const DB_COLORS: Record<DbType, string> = {
postgresql: `#${siPostgresql.hex}`,
mysql: `#${siMysql.hex}`,
redis: `#${siRedis.hex}`,
sqlite: `#${siSqlite.hex}`,
};
// SVG path data for each DB icon
const DB_PATHS: Record<DbType, string> = {
postgresql: siPostgresql.path,
mysql: siMysql.path,
redis: siRedis.path,
sqlite: siSqlite.path,
};
export const DB_LABELS: Record<DbType, string> = {
postgresql: "PostgreSQL",
mysql: "MySQL",
redis: "Redis",
sqlite: "SQLite",
};
interface DbIconProps {
type: DbType;
size?: number;
className?: string;
}
export function DbIcon({ type, size = 20, className }: DbIconProps) {
const path = DB_PATHS[type];
const color = DB_COLORS[type];
if (!path) return <span className="text-lg">❓</span>;
return (
<svg
role="img"
viewBox="0 0 24 24"
width={size}
height={size}
className={className}
fill={color}
xmlns="http://www.w3.org/2000/svg"
>
<path d={path} />
</svg>
);
}
// Keep backward compat for any legacy emoji usage
export const DB_ICONS: Record<DbType, string> = {
postgresql: "🐘",
mysql: "🐬",
redis: "⚡",
sqlite: "🗄️",
};
// ── Managed-PostgreSQL provider icons (Supabase, NeonDB) ──────────
// These are NOT DbType values; connections persist as db_type="postgresql".
type ProviderIconId = "supabase" | "neon";
const PROVIDER_ICON_DATA: Record<ProviderIconId, { hex: string; path: string }> = {
supabase: { hex: `#${siSupabase.hex}`, path: siSupabase.path },
neon: { hex: `#${siNeon.hex}`, path: siNeon.path },
};
export const PROVIDER_LABELS: Record<ProviderIconId, string> = {
supabase: "Supabase",
neon: "NeonDB",
};
interface ProviderIconProps {
id: ProviderIconId;
size?: number;
className?: string;
}
export function ProviderIcon({ id, size = 20, className }: ProviderIconProps) {
const data = PROVIDER_ICON_DATA[id];
if (!data) return <span className="text-lg">❓</span>;
return (
<svg
role="img"
viewBox="0 0 24 24"
width={size}
height={size}
className={className}
fill={data.hex}
xmlns="http://www.w3.org/2000/svg"
>
<path d={data.path} />
</svg>
);
}