Skip to content

feat: add plugins exports - #4076

Merged
mrlubos merged 2 commits into
mainfrom
feat/plugin-exports
Jun 16, 2026
Merged

mrlubos merged 2 commits into
mainfrom
feat/plugin-exports

Conversation

@mrlubos

@mrlubos mrlubos commented Jun 16, 2026

Copy link
Copy Markdown
Member

No description provided.

@bolt-new-by-stackblitz

Copy link
Copy Markdown

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

@changeset-bot

changeset-bot Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 98ce35e

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

This PR includes changesets to release 3 packages
Name Type
@hey-api/openapi-ts Minor
@hey-api/shared Patch
@hey-api/openapi-python 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

vercel Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Jun 16, 2026 9:08am

Request Review

@mrlubos
mrlubos marked this pull request as ready for review June 16, 2026 08:53
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. feature 🚀 Feature request. labels Jun 16, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ Minor suggestion — the nameBuilder type change in @hey-api/schemas isn't captured in the changesets.

Reviewed changes — adds a /plugins subpath export to both @hey-api/openapi-ts and @hey-api/openapi-python, backed by a new pluginHelper() factory in @hey-api/shared that produces type-safe plugin config builder functions. Internal dev presets are migrated to use the new helpers.

  • Add pluginHelper() in @hey-api/shared — a generic factory that returns a curried plugin config builder, stripping name from the user-facing parameter and narrowing it to the specific plugin name literal in the return type.
  • Add /plugins subpath exports — new package.json exports entries ("./plugins") and tsdown entry points for both openapi-ts and openapi-python, each exposing a plugins.ts barrel that exports one helper per registered plugin.
  • Migrate dev presets to plugins helpers — dev/typescript/presets.ts and dev/python/presets.ts switch from raw plugin name strings/config objects to plugins.myPlugin({ ... }) calls.
  • Clean up @hey-api/schemas types — drops the @hey-api/spec-types import and widens nameBuilder's schema callback parameter from a union of specific OpenAPI types to unknown.

ℹ️ nameBuilder callback type narrowed to unknown without changelog entry

The @hey-api/schemas plugin's nameBuilder callback parameter schema changed from OpenAPIV2.SchemaObject | OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject | OpenAPIV3_1.SchemaObject to unknown. This is a backward-incompatible type change for callers that access schema properties inside their nameBuilder callback.

The three changesets cover the plugin exports feature but don't mention this type change. Consider adding a short note to one of the @hey-api/openapi-ts patch changesets.

Technical details
# nameBuilder schema type widened to unknown

## Affected sites
- `packages/openapi-ts/src/plugins/@hey-api/schemas/types.ts:13` — `schema` parameter changed from OpenAPI union to `unknown`

## Required outcome
- Add a changeset note documenting the `nameBuilder` schema type change so consumers are aware.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@codecov

codecov Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.78%. Comparing base (e489311) to head (98ce35e).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4076      +/-   ##
==========================================
+ Coverage   38.70%   38.78%   +0.07%     
==========================================
  Files         626      627       +1     
  Lines       21870    21897      +27     
  Branches     6408     6422      +14     
==========================================
+ Hits         8465     8492      +27     
  Misses      10921    10921              
  Partials     2484     2484              
Flag Coverage Δ
unittests 38.78% <100.00%> (+0.07%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@pkg-pr-new

pkg-pr-new Bot commented Jun 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

@hey-api/codegen-core

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

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

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

@hey-api/nuxt

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

@hey-api/openapi-ts

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

@hey-api/shared

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

@hey-api/spec-types

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

@hey-api/types

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

@hey-api/vite-plugin

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

commit: 93129b7

@mrlubos
mrlubos merged commit 9f539eb into main Jun 16, 2026
2 of 3 checks passed
@mrlubos
mrlubos deleted the feat/plugin-exports branch June 16, 2026 09:06
@hey-api hey-api Bot mentioned this pull request Jun 16, 2026

This branch was successfully deployed

1 active deployment
Preview — 98ce35e3 Deployed Jun 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature 🚀 Feature request. 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