Closed trevorpfiz closed 1 month ago
@trevorpfiz How would you resolve naming conflicts across modules?
@trevorpfiz How would you resolve naming conflicts across modules?
hmm, would we be forced to do something like this?
export * as Schemas from './schemas.gen';
export * as Services from './services.gen';
export * as Types from './types.gen';
export * as ReactQuery from './@tanstack/react-query.gen';
The issue is if two or more modules export the same identifier. Say both TanStack Query and services would be exporting getFooOptions. You (well, Hey API) would then need to re-export every symbol one by one which would bloat the index file to potentially thousands of lines, EXCEPT for the conflicting one, which would need to be aliased.
I'm already not a fan of how conflicts are dealt with within files (appending digits) and this would be even more messy. Importing from a specific module is cleaner and removes a whole lot of complexity, that's why it's been done that way.
In fact, importing directly from index file is deprecated and will be removed altogether at some point https://heyapi.vercel.app/openapi-ts/migrating.html#deprecated-exports-from-index-ts
Description
Should this:
Be this?
I am doing this for now to be able to import the react-query artifacts from my
api
package:Ideally I can just export the client?
Thanks!
Reproducible example or configuration
No response
OpenAPI specification (optional)
No response
System information (optional)
No response