Skip to content

Generate native Socket.IO TypeScript types from AsyncAPI contracts - #5

Merged
atomiechen merged 8 commits into
mainfrom
codex/typescript-consumer-types
Sep 27, 2026
Merged

atomiechen merged 8 commits into
mainfrom
codex/typescript-consumer-types

Conversation

@atomiechen

@atomiechen atomiechen commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add @pydantic-socketio/codegen to turn the existing AsyncAPI contract into native Socket.IO TypeScript event types for both TypeScript clients and servers.
  • Preserve Pydantic model names and Python handler argument names in generated types. Deduplicate repeated schemas, distinguish different models with the same title, and accept earlier formatVersion 1 contracts without argument names.
  • Support Node 18, 20, 22, 24, and 26; verify both Python server → TypeScript client and Python client → TypeScript server against real Socket.IO peers and ACKs.
  • Keep Python and codegen release workflows separate. The npm package remains private and unreleased.

Verification

  • uv run --locked --no-sync pytest -q: 63 passed.
  • Ruff and Pyright: passed.
  • npm test --prefix packages/codegen: generated types compile, 12 incorrect uses fail type-checking, and both live exchange directions pass.
  • Local Node 18/20/22/24/26 runs and clean npm tarball installations: passed.
  • Fresh Python wheel and npm tarball also passed the independent local review exercise.

Release boundary

This PR does not publish the npm package. Its package.json remains private: true; 0.1.0 is the planned first public version. A separate release change can set public metadata, version, and a codegen-vX.Y.Z tag after review. The manual release workflow depends on atomiechen/reusable-workflows#1 being merged first. No release workflow has been dispatched.

@atomiechen
atomiechen merged commit 29b2611 into main Sep 27, 2026
23 checks passed
@atomiechen
atomiechen deleted the codex/typescript-consumer-types branch September 27, 2026 12:42
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