@@ -17,6 +17,7 @@ interface CliOptions {
1717 input ? : string ;
1818 output ? : string ;
1919 clientName ? : string ;
20+ framework ? : 'angular' | 'react' | 'vue' ;
2021 dateType ? : 'string' | 'Date' ;
2122 enumStyle ? : 'enum' | 'union' ;
2223 admin ? : boolean ;
@@ -64,6 +65,7 @@ async function runGeneration(options: CliOptions) {
6465 }
6566
6667 const cliOptions : Partial < GeneratorConfigOptions > = { } ;
68+ if (options.framework) cliOptions.framework = options.framework;
6769 if (options.dateType) cliOptions.dateType = options.dateType;
6870 if (options.enumStyle) cliOptions.enumStyle = options.enumStyle;
6971 if (options.generateServices !== undefined) cliOptions.generateServices = options.generateServices;
@@ -72,6 +74,7 @@ async function runGeneration(options: CliOptions) {
7274 if (options.testsForAdmin !== undefined) cliOptions.generateAdminTests = options.testsForAdmin;
7375
7476 const defaults: GeneratorConfigOptions = {
77+ framework : 'angular' ,
7578 dateType : 'Date' ,
7679 enumStyle : 'enum' ,
7780 generateServices : true ,
@@ -138,22 +141,23 @@ async function runGeneration(options: CliOptions) {
138141const program = new Command ( ) ;
139142program
140143 . name ( 'cdd_web_ng' )
141- . description ( 'OpenAPI ↔ Angular (TypeScript, HTML ) code generator' )
144+ . description ( 'OpenAPI ↔ Client SDK (Angular, React, Vue ) code generator' )
142145 . version ( packageJson . version ) ;
143146
144147program
145148 . command ( 'from_openapi' )
146- . description ( 'Generate Angular services and admin UI from an OpenAPI specification' )
149+ . description ( 'Generate Client SDK services and admin UI from an OpenAPI specification' )
147150 . option ( '-c, --config <path>' , 'Path to a configuration file (e.g., cdd-web-ng.config.js)' )
148151 . option ( '-i, --input <path>' , 'Path or URL to the OpenAPI spec (overrides config)' )
149152 . option ( '-o, --output <path>' , 'Output directory for generated files (overrides config)' )
150153 . option ( '--clientName <name>' , 'Name for the generated client (used for DI tokens)' )
154+ . addOption ( new Option ( '--framework <framework>' , 'Target framework' ) . choices ( [ 'angular' , 'react' , 'vue' ] ) . default ( 'angular' ) )
151155 . addOption ( new Option ( '--dateType <type>' , 'Date type to use' ) . choices ( [ 'string' , 'Date' ] ) )
152156 . addOption ( new Option ( '--enumStyle <style>' , 'Style for enums' ) . choices ( [ 'enum' , 'union' ] ) )
153- . option ( '--admin' , 'Generate an Angular Material admin UI' )
154- . addOption ( new Option ( '--no-generate-services' , 'Disable generation of Angular services' ) )
155- . option ( '--no-tests-for-service' , 'Disable generation of tests for Angular services' )
156- . option ( '--no-tests-for-admin' , 'Disable generation of tests for the Angular admin UI' )
157+ . option ( '--admin' , 'Generate an admin UI (Angular only) ' )
158+ . addOption ( new Option ( '--no-generate-services' , 'Disable generation of services' ) )
159+ . option ( '--no-tests-for-service' , 'Disable generation of tests for services' )
160+ . option ( '--no-tests-for-admin' , 'Disable generation of tests for the admin UI' )
157161 . action ( runGeneration ) ;
158162
159163program
0 commit comments