mirror of
https://github.com/gchq/CyberChef
synced 2025-01-12 12:38:48 +00:00
OperationConfig now loaded into App via value-loader so that operation code is only included in the worker
This commit is contained in:
parent
760ab688b2
commit
cc3aad17e1
6 changed files with 4000 additions and 1237 deletions
5160
package-lock.json
generated
5160
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -33,7 +33,8 @@
|
||||||
"babel-core": "^6.24.0",
|
"babel-core": "^6.24.0",
|
||||||
"babel-loader": "^6.4.0",
|
"babel-loader": "^6.4.0",
|
||||||
"babel-polyfill": "^6.23.0",
|
"babel-polyfill": "^6.23.0",
|
||||||
"babel-preset-env": "^1.2.2",
|
"babel-preset-env": "^1.6.0",
|
||||||
|
"babel-regenerator-runtime": "^6.5.0",
|
||||||
"css-loader": "^0.27.3",
|
"css-loader": "^0.27.3",
|
||||||
"exports-loader": "^0.6.4",
|
"exports-loader": "^0.6.4",
|
||||||
"extract-text-webpack-plugin": "^2.1.0",
|
"extract-text-webpack-plugin": "^2.1.0",
|
||||||
|
@ -48,7 +49,7 @@
|
||||||
"grunt-execute": "^0.2.2",
|
"grunt-execute": "^0.2.2",
|
||||||
"grunt-jsdoc": "^2.1.0",
|
"grunt-jsdoc": "^2.1.0",
|
||||||
"grunt-webpack": "^2.0.1",
|
"grunt-webpack": "^2.0.1",
|
||||||
"html-webpack-plugin": "^2.28.0",
|
"html-webpack-plugin": "^2.29.0",
|
||||||
"imports-loader": "^0.7.1",
|
"imports-loader": "^0.7.1",
|
||||||
"ink-docstrap": "^1.1.4",
|
"ink-docstrap": "^1.1.4",
|
||||||
"jsdoc-babel": "^0.3.0",
|
"jsdoc-babel": "^0.3.0",
|
||||||
|
@ -59,6 +60,7 @@
|
||||||
"postcss-loader": "^2.0.5",
|
"postcss-loader": "^2.0.5",
|
||||||
"style-loader": "^0.15.0",
|
"style-loader": "^0.15.0",
|
||||||
"url-loader": "^0.5.8",
|
"url-loader": "^0.5.8",
|
||||||
|
"value-loader": "^0.1.3",
|
||||||
"web-resource-inliner": "^4.1.0",
|
"web-resource-inliner": "^4.1.0",
|
||||||
"webpack": "^2.2.1",
|
"webpack": "^2.2.1",
|
||||||
"webpack-dev-server": "^2.5.0",
|
"webpack-dev-server": "^2.5.0",
|
||||||
|
|
23
src/core/config/MetaConfig.js
Normal file
23
src/core/config/MetaConfig.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/**
|
||||||
|
* Re-exports OperationConfig in value-loader format without the run function
|
||||||
|
* allowing the web app to access metadata about operations without having to
|
||||||
|
* import all the dependencies.
|
||||||
|
*
|
||||||
|
* @author n1474335 [n1474335@gmail.com]
|
||||||
|
* @copyright Crown Copyright 2017
|
||||||
|
* @license Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
import "babel-regenerator-runtime";
|
||||||
|
import Utils from "../Utils.js";
|
||||||
|
import OperationConfig from "./OperationConfig.js";
|
||||||
|
|
||||||
|
|
||||||
|
// Remove the run function from each operation config
|
||||||
|
for (let opConf in OperationConfig) {
|
||||||
|
delete OperationConfig[opConf].run;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Export a string version of the meta config so that it can be imported using
|
||||||
|
// value-loader without any of the dependencies.
|
||||||
|
export default "module.exports = " + JSON.stringify(OperationConfig) + ";";
|
|
@ -17,7 +17,7 @@ import CanvasComponents from "../core/lib/canvascomponents.js";
|
||||||
// CyberChef
|
// CyberChef
|
||||||
import App from "./App.js";
|
import App from "./App.js";
|
||||||
import Categories from "../core/config/Categories.js";
|
import Categories from "../core/config/Categories.js";
|
||||||
import OperationConfig from "../core/config/OperationConfig.js";
|
import OperationConfig from "value-loader?name=default!../core/config/MetaConfig.js";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -9,26 +9,26 @@ const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||||
* @license Apache-2.0
|
* @license Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const banner = "/**\n" +
|
const banner = `/**
|
||||||
"* CyberChef - The Cyber Swiss Army Knife\n" +
|
* CyberChef - The Cyber Swiss Army Knife
|
||||||
"*\n" +
|
*
|
||||||
"* @copyright Crown Copyright 2016\n" +
|
* @copyright Crown Copyright 2016
|
||||||
"* @license Apache-2.0\n" +
|
* @license Apache-2.0
|
||||||
"*\n" +
|
*
|
||||||
"* Copyright 2016 Crown Copyright\n" +
|
* Copyright 2016 Crown Copyright
|
||||||
"*\n" +
|
*
|
||||||
'* Licensed under the Apache License, Version 2.0 (the "License");\n' +
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
"* you may not use this file except in compliance with the License.\n" +
|
* you may not use this file except in compliance with the License.
|
||||||
"* You may obtain a copy of the License at\n" +
|
* You may obtain a copy of the License at
|
||||||
"*\n" +
|
*
|
||||||
"* http://www.apache.org/licenses/LICENSE-2.0\n" +
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
"*\n" +
|
*
|
||||||
"* Unless required by applicable law or agreed to in writing, software\n" +
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
'* distributed under the License is distributed on an "AS IS" BASIS,\n' +
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
"* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
"* See the License for the specific language governing permissions and\n" +
|
* See the License for the specific language governing permissions and
|
||||||
"* limitations under the License.\n" +
|
* limitations under the License.
|
||||||
"*/\n";
|
*/`;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|
Loading…
Reference in a new issue