refactor(core): remove duplicate types#6359
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the “Companion provider” type plumbing by removing the duplicated bridge types in @uppy/core/utils and wiring Uppy’s provider plugins and provider views directly to the real Provider / SearchProvider / ProviderView types now living in @uppy/core, aiming for improved type safety without behavior changes.
Changes:
- Removes the duplicate
CompanionClientProvider/CompanionClientSearchProvider/RequestOptionstype definitions previously exported from@uppy/core/utils. - Moves
RequestOptionsto@uppy/core/companion-client(exported viaRequestClient) and updates imports accordingly. - Updates provider-view call sites to use the generic
Provider.list/searchresponse typing and updates plugin/provider typings to use the real classes.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/@uppy/webdav/src/Webdav.tsx | Makes uppyVersions optional/defaulted in the WebDAV provider login override to match the updated core Provider login signature. |
| packages/@uppy/core/src/utils/index.ts | Stops exporting the duplicate companion/provider bridge types from the utils entrypoint. |
| packages/@uppy/core/src/utils/CompanionClientProvider.ts | Removes the duplicated bridge type definitions file entirely. |
| packages/@uppy/core/src/Uppy.ts | Switches UnknownProviderPlugin / UnknownSearchProviderPlugin typings to use real Provider/SearchProvider + ProviderView types. |
| packages/@uppy/core/src/provider-views/utils/companionFileToUppyFile.ts | Updates provider parameter types to the real Provider / SearchProvider classes. |
| packages/@uppy/core/src/provider-views/utils/addFiles.ts | Updates provider parameter types to the real Provider / SearchProvider classes. |
| packages/@uppy/core/src/provider-views/ProviderView/ProviderView.tsx | Adds a typed response shape for list/search and applies it at call sites using generic Provider methods. |
| packages/@uppy/core/src/companion-client/SearchProvider.ts | Removes dependency on the now-deleted bridge interface; keeps the concrete class. |
| packages/@uppy/core/src/companion-client/RequestClient.ts | Defines and exports RequestOptions here (new authoritative location). |
| packages/@uppy/core/src/companion-client/Provider.ts | Removes dependency on bridge types; makes uppyVersions optional/defaulted in login. |
| packages/@uppy/core/src/companion-client/index.ts | Re-exports RequestOptions from RequestClient via the companion-client entrypoint. |
| packages/@uppy/aws-s3/src/index.ts | Updates RequestOptions import to come from @uppy/core/companion-client. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…uppy into core-merge-5-type-unification
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This PR removes the duplicate companion/provider bridge types (CompanionClientProvider CompanionClientSearchProvider, and the
view: anyescape hatch) and wires the real Provider/ProviderView types directly, now possible since everything lives in@uppy/coreNet gain in type safety; no behavior change.for more context on the approach see description of #6351