Skip to content

Commit

Permalink
fix: ensure /lib is always gitignored for ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 28, 2018
1 parent 438667b commit 07c7e38
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/generators/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class App extends Generator {
type: 'single' | 'multi' | 'plugin' | 'base'
path: string
pjson: any
tsconfig: any
fromScratch: boolean
githubUser: string | undefined
answers: {
Expand Down Expand Up @@ -253,7 +252,6 @@ class App extends Generator {

if (this.ts) {
this.fs.copyTpl(this.templatePath('tslint.json'), this.destinationPath('tslint.json'), this)
this.tsconfig = this.fs.readJSON(this.destinationPath('tsconfig.json'), {compilerOptions: {outDir: './lib'}})
this.fs.copyTpl(this.templatePath('tsconfig.json'), this.destinationPath('tsconfig.json'), this)
if (this.mocha) {
this.fs.copyTpl(this.templatePath('test/tsconfig.json'), this.destinationPath('test/tsconfig.json'), this)
Expand Down Expand Up @@ -367,11 +365,6 @@ class App extends Generator {
})
}

private get _tsOutDir(): string | undefined {
if (!this.ts || !this.tsconfig || !this.tsconfig.compilerOptions || !this.tsconfig.compilerOptions.outDir) return
return this.tsconfig.compilerOptions.outDir.replace(/^\./, '')
}

private _gitignore(): string {
const existing = this.fs.exists(this.destinationPath('.gitignore')) ? this.fs.read(this.destinationPath('.gitignore')).split('\n') : []
return _([
Expand All @@ -381,7 +374,7 @@ class App extends Generator {
'/coverage',
'/node_modules',
'/tmp',
this._tsOutDir,
this.ts && '/lib',
this.mocha && '/.nyc_output',
])
.concat(existing)
Expand All @@ -394,7 +387,7 @@ class App extends Generator {
private _eslintignore(): string {
const existing = this.fs.exists(this.destinationPath('.eslintignore')) ? this.fs.read(this.destinationPath('.eslintignore')).split('\n') : []
return _([
this._tsOutDir,
this.ts && '/lib',
])
.concat(existing)
.compact()
Expand Down

0 comments on commit 07c7e38

Please sign in to comment.