11import { Command } from "@contentstack/cli-command" ;
2- import { flags , FlagInput } from "@contentstack/cli-utilities" ;
2+ import { flags , FlagInput , log } from "@contentstack/cli-utilities" ;
33import * as path from "path" ;
44import * as fs from "fs" ;
55import { cliux } from "@contentstack/cli-utilities" ;
@@ -170,6 +170,7 @@ export default class TypeScriptCodeGeneratorCommand extends Command {
170170 token : config . token ,
171171 environment : config . environment ,
172172 namespace : namespace ,
173+ logger : log ,
173174 } ;
174175
175176 // Add region or host based on whether it's a custom region
@@ -207,6 +208,7 @@ export default class TypeScriptCodeGeneratorCommand extends Command {
207208 systemFields : includeSystemFields ,
208209 isEditableTags : includeEditableTags ,
209210 includeReferencedEntry,
211+ logger : log ,
210212 } ) ;
211213
212214 fs . writeFileSync ( outputPath , result || "" ) ;
@@ -219,24 +221,16 @@ export default class TypeScriptCodeGeneratorCommand extends Command {
219221 "Generation completed successfully with partial schema" ,
220222 )
221223 ) {
222- cliux . print ( "" , { } ) ;
223- cliux . print (
224- "Type generation completed successfully with partial schema!" ,
225- { color : "green" , bold : true } ,
224+ cliux . print ( "" ) ;
225+ log . success ( "Type generation completed successfully with partial schema!" ) ;
226+ log . warn (
227+ "Some content types were skipped due to validation issues, but types were generated for valid content types."
226228 ) ;
227- cliux . print (
228- "Some content types were skipped due to validation issues, but types were generated for valid content types." ,
229- { color : "yellow" } ,
230- ) ;
231- cliux . print (
232- "Check the output above for details on what was skipped and suggestions for fixing issues." ,
233- { color : "cyan" } ,
229+ log . info (
230+ "Check the output above for details on what was skipped and suggestions for fixing issues."
234231 ) ;
235232 } else {
236- cliux . print (
237- `Successfully added the Content Types to '${ outputPath } '.` ,
238- { color : "green" } ,
239- ) ;
233+ log . success ( `Successfully added the Content Types to '${ outputPath } '.` ) ;
240234 }
241235
242236 // this.log(`Wrote ${outputPath} Content Types to '${result.outputPath}'.`)
0 commit comments