<commit_before>#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const mkdirp = require('mkdirp');
const lib = require('../src');

const buff = Object.keys(lib.svgs)
	.map(key => {
		const svg = `${lib.svgs[key]}`.replace(/class/g, 'className').replace(/fill-rule/g, 'fillRule');
		return `icons['talend-${key}'] = (${svg});`;
	})
	.concat(
		Object.keys(lib.filters).map(key => {
			const svg = `${lib.filters[key]}`.replace(
				/color-interpolation-filters/g,
				'colorInterpolationFilters',
			);
			return `filters['${key}'] = (${svg});`;
		}),
	);

buff.unshift('');
buff.unshift('const icons = {};');
buff.unshift('const filters = {};');
buff.unshift("import React from 'react';");
buff.push('');
buff.push('export default icons;');
buff.push('export { filters };');

const dist = path.join(__dirname, '../dist/');
mkdirp.sync(dist);
const options = require('../../../babel.config')();
options.filename = 'react.js';
const code = require('@babel/core').transformSync(buff.join('\n'), options);
fs.writeFileSync(path.join(dist, 'react.js'), code.code);

const styleSrc = path.join(__dirname, '../src/talendicons.css');
const styleDist = path.join(__dirname, '../dist/talendicons.css');
fs.createReadStream(styleSrc).pipe(fs.createWriteStream(styleDist));
<commit_msg>fix(Icons): transform stop-color to stopColor for react (#2148)<commit_after>#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const mkdirp = require('mkdirp');
const lib = require('../src');

const buff = Object.keys(lib.svgs)
	.map(key => {
		const svg = `${lib.svgs[key]}`
			.replace(/class/g, 'className')
			.replace(/fill-rule/g, 'fillRule')
			.replace(/stop-color/g, 'stopColor');
		return `icons['talend-${key}'] = (${svg});`;
	})
	.concat(
		Object.keys(lib.filters).map(key => {
			const svg = `${lib.filters[key]}`.replace(
				/color-interpolation-filters/g,
				'colorInterpolationFilters',
			);
			return `filters['${key}'] = (${svg});`;
		}),
	);

buff.unshift('');
buff.unshift('const icons = {};');
buff.unshift('const filters = {};');
buff.unshift("import React from 'react';");
buff.push('');
buff.push('export default icons;');
buff.push('export { filters };');

const dist = path.join(__dirname, '../dist/');
mkdirp.sync(dist);
const options = require('../../../babel.config')();
options.filename = 'react.js';
const code = require('@babel/core').transformSync(buff.join('\n'), options);
fs.writeFileSync(path.join(dist, 'react.js'), code.code);

const styleSrc = path.join(__dirname, '../src/talendicons.css');
const styleDist = path.join(__dirname, '../dist/talendicons.css');
fs.createReadStream(styleSrc).pipe(fs.createWriteStream(styleDist));

{'fraction_non_alphanumeric': 0.2357301704966642, 'fraction_numerical': 0.0014825796886582653, 'mean_word_length': 4.918859649122807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '644814', 'n_tokens_mistral': 968, 'n_tokens_neox': 923, 'n_words': 165}