dtsgenerator icon indicating copy to clipboard operation
dtsgenerator copied to clipboard

Move this project and generate result to ESM

Open horiuchi opened this issue 4 years ago • 2 comments

There's one big problem.

  • We need to remove namespace from the generated results. In that case, how do we guarantee the uniqueness of the output type names?

via. https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-make-my-typescript-project-output-esm

horiuchi avatar Mar 01 '22 01:03 horiuchi

One easy option would be to prefix every type / interface name with the namespace name. So for example

namespace Responses {
   export type BadRequest = any;
}

becomes

export type ResponsesBadRequest = any;

That would not necessarly guarantee uniquenesss but should work for most setups.

tfohlmeister avatar Jul 11 '22 10:07 tfohlmeister

Thanks for the good ideas. 👍 The name will be much longer, but I think I can guarantee uniqueness.

horiuchi avatar Jul 12 '22 04:07 horiuchi