<commit_before>/**
 * Build MJML template
 *
 * @author   <NAME> <<EMAIL>>
 * @version  0.1.0
 */

const gulp = require('gulp');
const tasker = require('gulp-tasker');
const conf = require('../base/conf');
const {handleError, handleSuccess} = require('../base/handlers');
const rename = require('gulp-rename');
const mjml = require('gulp-mjml');

const mjmlconvert = () => {
	return gulp
		.src(conf.path.mjml + '/**/*.mjml')
		.pipe(handleError('mjmlconvert', 'MJML generation faild'))
		.pipe(mjml())
		.pipe(rename(function (file) {
			file.extname += conf.mjml.extension.length > 0 ? conf.mjml.extension : '';
		}))
		.pipe(gulp.dest(function (file) {
			return file.base;
		}))
		.pipe(handleSuccess('mjmlconvert', 'MJML generation succeeded'));
}

const mjmlTask = gulp.series(mjmlconvert);

if ( conf.mjml.enabled ) {
	gulp.task('mjml', mjmlTask);

	tasker.addTask('default', mjmlTask);
	tasker.addTask('deploy', mjmlTask);
	tasker.addTask('watch', mjmlTask, conf.path.mjml + '/**/*.mjml');
}<commit_msg>Changed mjml file to new config type<commit_after>/**
 * Build MJML template
 *
 * @author   <NAME> <<EMAIL>>
 * @version  0.1.0
 */

const gulp = require('gulp');
const tasker = require('gulp-tasker');
const {handleError, handleSuccess} = require('../base/handlers');
const rename = require('gulp-rename');
const mjml = require('gulp-mjml');

const config = JSON.parse(fs.readFileSync('./package.json')).config;

const mjmlconvert = () => {
	return gulp
		.src(config.paths.source.mjml + '/**/*.mjml')
		.pipe(handleError('mjmlconvert', 'MJML generation faild'))
		.pipe(mjml())
		.pipe(rename(function (file) {
			file.extname += config.mjml.extension.length > 0 ? config.mjml.extension : '';
		}))
		.pipe(gulp.dest(function (file) {
			return file.base;
		}))
		.pipe(handleSuccess('mjmlconvert', 'MJML generation succeeded'));
}

const mjmlTask = gulp.series(mjmlconvert);

if ( config.mjml.enabled ) {
	gulp.task('mjml', mjmlTask);

	tasker.addTask('default', mjmlTask);
	tasker.addTask('deploy', mjmlTask);
	tasker.addTask('watch', mjmlTask, config.paths.source.mjml + '/**/*.mjml');
}
{'fraction_non_alphanumeric': 0.19781264859724204, 'fraction_numerical': 0.0038040893961008085, 'mean_word_length': 4.507853403141361, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '2440693', 'n_tokens_mistral': 831, 'n_tokens_neox': 776, 'n_words': 142}