Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
separator: '\n'
});
console.log('Created ' + JSONEDITOR_CSS);
// minify the css file
write(JSONEDITOR_CSS_MIN, new CleanCSS().minify(String(read(JSONEDITOR_CSS))));
// create a folder img and copy the icons
jake.mkdirP('./img');
jake.cpR(jsoneditorSrc + 'css/img/jsoneditor-icons.png', './img/');
console.log('Copied jsoneditor-icons.png to ./img/');
// copy assets
// concatenate and copy ace files
var aceSrc = './node_modules/ace/build/src-min/';
jake.mkdirP(BUILD_ACE);
concat({
src: [
aceSrc + 'ace.js',
aceSrc + 'ext-searchbox.js',
aceSrc + 'mode-json.js',
aceSrc + 'theme-textmate.js',
jsoneditorSrc + 'js/ace/theme-jsoneditor.js'
],
dest: BUILD_ACE + 'ace.js',
separator: '\n'
});
jake.cpR(aceSrc + 'worker-json.js', BUILD_ACE);
// copy and minify json lint file
jake.mkdirP(BUILD_JSONLINT);
minify({
src: [
jsoneditorSrc + 'css/jsoneditor.css',
jsoneditorSrc + 'css/contextmenu.css',
jsoneditorSrc + 'css/menu.css',
jsoneditorSrc + 'css/searchbox.css'
],
dest: JSONEDITOR_CSS,
separator: '\n'
});
console.log('Created ' + JSONEDITOR_CSS);
// minify the css file
write(JSONEDITOR_CSS_MIN, new CleanCSS().minify(String(read(JSONEDITOR_CSS))));
// create a folder img and copy the icons
jake.mkdirP('./img');
jake.cpR(jsoneditorSrc + 'css/img/jsoneditor-icons.png', './img/');
console.log('Copied jsoneditor-icons.png to ./img/');
// copy assets
// concatenate and copy ace files
var aceSrc = './node_modules/ace/build/src-min/';
jake.mkdirP(BUILD_ACE);
concat({
src: [
aceSrc + 'ace.js',
aceSrc + 'ext-searchbox.js',
aceSrc + 'mode-json.js',
aceSrc + 'theme-textmate.js',
jsoneditorSrc + 'js/ace/theme-jsoneditor.js'
],
dest: BUILD_ACE + 'ace.js',
task('build', {async: true}, function () {
jake.mkdirP(DIST);
jake.mkdirP(DIST + '/img');
// concatenate and stringify the css files
concat({
src: [
'./src/timeline/component/css/timeline.css',
'./src/timeline/component/css/panel.css',
'./src/timeline/component/css/labelset.css',
'./src/timeline/component/css/itemset.css',
'./src/timeline/component/css/item.css',
'./src/timeline/component/css/timeaxis.css',
'./src/timeline/component/css/currenttime.css',
'./src/timeline/component/css/customtime.css',
'./src/timeline/component/css/dataaxis.css',
'./src/timeline/component/css/pathStyles.css',
task('build', {async: true}, function () {
jake.mkdirP(DIST);
jake.mkdirP(DIST + '/img');
// concatenate and stringify the css files
concat({
src: [
'./src/timeline/component/css/timeline.css',
'./src/timeline/component/css/panel.css',
'./src/timeline/component/css/labelset.css',
'./src/timeline/component/css/itemset.css',
'./src/timeline/component/css/item.css',
'./src/timeline/component/css/timeaxis.css',
'./src/timeline/component/css/currenttime.css',
'./src/timeline/component/css/customtime.css',
'./src/timeline/component/css/dataaxis.css',
'./src/timeline/component/css/pathStyles.css',
jake.mkdirP(BUILD_ACE);
concat({
src: [
aceSrc + 'ace.js',
aceSrc + 'ext-searchbox.js',
aceSrc + 'mode-json.js',
aceSrc + 'theme-textmate.js',
jsoneditorSrc + 'js/ace/theme-jsoneditor.js'
],
dest: BUILD_ACE + 'ace.js',
separator: '\n'
});
jake.cpR(aceSrc + 'worker-json.js', BUILD_ACE);
// copy and minify json lint file
jake.mkdirP(BUILD_JSONLINT);
minify({
src: './node_modules/jsonlint/lib/jsonlint.js',
dest: BUILD_JSONLINT + 'jsonlint.js'
});
});
task('bundle', {async: true}, function () {
var b = browserify();
// make directory dist
jake.mkdirP(DIST);
b.add(INDEX);
b.bundle({
standalone: 'mathjs'
}, function (err, code) {
if(err) {
throw err;
}
// add header and shim to code
var lib = util.read(HEADER) + code;
// write bundled file
util.write(MATHJS, lib);
// update version number and stuff in the javascript files
task('zip', ['build', 'minify'], {async: true}, function () {
var pkg = 'jsoneditor-' + version();
var zipfile = BUILD + pkg + '.zip';
jake.mkdirP(BUILD);
var output = fs.createWriteStream(zipfile);
var archive = archiver('zip');
archive.on('error', function(err) {
throw err;
});
archive.pipe(output);
var filelist = new jake.FileList();
filelist.include([
'README.md',
'NOTICE',
'LICENSE',
'HISTORY.md',