-
-
Couldn't load subscription status.
- Fork 256
Export Operation type to fix methodNameBuilder TypeScript errors #2862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export Operation type to fix methodNameBuilder TypeScript errors #2862
Conversation
|
|
🦋 Changeset detectedLatest commit: 857c464 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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.
|
Co-authored-by: mrlubos <[email protected]>
|
@copilot can you add a test verifying this solution? |
Co-authored-by: mrlubos <[email protected]>
Added test in
All tests pass (969 total, including 2 new tests). Commit: 774e408 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2862 +/- ##
=======================================
Coverage 30.59% 30.59%
=======================================
Files 488 488
Lines 39938 39938
Branches 2442 2442
=======================================
Hits 12219 12219
Misses 27685 27685
Partials 34 34
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:
|
commit: |
TypeScript reports private type errors when using
methodNameBuilderin SDK plugin configuration because theOperationtype referenced in its signature is not exported from the package.Changes
Operationtype frompackages/openapi-ts/src/index.tspackages/openapi-ts/src/__tests__/exports.test.tsto verify Operation type is properly exported and can be used in methodNameBuilder signaturesThe SDK plugin's
methodNameBuilderaccepts(operation: IR.OperationObject | Operation) => string. WhileIR.OperationObjectis accessible via the exportedIRnamespace,Operationfrom~/types/clientwas not exported, causing TypeScript to treat it as private.Example
Users can now use
methodNameBuilderwithout TypeScript errors:Testing
The new tests verify that:
Fixes #2813
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.