@@ -36,6 +36,10 @@ type TemplateVariations = {
3636  envNames ?: { 
3737    dbUri : string 
3838  } 
39+   /** 
40+    * @default  false 
41+    */ 
42+   skipReadme ?: boolean 
3943  configureConfig ?: boolean 
4044  generateLockfile ?: boolean 
4145} 
@@ -92,6 +96,7 @@ async function main() {
9296        // This will replace the process.env.DATABASE_URI to process.env.POSTGRES_URL 
9397        dbUri : 'POSTGRES_URL' , 
9498      } , 
99+       skipReadme : true , 
95100    } , 
96101    { 
97102      name : 'payload-postgres-template' , 
@@ -151,6 +156,7 @@ async function main() {
151156    envNames, 
152157    sharp, 
153158    configureConfig, 
159+     skipReadme =  false , 
154160  }  of  variations )  { 
155161    header ( `Generating ${ name }  ...` ) 
156162    const  destDir  =  path . join ( templatesDir ,  dirname ) 
@@ -160,6 +166,7 @@ async function main() {
160166      '.next' , 
161167      '.env$' , 
162168      'pnpm-lock.yaml' , 
169+       ...( skipReadme  ? [ 'README.md' ]  : [ '' ] ) , 
163170    ] ) 
164171
165172    log ( `Copied to ${ destDir }  ` ) 
@@ -183,15 +190,26 @@ async function main() {
183190      } ) 
184191    } 
185192
186-     await  generateReadme ( { 
187-       destDir, 
188-       data : { 
189-         name, 
190-         description : name ,  // TODO: Add descriptions 
191-         attributes : {  db,  storage } , 
192-         ...( vercelDeployButtonLink  &&  {  vercelDeployButtonLink } ) , 
193-       } , 
194-     } ) 
193+     if  ( ! skipReadme )  { 
194+       await  generateReadme ( { 
195+         destDir, 
196+         data : { 
197+           name, 
198+           description : name ,  // TODO: Add descriptions 
199+           attributes : {  db,  storage } , 
200+           ...( vercelDeployButtonLink  &&  {  vercelDeployButtonLink } ) , 
201+         } , 
202+       } ) 
203+     } 
204+ 
205+     if  ( generateLockfile )  { 
206+       log ( 'Generating pnpm-lock.yaml' ) 
207+       execSyncSafe ( `pnpm install --ignore-workspace` ,  {  cwd : destDir  } ) 
208+     }  else  { 
209+       log ( 'Installing dependencies without generating lockfile' ) 
210+       execSyncSafe ( `pnpm install --ignore-workspace` ,  {  cwd : destDir  } ) 
211+       await  fs . rm ( `${ destDir }  /pnpm-lock.yaml` ,  {  force : true  } ) 
212+     } 
195213
196214    // Copy in initial migration if db is postgres. This contains user and media. 
197215    if  ( db  ===  'postgres'  ||  db  ===  'vercel-postgres' )  { 
@@ -214,17 +232,13 @@ async function main() {
214232        cwd : destDir , 
215233        env : { 
216234          ...process . env , 
235+           PAYLOAD_SECRET : 'asecretsolongnotevensantacouldguessit' , 
217236          BLOB_READ_WRITE_TOKEN : 'vercel_blob_rw_TEST_asdf' , 
218237          DATABASE_URI : 'postgres://localhost:5432/payloadtests' , 
219238        } , 
220239      } ) 
221240    } 
222241
223-     if  ( generateLockfile )  { 
224-       log ( 'Generating pnpm-lock.yaml' ) 
225-       execSyncSafe ( `pnpm install --ignore-workspace` ,  {  cwd : destDir  } ) 
226-     } 
227- 
228242    // TODO: Email? 
229243
230244    // TODO: Sharp? 
@@ -302,7 +316,7 @@ function log(message: string) {
302316function  execSyncSafe ( command : string ,  options ?: Parameters < typeof  execSync > [ 1 ] )  { 
303317  try  { 
304318    console . log ( `Executing: ${ command }  ` ) 
305-     execSync ( command ,  options ) 
319+     execSync ( command ,  {   stdio :  'inherit' ,  ... options   } ) 
306320  }  catch  ( error )  { 
307321    if  ( error  instanceof  Error )  { 
308322      const  stderr  =  ( error  as  any ) . stderr ?. toString ( ) 
0 commit comments