Skip to content

fix: sync downstream surfaces and automate their regeneration#405

Merged
jonaslagoni merged 5 commits into
mainfrom
followup
Jul 11, 2026
Merged

fix: sync downstream surfaces and automate their regeneration#405
jonaslagoni merged 5 commits into
mainfrom
followup

Conversation

@jonaslagoni

Copy link
Copy Markdown
Contributor

What & why

While reviewing the commits down to 3e722c5 I found several downstream surfaces had drifted from the recent feature commits (channels organization #398, single HTTP client class #402, and the OpenAPI HTTP client fixes). The root cause: their generated artifacts aren't wired into any automation, so they only refresh when someone remembers to.

Changes

Regenerated the stale committed artifacts (one-time catch-up):

Automated their regeneration going forward:

  • New generate:playground and generate:mcp:docs npm scripts.
  • Wired into version-bump.yml after generate:assets, so all three refresh in the chore(release) PR alongside the schemas/docs that already regenerate there.

Fixed MCP server client-protocol drift from #402:

  • client generator now advertises OpenAPI support, the http protocol, and the clientName option.
  • Replaced the NATS-only protocol filter with a shared resolveClientProtocols helper (maps the MCP http_client name → the client generator's http).

Migration docs:

Notes

  • dist/browser/* build outputs (40 MB bundle + 65 MB map) are gitignored and excluded; only the already-tracked website/static/codegen.browser.mjs is committed.
  • mcp-server typechecks clean. No src/ (main package) code changed — only npm scripts, a workflow, docs, and the separate mcp-server package — so this is a chore: and does not cut a new CLI release.

🤖 Generated with Claude Code

Several surfaces drifted from the recent feature commits (channels
`organization` #398, single HTTP client class #402):

- Regenerate the stale committed artifacts: playground browser bundle
  (`website/static/codegen.browser.mjs`), playground config schema
  (`website/src/schemas/configuration-schema.json`), and the MCP server
  bundled docs (`mcp-server/lib/resources/bundled-docs.ts`).
- Automate their regeneration in `version-bump.yml` via new
  `generate:playground` and `generate:mcp:docs` scripts, so they refresh
  in the release PR alongside the existing `generate:assets`.
- Teach the MCP server that the `client` generator now supports OpenAPI
  and the `http` protocol (plus the `clientName` option), replacing the
  NATS-only protocol filter with a shared mapping helper.
- Document the two breaking changes not yet in the migration guide:
  OpenAPI operation-name cleanup (0.72.3) and native `fetch` in the
  generated HTTP client (0.72.6).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonaslagoni jonaslagoni requested a review from ALagoni97 as a code owner July 11, 2026 10:13
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
the-codegen-project Ready Ready Preview, Comment Jul 11, 2026 10:56am
the-codegen-project-mcp Ready Ready Preview, Comment Jul 11, 2026 10:56am

The playground gated the `client` generator to AsyncAPI only and fed the
shared protocol selection verbatim to both the `channels` and `client`
generators. Since #402 the client generator supports OpenAPI via the
`http` protocol, but the picker names it `http_client` (the channels
name), so the client config was invalid.

- Allow the `client` preset for OpenAPI inputs.
- Let the HTTP Client protocol be selected for the client generator.
- Map the shared protocol selection onto the client generator's protocol
  names (`http_client` -> `http`) via a shared `toClientProtocols` helper,
  in both the JSON-config preview and the generation path.
- Make the "client only supports ..." hint input-aware (NATS for
  AsyncAPI, HTTP for OpenAPI).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`init` offered OpenAPI as an input type but hard-gated every generator to
`inputType === 'asyncapi'`, so choosing OpenAPI produced a config with an
empty `generators` array — even when include flags were passed. Since
OpenAPI now supports payloads, parameters, headers, channels and the HTTP
client (#311, #402), scaffold those for OpenAPI too:

- Broaden the flag relationships, interactive prompts and config emission
  to accept OpenAPI via a shared `supportsGenerators` helper.
- Seed OpenAPI-appropriate protocols: `channels` -> `['http_client']`,
  `client` -> `['http']` (instead of the NATS defaults).
- Strengthen init tests to assert the emitted generators (presets and
  protocols) rather than only that stdout is non-empty, and repurpose the
  misleading "no AsyncAPI-specific features" test into a real regression
  guard for OpenAPI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extend the init command beyond the payloads/parameters/headers/channels/
client presets and AsyncAPI/OpenAPI inputs:

- Add `--include-types` and `--include-models` flags (and interactive
  prompts) for the types and models generators.
- Add `jsonschema` as a selectable input type; it exposes only the models
  generator (the sole preset init offers that supports JSON Schema).
- Replace the single asyncapi/openapi gate with a per-preset input-support
  map so each generator is only offered/emitted for input types it
  supports (e.g. models works for JSON Schema, types does not).
- Re-export `defaultTypeScriptModelsOptions`/`generateTypescriptModels`
  through the generators barrels so init can consume the models default.
- Track types/models in telemetry and .gitignore output paths, and
  regenerate the command docs.

Tests assert the emitted presets per input type, including that JSON
Schema drops unsupported presets and keeps only models.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonaslagoni jonaslagoni changed the title chore: sync downstream surfaces and automate their regeneration fix: sync downstream surfaces and automate their regeneration Jul 11, 2026
@jonaslagoni jonaslagoni merged commit 2675e82 into main Jul 11, 2026
17 checks passed
@jonaslagoni jonaslagoni deleted the followup branch July 11, 2026 11:21
@jonaslagoni

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 0.74.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants