Skip to content

fix: add WithSpecExtensions type#3734

Merged
mrlubos merged 1 commit intomainfrom
fix/spec-types-2
Apr 9, 2026
Merged

fix: add WithSpecExtensions type#3734
mrlubos merged 1 commit intomainfrom
fix/spec-types-2

Conversation

@mrlubos
Copy link
Copy Markdown
Member

@mrlubos mrlubos commented Apr 9, 2026

No description provided.

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@pullfrog
Copy link
Copy Markdown

pullfrog bot commented Apr 9, 2026

Reviewed PR #3734. The changes are additive and non-breaking: a new WithSpecExtensions<T> type alias (T & SpecExtensions), expanded README, and additional npm keywords. No issues found — approved.

Task list (4/4 completed)
  • Read the full diff to understand all changes
  • Investigate each changed file in detail
  • Check for impact on existing consumers/exports
  • Submit review

Pullfrog  | View workflow run | Triggered by Pullfrog𝕏

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2026

🦋 Changeset detected

Latest commit: 93311f1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@hey-api/spec-types Patch
@hey-api/openapi-python Patch
@hey-api/openapi-ts Patch
@hey-api/shared Patch

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

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

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

Project Deployment Actions Updated (UTC)
hey-api-docs Ready Ready Preview, Comment Apr 9, 2026 11:10pm

Request Review

@mrlubos mrlubos marked this pull request as ready for review April 9, 2026 23:09
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 9, 2026
@pullfrog
Copy link
Copy Markdown

pullfrog bot commented Apr 9, 2026

TL;DR — Adds a WithSpecExtensions<T> utility type to @hey-api/spec-types so consumers can intersect any type with x-* extension properties in a single generic call. Also fleshes out the package README with full documentation, badges, and sponsor info, and expands package.json keywords for discoverability.

Key changes

  • Add WithSpecExtensions<T> utility type — a generic alias (T & SpecExtensions) that lets consumers annotate any spec type with x-* extension properties without manually intersecting.
  • Export WithSpecExtensions from package barrel — re-exports the new type from src/index.ts alongside the existing SpecExtensions.
  • Expand @hey-api/spec-types README — replaces the stub with full documentation including features, installation instructions, usage examples, sponsor tables, and live DevTrends badges.
  • Add npm discoverability keywords — adds 12 new keywords (json-schema, openapi-3.1, swagger-2.0, jsdoc, etc.) to package.json.

Summary | 5 files | 1 commit | base: mainfix/spec-types-2


WithSpecExtensions<T> utility type

Before: consumers had to manually write SomeType & SpecExtensions to allow x-* properties on spec objects.
After: WithSpecExtensions<T> provides a single-generic shorthand for the same intersection.

The new type is defined in src/extensions/spec.ts and re-exported from the package barrel. It's a thin alias — type WithSpecExtensions<T> = T & SpecExtensions — with a JSDoc comment describing its purpose.

packages/spec-types/src/extensions/spec.ts · packages/spec-types/src/index.ts


Package README and metadata refresh

Before: README was a minimal stub with commented-out badge links and no usage docs.
After: full README with features list, installation commands (npm/pnpm/yarn/bun), OpenAPI and JSON Schema usage examples, sponsor tables, and live DevTrends badges.

The package.json keywords array grows from 10 to 22 entries, covering specific spec versions (openapi-2.0, openapi-3.0, openapi-3.1, swagger-2.0) and related terms (jsdoc, intellisense, type-definitions) to improve npm search visibility.

packages/spec-types/README.md · packages/spec-types/package.json

Pullfrog  | View workflow run | Triggered by Pullfrog𝕏

Copy link
Copy Markdown

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no issues found.

Pullfrog  | View workflow run𝕏

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 9, 2026

Open in StackBlitz

@hey-api/codegen-core

npm i https://pkg.pr.new/@hey-api/codegen-core@3734

@hey-api/json-schema-ref-parser

npm i https://pkg.pr.new/@hey-api/json-schema-ref-parser@3734

@hey-api/nuxt

npm i https://pkg.pr.new/@hey-api/nuxt@3734

@hey-api/openapi-ts

npm i https://pkg.pr.new/@hey-api/openapi-ts@3734

@hey-api/shared

npm i https://pkg.pr.new/@hey-api/shared@3734

@hey-api/spec-types

npm i https://pkg.pr.new/@hey-api/spec-types@3734

@hey-api/types

npm i https://pkg.pr.new/@hey-api/types@3734

@hey-api/vite-plugin

npm i https://pkg.pr.new/@hey-api/vite-plugin@3734

commit: 93311f1

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.04%. Comparing base (ebf6878) to head (93311f1).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3734   +/-   ##
=======================================
  Coverage   40.04%   40.04%           
=======================================
  Files         520      520           
  Lines       19243    19243           
  Branches     5720     5720           
=======================================
  Hits         7705     7705           
  Misses       9342     9342           
  Partials     2196     2196           
Flag Coverage Δ
unittests 40.04% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mrlubos mrlubos merged commit b877338 into main Apr 9, 2026
12 checks passed
@mrlubos mrlubos deleted the fix/spec-types-2 branch April 9, 2026 23:14
@hey-api hey-api bot mentioned this pull request Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant