File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
packages/create-vitnode-app/src Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -125,10 +125,20 @@ export const createVitNode = async ({
125125 }
126126 }
127127
128- if ( mode === "apiMonorepo" || monorepo ) {
128+ if ( mode === "apiMonorepo" || ( monorepo && mode !== "singleApp" ) ) {
129129 await cp ( join ( templatePath , "monorepo" ) , root , {
130130 recursive : true ,
131131 } ) ;
132+ } else if ( monorepo && mode === "singleApp" ) {
133+ // Copy only the necessary monorepo files, excluding the api folder
134+ await copyFile (
135+ join ( templatePath , "monorepo" , "turbo.json" ) ,
136+ join ( root , "turbo.json" ) ,
137+ ) ;
138+ await copyFile (
139+ join ( templatePath , "monorepo" , ".gitignore_template" ) ,
140+ join ( root , ".gitignore_template" ) ,
141+ ) ;
132142 }
133143
134144 if ( eslint ) {
Original file line number Diff line number Diff line change 11import { program } from "commander" ;
2- import { existsSync , readFileSync } from "node:fs" ;
2+ import { existsSync } from "node:fs" ;
3+ import { mkdir , readFile } from "node:fs/promises" ;
34import { basename , join , resolve } from "node:path" ;
45import color from "picocolors" ;
56
@@ -54,7 +55,7 @@ export const validationProjectForPlugin = async (projectPath: string) => {
5455
5556 try {
5657 const packageJson : PackageJSON = JSON . parse (
57- readFileSync ( packageJsonPath , "utf-8" ) ,
58+ await readFile ( packageJsonPath , "utf-8" ) ,
5859 ) ;
5960
6061 if ( ! packageJson . packageManager ) {
@@ -107,6 +108,11 @@ export const validationProjectForPlugin = async (projectPath: string) => {
107108 process . exit ( 1 ) ;
108109 }
109110
111+ // Check that plugins directory exists
112+ if ( ! existsSync ( pluginsDir ) ) {
113+ await mkdir ( pluginsDir , { recursive : true } ) ;
114+ }
115+
110116 // Verify the plugins dir is writeable
111117 if ( ! ( await isWriteable ( pluginsDir ) ) ) {
112118 console . error (
You can’t perform that action at this time.
0 commit comments