generator-codedesignplus
Version:
Yeoman generator for creating microservices based on the CodeDesignPlus.Net.Microservice archetype.
39 lines (27 loc) • 934 B
JavaScript
import Generator from 'yeoman-generator';
import Core from './core/core.mjs';
import Utils from './core/utils.mjs';
import DotNet from './core/dotnet.mjs';
export default class extends Generator {
constructor(args, opts) {
super(args, opts);
this._utils = new Utils(this);
this._core = new Core(this._utils, this);
this._dotnet = new DotNet(this);
const [generator, answers] = this._core.arguments();
this._answers = answers;
this._generator = generator;
}
async prompting() {
}
async writing() {
if (!this.options.help) {
await this._utils.setPathBase();
const options = await this._utils.getOptions(this._answers);
await this._generator.generate(options);
if (this._generator.name === 'microservice'){
this._dotnet.removeProjects(options);
}
}
}
};