Skip to content

Commit a623e7b

Browse files
committed
chore(root): align repo-native dev commands
1 parent 7a63980 commit a623e7b

12 files changed

Lines changed: 68 additions & 57 deletions

File tree

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,46 @@
11
---
2-
name: dev-surface
3-
description: Use when working in Coop and needing to start, reuse, open, inspect, validate, or clean up this repo's local development surfaces through the shared dev-surfaces workbench.
2+
name: coop-dev-surface
3+
description: Use when working in Coop and needing the local app, receiver PWA, docs, API/signaling server, or extension watcher.
44
---
55

66
# Coop Dev Surface
77

8-
Use the global workbench CLI instead of starting duplicate servers manually:
8+
Inside this repo, use the repo-native command:
99

1010
```sh
11-
dev-surfaces status
12-
dev-surfaces up coop
13-
dev-surfaces open coop
14-
dev-surfaces logs coop:<surface>
15-
dev-surfaces down coop
11+
bun install
12+
# configure repo env if needed
13+
bun run dev
1614
```
1715

18-
Stable fallback path: `/Users/afo/Code/dev-surfaces/bin/dev-surfaces.js`.
16+
`bun run dev` runs `scripts/dev.ts`. It starts the app, API/signaling server, docs, extension watcher, optional Cloudflare tunnel, and a dev browser profile when available. It writes runtime state to `packages/app/public/__coop_dev__/state.json`, streams logs, and cleans up child processes on Ctrl-C.
1917

20-
## Surfaces
18+
Expected ports:
2119

22-
- `app`: app / receiver PWA on `3101`
23-
- `docs`: docs on `3102`
24-
- `api`: API / signaling on `3103`
25-
- `extension`: extension dev server, if bound on `3104`
20+
- `3101`: app / receiver PWA
21+
- `3102`: docs
22+
- `3103`: API / signaling
23+
- `3104`: extension dev server, when bound
2624

27-
## Validation Notes
25+
Useful native commands:
2826

29-
- Default real-browser proof should use Brave or another Chromium-family browser on this machine.
30-
- Keep receiver PWA and signaling URLs aligned when launching the extension surface.
31-
- `app` depends on `api`, and `extension` depends on both, so the workbench brings signaling up before UI review surfaces that need it.
32-
- Docs require Node 20+; the repo scripts prepend `mise where node@22` before running Docusaurus so agent shells do not fall back to system Node 18.
33-
- After changing local port docs or dev scripts, run `dev-surfaces doctor`.
27+
```sh
28+
bun run dev
29+
bun run dev:stop
30+
bun run dev:app
31+
bun run dev:api
32+
bun run dev:docs
33+
bun run dev:extension
34+
```
35+
36+
For cross-repo orchestration from anywhere, use the global workbench:
37+
38+
```sh
39+
dev launch coop
40+
dev launch coop:app
41+
dev status coop
42+
dev health coop
43+
dev stop coop
44+
```
3445

35-
Never kill unknown port occupants. If a port is busy and not owned by dev-surfaces, report the PID/command and ask for direction.
46+
Do not call `.dev-surfaces/run.mjs`; this repo should not have that wrapper.

AGENTS.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ For full details, see [`CLAUDE.md`](./CLAUDE.md).
88

99
```bash
1010
bun install # Install dependencies
11-
bun dev # Start app + extension (concurrent)
12-
bun dev:app # Start app only
13-
bun dev:extension # Start extension only (WXT dev + Chromium)
14-
bun dev:api # Start API server (signaling + routes)
11+
bun run dev # Start full repo-native local environment
12+
bun run dev:stop # Stop repo-tracked local targets
13+
bun run dev:app # Start app only
14+
bun run dev:extension # Start extension only (WXT dev + Chromium)
15+
bun run dev:api # Start API server (signaling + routes)
1516
cd packages/app && bun run build # Build app only
1617
cd packages/extension && bun run build # Build extension only
1718
bun format && bun lint # Format (Biome) and lint workspace

CLAUDE.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ This file provides guidance to Claude Code when working with this repository.
66

77
```bash
88
bun install # Install dependencies
9-
bun dev # Start app + extension (concurrent)
10-
bun dev:app # Start app only
11-
bun dev:extension # Start extension only (WXT dev + Chromium)
12-
bun dev:api # Start API server (signaling + routes)
9+
bun run dev # Start full repo-native local environment
10+
bun run dev:stop # Stop repo-tracked local targets
11+
bun run dev:app # Start app only
12+
bun run dev:extension # Start extension only (WXT dev + Chromium)
13+
bun run dev:api # Start API server (signaling + routes)
1314
cd packages/app && bun run build # Build app only
1415
cd packages/extension && bun run build # Build extension only
1516
bun format && bun lint # Format (Biome) and lint workspace
@@ -180,8 +181,8 @@ Do not duplicate these. Import or apply existing classes.
180181
| `wss://api.coop.town/yws` | Fly.io Yjs document sync | WebSocket fallback for peer sync |
181182
| `https://coop.town` | Vercel PWA (landing + receiver) | Proxied through Cloudflare |
182183
| `https://docs.coop.town` | Vercel docs | Proxied through Cloudflare |
183-
| `wss://dev-api.coop.town` | Cloudflare tunnel -> localhost:3103 | Only up during `bun dev` |
184-
| `https://local.coop.town` | Cloudflare tunnel localhost:3001 | Only up during `bun dev` |
184+
| `wss://dev-api.coop.town` | Cloudflare tunnel -> localhost:3103 | Only up during `bun run dev` or the coordinator fallback |
185+
| `https://local.coop.town` | Cloudflare tunnel -> localhost:3101 | Only up during `bun run dev` or the coordinator fallback |
185186

186187
## Environment
187188

@@ -197,7 +198,7 @@ Single `.env.local` at root (never create package-specific .env). Env vars are b
197198

198199
Full reference: `docs/builder/environment.md` (30+ vars covering TURN, Pimlico, FVM, Green Goods, trusted-node archive, tunnels)
199200

200-
`bun dev` automatically sets `VITE_COOP_SIGNALING_URLS` and `VITE_COOP_RECEIVER_APP_URL` for the extension build. The extension gets both local and production signaling URLs for fallback.
201+
The lower-level dev scripts started by `bun run dev` set `VITE_COOP_SIGNALING_URLS` and `VITE_COOP_RECEIVER_APP_URL` for the extension build. The extension gets both local and production signaling URLs for fallback.
201202

202203
## Validation Suites
203204

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,11 @@ Essential commands:
116116

117117
```bash
118118
bun install # Install dependencies
119-
bun dev # Start app + extension concurrently
120-
bun dev:app # Start app only
121-
bun dev:extension # Start extension only
122-
bun dev:api # Start API server
119+
bun run dev # Start full repo-native local environment
120+
bun run dev:stop # Stop repo-tracked local targets
121+
bun run dev:app # Start app only
122+
bun run dev:extension # Start extension only
123+
bun run dev:api # Start API server
123124
bun run test # Run unit tests with Vitest
124125
bun run build # Build shared -> app -> extension
125126
bun run validate smoke # Fast confidence pass

docs/builder/environment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ prefixed variables are baked into bundles at build time by Vite -- rebuild after
3636

3737
Notes:
3838

39-
- `bun dev` injects `VITE_COOP_RECEIVER_APP_URL` and `VITE_COOP_SIGNALING_URLS` for the extension
39+
- `bun run dev` starts the workbench targets whose lower-level scripts inject `VITE_COOP_RECEIVER_APP_URL` and `VITE_COOP_SIGNALING_URLS` for the extension
4040
watcher so local dev can point at the active app and API processes.
4141
- `VITE_COOP_RECEIVER_APP_URL` is also used to derive the receiver bridge content-script matches in
4242
the extension manifest.

docs/builder/getting-started.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ Run these commands from the repository root:
7878

7979
```bash
8080
bun install
81-
bun dev
81+
bun run dev
8282
```
8383

8484
Useful split commands:
8585

8686
```bash
87-
bun dev:app
88-
bun dev:extension
89-
bun dev:api
87+
bun run dev:app
88+
bun run dev:extension
89+
bun run dev:api
9090
```
9191

9292
## Keep One Root Environment File

docs/reference/demo-and-deploy-runbook.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ coordination patterns, and hardening live/operator rails.
9090
- `live`: bounded Smart Session execution for phase-1 Green Goods actions
9191
- Production passkeys must be created on the final production PWA domain.
9292

93-
## Environment 1: Local Development (with `bun dev`)
93+
## Environment 1: Local Development (with `bun run dev`)
9494

95-
Use `bun dev` to start all services concurrently. The dev script automatically configures the
96-
extension with the correct signaling and receiver URLs.
95+
Use `bun run dev` to start all local repo services through the repo-native dev coordinator. The lower-level
96+
dev scripts automatically configure the extension with the correct signaling and receiver URLs.
9797

9898
### Root `.env.local` (minimal)
9999

@@ -125,7 +125,7 @@ run `bun run docs:dev` or `bun run docs:build`.
125125

126126
```bash
127127
bun install
128-
bun dev
128+
bun run dev
129129
```
130130

131131
To stop the full local dev environment and clean up orphan listeners:
@@ -141,7 +141,7 @@ Expected surfaces:
141141
- Production fallback signaling: `wss://api.coop.town`
142142
- Extension bundle: `packages/extension/dist/chrome-mv3`
143143

144-
To run services individually instead of `bun dev`:
144+
To run services individually instead of `bun run dev`:
145145

146146
```bash
147147
bun run dev:app

docs/reference/extension-install-and-distribution.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ For development with live-reload and all local services:
7070

7171
```bash
7272
bun install
73-
bun dev
73+
bun run dev
7474
```
7575

76-
This starts the extension, the receiver PWA, and the signaling server concurrently. The dev script
77-
automatically sets `VITE_COOP_SIGNALING_URLS` and `VITE_COOP_RECEIVER_APP_URL` for the extension
78-
build.
76+
This starts the extension, receiver PWA, docs, and signaling server through the repo-native dev coordinator.
77+
The lower-level scripts automatically set `VITE_COOP_SIGNALING_URLS` and
78+
`VITE_COOP_RECEIVER_APP_URL` for the extension build.
7979

8080
If you only need the extension:
8181

docs/reference/original-introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ ERC-4337, ERC-1271, EIP-712, ERC-7579, ERC-5564, ERC-8004, Semaphore, Storacha/F
7373

7474
```bash
7575
bun install # Install dependencies
76-
bun dev # Start app + extension concurrently
77-
bun dev:api # Start API server
76+
bun run dev # Start the full repo-native local environment
77+
bun run dev:api # Start API server
7878
bun run test # Run tests
7979
bun run build # Build everything
8080
bun run validate:production-readiness # Staged-launch validation

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,5 @@
171171
"vite": "^6.2.0",
172172
"vitest": "^3.2.4"
173173
},
174-
"overrides": {
175-
"protobufjs": "7.5.9"
176-
},
177174
"trustedDependencies": ["@biomejs/biome"]
178175
}

0 commit comments

Comments
 (0)