Skip to content

refactor(adapters)!: consolidate to a single generic web-standard handler#75

Merged
scalvert merged 1 commit into
mainfrom
consolidate-adapters
Jun 16, 2026
Merged

refactor(adapters)!: consolidate to a single generic web-standard handler#75
scalvert merged 1 commit into
mainfrom
consolidate-adapters

Conversation

@scalvert

Copy link
Copy Markdown
Owner

Follows up #74. Collapses the platform-specific deploy adapters into one generic, web-standard handler.

Why

The deploy adapters were all doing the same thing behind different shapes. Every modern serverless/edge runtime (Cloudflare Workers, modern Netlify functions, Vercel Edge, Deno, Bun) speaks web-standard Request/Response, so a single createWebRequestHandler covers them all — the only per-platform difference is the export wrapper, which is a few lines of glue.

Breaking changes

Removed:

  • createVercelHandler (+ VercelRequest, VercelResponse)
  • createNetlifyHandler (+ NetlifyEvent, NetlifyContext)
  • generateAdapterFiles (+ Platform, GeneratorOptions, GeneratedFile)

Kept:

  • createWebRequestHandler — the single deploy handler (pre-loaded data, web-standard)
  • createNodeServer / createNodeHandler — local-dev server (Node http, filesystem)
  • createCloudflareHandler / CloudflareAdapterConfigdeprecated aliases, still exported

Migration

  • Vercel/Netlify users: switch to createWebRequestHandler with pre-loaded data (import docs from '.../docs.json') on a web-standard runtime (Vercel Edge / modern Netlify functions).
  • generateAdapterFiles users: scaffolding moves to an AI-directed deploy skill (follow-up).

Follow-up

A deploy skill (via the gleanwork configure-agents baseline) will direct an AI to scaffold the per-platform wrapper + config (wrangler.toml, netlify.toml, Vercel Edge), seeded from the templates removed here (recoverable from git history).

Verification

typecheck, eslint, build, 65/65 unit tests, and snippets:check all pass.

🤖 Generated with Claude Code

…dler

Remove the platform-specific deploy adapters and the file generator in
favor of createWebRequestHandler, which runs on any web-standard runtime
(Cloudflare Workers, modern Netlify functions, Vercel Edge, Deno, Bun).

BREAKING CHANGE: removes createVercelHandler, createNetlifyHandler (and the
VercelRequest/VercelResponse/NetlifyEvent/NetlifyContext types), and the file
generator (generateAdapterFiles, Platform, GeneratorOptions, GeneratedFile).

Kept: createWebRequestHandler (with createCloudflareHandler as a deprecated
alias) and createNodeServer/createNodeHandler for local development.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@scalvert scalvert added enhancement New feature or request breaking labels Jun 16, 2026
@scalvert
scalvert merged commit 1d5bc4b into main Jun 16, 2026
8 checks passed
@scalvert
scalvert deleted the consolidate-adapters branch June 16, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant