cli
cli copied to clipboard
Generating with preset: 'client' is not working correctly
My config:
import { TheCodegenConfiguration } from '@the-codegen-project/cli'
const config: TheCodegenConfiguration = {
inputType: 'asyncapi',
inputPath: '../../definitions/asyncapi.json',
language: 'typescript',
generators: [
{
preset: 'client',
outputPath: 'src/__nats__/channels',
language: 'typescript',
protocols: ['nats'],
},
{
preset: 'payloads',
outputPath: 'src/__nats__/payloads',
serializationType: 'json',
language: 'typescript',
enum: 'enum',
map: 'record',
useForJavaScript: true,
rawPropertyNames: false,
},
{
preset: 'parameters',
language: 'typescript',
outputPath: 'src/__nats__/parameters',
serializationType: 'json',
},
],
}
export default config
Is generating the following error:
It seems like the dependencies is getting a default array of 1 item: channels-typescript which the code might then expect to be present all the time. In my case I don't have any dependencies.
Update on this. I figured out it was because it adds the channels-typescript as a dependency but doesn't generate a default channels generator. That's the core issue here. Fixed it with this:
{
preset: 'channels',
outputPath: './src/__nats__/channels',
language: 'typescript',
protocols: ['nats'],
},
Should not be necessary, fixing