Version Packages#1991
Open
pmcelhaney wants to merge 1 commit intomainfrom
Open
Conversation
7de4969 to
39afb0d
Compare
210c9fe to
5ba9251
Compare
5ba9251 to
cf3f45b
Compare
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.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
counterfact@2.12.0
Minor Changes
3502d41: Add native support for the
QUERYHTTP method (OpenAPI 3.2). TheQUERYmethod is safe and idempotent but allows a request body, making it useful for complex search and filter operations.HttpMethodsinsrc/server/registry.tsnow includes"QUERY".Moduleinterface exposes aQUERYhandler that receives a request body.HTTP_METHODSinsrc/migrate/update-route-types.tsnow includes"QUERY"so the migration helper recognisesHTTP_QUERYtype imports.allowedMethodslist now includes"query".GETorHEAD, soQUERYrequests forward their body to the handler automatically.5aa3326: Add support for OpenAPI 3.2
querystringparameter location: generates a typed$.querystringproperty on the route handler argument and populates it at runtime with the full parsed query string8e15211: Add support for OpenAPI 3.2 streaming responses and Server-Sent Events (SSE) via
itemSchema.SchemaTypeCodernow recognisesitemSchemain a schema object and emitsAsyncIterable<T>.ResponseTypeCoderandOperationTypeCoderdetectitemSchemaon streaming content types (text/event-stream,application/jsonl,application/x-ndjson,application/ndjson,application/json-seq) and emitAsyncIterable<T>as the body type instead of a plain schema type.CounterfactResponseObject.bodynow acceptsAsyncIterable<unknown>in addition toUint8Array | string.$.response[200].stream(iterable, contentType?)) exposes astream()helper that returns a response with the async iterable as the body. The content type defaults totext/event-stream.routes-middlewareconvertsAsyncIterableresponse bodies into Node.jsReadablestreams, serialising each item in the appropriate wire format:text/event-stream→data: <json>\n\napplication/json-seq→\x1e<json>\n<json>\nCache-Control: no-cacheandX-Accel-Buffering: noheaders automatically.create-koa-appnow skips Node.jsReadablestream bodies so they are piped directly to the client.1329973: Support OpenAPI 3.2
xml.nodeTypefield in JSON-to-XML serialisation.nodeType: "attribute"serialises the value as an XML attribute.nodeType: "text"serialises the value as an XML text node (no child element wrapper).nodeType: "cdata"serialises the value as a CDATA section.nodeType: "none"omits the property from the XML output entirely.nodeType: "element"wraps the value in a child element (default behaviour); for arrays it is a synonym for the deprecatedxml.wrapped: true.xml.attribute: truecontinues to behave identically tonodeType: "attribute".xml.wrapped: truecontinues to behave identically tonodeType: "element"for arrays.Patch Changes
1302457: Add regression tests confirming that
$refreferences to#/components/mediaTypes/...entries (OpenAPI 3.2) are resolved correctly during bundling and code generation.specification.test.tsnow includes two tests: one that navigates to acomponents/mediaTypesentry viagetRequirement, and one that verifies transparent$reffollowing through such an entry.generate.test.tsnow includes two end-to-end tests: one that verifies code generation completes without error for a spec using a$refto a media type component, and one that verifies the generated TypeScript types include the correct schema from the referenced media type.7bbcf63: OpenAPI 3.2: include
discriminator.defaultMappingschema in generated union types foranyOf/oneOfschemasfda8f18: Add "Multiple API Versions" pattern to docs/patterns/. The new page explains how to configure multiple versioned specs and use
$.minVersion()to share route handlers across versions without duplication.Also rewrites the patterns index introduction: the single long paragraph is now split into labelled sections (Getting started, Organizing state, Runtime control, Versioned and multi-spec APIs, Long-term reliability, Integration strategies) followed by a complete pattern table.
1a868ba: Document support for Swagger 2.0 and OpenAPI 3.0, 3.1, and 3.2 in the README and getting started docs.
16f890f: Prefer
dataValueovervaluein OpenAPI 3.2 Example ObjectsWhen building example responses, Counterfact now checks for the
dataValuefield (introduced in OpenAPI 3.2) and uses it in preference to the existing
valuefield. IfdataValueis absent, the existingvaluefield is used asbefore, maintaining full backward compatibility with OpenAPI 3.0 and 3.1 specs.
b024920: Add regression tests verifying that OpenAPI 3.2
$selfdocument-identity field is preserved through bundling and that relative$refvalues in specs with$selfresolve correctly. CoversSpecification.fromFile(), the OpenAPI middleware, and end-to-end code generation.a6dc7e8: Updated dependency
precinctto12.3.1.fd5914c: Updated dependency
@swc/coreto1.15.33.a71e047: Updated dependency
@apidevtools/json-schema-ref-parserto15.3.1.4224be0: Updated dependency
@swc/coreto1.15.32.eed59b8: Updated dependency
astroto^6.0.0.01ff516: Updated dependency
precinctto12.3.2.e88e792: Updated dependency
@jest/globalsto30.3.0.Updated dependency
@types/debugto4.1.12.Updated dependency
@typescript-eslint/eslint-pluginto8.58.0.Updated dependency
@typescript-eslint/parserto8.58.0.Updated dependency
eslint-plugin-nto17.24.0.Updated dependency
eslint-plugin-promiseto7.2.1.Updated dependency
eslint-plugin-regexpto3.0.0.Updated dependency
eslint-plugin-securityto4.0.0.Updated dependency
posthog-nodeto5.28.11.Updated dependency
tsxto4.21.0.ca7c067: Updated dependency
@typescript-eslint/eslint-pluginto8.59.1.Updated dependency
@typescript-eslint/parserto8.59.1.68b730f: Updated dependency
json-schema-fakerto0.6.1.15b4c1b: Updated dependency
typescriptto6.0.3.dd4e758: Updated dependency
prettierto3.8.3.10148fd: Updated dependency
posthog-nodeto5.33.3.d8258a9: Updated dependency
eslint-plugin-jestto29.15.2.7a38b14: Updated dependency
@types/debugto4.1.13.47d07e4: Updated dependency
@changesets/clito2.31.0.6d582b4: Updated dependency
eslintto10.3.0.89d4554: Updated dependency
fs-extrato11.3.5.1a51c4f: Updated dependency
@typescript-eslint/eslint-pluginto8.59.2.Updated dependency
@typescript-eslint/parserto8.59.2.e1bad83: Updated dependency
eslint-plugin-regexpto3.1.0.b459631: Set
name: "Counterfact"on the injected server entry in the served OpenAPI document. OpenAPI 3.2-aware tools (e.g. Swagger UI) use thenamefield as the primary label for a server entry in the server selector.35abb32: Upgrade
@apidevtools/json-schema-ref-parserfrom 15.1.3 to 15.3.5. The new version includes a built-in fix for Windows paths using forward slashes (C:/...), making thepatch-packagepatch unnecessary.