-
Notifications
You must be signed in to change notification settings - Fork 33
fix: reduce complexity #687
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
Conversation
This comment has been minimized.
This comment has been minimized.
| ? (T["parameters"] extends { query?: infer Q } ? Q : {}) & | ||
| (T["parameters"] extends { path?: infer P } ? P : {}) & | ||
| (T["parameters"] extends { header?: infer H } ? H : {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this. Maybe needs a Partial around it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would it need Partial? It seems to be the same output as before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR aims to reduce TypeScript compilation complexity by simplifying type definitions and optimizing the build configuration. The changes focus on restructuring complex union-to-intersection type operations into simpler parameter extraction patterns and updating build tooling for better diagnostics.
- Simplified parameter extraction logic by replacing complex union-to-intersection types with direct parameter mapping
- Restructured operation types using separate interfaces for better modularity
- Added build optimization flags and tracing capabilities for performance monitoring
Reviewed Changes
Copilot reviewed 6 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.test.json | Added extended diagnostics flag for better TypeScript compiler insights |
| src/RequestRequestOptions.ts | Changed signal type from AbortSignal to any for broader compatibility |
| scripts/update-endpoints/typescript.mjs | Added readonly method detection logic for endpoint categorization |
| scripts/update-endpoints/templates/endpoints.ts.template | Refactored complex type definitions into simpler interface-based approach |
| scripts/update-endpoints/fetch-json.mjs | Added response code fetching to GraphQL query |
| package.json | Updated test script to include TypeScript trace generation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/RequestRequestOptions.ts
Outdated
| * Use an `AbortController` instance to cancel a request. In node you can only cancel streamed requests. | ||
| */ | ||
| signal?: AbortSignal; | ||
| signal?: any; |
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the signal type from AbortSignal to any removes type safety and could lead to runtime errors. Consider using a union type like AbortSignal | undefined or keeping the original AbortSignal type if compatibility is the concern.
| signal?: any; | |
| signal?: AbortSignal | undefined; |
Co-authored-by: Copilot <[email protected]>
|
Tested with the |
|
🎉 This PR is included in version 15.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Resolves #ISSUE_NUMBER
Before the change?
After the change?
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!