Wire @internal/web to durable-objects workers—workspace dep, alchemy.run.ts ReactRouter bindings, and env patterns. Use when adding `workspace:*` for a worker, editing apps/web/alchemy.run.ts, or debugging missing worker types after a new package.
Installation
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Wire @internal/web to durable-objects workers—workspace dep, alchemy.run.ts ReactRouter bindings, and env patterns. Use when adding `workspace:*` for a worker, editing apps/web/alchemy.run.ts, or debugging missing worker types after a new package.
Web app: Alchemy bindings to workers and DOs
When to use
Exposing a durable-objects/<pkg> worker or DO to the web app’s ReactRouterbindings.
After adding a new workspace:* worker dependency, fixing how env in workers/app.ts lines up with imports in alchemy.run.ts.
What to do
Dependency — apps/web/package.json: "<package-name>": "workspace:*". bun install from repo root.
Bindings — Pass each binding into ReactRouter("…", { bindings: { …, MyDo: myWorker.bindings.MyDo, … } }) using the names your workers/app.ts reads from this.env (e.g. this.env.PingDo). D1: import mainDb from @internal/db/alchemy and set DB: mainDb (D1 is defined in packages/db/alchemy.run.ts, not inlined in web).
If you are tempted to add include lines in tsconfig.cloudflare.json that point at another package’s workers/app.ts, don’t—multiple declare global { type Env } sources break the web Env. Types follow your normal imports; no need to list durable-objects/… in include.
Verify — bun run typegen and bun run typecheck from root.