2017-09-22 18:05:15 +02:00
|
|
|
"use strict";
|
|
|
|
|
2017-04-13 20:00:55 +02:00
|
|
|
const webpack = require("webpack");
|
|
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
2017-08-01 16:42:09 +02:00
|
|
|
const NodeExternals = require("webpack-node-externals");
|
2017-04-13 20:00:55 +02:00
|
|
|
const Inliner = require("web-resource-inliner");
|
2017-08-09 21:09:23 +02:00
|
|
|
const fs = require("fs");
|
2016-12-14 17:39:17 +01:00
|
|
|
|
2017-07-04 00:15:57 +02:00
|
|
|
/**
|
|
|
|
* Grunt configuration for building the app in various formats.
|
|
|
|
*
|
|
|
|
* @author n1474335 [n1474335@gmail.com]
|
|
|
|
* @copyright Crown Copyright 2017
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2017-03-23 01:33:40 +01:00
|
|
|
module.exports = function (grunt) {
|
2016-11-28 11:42:58 +01:00
|
|
|
grunt.file.defaultEncoding = "utf8";
|
|
|
|
grunt.file.preserveBOM = false;
|
2016-12-14 17:39:17 +01:00
|
|
|
|
2016-11-28 11:42:58 +01:00
|
|
|
// Tasks
|
|
|
|
grunt.registerTask("dev",
|
|
|
|
"A persistent task which creates a development build whenever source files are modified.",
|
2017-09-17 14:47:33 +02:00
|
|
|
["clean:dev", "concurrent:dev"]);
|
2017-03-21 23:41:44 +01:00
|
|
|
|
|
|
|
grunt.registerTask("node",
|
|
|
|
"Compiles CyberChef into a single NodeJS module.",
|
2017-09-17 14:47:33 +02:00
|
|
|
["clean:node", "webpack:metaConf", "webpack:node", "chmod:build"]);
|
2016-12-14 17:39:17 +01:00
|
|
|
|
2017-02-23 19:59:58 +01:00
|
|
|
grunt.registerTask("test",
|
2017-02-25 00:50:17 +01:00
|
|
|
"A task which runs all the tests in test/tests.",
|
2017-09-17 14:47:33 +02:00
|
|
|
["clean:test", "webpack:metaConf", "webpack:tests", "execute:test"]);
|
2016-12-14 17:39:17 +01:00
|
|
|
|
2016-11-28 11:42:58 +01:00
|
|
|
grunt.registerTask("docs",
|
|
|
|
"Compiles documentation in the /docs directory.",
|
|
|
|
["clean:docs", "jsdoc", "chmod:docs"]);
|
2016-12-14 17:39:17 +01:00
|
|
|
|
2017-03-27 17:08:36 +02:00
|
|
|
grunt.registerTask("prod",
|
|
|
|
"Creates a production-ready build. Use the --msg flag to add a compile message.",
|
2017-09-17 14:47:33 +02:00
|
|
|
["eslint", "clean:prod", "webpack:metaConf", "webpack:web", "inline", "chmod"]);
|
2016-12-03 01:37:38 +01:00
|
|
|
|
2016-11-28 11:42:58 +01:00
|
|
|
grunt.registerTask("default",
|
2017-03-29 22:51:42 +02:00
|
|
|
"Lints the code base",
|
|
|
|
["eslint", "exec:repoSize"]);
|
2016-12-14 17:39:17 +01:00
|
|
|
|
2017-03-27 17:08:36 +02:00
|
|
|
grunt.registerTask("inline",
|
|
|
|
"Compiles a production build of CyberChef into a single, portable web page.",
|
2017-08-25 01:25:49 +02:00
|
|
|
["webpack:webInline", "runInliner", "clean:inlineScripts"]);
|
2017-03-27 17:08:36 +02:00
|
|
|
|
2017-08-25 01:25:49 +02:00
|
|
|
|
|
|
|
grunt.registerTask("runInliner", runInliner);
|
2016-11-28 11:42:58 +01:00
|
|
|
grunt.registerTask("doc", "docs");
|
2017-02-28 18:08:36 +01:00
|
|
|
grunt.registerTask("tests", "test");
|
2016-12-14 17:39:17 +01:00
|
|
|
grunt.registerTask("lint", "eslint");
|
|
|
|
|
|
|
|
|
2016-11-28 11:42:58 +01:00
|
|
|
// Load tasks provided by each plugin
|
2016-12-14 17:39:17 +01:00
|
|
|
grunt.loadNpmTasks("grunt-eslint");
|
2017-03-27 17:08:36 +02:00
|
|
|
grunt.loadNpmTasks("grunt-webpack");
|
2016-11-28 11:42:58 +01:00
|
|
|
grunt.loadNpmTasks("grunt-jsdoc");
|
|
|
|
grunt.loadNpmTasks("grunt-contrib-clean");
|
|
|
|
grunt.loadNpmTasks("grunt-contrib-copy");
|
|
|
|
grunt.loadNpmTasks("grunt-chmod");
|
|
|
|
grunt.loadNpmTasks("grunt-exec");
|
2017-02-28 18:08:36 +01:00
|
|
|
grunt.loadNpmTasks("grunt-execute");
|
2017-04-05 22:30:22 +02:00
|
|
|
grunt.loadNpmTasks("grunt-accessibility");
|
2017-09-17 14:47:33 +02:00
|
|
|
grunt.loadNpmTasks("grunt-concurrent");
|
2016-12-14 17:39:17 +01:00
|
|
|
|
|
|
|
|
2017-03-27 17:08:36 +02:00
|
|
|
// Project configuration
|
2017-05-03 00:03:28 +02:00
|
|
|
const compileTime = grunt.template.today("UTC:dd/mm/yyyy HH:MM:ss") + " UTC",
|
2017-07-04 00:15:57 +02:00
|
|
|
pkg = grunt.file.readJSON("package.json"),
|
|
|
|
webpackConfig = require("./webpack.config.js"),
|
|
|
|
BUILD_CONSTANTS = {
|
|
|
|
COMPILE_TIME: JSON.stringify(compileTime),
|
|
|
|
COMPILE_MSG: JSON.stringify(grunt.option("compile-msg") || grunt.option("msg") || ""),
|
2017-09-20 01:37:57 +02:00
|
|
|
PKG_VERSION: JSON.stringify(pkg.version),
|
|
|
|
ENVIRONMENT_IS_WORKER: function() {
|
|
|
|
return typeof importScripts === "function";
|
|
|
|
},
|
|
|
|
ENVIRONMENT_IS_NODE: function() {
|
|
|
|
return typeof process === "object" && typeof require === "function";
|
|
|
|
},
|
|
|
|
ENVIRONMENT_IS_WEB: function() {
|
|
|
|
return typeof window === "object";
|
|
|
|
}
|
2017-08-09 21:09:23 +02:00
|
|
|
},
|
|
|
|
moduleEntryPoints = listEntryModules();
|
2016-11-28 11:42:58 +01:00
|
|
|
|
2017-03-27 17:08:36 +02:00
|
|
|
/**
|
|
|
|
* Compiles a production build of CyberChef into a single, portable web page.
|
|
|
|
*/
|
|
|
|
function runInliner() {
|
2017-04-13 20:00:55 +02:00
|
|
|
const done = this.async();
|
2017-03-27 17:08:36 +02:00
|
|
|
Inliner.html({
|
|
|
|
relativeTo: "build/prod/",
|
|
|
|
fileContent: grunt.file.read("build/prod/cyberchef.htm"),
|
|
|
|
images: true,
|
|
|
|
svgs: true,
|
|
|
|
scripts: true,
|
|
|
|
links: true,
|
|
|
|
strict: true
|
|
|
|
}, function(error, result) {
|
|
|
|
if (error) {
|
2017-04-13 20:00:55 +02:00
|
|
|
if (error instanceof Error) {
|
2017-04-28 17:51:57 +02:00
|
|
|
done(error);
|
2017-04-13 20:00:55 +02:00
|
|
|
} else {
|
2017-04-28 17:51:57 +02:00
|
|
|
done(new Error(error));
|
2017-04-13 20:00:55 +02:00
|
|
|
}
|
|
|
|
} else {
|
2017-04-28 17:51:57 +02:00
|
|
|
grunt.file.write("build/prod/cyberchef.htm", result);
|
|
|
|
done(true);
|
2017-03-27 17:08:36 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2016-12-14 17:39:17 +01:00
|
|
|
|
2017-08-09 21:09:23 +02:00
|
|
|
/**
|
|
|
|
* Generates an entry list for all the modules.
|
|
|
|
*/
|
|
|
|
function listEntryModules() {
|
|
|
|
const path = "./src/core/config/modules/";
|
|
|
|
let entryModules = {};
|
|
|
|
|
|
|
|
fs.readdirSync(path).forEach(file => {
|
2017-08-25 01:25:49 +02:00
|
|
|
if (file !== "Default.js" && file !== "OpModules.js")
|
2017-08-09 21:09:23 +02:00
|
|
|
entryModules[file.split(".js")[0]] = path + file;
|
|
|
|
});
|
|
|
|
|
|
|
|
return entryModules;
|
|
|
|
}
|
|
|
|
|
2016-11-28 11:42:58 +01:00
|
|
|
grunt.initConfig({
|
2017-03-27 17:08:36 +02:00
|
|
|
clean: {
|
2017-09-17 14:47:33 +02:00
|
|
|
dev: ["build/dev/*", "src/core/config/MetaConfig.js"],
|
|
|
|
prod: ["build/prod/*", "src/core/config/MetaConfig.js"],
|
|
|
|
test: ["build/test/*", "src/core/config/MetaConfig.js"],
|
|
|
|
node: ["build/node/*", "src/core/config/MetaConfig.js"],
|
2017-09-13 17:21:31 +02:00
|
|
|
docs: ["docs/*", "!docs/*.conf.json", "!docs/*.ico", "!docs/*.png"],
|
2017-09-17 14:47:33 +02:00
|
|
|
inlineScripts: ["build/prod/scripts.js"],
|
2017-03-27 17:08:36 +02:00
|
|
|
},
|
2016-12-14 17:39:17 +01:00
|
|
|
eslint: {
|
2016-11-28 11:42:58 +01:00
|
|
|
options: {
|
2017-04-28 17:51:57 +02:00
|
|
|
configFile: "./.eslintrc.json"
|
2016-11-28 11:42:58 +01:00
|
|
|
},
|
2017-03-27 20:39:04 +02:00
|
|
|
configs: ["Gruntfile.js"],
|
2017-09-17 14:47:33 +02:00
|
|
|
core: ["src/core/**/*.js", "!src/core/lib/**/*", "!src/core/config/MetaConfig.js"],
|
2017-03-23 01:33:40 +01:00
|
|
|
web: ["src/web/**/*.js"],
|
|
|
|
node: ["src/node/**/*.js"],
|
2017-02-28 18:08:36 +01:00
|
|
|
tests: ["test/**/*.js"],
|
2016-11-28 11:42:58 +01:00
|
|
|
},
|
|
|
|
jsdoc: {
|
|
|
|
options: {
|
|
|
|
destination: "docs",
|
|
|
|
template: "node_modules/ink-docstrap/template",
|
|
|
|
recurse: true,
|
|
|
|
readme: "./README.md",
|
|
|
|
configure: "docs/jsdoc.conf.json"
|
|
|
|
},
|
|
|
|
all: {
|
|
|
|
src: [
|
2017-03-23 01:33:40 +01:00
|
|
|
"src/**/*.js",
|
|
|
|
"!src/core/lib/**/*",
|
2017-09-17 15:59:11 +02:00
|
|
|
"!src/core/config/MetaConfig.js"
|
2016-11-28 11:42:58 +01:00
|
|
|
],
|
|
|
|
}
|
|
|
|
},
|
2017-09-17 14:47:33 +02:00
|
|
|
concurrent: {
|
|
|
|
options: {
|
|
|
|
logConcurrentOutput: true
|
|
|
|
},
|
|
|
|
dev: ["webpack:metaConfDev", "webpack-dev-server:start"]
|
|
|
|
},
|
2017-04-05 22:30:22 +02:00
|
|
|
accessibility: {
|
|
|
|
options: {
|
2017-04-07 18:00:32 +02:00
|
|
|
accessibilityLevel: "WCAG2A",
|
|
|
|
verbose: false,
|
|
|
|
ignore: [
|
|
|
|
"WCAG2A.Principle1.Guideline1_3.1_3_1.H42.2"
|
|
|
|
]
|
2017-04-05 22:30:22 +02:00
|
|
|
},
|
|
|
|
test: {
|
|
|
|
src: ["build/**/*.html"]
|
|
|
|
}
|
|
|
|
},
|
2017-03-21 23:41:44 +01:00
|
|
|
webpack: {
|
2017-07-04 00:15:57 +02:00
|
|
|
options: webpackConfig,
|
2017-09-17 14:47:33 +02:00
|
|
|
metaConf: {
|
|
|
|
target: "node",
|
2018-01-25 14:44:39 +01:00
|
|
|
entry: [
|
|
|
|
"babel-polyfill",
|
|
|
|
"./src/core/config/OperationConfig.js"
|
|
|
|
],
|
2017-09-17 14:47:33 +02:00
|
|
|
output: {
|
|
|
|
filename: "MetaConfig.js",
|
|
|
|
path: __dirname + "/src/core/config/",
|
|
|
|
library: "MetaConfig",
|
|
|
|
libraryTarget: "commonjs2",
|
|
|
|
libraryExport: "default"
|
2017-08-04 15:59:32 +02:00
|
|
|
},
|
2017-09-17 15:53:17 +02:00
|
|
|
externals: [NodeExternals()],
|
2017-09-17 14:47:33 +02:00
|
|
|
},
|
|
|
|
metaConfDev: {
|
|
|
|
target: "node",
|
2018-01-25 14:44:39 +01:00
|
|
|
entry: [
|
|
|
|
"babel-polyfill",
|
|
|
|
"./src/core/config/OperationConfig.js"
|
|
|
|
],
|
2017-09-17 14:47:33 +02:00
|
|
|
output: {
|
|
|
|
filename: "MetaConfig.js",
|
|
|
|
path: __dirname + "/src/core/config/",
|
|
|
|
library: "MetaConfig",
|
|
|
|
libraryTarget: "commonjs2",
|
|
|
|
libraryExport: "default"
|
|
|
|
},
|
2017-09-17 15:53:17 +02:00
|
|
|
externals: [NodeExternals()],
|
2017-09-17 14:47:33 +02:00
|
|
|
watch: true
|
|
|
|
},
|
2017-07-04 00:15:57 +02:00
|
|
|
web: {
|
2017-03-23 19:41:36 +01:00
|
|
|
target: "web",
|
2017-08-09 21:09:23 +02:00
|
|
|
entry: Object.assign({
|
2018-02-20 17:52:27 +01:00
|
|
|
main: "./src/web/index.js",
|
|
|
|
sitemap: "./src/web/static/sitemap.js"
|
2017-08-09 21:09:23 +02:00
|
|
|
}, moduleEntryPoints),
|
2017-03-23 19:41:36 +01:00
|
|
|
output: {
|
2017-03-27 17:20:43 +02:00
|
|
|
path: __dirname + "/build/prod"
|
2017-03-22 17:12:53 +01:00
|
|
|
},
|
2017-08-25 01:25:49 +02:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"./config/modules/OpModules.js": "./config/modules/Default.js"
|
|
|
|
}
|
|
|
|
},
|
2017-03-22 17:12:53 +01:00
|
|
|
plugins: [
|
2017-07-04 00:15:57 +02:00
|
|
|
new webpack.DefinePlugin(BUILD_CONSTANTS),
|
2017-03-23 19:41:36 +01:00
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
|
|
compress: {
|
|
|
|
"screw_ie8": true,
|
|
|
|
"dead_code": true,
|
|
|
|
"unused": true,
|
|
|
|
"warnings": false
|
|
|
|
},
|
|
|
|
comments: false,
|
|
|
|
}),
|
2017-08-25 01:25:49 +02:00
|
|
|
new HtmlWebpackPlugin({
|
2017-03-27 17:08:36 +02:00
|
|
|
filename: "index.html",
|
|
|
|
template: "./src/web/html/index.html",
|
2017-08-09 21:09:23 +02:00
|
|
|
chunks: ["main"],
|
2017-03-27 17:08:36 +02:00
|
|
|
compileTime: compileTime,
|
2017-05-19 00:40:53 +02:00
|
|
|
version: pkg.version,
|
2017-03-27 17:08:36 +02:00
|
|
|
minify: {
|
|
|
|
removeComments: true,
|
|
|
|
collapseWhitespace: true,
|
|
|
|
minifyJS: true,
|
|
|
|
minifyCSS: true
|
|
|
|
}
|
|
|
|
}),
|
2017-08-25 01:25:49 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
webInline: {
|
|
|
|
target: "web",
|
|
|
|
entry: "./src/web/index.js",
|
|
|
|
output: {
|
|
|
|
filename: "scripts.js",
|
|
|
|
path: __dirname + "/build/prod"
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin(BUILD_CONSTANTS),
|
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
|
|
compress: {
|
|
|
|
"screw_ie8": true,
|
|
|
|
"dead_code": true,
|
|
|
|
"unused": true,
|
|
|
|
"warnings": false
|
|
|
|
},
|
|
|
|
comments: false,
|
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
2017-03-27 17:08:36 +02:00
|
|
|
filename: "cyberchef.htm",
|
|
|
|
template: "./src/web/html/index.html",
|
|
|
|
compileTime: compileTime,
|
2017-05-19 00:40:53 +02:00
|
|
|
version: pkg.version,
|
2017-03-27 17:08:36 +02:00
|
|
|
inline: true,
|
|
|
|
minify: {
|
|
|
|
removeComments: true,
|
|
|
|
collapseWhitespace: true,
|
|
|
|
minifyJS: true,
|
|
|
|
minifyCSS: true
|
|
|
|
}
|
|
|
|
}),
|
2017-03-22 17:12:53 +01:00
|
|
|
]
|
2017-03-21 23:41:44 +01:00
|
|
|
},
|
|
|
|
tests: {
|
|
|
|
target: "node",
|
2017-03-25 14:32:35 +01:00
|
|
|
entry: "./test/index.js",
|
2017-08-01 16:42:09 +02:00
|
|
|
externals: [NodeExternals()],
|
2017-03-21 23:41:44 +01:00
|
|
|
output: {
|
|
|
|
filename: "index.js",
|
2017-03-27 17:20:43 +02:00
|
|
|
path: __dirname + "/build/test"
|
2017-09-20 01:37:57 +02:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin(BUILD_CONSTANTS)
|
|
|
|
]
|
2017-03-21 23:41:44 +01:00
|
|
|
},
|
|
|
|
node: {
|
|
|
|
target: "node",
|
2017-03-25 14:32:35 +01:00
|
|
|
entry: "./src/node/index.js",
|
2017-08-01 16:42:09 +02:00
|
|
|
externals: [NodeExternals()],
|
2017-03-21 23:41:44 +01:00
|
|
|
output: {
|
|
|
|
filename: "CyberChef.js",
|
2017-03-27 17:20:43 +02:00
|
|
|
path: __dirname + "/build/node",
|
2017-03-21 23:41:44 +01:00
|
|
|
library: "CyberChef",
|
|
|
|
libraryTarget: "commonjs2"
|
2017-09-20 01:37:57 +02:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin(BUILD_CONSTANTS)
|
|
|
|
]
|
2017-03-21 23:41:44 +01:00
|
|
|
}
|
|
|
|
},
|
2017-07-04 00:15:57 +02:00
|
|
|
"webpack-dev-server": {
|
|
|
|
options: {
|
|
|
|
webpack: webpackConfig,
|
2017-09-22 18:05:15 +02:00
|
|
|
host: "0.0.0.0",
|
|
|
|
disableHostCheck: true,
|
2017-09-17 14:47:33 +02:00
|
|
|
overlay: true,
|
2017-09-22 18:05:15 +02:00
|
|
|
inline: false,
|
2017-09-17 14:47:33 +02:00
|
|
|
clientLogLevel: "error",
|
2017-07-04 00:15:57 +02:00
|
|
|
stats: {
|
|
|
|
children: false,
|
2017-09-17 14:47:33 +02:00
|
|
|
chunks: false,
|
|
|
|
modules: false,
|
|
|
|
warningsFilter: /source-map/,
|
|
|
|
}
|
2017-07-04 00:15:57 +02:00
|
|
|
},
|
|
|
|
start: {
|
|
|
|
webpack: {
|
|
|
|
target: "web",
|
2017-08-09 21:09:23 +02:00
|
|
|
entry: Object.assign({
|
|
|
|
main: "./src/web/index.js"
|
|
|
|
}, moduleEntryPoints),
|
2017-08-25 01:25:49 +02:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"./config/modules/OpModules.js": "./config/modules/Default.js"
|
|
|
|
}
|
|
|
|
},
|
2017-07-04 00:15:57 +02:00
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin(BUILD_CONSTANTS),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
filename: "index.html",
|
|
|
|
template: "./src/web/html/index.html",
|
2017-08-09 21:09:23 +02:00
|
|
|
chunks: ["main"],
|
2017-07-04 00:15:57 +02:00
|
|
|
compileTime: compileTime,
|
|
|
|
version: pkg.version,
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2016-11-28 11:42:58 +01:00
|
|
|
copy: {
|
2017-01-31 19:24:56 +01:00
|
|
|
ghPages: {
|
2016-12-03 01:37:38 +01:00
|
|
|
options: {
|
2017-09-13 17:21:31 +02:00
|
|
|
process: function (content, srcpath) {
|
2016-12-03 01:37:38 +01:00
|
|
|
// Add Google Analytics code to index.html
|
2017-09-13 17:21:31 +02:00
|
|
|
if (srcpath.indexOf("index.html") >= 0) {
|
|
|
|
content = content.replace("</body></html>",
|
|
|
|
grunt.file.read("src/web/static/ga.html") + "</body></html>");
|
|
|
|
return grunt.template.process(content, srcpath);
|
|
|
|
} else {
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
noProcess: ["**", "!**/*.html"]
|
2016-12-03 01:37:38 +01:00
|
|
|
},
|
2017-09-13 17:21:31 +02:00
|
|
|
files: [
|
|
|
|
{
|
|
|
|
src: "build/prod/index.html",
|
|
|
|
dest: "build/prod/index.html"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
expand: true,
|
|
|
|
src: "docs/**",
|
|
|
|
dest: "build/prod/"
|
2018-02-20 17:52:27 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
src: "src/web/static/robots.txt",
|
|
|
|
dest: "build/prod/"
|
2017-09-13 17:21:31 +02:00
|
|
|
}
|
|
|
|
]
|
2016-11-28 11:42:58 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
chmod: {
|
|
|
|
build: {
|
|
|
|
options: {
|
|
|
|
mode: "755",
|
|
|
|
},
|
2017-03-27 17:08:36 +02:00
|
|
|
src: ["build/**/*", "build/"]
|
2016-11-28 11:42:58 +01:00
|
|
|
},
|
|
|
|
docs: {
|
|
|
|
options: {
|
|
|
|
mode: "755",
|
|
|
|
},
|
|
|
|
src: ["docs/**/*", "docs/"]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
exec: {
|
2017-01-31 19:24:56 +01:00
|
|
|
repoSize: {
|
2016-11-28 11:42:58 +01:00
|
|
|
command: [
|
2016-12-14 17:39:17 +01:00
|
|
|
"git ls-files | wc -l | xargs printf '\n%b\ttracked files\n'",
|
|
|
|
"du -hs | egrep -o '^[^\t]*' | xargs printf '%b\trepository size\n'"
|
|
|
|
].join(";"),
|
2016-11-28 11:42:58 +01:00
|
|
|
stderr: false
|
|
|
|
},
|
2017-01-31 19:24:56 +01:00
|
|
|
cleanGit: {
|
2016-11-28 11:42:58 +01:00
|
|
|
command: "git gc --prune=now --aggressive"
|
|
|
|
},
|
2018-02-20 17:52:27 +01:00
|
|
|
sitemap: {
|
|
|
|
command: "node build/prod/sitemap.js > build/prod/sitemap.xml"
|
|
|
|
}
|
2016-11-28 11:42:58 +01:00
|
|
|
},
|
2017-02-28 18:08:36 +01:00
|
|
|
execute: {
|
2017-03-21 23:41:44 +01:00
|
|
|
test: "build/test/index.js"
|
2017-02-28 18:08:36 +01:00
|
|
|
},
|
2016-11-28 11:42:58 +01:00
|
|
|
});
|
|
|
|
};
|