cli
cli copied to clipboard
When running codegen generate it removes the config file and throws an error
My file:
/** @type {import("@the-codegen-project/cli").TheCodegenConfiguration} **/
export default {
inputType: 'asyncapi',
inputPath: '../../../definitions/services/bundled/blackbox-api.asyncapi.json',
language: 'typescript',
generators: [
{
preset: 'channels',
outputPath: 'src/__gen__/channels',
protocols: ['nats'],
},
{
preset: 'payloads',
outputPath: 'src/__gen__/payloads',
serializationType: 'json',
model: 'class',
enum: 'enum',
map: 'record',
moduleSystem: 'esm',
useForJavaScript: true,
rawPropertyNames: false,
},
{
preset: 'parameters',
outputPath: 'src/__gen__/parameters',
serializationType: 'json',
},
],
}
Running command:
pnpm codegen generate
Produces:
Steps to reproduce:
- Write pnpm codegen init
- Select ESM and everything else Yes
- Run pnpm codegen generate
- It removes the codegen file?
Seems like this issue is only with .mjs file? As the codegen.json is working, but have other issues tho. But not related to this issue i think.
Just tried it, cannot reproduce it, it generates the files and does nothing to the generation file.