forked from imbytecat/fullstack-starter
chore: 重构 Turbo 构建配置并强化 Bun 专用说明
将应用特定的构建输出配置下沉至各自 turbo.json,根级 build 任务添加拓扑依赖;AGENTS.md 统一添加 Bun 专用运行时警告;桌面端启用 Linux CEF 渲染器。
This commit is contained in:
@@ -4,8 +4,11 @@ Guidelines for AI agents working in this Bun monorepo.
|
||||
|
||||
## Project Overview
|
||||
|
||||
> **⚠️ This project uses [Bun](https://bun.sh) exclusively as both the JavaScript runtime and package manager. Do NOT use Node.js / npm / yarn / pnpm. All commands start with `bun` — use `bun install` for dependencies and `bun run` / `bun <script>` for scripts. Never use `npm`, `npx`, or `node`.**
|
||||
|
||||
- **Monorepo**: Bun workspaces + Turborepo orchestration
|
||||
- **Runtime**: Bun (see `mise.toml` for version)
|
||||
- **Runtime**: Bun (see `mise.toml` for version) — **NOT Node.js**
|
||||
- **Package Manager**: Bun — **NOT npm / yarn / pnpm**
|
||||
- **Apps**:
|
||||
- `apps/server` - TanStack Start fullstack web app (see `apps/server/AGENTS.md`)
|
||||
- `apps/desktop` - Tauri v2 desktop shell, loads server via sidecar (see `apps/desktop/AGENTS.md`)
|
||||
@@ -153,6 +156,7 @@ export const myTable = pgTable('my_table', {
|
||||
- Include `createdAt`/`updatedAt` on all tables
|
||||
|
||||
**DON'T:**
|
||||
- Use `npm`, `npx`, `node`, `yarn`, `pnpm` — always use `bun` / `bunx`
|
||||
- Edit `src/routeTree.gen.ts` (auto-generated)
|
||||
- Use `as any`, `@ts-ignore`, `@ts-expect-error`
|
||||
- Commit `.env` files
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
Electrobun desktop shell - loads the server app in a native window.
|
||||
|
||||
> **⚠️ This project uses Bun — NOT Node.js / npm. All commands use `bun`. Never use `npm`, `npx`, or `node`.**
|
||||
|
||||
## Architecture
|
||||
|
||||
- **Type**: Electrobun desktop application
|
||||
@@ -75,5 +77,6 @@ Electrobun.events.on('will-quit', () => {
|
||||
- Handle server startup gracefully
|
||||
|
||||
**DON'T:**
|
||||
- Use `npm`, `npx`, `node`, `yarn`, `pnpm` — always use `bun` / `bunx`
|
||||
- Hardcode dependency versions (use catalog)
|
||||
- Block main thread during server wait
|
||||
|
||||
@@ -10,5 +10,8 @@ export default {
|
||||
bun: {
|
||||
entrypoint: 'src/bun/index.ts',
|
||||
},
|
||||
linux: {
|
||||
bundleCEF: true,
|
||||
},
|
||||
},
|
||||
} satisfies ElectrobunConfig
|
||||
|
||||
@@ -38,6 +38,7 @@ async function main() {
|
||||
width: 1200,
|
||||
height: 800,
|
||||
},
|
||||
renderer: 'cef',
|
||||
})
|
||||
|
||||
Electrobun.events.on('will-quit', () => console.log('Quitting...'))
|
||||
|
||||
9
apps/desktop/turbo.json
Normal file
9
apps/desktop/turbo.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "../../node_modules/turbo/schema.json",
|
||||
"extends": ["//"],
|
||||
"tasks": {
|
||||
"build": {
|
||||
"outputs": ["build/**", "artifacts/**"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,11 @@ TanStack Start fullstack web app with ORPC (contract-first RPC).
|
||||
|
||||
## Tech Stack
|
||||
|
||||
> **⚠️ This project uses Bun — NOT Node.js / npm. All commands use `bun`. Never use `npm`, `npx`, or `node`.**
|
||||
|
||||
- **Framework**: TanStack Start (React 19 SSR, file-based routing)
|
||||
- **Runtime**: Bun
|
||||
- **Runtime**: Bun — **NOT Node.js**
|
||||
- **Package Manager**: Bun — **NOT npm / yarn / pnpm**
|
||||
- **Language**: TypeScript (strict mode)
|
||||
- **Styling**: Tailwind CSS v4
|
||||
- **Database**: PostgreSQL + Drizzle ORM
|
||||
@@ -195,6 +198,7 @@ export const env = createEnv({
|
||||
- Use `ORPCError` with proper codes
|
||||
|
||||
**DON'T:**
|
||||
- Use `npm`, `npx`, `node`, `yarn`, `pnpm` — always use `bun` / `bunx`
|
||||
- Edit `src/routeTree.gen.ts` (auto-generated)
|
||||
- Use `as any`, `@ts-ignore`, `@ts-expect-error`
|
||||
- Commit `.env` files
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
"$schema": "../../node_modules/turbo/schema.json",
|
||||
"extends": ["//"],
|
||||
"tasks": {
|
||||
"build": {
|
||||
"outputs": [".output/**"]
|
||||
},
|
||||
"compile": {
|
||||
"dependsOn": ["build"],
|
||||
"outputs": ["out/**"]
|
||||
|
||||
@@ -9,11 +9,8 @@
|
||||
],
|
||||
"tasks": {
|
||||
"build": {
|
||||
"outputs": ["dist/**", ".output/**", "build", "artifacts"]
|
||||
},
|
||||
"compile": {
|
||||
"dependsOn": ["build"],
|
||||
"outputs": ["out/**"]
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": ["dist/**"]
|
||||
},
|
||||
"dev": {
|
||||
"cache": false,
|
||||
|
||||
Reference in New Issue
Block a user