@@ -144,24 +144,27 @@ export const createVitNode = async ({
144144
145145 if ( eslint ) {
146146 spinner . text = "Copying ESLint & Prettier files..." ;
147- if ( mode === "onlyApi" ) {
148- await cp ( join ( templatePath , "eslint" ) , root , {
149- recursive : true ,
150- } ) ;
151- } else if ( mode === "singleApp" ) {
152- const target = monorepo ? monorepoStructure . web : root ;
153- await cp ( join ( templatePath , "eslint-react" ) , target , {
154- recursive : true ,
155- } ) ;
156- } else if ( mode === "apiMonorepo" ) {
157- await Promise . all ( [
158- cp ( join ( templatePath , "eslint" ) , monorepoStructure . api , {
147+ if ( monorepo ) {
148+ if ( existsSync ( monorepoStructure . api ) ) {
149+ await cp ( join ( templatePath , "eslint" ) , monorepoStructure . api , {
159150 recursive : true ,
160- } ) ,
161- cp ( join ( templatePath , "eslint-react" ) , monorepoStructure . web , {
151+ } ) ;
152+ }
153+ if ( existsSync ( monorepoStructure . web ) ) {
154+ await cp ( join ( templatePath , "eslint-react" ) , monorepoStructure . web , {
155+ recursive : true ,
156+ } ) ;
157+ }
158+ } else {
159+ if ( mode === "onlyApi" ) {
160+ await cp ( join ( templatePath , "eslint" ) , root , {
162161 recursive : true ,
163- } ) ,
164- ] ) ;
162+ } ) ;
163+ } else if ( mode === "singleApp" ) {
164+ await cp ( join ( templatePath , "eslint-react" ) , root , {
165+ recursive : true ,
166+ } ) ;
167+ }
165168 }
166169 }
167170
@@ -274,6 +277,25 @@ export const createVitNode = async ({
274277 } ) ;
275278 }
276279
280+ spinner . text = "Preparing README..." ;
281+ // Copy README.md
282+ await copyFile ( join ( templatePath , "README.md" ) , join ( root , "README.md" ) ) ;
283+ // Update README.md with package manager
284+ let readmeContent = await readFile ( join ( root , "README.md" ) , "utf-8" ) ;
285+ readmeContent = readmeContent . replaceAll ( "pnpm" , packageManager ) ;
286+
287+ // Update README.md with start URLs
288+ let startUrlsText = "[http://localhost:3000](http://localhost:3000)" ;
289+ if ( mode === "onlyApi" ) {
290+ startUrlsText = "[http://localhost:8080](http://localhost:8080)" ;
291+ } else if ( mode === "apiMonorepo" ) {
292+ startUrlsText =
293+ "[http://localhost:3000](http://localhost:3000) for the Web app and [http://localhost:8080](http://localhost:8080) for the API" ;
294+ }
295+
296+ readmeContent = readmeContent . replace ( "{{START_URLS}}" , startUrlsText ) ;
297+ await writeFile ( join ( root , "README.md" ) , readmeContent ) ;
298+
277299 spinner . text = "Generating migrations..." ;
278300 let migrationsCwd : string ;
279301 if ( mode === "apiMonorepo" || ( monorepo && mode !== "singleApp" ) ) {
0 commit comments