-
Notifications
You must be signed in to change notification settings - Fork 65
feat: esm support on Odata #6061
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
base: main
Are you sure you want to change the base?
Conversation
…25-esm-support-oData
test-packages/test-services-odata-v2/generate-odata-services.ts
Outdated
Show resolved
Hide resolved
packages/generator/src/generator-without-ts-morph/request-builder/imports.ts
Outdated
Show resolved
Hide resolved
packages/generator/src/generator-without-ts-morph/request-builder/imports.spec.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Deeksha Sinha <[email protected]>
packages/generator/src/generator-without-ts-morph/request-builder/file.ts
Outdated
Show resolved
Hide resolved
packages/generator/src/generator-without-ts-morph/request-builder/imports.ts
Outdated
Show resolved
Hide resolved
deekshas8
left a comment
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.
It's almost there, just some code cleanup and restructuring needed, Please consider ALL comments and lets discuss if you have questions.
…oud-sdk-js into I753325-esm-support-oData
…oud-sdk-js into I753325-esm-support-oData
| /** | ||
| * @internal | ||
| */ | ||
| export type ModuleType = 'commonjs' | 'esm'; |
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.
A barel file is only for exporting. You shouldn't define types here. Please move it to a more appropriate file.
| */ | ||
| export type ModuleType = 'commonjs' | 'esm'; | ||
|
|
||
| export { getCommonCliOptions } from './options'; |
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.
| export { getCommonCliOptions } from './options'; | |
| export * from './options'; |
The internal barel file exports everything. index.ts determines the public api and hence only exports public facing types, functions, etc.
The generateESM flag, used in both generator and openapi generator packages controls if the generated client code follows the ECMACScript Module (ESM) syntax or the default, CommonJS one.
when generateESM: true is set, the generator produces code which folllows the ESM syntax.