chore: format markdown
Signed-off-by: Dmytro Stanchiev <git@dmytros.dev>
This commit is contained in:
@@ -1,19 +1,26 @@
|
||||
# opencode Monorepo Config Adoption Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use
|
||||
> superpowers:subagent-driven-development (recommended) or superpowers:executing-plans
|
||||
> to implement this plan task-by-task.
|
||||
> Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** Adopt opencode-style monorepo config: Turbo task orchestration, workspace dep catalog, shared root tsconfig, bunfig.toml, and `exports` field in all packages.
|
||||
**Goal:** Adopt opencode-style monorepo config: Turbo task orchestration, workspace dep
|
||||
catalog, shared root tsconfig, bunfig.toml, and `exports` field in all packages.
|
||||
|
||||
**Architecture:** Pure config changes across 10 files — no source code touched. Root config files are added/updated first, then per-package files updated to reference them. Changes are independent within each task and safe to commit atomically.
|
||||
**Architecture:** Pure config changes across 10 files — no source code touched.
|
||||
Root config files are added/updated first, then per-package files updated to reference
|
||||
them. Changes are independent within each task and safe to commit atomically.
|
||||
|
||||
**Tech Stack:** Bun workspaces, Turbo 2.x, @tsconfig/bun, TypeScript (tsgo / @typescript/native-preview)
|
||||
**Tech Stack:** Bun workspaces, Turbo 2.x, @tsconfig/bun, TypeScript (tsgo /
|
||||
@typescript/native-preview)
|
||||
|
||||
---
|
||||
* * *
|
||||
|
||||
## File Map
|
||||
|
||||
| File | Action | Responsible for |
|
||||
|---|---|---|
|
||||
| --- | --- | --- |
|
||||
| `package.json` | Modify | Workspace catalog, turbo devDep, @tsconfig/bun devDep, updated scripts |
|
||||
| `turbo.json` | Create | Task graph: typecheck, build, test |
|
||||
| `tsconfig.json` | Create | Shared TS compiler options for all packages |
|
||||
@@ -25,14 +32,16 @@
|
||||
| `packages/api-server/tsconfig.json` | Modify | Slim — extends root, paths only |
|
||||
| `packages/mcp-server/tsconfig.json` | Modify | Slim — extends root, paths only |
|
||||
|
||||
---
|
||||
* * *
|
||||
|
||||
### Task 1: Add `bunfig.toml` and `turbo.json`
|
||||
|
||||
Two new root config files with no dependencies on other tasks.
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `bunfig.toml`
|
||||
|
||||
- Create: `turbo.json`
|
||||
|
||||
- [ ] **Step 1: Create `bunfig.toml`**
|
||||
@@ -83,13 +92,15 @@ git add bunfig.toml turbo.json
|
||||
git commit -m "chore: add bunfig.toml and turbo.json"
|
||||
```
|
||||
|
||||
---
|
||||
* * *
|
||||
|
||||
### Task 2: Create root `tsconfig.json`
|
||||
|
||||
Shared base tsconfig all packages will extend. Extracts the common options currently duplicated in all 3 per-package tsconfigs.
|
||||
Shared base tsconfig all packages will extend.
|
||||
Extracts the common options currently duplicated in all 3 per-package tsconfigs.
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `tsconfig.json`
|
||||
|
||||
- [ ] **Step 1: Create root `tsconfig.json`**
|
||||
@@ -130,13 +141,15 @@ git add tsconfig.json
|
||||
git commit -m "chore: add shared root tsconfig.json"
|
||||
```
|
||||
|
||||
---
|
||||
* * *
|
||||
|
||||
### Task 3: Update root `package.json`
|
||||
|
||||
Add workspace catalog, `turbo` + `@tsconfig/bun` devDependencies, and update scripts to use `turbo run`.
|
||||
Add workspace catalog, `turbo` + `@tsconfig/bun` devDependencies, and update scripts to
|
||||
use `turbo run`.
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `package.json`
|
||||
|
||||
- [ ] **Step 1: Replace root `package.json`**
|
||||
@@ -180,7 +193,11 @@ Write this complete file:
|
||||
}
|
||||
```
|
||||
|
||||
> **Note on catalog versions:** The catalog pins exact versions. The values above are taken from the current package installs. If `@types/bun` was `latest`, check `node_modules/@types/bun/package.json` for the actual installed version and use that. Same for `@typescript/native-preview`.
|
||||
> **Note on catalog versions:** The catalog pins exact versions.
|
||||
> The values above are taken from the current package installs.
|
||||
> If `@types/bun` was `latest`, check `node_modules/@types/bun/package.json` for the
|
||||
> actual installed version and use that.
|
||||
> Same for `@typescript/native-preview`.
|
||||
|
||||
- [ ] **Step 2: Check actual installed versions**
|
||||
|
||||
@@ -208,7 +225,8 @@ Expected: lock file updated, `turbo` and `@tsconfig/bun` appear in `node_modules
|
||||
bunx turbo run typecheck --dry
|
||||
```
|
||||
|
||||
Expected: output lists the `typecheck` task for each package (even if no `typecheck` script exists yet — turbo will note them as skipped/missing).
|
||||
Expected: output lists the `typecheck` task for each package (even if no `typecheck`
|
||||
script exists yet — turbo will note them as skipped/missing).
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
|
||||
@@ -217,15 +235,19 @@ git add package.json bun.lock
|
||||
git commit -m "chore: add workspace catalog and turbo to root package.json"
|
||||
```
|
||||
|
||||
---
|
||||
* * *
|
||||
|
||||
### Task 4: Update per-package `package.json` files
|
||||
|
||||
Rename `type:check` → `typecheck`, replace `main`/`module` with `exports`, swap pinned dep versions for `catalog:` references.
|
||||
Rename `type:check` → `typecheck`, replace `main`/`module` with `exports`, swap pinned
|
||||
dep versions for `catalog:` references.
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `packages/core/package.json`
|
||||
|
||||
- Modify: `packages/api-server/package.json`
|
||||
|
||||
- Modify: `packages/mcp-server/package.json`
|
||||
|
||||
- [ ] **Step 1: Replace `packages/core/package.json`**
|
||||
@@ -325,7 +347,9 @@ Rename `type:check` → `typecheck`, replace `main`/`module` with `exports`, swa
|
||||
bun install
|
||||
```
|
||||
|
||||
Expected: no errors. Catalog refs resolved. `bun.lock` updated.
|
||||
Expected: no errors.
|
||||
Catalog refs resolved.
|
||||
`bun.lock` updated.
|
||||
|
||||
- [ ] **Step 5: Verify typecheck still works per-package**
|
||||
|
||||
@@ -345,15 +369,19 @@ git add packages/core/package.json packages/api-server/package.json packages/mcp
|
||||
git commit -m "chore: use exports field and catalog refs in all packages"
|
||||
```
|
||||
|
||||
---
|
||||
* * *
|
||||
|
||||
### Task 5: Slim per-package `tsconfig.json` files
|
||||
|
||||
Replace the duplicated full tsconfig in each package with a slim `extends`-based one pointing to root.
|
||||
Replace the duplicated full tsconfig in each package with a slim `extends`-based one
|
||||
pointing to root.
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `packages/core/tsconfig.json`
|
||||
|
||||
- Modify: `packages/api-server/tsconfig.json`
|
||||
|
||||
- Modify: `packages/mcp-server/tsconfig.json`
|
||||
|
||||
- [ ] **Step 1: Replace `packages/core/tsconfig.json`**
|
||||
@@ -400,7 +428,8 @@ Replace the duplicated full tsconfig in each package with a slim `extends`-based
|
||||
|
||||
- [ ] **Step 4: Verify `@tsconfig/bun` is resolvable**
|
||||
|
||||
The root tsconfig extends `@tsconfig/bun/tsconfig.json`. Confirm the package is installed:
|
||||
The root tsconfig extends `@tsconfig/bun/tsconfig.json`. Confirm the package is
|
||||
installed:
|
||||
|
||||
```bash
|
||||
ls node_modules/@tsconfig/bun/tsconfig.json
|
||||
@@ -414,7 +443,8 @@ Expected: file exists.
|
||||
bun run typecheck
|
||||
```
|
||||
|
||||
Expected: Turbo runs `typecheck` for all 3 packages in parallel, all pass (or same pre-existing errors — no new ones).
|
||||
Expected: Turbo runs `typecheck` for all 3 packages in parallel, all pass (or same
|
||||
pre-existing errors — no new ones).
|
||||
|
||||
- [ ] **Step 6: Commit**
|
||||
|
||||
@@ -423,7 +453,7 @@ git add packages/core/tsconfig.json packages/api-server/tsconfig.json packages/m
|
||||
git commit -m "chore: slim per-package tsconfigs to extend root"
|
||||
```
|
||||
|
||||
---
|
||||
* * *
|
||||
|
||||
### Task 6: Smoke test full build pipeline
|
||||
|
||||
@@ -437,7 +467,8 @@ Verify everything works end-to-end.
|
||||
bun run typecheck
|
||||
```
|
||||
|
||||
Expected: Turbo runs `typecheck` across all packages. Exit 0.
|
||||
Expected: Turbo runs `typecheck` across all packages.
|
||||
Exit 0.
|
||||
|
||||
- [ ] **Step 2: Run full build**
|
||||
|
||||
@@ -445,7 +476,8 @@ Expected: Turbo runs `typecheck` across all packages. Exit 0.
|
||||
bun run build
|
||||
```
|
||||
|
||||
Expected: `dist/` cleaned, Turbo runs `build` (core first, then api-server and mcp-server in parallel), build artifacts appear in `dist/api/` and `dist/mcp/`.
|
||||
Expected: `dist/` cleaned, Turbo runs `build` (core first, then api-server and
|
||||
mcp-server in parallel), build artifacts appear in `dist/api/` and `dist/mcp/`.
|
||||
|
||||
- [ ] **Step 3: Verify dist artifacts**
|
||||
|
||||
@@ -461,7 +493,9 @@ Expected: compiled output files in both directories.
|
||||
grep -c '\^' bun.lock | head -5
|
||||
```
|
||||
|
||||
With `exact = true` in bunfig.toml, new installs won't add `^` ranges. Existing `^` ranges in `bun.lock` from before are fine — they'll be resolved to exact on next fresh install.
|
||||
With `exact = true` in bunfig.toml, new installs won’t add `^` ranges.
|
||||
Existing `^` ranges in `bun.lock` from before are fine — they’ll be resolved to exact on
|
||||
next fresh install.
|
||||
|
||||
- [ ] **Step 5: Final commit if any loose files**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user