@@ -18,7 +18,7 @@ import {
1818} from 'src/build-system/utils/database-utils' ;
1919
2020// The function from step #1
21- import { generateFrontEndCodePrompt } from './prompt' ;
21+ import { generateFrontEndCodePrompt , generateCSSPrompt } from './prompt' ;
2222
2323/**
2424 * FrontendCodeHandler is responsible for generating the frontend codebase
@@ -61,6 +61,8 @@ export class FrontendCodeHandler implements BuildHandler<string> {
6161 path . resolve ( frontendPath , 'src' , file ) ,
6262 ) ;
6363
64+ const extension = currentFullFilePath . split ( '.' ) . pop ( ) || '' ;
65+
6466 // Retrieve the direct dependencies for this file
6567 const directDepsArray = fileInfos [ file ] ?. dependsOn || [ ] ;
6668
@@ -96,15 +98,30 @@ export class FrontendCodeHandler implements BuildHandler<string> {
9698 `2 Generating file in dependency order directDependencies: ${ directDependencies } ` ,
9799 ) ;
98100
99- // Generate the prompt
100- const frontendCodePrompt = generateFrontEndCodePrompt (
101- sitemapDoc ,
102- uxDataMapDoc ,
103- backendRequirementDoc . overview ,
104- currentFullFilePath ,
105- directDependencies ,
106- dependenciesContext ,
101+ let frontendCodePrompt = '' ;
102+
103+ if ( extension === 'css' ) {
104+ frontendCodePrompt = generateCSSPrompt (
105+ file ,
106+ directDependencies ,
107+ dependenciesContext ,
108+ ) ;
109+ } else {
110+ // Generate the prompt
111+ frontendCodePrompt = generateFrontEndCodePrompt (
112+ sitemapDoc ,
113+ uxDataMapDoc ,
114+ backendRequirementDoc . overview ,
115+ file ,
116+ directDependencies ,
117+ dependenciesContext ,
118+ ) ;
119+ }
120+ this . logger . log (
121+ 'generate code prompt for frontendCodePrompt or css: ' +
122+ frontendCodePrompt ,
107123 ) ;
124+
108125 this . logger . debug ( 'Generated frontend code prompt.' ) ;
109126
110127 let generatedCode = '' ;
0 commit comments