@@ -8,12 +8,16 @@ const rootDir = __dirname;
88module . exports = {
99 prompts : require ( "./prompts" ) ,
1010 templateData ( ) {
11+ const tsconfig = {
12+ includes : [ '\t\t"./src"' ]
13+ } ;
1114 const scripts = [
12- '\t\t"build": "rm -rf ./dist /** && tsc"' ,
15+ '\t\t"build": "rm -rf ./lib /** && tsc"' ,
1316 '\t\t"watch": "tsc -- --watch"'
1417 ] ;
1518 if ( this . answers . tests ) {
16- scripts . push ( '\t\t"test": "jest && npm run build"' ) ;
19+ tsconfig . includes . push ( '\t\t"./__tests__"' ) ;
20+ scripts . push ( '\t\t"test": "jest"' ) ;
1721 } else {
1822 scripts . push (
1923 '\t\t"test": "echo \\"Warn: No test specified\\" && exit 0"'
@@ -86,6 +90,9 @@ module.exports = {
8690 const pmRun = this . answers . pm === "yarn" ? "yarn" : "npm run" ;
8791
8892 return {
93+ tsconfig : {
94+ includes : tsconfig . includes . join ( ",\n" )
95+ } ,
8996 scripts : scripts . join ( ",\n" ) ,
9097 devDependencies : devDependencies . join ( ",\n" ) ,
9198 peerDependencies : peerDependencies . join ( ",\n" ) ,
@@ -114,26 +121,24 @@ module.exports = {
114121 "__tests__/**" : "tests" ,
115122 jest_config_js : "tests" ,
116123 travis_yml : "semanticrelease" ,
117- releaserc : "semanticrelease" ,
118- _yarn_lock : 'pm=="yarn"' ,
119- _package_lock_json : 'pm=="npm"'
124+ releaserc : "semanticrelease"
120125 }
121126 }
122127 ] ;
123128
124129 actions . push ( {
125130 type : "move" ,
126131 patterns : {
132+ "src/index_tsx" : "src/index.tsx" ,
133+ "__tests__/index_spec_tsx" : "__tests__/index.spec.tsx" ,
127134 gitignore : ".gitignore" ,
128135 babelrc : ".babelrc" ,
129136 travis_yml : ".travis.yml" ,
130137 jest_config_js : "jest.config.js" ,
131138 releaserc : ".releaserc" ,
132139 _package_json : "package.json" ,
133140 _tsconfig_json : "tsconfig.json" ,
134- _tslint_json : "tslint.json" ,
135- _yarn_lock : "yarn.lock" ,
136- _package_lock_json : "package-lock.json"
141+ _tslint_json : "tslint.json"
137142 }
138143 } ) ;
139144
0 commit comments