Skip to content

Split Express entrypoint into focused modules#8

Merged
mmurrs merged 1 commit into
mainfrom
refactor/split-express-facade
May 22, 2026
Merged

Split Express entrypoint into focused modules#8
mmurrs merged 1 commit into
mainfrom
refactor/split-express-facade

Conversation

@mmurrs
Copy link
Copy Markdown
Owner

@mmurrs mmurrs commented May 22, 2026

Summary

  • keep src/express.ts as the public facade and createDual402 entrypoint
  • move public/internal types into src/types.ts
  • move startup config validation and x402 resolution into src/config.ts
  • move charge middleware creation into src/charge.ts
  • move paidRoute, dualDiscovery, and OpenAPI generation into src/discovery.ts

Why

This applies the maintainability review finding that src/express.ts had crossed 1k lines and mixed public API, config validation, payment middleware, and discovery generation in one file. The PR is intentionally mechanical so behavior and public imports stay stable.

The current handler metadata coupling and cast-heavy x402 shape probing are left unchanged for follow-up PRs.

Verification

  • npm run check
  • npm audit --omit=dev
  • npm pack --dry-run

@mmurrs mmurrs force-pushed the refactor/split-express-facade branch from aa328d1 to 50bcdf2 Compare May 22, 2026 02:46
@mmurrs mmurrs marked this pull request as ready for review May 22, 2026 15:22
@mmurrs mmurrs merged commit c29c6c4 into main May 22, 2026
1 check passed
@mmurrs mmurrs deleted the refactor/split-express-facade branch May 22, 2026 15:22
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