<commit_before>
const Generator = require('yeoman-generator');
const chalk = require('chalk');
const yosay = require('yosay');
const fs = require('fs');
const path = require('path');


const templatesFolder = path.join(__dirname, 'templates');

module.exports = class extends Generator {
	prompting() {
		this.log(
			yosay(`Welcome to the unreal ${chalk.red('systemic')} generator!`),
		);

		const prompts = [{
			type: 'input',
			name: 'name',
			message: 'Your service name',
			default: this.appname.replace(/\s+/g, '-'),
		},
		{
			type: 'input',
			name: 'description',
			message: 'A brief description',
			default: '',
		},
		{
			type: 'input',
			name: 'author',
			message: 'The service author',
			default: 'author',
		},
		{
			type: 'input',
			name: 'email',
			message: 'The service author contact email',
			default: '<EMAIL>',
		}];

		return this.prompt(prompts).then(props => {
			this.props = props;
			this.props.components = ['app', 'config', 'logging', 'express', 'routes'];
		});
	}

	writing() {
		const copyFiles = (from, to) => {
			const configFiles = fs.readdirSync(path.join(templatesFolder, from));
			configFiles.forEach(file => {
				this.fs.copyTpl(this.templatePath(`./${from}/${file}`), this.destinationPath(`${to}/${file.replace(/^_/, '')}`), this.props);
			});
		};

		const copyAppFiles = () => {
			this.fs.copy(this.templatePath('./test/.eslintrc'), this.destinationPath('./test/.eslintrc'));
			this.fs.copy(this.templatePath('./test/*'), this.destinationPath('./test/'));
			this.props.components.forEach(component => {
				this.fs.copy(this.templatePath(`./lib/components/${component}/*`), this.destinationPath(`./components/${component}/`));
			});
		};

		copyFiles('docs', 'docs');
		copyFiles('config', 'config');
		copyFiles('root', '.');
		copyAppFiles();
	}

	install() {
		this.installDependencies({ npm: true, bower: false });
	}

	end() {
		const outputMsg = `\n\nYour service ${this.props.name} has been created.\nnpm run start - start your systemic service`;
		this.log(yosay(outputMsg));
	}
};<commit_msg>fix: modifies generator in order to proper generate new componentes<commit_after>
const Generator = require('yeoman-generator');
const chalk = require('chalk');
const yosay = require('yosay');
const fs = require('fs');
const path = require('path');


const templatesFolder = path.join(__dirname, 'templates');

module.exports = class extends Generator {
	prompting() {
		this.log(
			yosay(`Welcome to the unreal ${chalk.red('systemic')} generator!`),
		);

		const prompts = [{
			type: 'input',
			name: 'name',
			message: 'Your service name',
			default: this.appname.replace(/\s+/g, '-'),
		},
		{
			type: 'input',
			name: 'description',
			message: 'A brief description',
			default: '',
		},
		{
			type: 'input',
			name: 'author',
			message: 'The service author',
			default: 'author',
		},
		{
			type: 'input',
			name: 'email',
			message: 'The service author contact email',
			default: '<EMAIL>',
		}];

		return this.prompt(prompts).then(props => {
			this.props = props;
			this.props.components = ['app', 'config', 'logging', 'express', 'routes', 'store', 'bus', 'controller'];
		});
	}

	writing() {
		const copyFiles = (from, to) => {
			const configFiles = fs.readdirSync(path.join(templatesFolder, from));
			configFiles.forEach(file => {
				this.fs.copyTpl(this.templatePath(`./${from}/${file}`), this.destinationPath(`${to}/${file.replace(/^_/, '')}`), this.props);
			});
		};

		const copyAppFiles = () => {
			this.fs.copy(this.templatePath('./test/.eslintrc'), this.destinationPath('./test/.eslintrc'));
			this.fs.copy(this.templatePath('./test/*'), this.destinationPath('./test/'));
			this.fs.copy(this.templatePath('./test/helpers/*'), this.destinationPath('./test/helpers/'));
			this.props.components.forEach(component => {
				this.fs.copy(this.templatePath(`./lib/components/${component}/`), this.destinationPath(`./components/${component}/`));
			});
		};

		copyFiles('docs', 'docs');
		copyFiles('config', 'config');
		copyFiles('root', '.');
		copyAppFiles();
	}

	install() {
		this.installDependencies({ npm: true, bower: false });
	}

	end() {
		const outputMsg = `\n\nYour service ${this.props.name} has been created.\nnpm run start - start your systemic service`;
		this.log(yosay(outputMsg));
	}
};
{'fraction_non_alphanumeric': 0.2067686601761706, 'fraction_numerical': 0.0, 'mean_word_length': 3.9826789838337184, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4412493', 'n_tokens_mistral': 1599, 'n_tokens_neox': 1410, 'n_words': 284}