build: 改成 Bun workspaces 的 monorepo

- 根目录新增 package.json(workspaces: client、server),两边共用一个 bun.lock,
  依赖版本与原来两个 lockfile 完全一致
- 根目录脚本:bun run dev / build / build:staging / test / typecheck / fmt,
  取代 dev.sh;client 的 start 改名为 dev,包名改为 webpreview-client
- workspaces 用 isolated 安装,补上 client 一直直接 import 却没声明的 @codemirror/view
- server 镜像改用仓库根目录做构建上下文,只装 server 的依赖;
  .dockerignore 用白名单,不再把 node_modules、数据库等发给 docker
- CI 在根目录安装并构建前端

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-26 20:57:29 +08:00
1 parent a69ee16004
commit 4014aaabbf
10 files changed
+115 -137

No files matched your search

+3 -2
View File
@@ -1,10 +1,10 @@
{
"name": "web",
"name": "webpreview-client",
"private": true,
"version": "0.3.0",
"type": "module",
"scripts": {
"start": "bun --bun vite",
"dev": "bun --bun vite",
"build": "bun --bun vite build",
"build:staging": "bun --bun vite build --mode staging",
"fmt": "bun fmt src/"
@@ -13,6 +13,7 @@
"@codemirror/lang-css": "^6.3.1",
"@codemirror/lang-html": "^6.4.12",
"@codemirror/lang-javascript": "^6.2.5",
"@codemirror/view": "^6.41.1",
"@vueuse/core": "^15.0.0",
"axios": "^1.20.0",
"codemirror": "^6.0.2",