diff --git a/generators/app/index.js b/generators/app/index.js index abc22a5..7b5d023 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -60,7 +60,7 @@ module.exports = yeoman.generators.Base.extend({ when: () => folder !== this.packageName }, (props) => { console.log('quit', props.quit); - if (props.quit) { + if (props.quit === 'Y') { this.log(''); this.log(`Please create your repo and run ${chalk.green('yo typings') } again.`); process.exit(1); @@ -128,6 +128,10 @@ module.exports = yeoman.generators.Base.extend({ writing: { copyFiles() { + this.fs.copy( + this.templatePath('.vscode/*'), + this.destinationPath('.vscode') + ); this.fs.copy( this.templatePath('test/*'), this.destinationPath('test') diff --git a/generators/app/templates/.vscode/settings.json b/generators/app/templates/.vscode/settings.json new file mode 100644 index 0000000..25fa621 --- /dev/null +++ b/generators/app/templates/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib" +} diff --git a/test/app.js b/test/app.js index 32197d2..5888e93 100644 --- a/test/app.js +++ b/test/app.js @@ -9,6 +9,7 @@ describe('generator-typings:app', function () { helpers.run(path.join(__dirname, '../generators/app')) .withPrompts({ sourceUri: 'facebook/reactDOM', + quit: 'n', packageName: 'typed-reactDOM', username: 'unional' }) @@ -17,6 +18,7 @@ describe('generator-typings:app', function () { it('creates files', function () { assert.file([ + '.vscode/settings.json', 'test/test.ts', 'test/tsconfig.json', '.editorconfig',