orpc-v2: createPlugin restructure (Layer-based initialize, errorStatusMap, scope lifecycle)

Open
#259 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
backend, tooling

Research direction

Start with blocked issue #258 and the current every-plugin createPlugin contract. Audit tools/buildService, the per-plugin context-bridge modules, and middleware call sites, then review the every-plugin suite. Done means Layer-based initialization, scope-lifecycle release tests, the specified errorStatusMap values, guarded middleware reuse, and a green suite.

Written by the indexing model from the issue text.

Description

ready-for-agent

Ticket ID: B2

Parent

#248 — orpc-v2: consolidate fork into everything-dev and migrate platform to oRPC v2 + Effect 4 (epic)

What to build

Stage B, step 2: restructure every-plugin's createPlugin for v2 + Effect 4:

  • initialize composes Effect Layers; scoped resources (db pools, repositories, caches, publishers) bind to the plugin lifecycle scope via Layer semantics — replacing the tools/buildService pattern.
  • Per-plugin context bridging moves to effect/context composed by a base-builder middleware — the per-plugin context-bridge modules go away.
  • errorStatusMap plumbing lands here with custom entries TIMEOUT: 504 and CONNECTION_ERROR: 502 (v2's default TIMEOUT: 408 would change current HTTP behavior).
  • v2 removes middleware dedup — audit middleware call sites and add context-flag guards where double-apply was relied on.

Acceptance criteria

  • createPlugin's new contract implemented with Layer-based initialize; tools/buildService removed
  • Scope-lifecycle tests prove resources release on plugin shutdown
  • errorStatusMap carries TIMEOUT: 504, CONNECTION_ERROR: 502
  • Middleware double-apply sites guarded; every-plugin suite green

Blocked by

  • #258 — deps bump + every-plugin v2 surface
Dominant language
TypeScript
Stars
5
Forks
6
Avg merge
1m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NEARBuilders/everything-dev

All issues in NEARBuilders/everything-dev

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.