diff --git a/Gruntfile.js b/Gruntfile.js
index 7df4c380..c25946e2 100755
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,7 +1,7 @@
var webpack = require("webpack"),
ExtractTextPlugin = require("extract-text-webpack-plugin");
-module.exports = function(grunt) {
+module.exports = function (grunt) {
grunt.file.defaultEncoding = "utf8";
grunt.file.preserveBOM = false;
@@ -21,7 +21,7 @@ module.exports = function(grunt) {
grunt.registerTask("prod",
"Creates a production-ready build. Use the --msg flag to add a compile message.",
["eslint", "test", "exec:stats", "clean", "jsdoc", "webpack:web", "copy:htmlDev", "copy:htmlProd", "copy:htmlInline",
- "copy:staticDev", "copy:staticProd", "cssmin", "uglify:prod", "inline", "htmlmin", "docs", "chmod"]);
+ "copy:staticDev", "copy:staticProd", "cssmin", "uglify:prod", "inline", "htmlmin", "chmod"]);
grunt.registerTask("docs",
"Compiles documentation in the /docs directory.",
@@ -61,32 +61,32 @@ module.exports = function(grunt) {
var compileTime = grunt.template.today("dd/mm/yyyy HH:MM:ss") + " UTC",
- banner = '/**\n\
- * CyberChef - The Cyber Swiss Army Knife\n\
- *\n\
- * @copyright Crown Copyright 2016\n\
- * @license Apache-2.0\n\
- *\n\
- * Copyright 2016 Crown Copyright\n\
- *\n\
- * Licensed under the Apache License, Version 2.0 (the "License");\n\
- * you may not use this file except in compliance with the License.\n\
- * You may obtain a copy of the License at\n\
- *\n\
- * http://www.apache.org/licenses/LICENSE-2.0\n\
- *\n\
- * Unless required by applicable law or agreed to in writing, software\n\
- * distributed under the License is distributed on an "AS IS" BASIS,\n\
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\
- * See the License for the specific language governing permissions and\n\
- * limitations under the License.\n\
- */\n';
+ banner = "/**\n" +
+ "* CyberChef - The Cyber Swiss Army Knife\n" +
+ "*\n" +
+ "* @copyright Crown Copyright 2016\n" +
+ "* @license Apache-2.0\n" +
+ "*\n" +
+ "* Copyright 2016 Crown Copyright\n" +
+ "*\n" +
+ '* Licensed under the Apache License, Version 2.0 (the "License");\n' +
+ "* you may not use this file except in compliance with the License.\n" +
+ "* You may obtain a copy of the License at\n" +
+ "*\n" +
+ "* http://www.apache.org/licenses/LICENSE-2.0\n" +
+ "*\n" +
+ "* Unless required by applicable law or agreed to in writing, software\n" +
+ '* distributed under the License is distributed on an "AS IS" BASIS,\n' +
+ "* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
+ "* See the License for the specific language governing permissions and\n" +
+ "* limitations under the License.\n" +
+ "*/\n";
var templateOptions = {
data: {
compileTime: compileTime,
compileMsg: grunt.option("compile-msg") || grunt.option("msg") || "",
- codebaseStats: grunt.file.read("src/static/stats.txt").split("\n").join("
")
+ codebaseStats: grunt.file.read("src/web/static/stats.txt").split("\n").join("
")
}
};
@@ -94,13 +94,12 @@ module.exports = function(grunt) {
grunt.initConfig({
eslint: {
options: {
- configFile: "src/js/.eslintrc.json"
+ configFile: "src/.eslintrc.json"
},
gruntfile: ["Gruntfile.js"],
- core: ["src/js/core/**/*.js"],
- config: ["src/js/config/**/*.js"],
- views: ["src/js/views/**/*.js"],
- operations: ["src/js/operations/**/*.js"],
+ core: ["src/core/**/*.js", "!src/core/lib/**/*"],
+ web: ["src/web/**/*.js"],
+ node: ["src/node/**/*.js"],
tests: ["test/**/*.js"],
},
jsdoc: {
@@ -113,8 +112,8 @@ module.exports = function(grunt) {
},
all: {
src: [
- "src/js/**/*.js",
- "!src/js/lib/**/*",
+ "src/**/*.js",
+ "!src/core/lib/**/*",
],
}
},
@@ -165,8 +164,8 @@ module.exports = function(grunt) {
"bootstrap",
"bootstrap-switch",
"bootstrap-colorpicker",
- "./src/css/index.js",
- "./src/js/views/html/main.js"
+ "./src/web/css/index.js",
+ "./src/web/index.js"
],
output: {
filename: "scripts.js",
@@ -218,7 +217,7 @@ module.exports = function(grunt) {
},
node: {
target: "node",
- entry: ["babel-polyfill", "./src/js/views/node/index.js"],
+ entry: ["babel-polyfill", "./src/node/index.js"],
output: {
filename: "CyberChef.js",
path: "build/node",
@@ -236,25 +235,25 @@ module.exports = function(grunt) {
copy: {
htmlDev: {
options: {
- process: function(content, srcpath) {
+ process: function (content, srcpath) {
return grunt.template.process(content, templateOptions);
}
},
- src: "src/html/index.html",
+ src: "src/web/html/index.html",
dest: "build/dev/index.html"
},
htmlProd: {
options: {
- process: function(content, srcpath) {
+ process: function (content, srcpath) {
return grunt.template.process(content, templateOptions);
}
},
- src: "src/html/index.html",
+ src: "src/web/html/index.html",
dest: "build/prod/index.html"
},
htmlInline: {
options: {
- process: function(content, srcpath) {
+ process: function (content, srcpath) {
// TODO: Do all this in Jade
content = content.replace(
'Download CyberChef
',
@@ -262,14 +261,14 @@ module.exports = function(grunt) {
return grunt.template.process(content, templateOptions);
}
},
- src: "src/html/index.html",
+ src: "src/web/html/index.html",
dest: "build/prod/cyberchef.htm"
},
staticDev: {
files: [
{
expand: true,
- cwd: "src/static/",
+ cwd: "src/web/static/",
src: [
"**/*",
"**/.*",
@@ -284,7 +283,7 @@ module.exports = function(grunt) {
files: [
{
expand: true,
- cwd: "src/static/",
+ cwd: "src/web/static/",
src: [
"**/*",
"**/.*",
@@ -297,7 +296,7 @@ module.exports = function(grunt) {
},
ghPages: {
options: {
- process: function(content, srcpath) {
+ process: function (content, srcpath) {
// Add Google Analytics code to index.html
content = content.replace("