<commit_before>/*
*	The purpose of the is file is to do the following:
*		- create, update manifest.json file which specifies the dependencies for the terminal component
*		- create, update directory for the bootstrap file
*/

var fs = require('fs');
var mkdirp = require('mkdirp');

var defaults = {
	bundleName : 'bundle.js',
	appendTo : 'body',
	css: 'styles.css'
};
var manifest;

function StageDependancies(config) {
	this.config = config;
}

// creates, updates manifest.json file
function modifyManifest(config) {
	if (typeof config.manifestFile == 'undefined') {
			console.log('Error Missing Manifest: manifest file needs to be defined in webpack config!');
			return;
		}

		try {
			manifest = require(config.manifestFile);
		}catch(e) {
			manifest = {};
		}

		if (config.default) {
			manifest['terminalv2'] = {
				'basePath': require('../package.json').name + '/',
				'bundle': 'default', 
				'appendTo': config.appendTo
			};
		}
		else {
			manifest['terminalv2'] = {
				'basePath': require('../package.json').name + '/',
				'bundle': config.bundleName, 
				'appendTo': config.appendTo
			};
		}

		var data = JSON.stringify(manifest);
		fs.writeFile(config.manifestFile, data, (err) => {
		  if (err) throw err;
		});
}

StageDependancies.prototype.apply = function(compiler) {
	var config = this.config;

	config.basePath = config.basePath || defaults.basePath;
	config.bundleName = config.bundleName || defaults.bundleName; 
	config.css = config.css || defaults.css; 
	config.appendTo = config.appendTo || defaults.appendTo; 

	compiler.plugin('done', function() {
		var dest = '../../htdocs/public/js';

		modifyManifest(config);
		
		mkdirp(dest, function(){});
		fs.createReadStream('./shared/bootstrap-components.js').pipe(fs.createWriteStream([dest,'/bootstrap-components.js'].join('')));
	});
}

module.exports = StageDependancies;<commit_msg>fixed copy issue of bootstrap from react env to production<commit_after>/*
*	The purpose of the is file is to do the following:
*		- create, update manifest.json file which specifies the dependencies for the terminal component
*		- create, update directory for the bootstrap file
*/

var fs = require('fs');
var mkdirp = require('mkdirp');

var defaults = {
	bundleName : 'bundle.js',
	appendTo : 'body',
	css: 'styles.css'
};
var manifest;

function StageDependancies(config) {
	this.config = config;
}

// creates, updates manifest.json file
function modifyManifest(config) {
	if (typeof config.manifestFile == 'undefined') {
			console.log('Error Missing Manifest: manifest file needs to be defined in webpack config!');
			return;
		}

		try {
			manifest = require(config.manifestFile);
		}catch(e) {
			manifest = {};
		}

		if (config.default) {
			manifest['terminalv2'] = {
				'basePath': require('../package.json').name + '/',
				'bundle': 'default', 
				'appendTo': config.appendTo
			};
		}
		else {
			manifest['terminalv2'] = {
				'basePath': require('../package.json').name + '/',
				'bundle': config.bundleName, 
				'appendTo': config.appendTo
			};
		}

		var data = JSON.stringify(manifest);
		fs.writeFile(config.manifestFile, data, (err) => {
		  if (err) throw err;
		});
}

StageDependancies.prototype.apply = function(compiler) {
	var config = this.config;

	config.basePath = config.basePath || defaults.basePath;
	config.bundleName = config.bundleName || defaults.bundleName; 
	config.css = config.css || defaults.css; 
	config.appendTo = config.appendTo || defaults.appendTo; 

	compiler.plugin('done', function() {
		var dest = '../htdocs/public/js';

		modifyManifest(config);
		
		mkdirp(dest, function(){});
		fs.createReadStream('./shared/bootstrap-components.js').pipe(fs.createWriteStream([dest,'/bootstrap-components.js'].join('')));
	});
}

module.exports = StageDependancies;
{'fraction_non_alphanumeric': 0.1553270042194093, 'fraction_numerical': 0.0010548523206751054, 'mean_word_length': 3.932379713914174, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5705722', 'n_tokens_mistral': 1321, 'n_tokens_neox': 1167, 'n_words': 276}