Last active
January 16, 2021 10:19
-
-
Save iksena/884b5dac7c8ac32078a4d3d5e6a1610c to your computer and use it in GitHub Desktop.
yo microservice install task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Generator = require('yeoman-generator'); | |
class MicroserviceGenerator extends Generator { | |
// ...other tasks | |
install() { | |
const devDependencies = [ | |
'@types/cors', | |
'@types/express', | |
'@types/jest', | |
'@typescript-eslint/eslint-plugin', | |
'@typescript-eslint/parser', | |
'eslint', | |
'eslint-config-airbnb-base', | |
'eslint-plugin-import', | |
'jest', | |
'ts-jest', | |
'ts-node', | |
'typescript', | |
]; | |
const dependencies = [ | |
'body-parser', | |
'cors', | |
'dotenv', | |
'express', | |
'joi', | |
]; | |
this.npmInstall(devDependencies, {'save-dev': true}); | |
this.npmInstall(dependencies); | |
} | |
end() { | |
this.log('Your microservice is ready!'); | |
} | |
} | |
module.exports = MicroserviceGenerator; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment