@@ -20,7 +20,7 @@ export default class TypescriptGenerator extends Generator {
2020 {
2121 type : 'input' ,
2222 name : 'name' ,
23- message : 'Your project name' ,
23+ message : 'Your package name' ,
2424 default : path . basename ( this . destinationRoot ( ) ) , // Default to current folder name
2525 } ,
2626 {
@@ -46,6 +46,7 @@ export default class TypescriptGenerator extends Generator {
4646 this . props = await this . prompt ( prompts ) ;
4747
4848 const prefix = this . props . org === 'mljs' ? 'ml-' : '' ;
49+ this . props . repoName = this . props . name . split ( '/' ) . at ( - 1 ) ;
4950 this . props . npmName = prefix + this . props . name ;
5051 }
5152
@@ -90,12 +91,12 @@ export default class TypescriptGenerator extends Generator {
9091 devDependencies,
9192 repository : {
9293 type : 'git' ,
93- url : `git+https://github.com/${ this . props . org } /${ this . props . name } .git` ,
94+ url : `git+https://github.com/${ this . props . org } /${ this . props . repoName } .git` ,
9495 } ,
9596 bugs : {
96- url : `https://github.com/${ this . props . org } /${ this . props . name } /issues` ,
97+ url : `https://github.com/${ this . props . org } /${ this . props . repoName } /issues` ,
9798 } ,
98- homepage : `https://github.com/${ this . props . org } /${ this . props . name } #readme` ,
99+ homepage : `https://github.com/${ this . props . org } /${ this . props . repoName } #readme` ,
99100 } ) ;
100101 }
101102
@@ -106,6 +107,7 @@ export default class TypescriptGenerator extends Generator {
106107 const year = date . getFullYear ( ) ;
107108 const camelName = camelCase ( this . props . name ) ;
108109 const includes = {
110+ repoName : this . props . repoName ,
109111 npmName : this . props . npmName ,
110112 name : this . props . name ,
111113 org : this . props . org ,
@@ -156,10 +158,9 @@ export default class TypescriptGenerator extends Generator {
156158 this . destinationPath ( '.github/workflows/release.yml' ) ,
157159 ) ;
158160 this . fs . copy ( this . templatePath ( 'npmrc' ) , this . destinationPath ( '.npmrc' ) ) ;
159- this . fs . copyTpl (
161+ this . fs . copy (
160162 this . templatePath ( 'gitignore' ) ,
161163 this . destinationPath ( '.gitignore' ) ,
162- includes ,
163164 ) ;
164165 this . fs . copyTpl (
165166 this . templatePath ( 'LICENSE' ) ,
@@ -171,10 +172,9 @@ export default class TypescriptGenerator extends Generator {
171172 this . destinationPath ( 'README.md' ) ,
172173 includes ,
173174 ) ;
174- this . fs . copyTpl (
175+ this . fs . copy (
175176 this . templatePath ( 'vitest.config.ts' ) ,
176177 this . destinationPath ( 'vitest.config.ts' ) ,
177- includes ,
178178 ) ;
179179 }
180180}
0 commit comments