cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open ALagoni97 opened this issue 2 years ago • 2 comments

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 avatar Sep 24 '24 14:09 ALagoni97

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.

ALagoni97 avatar Sep 24 '24 14:09 ALagoni97

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

jonaslagoni avatar Oct 30 '24 10:10 jonaslagoni