refactor: 统一打包命令为 dist 体系,build 仅编译不打包
- build:linux/mac/win → dist/dist:linux/dist:mac/dist:win - Turbo 任务依赖:desktop#dist:* → server#compile → server#build - 根目录 bun dist 一条命令完成完整打包流水线 - 更新 AGENTS.md 文档同步命令变更
This commit is contained in:
12
AGENTS.md
12
AGENTS.md
@@ -20,6 +20,11 @@ Guidelines for AI agents working in this Bun monorepo.
|
|||||||
```bash
|
```bash
|
||||||
bun dev # Start all apps in dev mode
|
bun dev # Start all apps in dev mode
|
||||||
bun build # Build all apps
|
bun build # Build all apps
|
||||||
|
bun compile # Compile server to standalone binary (depends on build)
|
||||||
|
bun dist # Full packaging pipeline: server build → compile → desktop distributable (current platform)
|
||||||
|
bun dist:linux # Full pipeline → Linux distributable
|
||||||
|
bun dist:mac # Full pipeline → macOS distributable
|
||||||
|
bun dist:win # Full pipeline → Windows distributable
|
||||||
bun fix # Lint + format (Biome auto-fix)
|
bun fix # Lint + format (Biome auto-fix)
|
||||||
bun typecheck # TypeScript check across monorepo
|
bun typecheck # TypeScript check across monorepo
|
||||||
```
|
```
|
||||||
@@ -43,9 +48,10 @@ bun db:studio # Open Drizzle Studio
|
|||||||
```bash
|
```bash
|
||||||
bun dev # electron-vite dev mode (requires server dev running)
|
bun dev # electron-vite dev mode (requires server dev running)
|
||||||
bun build # electron-vite build (main + preload)
|
bun build # electron-vite build (main + preload)
|
||||||
bun build:win # Build + package for Windows
|
bun dist # Build + package for current platform
|
||||||
bun build:mac # Build + package for macOS
|
bun dist:linux # Build + package for Linux
|
||||||
bun build:linux # Build + package for Linux
|
bun dist:mac # Build + package for macOS
|
||||||
|
bun dist:win # Build + package for Windows
|
||||||
bun fix # Biome auto-fix
|
bun fix # Biome auto-fix
|
||||||
bun typecheck # TypeScript check
|
bun typecheck # TypeScript check
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -24,9 +24,10 @@ Thin Electron shell hosting the fullstack server app.
|
|||||||
```bash
|
```bash
|
||||||
bun dev # electron-vite dev (requires server dev running)
|
bun dev # electron-vite dev (requires server dev running)
|
||||||
bun build # electron-vite build (main + preload)
|
bun build # electron-vite build (main + preload)
|
||||||
bun build:win # Build + package for Windows
|
bun dist # Build + package for current platform
|
||||||
bun build:mac # Build + package for macOS
|
bun dist:linux # Build + package for Linux
|
||||||
bun build:linux # Build + package for Linux
|
bun dist:mac # Build + package for macOS
|
||||||
|
bun dist:win # Build + package for Windows
|
||||||
bun fix # Biome auto-fix
|
bun fix # Biome auto-fix
|
||||||
bun typecheck # TypeScript check
|
bun typecheck # TypeScript check
|
||||||
```
|
```
|
||||||
@@ -57,10 +58,15 @@ bun typecheck # TypeScript check
|
|||||||
|
|
||||||
## Production Build Workflow
|
## Production Build Workflow
|
||||||
|
|
||||||
1. **Build server**: `bun build` in `apps/server` → `.output/`
|
From monorepo root, run `bun dist` to execute the full pipeline automatically (via Turbo task dependencies):
|
||||||
2. **Compile server**: `bun compile` in `apps/server` → `out/server-{platform}`
|
|
||||||
3. **Copy binary**: Copy the platform-appropriate binary to `apps/desktop/resources/server`
|
1. **Build server**: `apps/server` → `vite build` → `.output/`
|
||||||
4. **Package desktop**: `bun build:linux` (or `:mac` / `:win`) in `apps/desktop`
|
2. **Compile server**: `apps/server` → `bun compile.ts` → `out/server-{platform}`
|
||||||
|
3. **Package desktop**: `apps/desktop` → `electron-vite build` + `electron-builder` → distributable
|
||||||
|
|
||||||
|
The `electron-builder.yml` `extraResources` config reads binaries directly from `../server/out/`, no manual copy needed.
|
||||||
|
|
||||||
|
To build for a specific platform explicitly, use `bun dist:linux` / `bun dist:mac` / `bun dist:win` in `apps/desktop`.
|
||||||
|
|
||||||
## Critical Rules
|
## Critical Rules
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,11 @@
|
|||||||
"main": "out/main/index.js",
|
"main": "out/main/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "electron-vite build",
|
"build": "electron-vite build",
|
||||||
"build:linux": "electron-vite build && electron-builder --linux --config",
|
|
||||||
"build:mac": "electron-vite build && electron-builder --mac --config",
|
|
||||||
"build:win": "electron-vite build && electron-builder --win --config",
|
|
||||||
"dev": "electron-vite dev",
|
"dev": "electron-vite dev",
|
||||||
|
"dist": "bun run build && electron-builder --config",
|
||||||
|
"dist:linux": "bun run build && electron-builder --linux --config",
|
||||||
|
"dist:mac": "bun run build && electron-builder --mac --config",
|
||||||
|
"dist:win": "bun run build && electron-builder --win --config",
|
||||||
"fix": "biome check --write",
|
"fix": "biome check --write",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ bun db:studio # Drizzle Studio GUI
|
|||||||
|
|
||||||
# Build
|
# Build
|
||||||
bun build # Production build → .output/
|
bun build # Production build → .output/
|
||||||
bun compile # Compile to standalone binary
|
bun compile # Compile to standalone binary (depends on build)
|
||||||
|
# Also triggered automatically by root `bun dist`
|
||||||
|
|
||||||
# Code Quality
|
# Code Quality
|
||||||
bun fix # Biome auto-fix
|
bun fix # Biome auto-fix
|
||||||
|
|||||||
@@ -11,6 +11,10 @@
|
|||||||
"build": "turbo run build",
|
"build": "turbo run build",
|
||||||
"compile": "turbo run compile",
|
"compile": "turbo run compile",
|
||||||
"dev": "turbo run dev",
|
"dev": "turbo run dev",
|
||||||
|
"dist": "turbo run dist",
|
||||||
|
"dist:linux": "turbo run dist:linux",
|
||||||
|
"dist:mac": "turbo run dist:mac",
|
||||||
|
"dist:win": "turbo run dist:win",
|
||||||
"fix": "turbo run fix",
|
"fix": "turbo run fix",
|
||||||
"typecheck": "turbo run typecheck"
|
"typecheck": "turbo run typecheck"
|
||||||
},
|
},
|
||||||
|
|||||||
16
turbo.json
16
turbo.json
@@ -9,6 +9,22 @@
|
|||||||
"compile": {
|
"compile": {
|
||||||
"dependsOn": ["build"]
|
"dependsOn": ["build"]
|
||||||
},
|
},
|
||||||
|
"dist": {},
|
||||||
|
"dist:linux": {},
|
||||||
|
"dist:mac": {},
|
||||||
|
"dist:win": {},
|
||||||
|
"@furtherverse/desktop#dist": {
|
||||||
|
"dependsOn": ["@furtherverse/server#compile"]
|
||||||
|
},
|
||||||
|
"@furtherverse/desktop#dist:linux": {
|
||||||
|
"dependsOn": ["@furtherverse/server#compile"]
|
||||||
|
},
|
||||||
|
"@furtherverse/desktop#dist:mac": {
|
||||||
|
"dependsOn": ["@furtherverse/server#compile"]
|
||||||
|
},
|
||||||
|
"@furtherverse/desktop#dist:win": {
|
||||||
|
"dependsOn": ["@furtherverse/server#compile"]
|
||||||
|
},
|
||||||
"dev": {
|
"dev": {
|
||||||
"cache": false,
|
"cache": false,
|
||||||
"persistent": true
|
"persistent": true
|
||||||
|
|||||||
Reference in New Issue
Block a user