the-codegen-project / cli

Simplify your implementation in any language when using standards such as AsyncAPI
https://the-codegen-project.netlify.app/
Apache License 2.0
17 stars 0 forks source link

When running codegen generate it removes the config file and throws an error #80

Closed ALagoni97 closed 1 week ago

ALagoni97 commented 1 month ago

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: image

Steps to reproduce:

  1. Write pnpm codegen init
  2. Select ESM and everything else Yes
  3. Run pnpm codegen generate
  4. It removes the codegen file?
ALagoni97 commented 1 month ago

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.

jonaslagoni commented 1 week ago

Just tried it, cannot reproduce it, it generates the files and does nothing to the generation file.