feat: first-run DX, CI pipeline wiring & input fidelity#432
Open
jonaslagoni wants to merge 32 commits into
Open
feat: first-run DX, CI pipeline wiring & input fidelity#432jonaslagoni wants to merge 32 commits into
jonaslagoni wants to merge 32 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Single source of truth for cosmiconfig searchPlaces and the not-found error message; primary codegen.* names keep search priority, extras (package.json, .codegenrc*, .config/codegenrc*, codegen.config.*) appended. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- languages flag defaults to typescript - error (exit 1) instead of silently writing empty generators - shouldAskInclude reads flags-or-answers so flag-driven includes compose - explicit --config-type wins over the interactive prompt (setFromDefault) - new --channels-protocols flag + interactive question seeds channels protocols - warn on asyncapi channels with no protocols - gitignore entries derived from the generators actually built Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- published dependency (^0) instead of workspace:* - generate script runs 'codegen generate' - drop duplicate codegen.config.js (keep discoverable codegen.js) - add package-lock.json for CI npm ci - realign index.ts with current generated models (reservedName, Date fields, enum types, nested model classes) - README no longer claims marshalling the models generator does not emit Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
OpenAPI channels and client are registered, implemented and shipped (examples/openapi-http-client); mark them supported in the matrices. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the break-on-first-payload-less loop with a filter that keeps every payload-bearing message, warns about skipped ones, and collapses to a plain schema when only one message carries a payload. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collect all header-bearing messages: 0 -> undefined, 1 -> unchanged single schema, 2+ -> channel-scoped oneOf union mirroring the payloads builder; warn about skipped header-less messages. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AsyncAPI and OpenAPI callers now read the document's HTTP(S) servers and pass them as the generated client's default baseURL (runtime context.baseUrl still overrides). Non-HTTP servers, relative URLs, and unresolved server variables are skipped with a warning/verbose log. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- accept any +json content type (isJsonContentType), preferring application/json - warn (never silently drop) when an operation's content is all non-JSON - warn per operation with cookie parameters (dropped, unsupported) - warn once when a document declares webhooks (ignored, unsupported) - headers guard checks headerParams instead of allParameters Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- runtime aggregate test now runs test:regular and test:payload-types - test:regular includes jsdoc.spec.ts - CI matrix adds WebSocket, Organization, Payload Types entries (10 total) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- TEST_SPECIFIC_FILE/CONFIG default to full matrix (env-overridable for CI) - pair configs only with schema files of matching inputType (removes the inherent asyncapi-config x jsonschema-file cross-product failures) - KNOWN_FAILING tracked-debt scaffold with explicit skip (currently empty: all 214 compatible pairs pass locally) - shard blackbox CI into 4 config buckets via BLACKBOX_CONFIG Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- pull_request (not pull_request_target) with real paths (website/**, src/browser/**, esbuild.browser.mjs) so it triggers and checks out the PR - build the browser bundle (first CI coverage) and verify it lands in the site - drop the nonexistent lint step, dead retry, and wait-for-vercel step Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New CI job packs the CLI, then for every example runs npm ci, installs the packed tarball where the example depends on the published CLI, runs npm run generate, and (if present) npm run build against the PR's build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- HTTP client base URL precedence (context.baseUrl > servers[0] > localhost) - OpenAPI content types (+json), servers, and limitations (cookie/webhooks/non-JSON) - OpenAPI inputs matrix: channels/client now supported - AsyncAPI multi-message payload/header union semantics - getting-started: non-interactive init flags + empty-generators guard - regenerate openapi-http-client example (server-derived baseURL) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Command docs and JSON schemas already reflect the changes; this run only updates markdown tocs and applies prettier to touched source files. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Runtime regeneration reflects the new generators: - HTTP clients default baseURL from document servers - request-reply channel uses the multi-message oneOf header union (UserItemsHeaders / ItemResponseHeaders) Fix pre-existing formats spec: format:time unmarshals to a string, not a Date. Verified green: unit (706), blackbox full matrix (214 pairs), runtime tier across http/nats/kafka/mqtt/amqp/regular/payload-types/organization/ websocket/eventsource, plus build, lint and typecheck. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A request/reply channel lists both its request and reply messages, and the channel-level headers are consumed as the request headers. The header union was folding the reply message's headers into the request type (e.g. requestHeaders?: ItemRequestHeaders | ItemResponseHeaders), which is wrong — a request must not carry the response's headers. Reply-only messages are now excluded from the channel header union (a message used as both request and reply is kept). Request/reply generated output returns to request-only headers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- reformat typescript-library/typescript-nextjs asyncapi.json to spaces (tabs trigger a parser warning that the loader treats as fatal, failing codegen generate) - scope the examples smoke test to generation only; running each example's own build couples CI to app toolchains/deps (Next.js, ajv) and is redundant with the blackbox tier, which already type-checks generated output Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract buildChannelHeaderEntry and addMessageIds helpers so the reply-only exclusion logic stays under the complexity limit (no behavior change). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move the per-example loop out of the CI bash script into scripts/testExamples.js (exposed as 'npm run test:examples') so anyone can run the exact same check locally. It builds+packs the CLI, then for each example runs npm ci, installs the packed tarball with --no-save where the example depends on the CLI (so it never rewrites committed manifests), and runs npm run generate. The tarball is cleaned up and gitignored. CI now just calls the script. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- rename scripts/testExamples.js -> generateExamples.js; it (re)generates every example against the current build - 'npm run generate:examples' refreshes the examples' committed output; 'npm run test:examples' aliases it as the CI smoke test (fails on any error) - release workflow regenerates examples against the released CLI and commits the refresh back ([skip ci], only when generation changed something) so the committed example output never drifts Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…release step Examples are refreshed through the same generate:assets hook that already regenerates docs/schemas (run in prepare:pr and prepublishOnly), so no bespoke release-workflow commit-back is needed. Reverts the release.yml change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
npm pack --json's filename field is scoped (@scope/name-x.y.z.tgz) on some npm versions (e.g. npm 8 used by pr-testing) while the on-disk file is flattened (scope-name-x.y.z.tgz), so joining root + that field pointed at a nonexistent path and the tarball install failed on CI. Pack into an isolated temp dir and read the actual produced file from disk instead; clean up the dir afterward. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue: none (sourced from
.claude/thoughts/shared/improvements/2026-07-23-2146-improvements.md, ideas 1–3; plan.claude/thoughts/shared/plans/2026-07-23-first-run-ci-input-fidelity.md)What
Fixes three verified problem areas end to end:
codegen initcan no longer silently produce an empty config,codegen generatewarns on no-op channel generation, the internalbasecommand is hidden, and the brokenjsonschema-modelsexample works again.baseURLfrom the document'sservers, and OpenAPI extraction accepts+jsoncontent types and warns (never silently drops) on skipped operations, cookie params, and webhooks.Why
The first-run path had several silent failure modes: config file names the docs promised weren't discovered,
init --no-ttywithout generator flags wrotegenerators: []and still printed success, and generated channel barrels with no protocols were counted as output with no warning. The three-tier test pipeline had large blind spots — the blackbox suite was pinned to 1 of 23 schema files, several runtime suites ran nowhere in CI, the website workflow never triggered (wrongpaths), and the browser bundle and examples had zero CI. And the input processors silently lost data: a payload-less message truncated the rest of a channel's payloads, only the first message's headers were kept, HTTP clients ignored declared servers, and OpenAPI dropped non-application/jsonJSON bodies and cookie/webhook constructs without a word.Changes
First-run path
CONFIG_SEARCH_PLACESconstant drives both cosmiconfig discovery and the not-found error (historical 7 names keep priority; cosmiconfig-standard names appended). Docs reordered to match.codegen init:languagesdefaults totypescript; errors instead of writing emptygenerators; flag/answer composition fixed viashouldAskInclude; explicit--config-typewins over the prompt; new repeatable--channels-protocolsflag seeds channel protocols;.gitignoreentries derive from the generators actually built; warns when AsyncAPI channels end up with no protocols.codegen generatewarns (once) when a channels generator produces no protocol functions (barrel still emitted).codegen basecommand hidden from the manifest and docs.examples/jsonschema-modelsfixed: published dependency,codegen generatescript, de-duplicated config,package-lock.json, andindex.tsrealigned with current generated models.channels/clientindocs/generators/README.md,docs/getting-started/generators.md, anddocs/inputs/openapi.md.Input fidelity
break(keeps every payload-bearing member; collapses to a plain schema for a single one).oneOfunion across all header-bearing messages (channel-scoped id), mirroring the payloads builder; single-message output unchanged.baseURLdefaults to the document's first HTTP(S) server (AsyncAPI + OpenAPI); non-HTTP/relative/variable-less servers skipped with a log. Runtimecontext.baseUrlstill overrides.isJsonContentTypeaccepts any+jsonsubtype (prefersapplication/json); warns per operation on non-JSON-only content, per cookie parameter, and once per document with webhooks.Test pipeline
inputType), env-overridable, with a tracked-debtKNOWN_FAILINGscaffold (empty — all pairs pass); CI sharded into 4 config buckets.test:regular+test:payload-typesadded to the aggregate,jsdoc.spec.tswired in, CI matrix gains WebSocket/Organization/Payload-types (10 entries).pull_requestwith real paths, PR checkout, browser-bundle build, and honest install+build (dropped the nonexistent lint, dead retry, and vercel-wait steps).examples-testing.ymlsmoke-tests every example against the packed CLI.Docs: HTTP baseURL precedence, AsyncAPI multi-message union semantics, OpenAPI content-type support and limitations, and non-interactive
initusage.Testing
All verified locally (green):
npm test(706 passing, 1 skipped)npm run buildnpm run lintnpm run generate:assets(clean on second run)BLACKBOX_CONFIGNotes
oneOfheader union (new type name/shape); HTTPbaseURLdefaults to the document server instead ofhttp://localhost:3000; OpenAPI+json-only operations now produce payload models. Single-message channels and documents without servers are unchanged. Non-output behavior changes: config discovery finds more file names (existing names keep priority),initerrors instead of silently writing empty configs, and new warnings are emitted.format: timeunmarshals to a string (no JSDatefor a time-of-day).2026-07-17-headers-companion-interface.mdwork rewrites the same header generator sites and must rebase on this branch — do not run both concurrently.🤖 Generated with Claude Code