NEARBuilders / NEARBuilders/everything-dev
orpc-v2: consolidate fork into everything-dev and migrate platform to oRPC v2 + Effect 4 (epic)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 6
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
Ticket ID: EPIC
What to build
Consolidate the citynode.app fork into everything-dev, then migrate the whole platform from oRPC v1 + Effect 3.21.2 to oRPC v2 (2.0.0-beta.35) + Effect 4 (4.0.0-rc.112) with @orpc/experimental-effect for typed Effect handlers — keeping the deployed wire contract (REST/RPC paths, OpenAPI spec, MCP tools) equivalent throughout.
Two stages, per the plan doc at plans/infra/orpc-v2-effect-migration.md (lands on upstream main with M1 — read it alongside the corrections below):
- Stage A (A1–A5): wire-compatible Effect 4 upgrade. every-plugin first, then host + api, then all five plugins, then integrate and verify. No oRPC version changes; each step stays green and deployable.
- Stage B (B1–B7): oRPC v2 +
@orpc/experimental-effecton a single integration branch (orpc-v2), cut from Stage A green. This is a wide refactor — the monorepo being red between B1 and B6 is expected; green is promised only at B7. Merge and release atomically. - B8: citynode.app adopts the migrated platform and atomically redeploys its runtime.
After B8, a separate future epic breaks citynode.app off as a pure child app consuming the published platform — out of scope here.
Validated corrections to the plan doc
Researched against the official oRPC v2 docs and the npm registry; the tickets below follow these corrections, not the stale claims in the doc:
- Pins: all
@orpc/*v2 packages at2.0.0-beta.35;effectat4.0.0-rc.112. Every published version of@orpc/experimental-effectpeers oneffect >= 4.0.0-beta.90— there is no Effect 3-compatible integration, which is why Stage A lands first. - Publisher rename is mandatory:
@orpc/experimental-publisheris dead-ended at v1. Move to@orpc/publisher:MemoryPublisherfrom@orpc/publisher/memory,resumeRetentionSeconds→resume: { enabled, seconds }, andpublish()is now async. interceptorsstill exists in v2 — the doc's rename toroutingInterceptors/transportInterceptorsdoes not apply to current code; carry interceptors over unchanged.- No-ops: the doc's
safe()/isInferableErrorandcreateTanstackQueryUtilschanges have zero call sites / no options in this codebase — skip them. errorStatusMapcustom entries:TIMEOUT: 504andCONNECTION_ERROR: 502— v2's default (TIMEOUT: 408) would change current HTTP behavior.- OpenAPI spec version: the v2 generator defaults to 3.2.0; pass
version: '3.1.1'explicitly — MCP tool generation requires 3.1. - Route extension preload: every contract file needs
import "@orpc/openapi/extensions/route"— it patches the contract builder prototype so.routecarries full OpenAPIMeta (tags/summary/description flow into the spec). - Middleware dedup removed in v2 — audit middleware call sites and guard re-entry with context flags where double-apply was relied on.
- Host handlers live in
host/src/routes/api.ts, notprogram.tsas the doc claims.
Acceptance criteria
- M0 + M1: upstream main contains the fork's history; identity docs reconciled; both repos' CI green
- Stage A merged: platform on Effect 4, wire-compatible, all suites green
- Stage B merged and released: oRPC v2 everywhere; OpenAPI spec, MCP tools, and route surface equivalent; every-plugin + everything-dev published to npm; everything.dev runtime redeployed
- B8: citynode.app runtime redeployed on the migrated platform; external consumers unbroken
Blocked by
None — frontier: M0.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with plans/infra/orpc-v2-effect-migration.md and the validated corrections in this issue; host handlers are in host/src/routes/api.ts. Review the staged M0–B8 sequence, then inspect the relevant packages and CI before attempting work. Done means the staged migration is merged and released with green suites, equivalent OpenAPI/MCP/route behavior, published packages, and the runtime redeployed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend, build-system, devops
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100