Conversation
|
|
🦋 Changeset detectedLatest commit: b4a8afe The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
TL;DR — Cleans up Key changes
Summary | 18 files | 4 commits | base: Mutable arrays across all spec types
This is the dominant mechanical change across the PR, touching every spec version (v2, v3, v3.1) and both JSON Schema drafts (draft-4, draft-2020-12). The changesets indicate a patch-level bump for
Generic self-referential
|
| Spec version | Before | After |
|---|---|---|
v3.1 SchemaObject |
JSONSchemaDraft2020_12 & OpenAPIExtensions |
JSONSchemaDraft2020_12<SchemaObject> & OpenAPIV3_1SchemaExtensions & SpecExtensions & EnumExtensions |
v3 SchemaObject |
extends EnumExtensions, OpenAPIExtensions |
extends EnumExtensions, SpecExtensions |
v2 SchemaObject |
extends JSONSchemaDraft4, OpenAPIV2NullableExtensions |
extends JSONSchemaDraft4, EnumExtensions, OpenAPIV2NullableExtensions |
draft-2020-12 Document |
extends ..., EnumExtensions, OpenAPIV3_1SchemaExtensions, OpenAPIExtensions |
extends ArrayKeywords, NumberKeywords, ObjectKeywords, StringKeywords |
draft-4 Document |
extends EnumExtensions |
No extension inheritance |
draft-2020-12/spec.ts · draft-4/spec.ts · v3-1/spec.ts · v2/spec.ts
Rename and split extension files
Before: All extension types (
CodeSampleObject,LinguistLanguages,EnumExtensions,OpenAPIExtensions) lived in a single file, withOpenAPIExtensionsas the name for the generic[x-${string}]: unknownindex signature.
After: Extensions are split intocode-samples.ts,enum.ts, andspec.ts.OpenAPIExtensionsis renamed toSpecExtensionsto reflect its broader applicability.
code-samples.ts · enum.ts · spec.ts · index.ts
Build migration to tsdown
Before: Build used
tsc --buildwith.d.tsoutput and no Turbo configuration.
After: Build usestsdownwith ESM-only output, sourcemaps,.d.mtstype declarations, and a dedicatedturbo.jsonfor task orchestration.
This aligns @hey-api/spec-types with the build tooling used by the rest of the monorepo. A tsconfig.json project reference to @hey-api/types is also added.
package.json · tsdown.config.ts · turbo.json · tsconfig.json
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3715 +/- ##
=======================================
Coverage 40.24% 40.24%
=======================================
Files 520 520
Lines 19302 19302
Branches 5726 5720 -6
=======================================
Hits 7769 7769
Misses 9337 9337
Partials 2196 2196
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Caution
OpenAPIExtensions was renamed to SpecExtensions and its export removed, but packages/shared/src/ir/types.ts still imports OpenAPIExtensions from @hey-api/spec-types (lines 3, 25, 49, 135). This will break the shared package build.
Additionally, removing OpenAPIV3_1SchemaExtensions from JSONSchemaDraft2020_12.Document means that Pick<JSONSchemaDraft2020_12.Document, 'example'> in IRSchemaObject (line 133 of ir/types.ts) becomes invalid — example is no longer a key of Document.
The type-level restructuring (splitting extensions/openapi into extensions/code-samples, extensions/enum, extensions/spec, and moving EnumExtensions/OpenAPIV3_1SchemaExtensions from Document to SchemaObject) makes sense — JSON Schema Document shouldn't carry OpenAPI-specific extensions. The ReadonlyArray → Array change and stricter swagger: '2.0' are both good fixes. The tsc → tsdown build migration aligns with the rest of the monorepo.
@hey-api/codegen-core
@hey-api/json-schema-ref-parser
@hey-api/nuxt
@hey-api/openapi-ts
@hey-api/shared
@hey-api/spec-types
@hey-api/types
@hey-api/vite-plugin
commit: |

Closes #3716