@@ -5,16 +5,22 @@ import { execa } from 'execa';
55import inquirer from 'inquirer' ;
66import fs from 'fs-extra' ;
77import path from 'path' ;
8- import templates from './templates.js' ;
8+ import { defaultTemplates } from './templates.js' ;
99import { mergeTemplates } from './template-loader.js' ;
1010
11+ /** Project data provided by the user */
1112type ProjectData = {
12- name : string ,
13+ /** Project name */
14+ name : string ,
15+ /** Project version */
1316 version : string ,
17+ /** Project description */
1418 description : string ,
19+ /** Project author */
1520 author : string
1621}
1722
23+ /** Command to create a new project */
1824program
1925 . version ( '1.0.0' )
2026 . command ( 'create' )
@@ -23,7 +29,7 @@ program
2329 . argument ( '[template-name]' , 'The name of the template to use' )
2430 . option ( '-t, --template-file <path>' , 'Path to a JSON file with custom templates (same format as built-in)' )
2531 . action ( async ( projectDirectory , templateName , options ) => {
26- const templatesToUse = mergeTemplates ( templates , options ?. templateFile ) ;
32+ const templatesToUse = mergeTemplates ( defaultTemplates , options ?. templateFile ) ;
2733
2834 // If template name is not provided, show available templates and let user select
2935 if ( ! templateName ) {
@@ -161,13 +167,14 @@ program
161167 }
162168 } ) ;
163169
170+ /** Command to list all available templates */
164171program
165172 . command ( 'list' )
166173 . description ( 'List all available templates' )
167174 . option ( '--verbose' , 'List all available templates with verbose information' )
168175 . option ( '-t, --template-file <path>' , 'Include templates from a JSON file (same format as built-in)' )
169176 . action ( ( options ) => {
170- const templatesToUse = mergeTemplates ( templates , options ?. templateFile ) ;
177+ const templatesToUse = mergeTemplates ( defaultTemplates , options ?. templateFile ) ;
171178 console . log ( '\n📋 Available templates:\n' ) ;
172179 templatesToUse . forEach ( template => {
173180 console . log ( ` ${ template . name . padEnd ( 20 ) } - ${ template . description } ` )
@@ -181,6 +188,7 @@ program
181188 console . log ( '' ) ;
182189 } ) ;
183190
191+ /** Command to run PatternFly codemods on a directory */
184192program
185193 . command ( 'update' )
186194 . description ( 'Run PatternFly codemods on a directory to transform code to the latest PatternFly patterns' )
0 commit comments