Skip to content

Conversation

@BrigittaK307
Copy link

@BrigittaK307 BrigittaK307 commented Sep 17, 2025

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.

Co-authored-by: Deeksha Sinha <[email protected]>
Copy link
Contributor

@deekshas8 deekshas8 left a 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.

/**
* @internal
*/
export type ModuleType = 'commonjs' | 'esm';
Copy link
Contributor

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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants