@@ -58,7 +58,7 @@ const commandHandler = {
5858 } ,
5959}
6060
61- const getTemplateFile = ( templateName ) => {
61+ const getTemplateDirectory = ( templateName ) => {
6262 return templateName === 'react-router'
6363 ? templates . templateWithReactRouter
6464 : templates . templateWithList
@@ -156,7 +156,7 @@ const command = {
156156 }
157157
158158 reporter . info ( 'Copying template files' )
159- const templateFiles = getTemplateFile ( selectedOptions . templateName )
159+ const templateFiles = getTemplateDirectory ( selectedOptions . templateName )
160160 fs . copySync ( templateFiles , cwd )
161161
162162 const paths = {
@@ -166,6 +166,7 @@ const command = {
166166 pnpmLock : path . join ( cwd , 'pnpm-lock.yaml' ) ,
167167 pnpmWorkspace : path . join ( cwd , 'pnpm-workspace.yaml' ) ,
168168 appRootFile : path . join ( cwd , 'src/App.tsx' ) ,
169+ appRootWrapperFile : path . join ( cwd , 'src/AppWrapper.tsx' ) ,
169170 initYarnLock : path . join ( __dirname , '../templates/yarn.lock' ) ,
170171 initNpmLock : path . join ( __dirname , '../templates/package-lock.json' ) ,
171172 }
@@ -179,6 +180,12 @@ const command = {
179180 // Default template is with PNPM with TypeScript - some modifications here for yarn/npm/JS
180181 const templateModifications = [
181182 [ paths . package , true , ( f ) => f . replace ( '{{template-name}}' , name ) ] ,
183+ [
184+ paths . appRootWrapperFile ,
185+ true ,
186+ ( f ) => f . replace ( '{{template-name}}' , name ) ,
187+ ] ,
188+
182189 // [
183190 // path.join(paths.base, '.husky/pre-commit'),
184191 // !pnpm,
@@ -249,14 +256,14 @@ const command = {
249256 // convert to JS
250257 if ( ! typeScript ) {
251258 reporter . info ( 'Preparing JavaScript template' )
252- reporter . info ( ` running '${ pkgManager } install'` )
259+ reporter . info ( ` Running '${ pkgManager } install'` )
253260
254261 await exec ( {
255262 cmd : pkgManager ,
256263 args : [ 'install' ] ,
257264 cwd : paths . base ,
258265 } )
259- reporter . info ( ' convert template to JS with tsc' )
266+ reporter . info ( ' Converting template to JS with tsc' )
260267 await exec ( {
261268 cmd : 'npx' ,
262269 args : [
@@ -274,7 +281,7 @@ const command = {
274281 pipe : argv . debug ,
275282 } )
276283
277- reporter . info ( ' Deleting TS files')
284+ reporter . debug ( ' Deleting TS files')
278285 const filePathsToRemove = path . join ( paths . base , '/src/**/*.ts[x]' )
279286 const filesToRemove = await fg . glob ( filePathsToRemove )
280287
0 commit comments