Skip to content

feat(api): scaffold packages/api with health group contract (Step 1a)#142

Open
guidefari wants to merge 1 commit into
migration/effect-http-apifrom
migration/1a-api-health-contract
Open

feat(api): scaffold packages/api with health group contract (Step 1a)#142
guidefari wants to merge 1 commit into
migration/effect-http-apifrom
migration/1a-api-health-contract

Conversation

@guidefari

Copy link
Copy Markdown
Owner

Step 1a of the Hono -> Effect HttpApi migration (docs/migration-effect-http-api.md), redone after closing #136 for scope creep. This PR is contract-only, on purpose.

What

  • New leaf workspace package packages/api (depends only on effect@4.0.0-beta.93) so server-only code cannot leak into the www client bundle.
  • Health group contract: live (/health/live), ready (/health/ready), check (/health) endpoints with response schemas mirroring current Hono behavior.
  • ReadinessCheckFailedError (Schema.TaggedErrorClass, httpApiStatus: 500) for the readiness failure path.
  • Also includes the revised migration doc: the step breakdown is now split into smaller single-purpose check-ins (1a/1b, 2a/2b/2c, 3a/3b, ...) instead of the old coarse steps that let feat(api): scaffold @gbfm/api with Effect HttpApi health contract #136 balloon.

What this deliberately does NOT do

  • No apps/vps changes. Nothing serves this contract yet.
  • No unit tests yet -- that's 1b, kept separate so this PR is pure "does the contract typecheck and read well."
  • No hand-rolled test scripts. Test policy in the revised doc: vitest only.

Verification

  • bun --filter='@gbfm/api' typecheck -- clean
  • bun run lint / bun run format:check -- clean

Next

1b: contract unit tests (schema decode/encode, error tagging) in packages/api.

Step 1a of the Hono -> Effect HttpApi migration
(docs/migration-effect-http-api.md).

- New leaf workspace package packages/api (depends only on effect),
  so server-only code cannot leak into the www client bundle.
- Health group contract: live (/health/live), ready (/health/ready),
  and check (/health) endpoints with response schemas mirroring the
  current Hono behavior.
- ReadinessCheckFailedError (Schema.TaggedErrorClass, httpApiStatus
  500) for the readiness failure path.

No apps/vps changes -- nothing serves this contract yet. Unit tests
for the contract land in 1b. Also revises the migration doc's step
breakdown into smaller single-purpose check-ins after closing #136.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant