Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

master update #2

Merged
merged 180 commits into from
Feb 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
283d7f2
Add Output Filter option to Magic operation
j433866 Dec 18, 2018
367d79e
Fix filtering to work on all the data and not just the result snippet
j433866 Dec 18, 2018
c8eab5d
Commenting
j433866 Dec 18, 2018
b6bdcaa
Rename output filter argument to Crib
j433866 Dec 18, 2018
5d4c724
Add note about crib to operation description
j433866 Dec 18, 2018
f600571
Fix to make the filter work when intensive mode was turned on.
j433866 Dec 19, 2018
952f49e
Add qr-image to package
j433866 Dec 19, 2018
2070e1a
Add new Generate QR Code module
j433866 Dec 19, 2018
866dd54
Add the Play Media operation and place it under a new "Multimedia" ca…
anthony-arnold Dec 19, 2018
ae20a95
Add customisation arguments.
j433866 Dec 19, 2018
6337e84
Merge branch 'master' of https://github.com/j433866/CyberChef into j4…
n1474335 Dec 19, 2018
ed2c886
Magic crib now only applies after all branches have been explored.
n1474335 Dec 19, 2018
13d87d3
Merge branch 'j433866-master'
n1474335 Dec 19, 2018
f367c1f
8.15.1
n1474335 Dec 19, 2018
8c6c3a1
Merge branch 'play-media' of https://github.com/anthony-arnold/CyberC…
n1474335 Dec 19, 2018
01c4cfd
Tidied up 'Play Media' operation
n1474335 Dec 19, 2018
ae28d47
Merge branch 'anthony-arnold-play-media'
n1474335 Dec 19, 2018
8c3569e
8.16.0
n1474335 Dec 19, 2018
b3113c1
Change module to Image, change default format value to PNG
j433866 Dec 20, 2018
1953d9a
Add Jimp and jsqr modules
j433866 Dec 20, 2018
e5b2b84
Add new ParseQRCode operation
j433866 Dec 20, 2018
ed25017
Add process.browser to webpack config, so we don't include stuff we d…
j433866 Dec 20, 2018
ae5128a
Always generate a PNG if the format isn't SVG
j433866 Dec 21, 2018
d0e428b
Improve image normalising
j433866 Dec 21, 2018
c2f6b8d
Add tests for Parse QR Code module
j433866 Dec 21, 2018
0046f7e
Added colour channel splitting support
mattnotmitt Dec 21, 2018
5a9583c
Add to categories
mattnotmitt Dec 21, 2018
18693d2
Add tests, however non-functional due to lack of File in Node
mattnotmitt Dec 21, 2018
454ef00
Disabled tests
mattnotmitt Dec 21, 2018
bf24547
The 'option' and 'editableOption' arguments can now specify a 'defaul…
n1474335 Dec 25, 2018
387008b
8.16.1
n1474335 Dec 25, 2018
4ee0800
Merge branch 'qrcodes' of https://github.com/j433866/CyberChef into j…
n1474335 Dec 25, 2018
9734b78
Tidied up QR code operations
n1474335 Dec 25, 2018
dfe3198
Merge branch 'j433866-qrcodes'
n1474335 Dec 25, 2018
d232530
8.17.0
n1474335 Dec 25, 2018
b29bb6f
Added 'DishError' and refined test results.
n1474335 Dec 25, 2018
43dcd54
Added webpack-bundle-analyzer to production build. Refactored some mo…
n1474335 Dec 25, 2018
8fef01d
Fixed bundle analyzer filepath
n1474335 Dec 26, 2018
f6d97c1
8.17.1
n1474335 Dec 26, 2018
16be7cb
Fixed grunt-webpack circular reference issue
n1474335 Dec 26, 2018
e386863
8.17.2
n1474335 Dec 26, 2018
02b92c7
Merge branch 'features/colour-channel' of https://github.com/artemisb…
n1474335 Dec 26, 2018
8b533e9
Tidied up 'Split Colour Channels' operation and added 'Multimedia' ca…
n1474335 Dec 26, 2018
7a4eff0
Merge branch 'artemisbot-features/colour-channel'
n1474335 Dec 26, 2018
e693240
8.18.0
n1474335 Dec 26, 2018
5acee80
'editableOption's are now full width. 'editableOptionShort' type adde…
n1474335 Dec 26, 2018
a1b1614
8.18.1
n1474335 Dec 26, 2018
f2d115e
add lorem ipsum generator
klaxon1 Dec 28, 2018
c7e9115
Restructured tests directory
n1474335 Dec 28, 2018
b0fb9db
Added nightwatch.js test suite for confirming that the app loads corr…
n1474335 Dec 29, 2018
b631e3f
Added nightwatch tests to TravisCI build process for prod and inline …
n1474335 Dec 29, 2018
f7707fa
Added Chrome to TravisCI config
n1474335 Dec 30, 2018
840e44d
Tidied up UI tests
n1474335 Dec 30, 2018
7f2e879
Added explicit bake after input added in test suite.
n1474335 Dec 30, 2018
71e0a4e
Increased UI test timeouts
n1474335 Dec 30, 2018
19b3dcf
Updated CHANGELOG
n1474335 Dec 30, 2018
bb44268
Merge branch 'feature-browser-testsuite'
n1474335 Dec 30, 2018
0cea56d
8.19.0
n1474335 Dec 30, 2018
688c2d0
Update ParseX509Certificate.mjs
Dec 30, 2018
32aea6b
Adds 'To Case Insensitive Regex' operation
masq Dec 30, 2018
3c16b83
Adds 'From Case Insensitive Regex' operation
masq Dec 30, 2018
b750006
Adds tests for 'To/From Case Insensitive Regex' operations
masq Dec 30, 2018
1d04b64
Adds 'To/From Case Insensitive Regex' operations under 'Utils'
masq Dec 30, 2018
126ad58
Registers tests for 'To/From Case Insensitive Regex' operations
masq Dec 30, 2018
40acf75
Update to understand Generalized / UTC Time
Dec 30, 2018
050ab03
Simplify to improve readability
Dec 30, 2018
d469fb9
Updated dependencies
n1474335 Jan 1, 2019
4e466c7
8.19.1
n1474335 Jan 1, 2019
76f1e5e
Merge branch 'patch-2' of https://github.com/edwardwall/CyberChef int…
n1474335 Jan 1, 2019
c123d73
Merge branch 'edwardwall-patch-2'
n1474335 Jan 1, 2019
017dde3
8.19.2
n1474335 Jan 1, 2019
29411c9
Added increase-memory-limit plugin to TravisCI build process to reduc…
n1474335 Jan 1, 2019
1bf513c
8.19.3
n1474335 Jan 1, 2019
c86007d
Removed increase-memory-limit plugin in favour of NODE_OPTIONS enviro…
n1474335 Jan 1, 2019
bc00fa0
8.19.4
n1474335 Jan 1, 2019
cb2c376
Increasing Node memory limit from 1G to 2G
n1474335 Jan 1, 2019
c82971f
8.19.5
n1474335 Jan 1, 2019
0f0e346
Add new Subsection operation
j433866 Jan 8, 2019
1a827ef
Add Subsection to Flow Control category
j433866 Jan 8, 2019
8ac5b48
Update operation description
j433866 Jan 8, 2019
5ac469b
Added yara rule support
mattnotmitt Jan 8, 2019
13439e1
Merge remote-tracking branch 'upstream/master' into features/yara
mattnotmitt Jan 8, 2019
766de7e
Fixed bug in 'Regular expression' operation when highlighting lookaheads
n1474335 Jan 8, 2019
3a6b287
8.19.6
n1474335 Jan 8, 2019
cb9ab7a
Fixed 'Maximise output' button functionality
n1474335 Jan 8, 2019
fe1332f
8.19.7
n1474335 Jan 8, 2019
df8abb0
Added code argtype
mattnotmitt Jan 8, 2019
4c1521a
No data matches & warnings support
mattnotmitt Jan 8, 2019
26a2fb6
Increased size of rule inp & expanded memory for wasm
mattnotmitt Jan 9, 2019
4db2335
Speedrunning strats (increased speed on big files)
mattnotmitt Jan 9, 2019
ebb632e
Added metadata, string identifiers and operation args
mattnotmitt Jan 9, 2019
0e601d5
Merge branch 'feature/lorem-ipsum-generator' of https://github.com/kl…
n1474335 Jan 9, 2019
dd9ba4d
Fixed problems flagged by n's review
mattnotmitt Jan 9, 2019
c49a770
Tidied up Lorem Ipsum op
n1474335 Jan 9, 2019
1db8e6d
Merge branch 'klaxon1-feature/lorem-ipsum-generator'
n1474335 Jan 9, 2019
324c409
8.20.0
n1474335 Jan 9, 2019
c5270d7
Merge branch 'insense' of https://github.com/masq/CyberChef into masq…
n1474335 Jan 10, 2019
995fcab
Tidied up Case Insensitive Regex ops
n1474335 Jan 10, 2019
f82a727
Merge branch 'masq-insense'
n1474335 Jan 10, 2019
863a525
8.21.0
n1474335 Jan 10, 2019
6424839
Merge branch 'subsection' of https://github.com/j433866/CyberChef int…
n1474335 Jan 10, 2019
9e63e40
Add new MGRS module and update webpack-dev-server
j433866 Jan 10, 2019
c2068b3
Tidied up and added global matching to Subsection operation
n1474335 Jan 10, 2019
79d3c90
Merge branch 'j433866-subsection'
n1474335 Jan 10, 2019
9787ab0
8.22.0
n1474335 Jan 10, 2019
abdd70c
Add ConvertCoordinates to lib folder
j433866 Jan 11, 2019
8bba4b2
More speedrun stats (literally 10x faster)
mattnotmitt Jan 12, 2019
68fbbb6
Add new Convert co-ordinate format module.
j433866 Jan 14, 2019
8d1f668
Remove old Geohash modules
j433866 Jan 14, 2019
8b77ad7
Stop delimiters breaking MGRS conversion
j433866 Jan 14, 2019
1a88a01
Fix delimiter breaking Geohash detection
j433866 Jan 14, 2019
b3ac8d0
Removed some debug logging
j433866 Jan 14, 2019
04b0b8c
Tidy up code
j433866 Jan 14, 2019
ee36052
Remove MGRS npm module
j433866 Jan 14, 2019
4d8127a
Modified description of ToBase64 operation
calfr Jan 14, 2019
ad4451a
Rewrite MGRS to use new Geodesy module.
j433866 Jan 15, 2019
5e68959
Catch when OS grid references aren't calculated
j433866 Jan 15, 2019
d00b0f4
Basically rewrote the whole thing using the new geodesy module
j433866 Jan 15, 2019
0602f45
Added initial tests & counts support
mattnotmitt Jan 15, 2019
fcc39a0
Added File upload support to textarea
mattnotmitt Jan 15, 2019
3dfaaf4
Update libyara for test pass
mattnotmitt Jan 15, 2019
2e9b1e0
Merge remote-tracking branch 'upstream/master' into features/yara
mattnotmitt Jan 15, 2019
d1961ca
Marginally reduced size of libyara-wasm
mattnotmitt Jan 16, 2019
69797e5
Add better error handling.
j433866 Jan 16, 2019
439654e
Add tests for new co-ordinate conversion module.
j433866 Jan 17, 2019
4bd923d
Improved handling of negative numbers and weirder inputs.
j433866 Jan 17, 2019
55775f4
Merge branch 'picapi-b64-description-fix'
n1474335 Jan 18, 2019
445a857
8.22.1
n1474335 Jan 18, 2019
4cabb84
Merge branch 'features/yara' of https://github.com/artemisbot/CyberCh…
n1474335 Jan 18, 2019
0c14bac
Add button to input to allow opening of files using the file prompt.
j433866 Jan 18, 2019
acb8c0b
Change icon from folder to input
j433866 Jan 18, 2019
ba04cac
Tidied up YARA operation
n1474335 Jan 18, 2019
291ebd5
Merge branch 'artemisbot-features/yara'
n1474335 Jan 18, 2019
715f7bb
Lint
n1474335 Jan 18, 2019
eca2c14
8.23.0
n1474335 Jan 18, 2019
03d8bf2
Merge branch 'coordinates' of https://github.com/j433866/CyberChef in…
n1474335 Jan 18, 2019
6983783
Tidied up co-ordinate operation
n1474335 Jan 18, 2019
6f8a5ea
Merge branch 'j433866-coordinates'
n1474335 Jan 18, 2019
3209c94
Fix conversion breaking when compass directions are used as delimiters
j433866 Jan 21, 2019
8b44927
Fix XSS for To Table operation and Magic button
j433866 Jan 31, 2019
74a22bc
Swap ordering of truncating and escaping
j433866 Jan 31, 2019
c8cb269
WIP: Recipe refactored to use dynamic import
d98762625 Feb 1, 2019
069d0e4
WIP: use mini-css-extract-plugin instead of extract-text, to work wit…
d98762625 Feb 1, 2019
4bf2a29
WIP: bundle all css into main.css with mini-css-extract. Cannot split…
d98762625 Feb 1, 2019
9af5e40
update linting to allow dybnamic import. Recipe highlight still broken
d98762625 Feb 1, 2019
6a099f0
Inital Commit
h345983745 Feb 6, 2019
d420750
Small Updates
h345983745 Feb 6, 2019
3e9c75f
Added to Categories
h345983745 Feb 6, 2019
105090d
Spelling Check
h345983745 Feb 6, 2019
0d0a634
Added More Request Types
h345983745 Feb 6, 2019
613cbaa
Fixing Formating Issues
h345983745 Feb 7, 2019
75a58f4
Removed jpath import
h345983745 Feb 7, 2019
58a8af2
Highligting for Recipe now working. Discovered bug when highlighting …
d98762625 Feb 8, 2019
4dc5a14
Merge branch 'j433866-coords-fix'
n1474335 Feb 8, 2019
f1264d6
Update package-lock.json
n1474335 Feb 8, 2019
f48af97
8.23.1
n1474335 Feb 8, 2019
d2b4c40
Fixed BigNumber/XRegExp incompatibility. CLoses #481
n1474335 Feb 8, 2019
d54d66c
8.23.2
n1474335 Feb 8, 2019
821bc94
Merge branch 'xss_fixes' of https://github.com/j433866/CyberChef into…
n1474335 Feb 8, 2019
310ff30
Merge branch 'j433866-xss_fixes'
n1474335 Feb 8, 2019
7d09ba5
8.23.3
n1474335 Feb 8, 2019
3d20833
Fixed populateOption HTML escape bug. Closes #490
n1474335 Feb 8, 2019
0db0ced
8.23.4
n1474335 Feb 8, 2019
b8ecd83
Merge branch 'dnsoverhttps' of https://github.com/h345983745/CyberChe…
n1474335 Feb 8, 2019
ab43635
Tidied up 'DNS over HTTPS' operation and fixed manualBake flag.
n1474335 Feb 8, 2019
42d1c94
Merge branch 'h345983745-dnsoverhttps'
n1474335 Feb 8, 2019
42826e5
Updated changelog
n1474335 Feb 8, 2019
7a4e030
8.24.0
n1474335 Feb 8, 2019
d71aa8d
Merge branch 'open-file-button' of https://github.com/j433866/CyberCh…
n1474335 Feb 11, 2019
d22eac9
WIP getting prod working with minicss webpack plugin
d98762625 Feb 11, 2019
13abbd2
Abstracted out loadFile logic to separate function
n1474335 Feb 11, 2019
d84a61d
Merge branch 'j433866-open-file-button'
n1474335 Feb 11, 2019
b5c655d
8.24.1
n1474335 Feb 11, 2019
a7a2fe2
prod working with mini css webpack plugin
d98762625 Feb 11, 2019
2391e08
tidy up
d98762625 Feb 11, 2019
c01c076
try/catch to allow chef to run from prod file
d98762625 Feb 11, 2019
481f2a4
Merge branch 'master' of github.com:gchq/CyberChef into dynamic-import
d98762625 Feb 11, 2019
49e2b05
Dynamic module loading is now cached and Webpack includes the import …
n1474335 Feb 11, 2019
ce61bcc
Merge branch 'd98762625-dynamic-import'
n1474335 Feb 11, 2019
8148c1a
8.24.2
n1474335 Feb 11, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[{package.json,.travis.yml}]
[{package.json,.travis.yml,nightwatch.json}]
indent_style = space
indent_size = 2
13 changes: 12 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 9,
"ecmaFeatures": {
"impliedStrict": true
},
"sourceType": "module"
"sourceType": "module",
"allowImportExportEverywhere": true
},
"env": {
"browser": true,
Expand Down Expand Up @@ -87,6 +89,15 @@
"no-var": "error",
"prefer-const": "error"
},
"overrides": [
{
"files": "tests/**/*",
"rules": {
"no-unused-expressions": "off",
"no-console": "off"
}
}
],
"globals": {
"$": false,
"jQuery": false,
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ docs/*
src/core/config/modules/*
src/core/config/OperationConfig.json
src/core/operations/index.mjs
tests/browser/output/*

4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
language: node_js
node_js:
- node
addons:
chrome: stable
install: npm install
before_script:
- npm install -g grunt
- export NODE_OPTIONS=--max_old_space_size=2048
script:
- grunt lint
- grunt test
- grunt docs
- grunt node
- grunt prod --msg="$COMPILE_MSG"
- xvfb-run --server-args="-screen 0 1200x800x24" grunt testui
before_deploy:
- grunt exec:sitemap
- grunt copy:ghPages
Expand Down
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@
All major and minor version changes will be documented in this file. Details of patch-level version changes can be found in [commit messages](https://github.com/gchq/CyberChef/commits/master).


### [8.24.0] - 2019-02-08
- 'DNS over HTTPS' operation added [@h345983745] | [#489]

### [8.23.1] - 2019-01-18
- 'Convert co-ordinate format' operation added [@j433866] | [#476]

### [8.23.0] - 2019-01-18
- 'YARA Rules' operation added [@artemisbot] | [#468]

### [8.22.0] - 2019-01-10
- 'Subsection' operation added [@j433866] | [#467]

### [8.21.0] - 2019-01-10
- 'To Case Insensitive Regex' and 'From Case Insensitive Regex' operations added [@masq] | [#461]

### [8.20.0] - 2019-01-09
- 'Generate Lorem Ipsum' operation added [@klaxon1] | [#455]

### [8.19.0] - 2018-12-30
- UI test suite added to confirm that the app loads correctly in a reasonable time and that various operations from each module can be run [@n1474335] | [#458]

### [8.18.0] - 2018-12-26
- 'Split Colour Channels' operation added [@artemisbot] | [#449]

### [8.17.0] - 2018-12-25
- 'Generate QR Code' and 'Parse QR Code' operations added [@j433866] | [#448]

### [8.16.0] - 2018-12-19
- 'Play Media' operation added [@anthony-arnold] | [#446]

### [8.15.0] - 2018-12-18
- 'Text Encoding Brute Force' operation added [@Cynser] | [#439]

Expand Down Expand Up @@ -76,6 +106,16 @@ All major and minor version changes will be documented in this file. Details of



[8.24.0]: https://github.com/gchq/CyberChef/releases/tag/v8.24.0
[8.23.1]: https://github.com/gchq/CyberChef/releases/tag/v8.23.1
[8.23.0]: https://github.com/gchq/CyberChef/releases/tag/v8.23.0
[8.22.0]: https://github.com/gchq/CyberChef/releases/tag/v8.22.0
[8.21.0]: https://github.com/gchq/CyberChef/releases/tag/v8.21.0
[8.20.0]: https://github.com/gchq/CyberChef/releases/tag/v8.20.0
[8.19.0]: https://github.com/gchq/CyberChef/releases/tag/v8.19.0
[8.18.0]: https://github.com/gchq/CyberChef/releases/tag/v8.18.0
[8.17.0]: https://github.com/gchq/CyberChef/releases/tag/v8.17.0
[8.16.0]: https://github.com/gchq/CyberChef/releases/tag/v8.16.0
[8.15.0]: https://github.com/gchq/CyberChef/releases/tag/v8.15.0
[8.14.0]: https://github.com/gchq/CyberChef/releases/tag/v8.14.0
[8.13.0]: https://github.com/gchq/CyberChef/releases/tag/v8.13.0
Expand All @@ -99,7 +139,9 @@ All major and minor version changes will be documented in this file. Details of

[@n1474335]: https://github.com/n1474335
[@d98762625]: https://github.com/d98762625
[@j433866]: https://github.com/j433866
[@GCHQ77703]: https://github.com/GCHQ77703
[@h345983745]: https://github.com/h345983745
[@artemisbot]: https://github.com/artemisbot
[@picapi]: https://github.com/picapi
[@Dachande663]: https://github.com/Dachande663
Expand All @@ -112,6 +154,8 @@ All major and minor version changes will be documented in this file. Details of
[@jarmovanlenthe]: https://github.com/jarmovanlenthe
[@tcode2k16]: https://github.com/tcode2k16
[@Cynser]: https://github.com/Cynser
[@anthony-arnold]: https://github.com/anthony-arnold
[@masq]: https://github.com/masq

[#95]: https://github.com/gchq/CyberChef/pull/299
[#173]: https://github.com/gchq/CyberChef/pull/173
Expand All @@ -138,3 +182,13 @@ All major and minor version changes will be documented in this file. Details of
[#439]: https://github.com/gchq/CyberChef/pull/439
[#441]: https://github.com/gchq/CyberChef/pull/441
[#443]: https://github.com/gchq/CyberChef/pull/443
[#446]: https://github.com/gchq/CyberChef/pull/446
[#448]: https://github.com/gchq/CyberChef/pull/448
[#449]: https://github.com/gchq/CyberChef/pull/449
[#455]: https://github.com/gchq/CyberChef/pull/455
[#458]: https://github.com/gchq/CyberChef/pull/458
[#461]: https://github.com/gchq/CyberChef/pull/461
[#467]: https://github.com/gchq/CyberChef/pull/467
[#468]: https://github.com/gchq/CyberChef/pull/468
[#476]: https://github.com/gchq/CyberChef/pull/476
[#489]: https://github.com/gchq/CyberChef/pull/489
117 changes: 65 additions & 52 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const NodeExternals = require("webpack-node-externals");
const Inliner = require("web-resource-inliner");
const glob = require("glob");
Expand Down Expand Up @@ -29,8 +30,12 @@ module.exports = function (grunt) {
["clean:node", "clean:config", "exec:generateConfig", "webpack:node", "chmod:build"]);

grunt.registerTask("test",
"A task which runs all the tests in test/tests.",
["exec:generateConfig", "exec:tests"]);
"A task which runs all the operation tests in the tests directory.",
["exec:generateConfig", "exec:opTests"]);

grunt.registerTask("testui",
"A task which runs all the UI tests in the tests directory. The prod task must already have been run.",
["connect:prod", "exec:browserTests"]);

grunt.registerTask("docs",
"Compiles documentation in the /docs directory.",
Expand Down Expand Up @@ -66,6 +71,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-exec");
grunt.loadNpmTasks("grunt-accessibility");
grunt.loadNpmTasks("grunt-concurrent");
grunt.loadNpmTasks("grunt-contrib-connect");


// Project configuration
Expand Down Expand Up @@ -143,11 +149,11 @@ module.exports = function (grunt) {
options: {
configFile: "./.eslintrc.json"
},
configs: ["*.js"],
configs: ["*.{js,mjs}"],
core: ["src/core/**/*.{js,mjs}", "!src/core/vendor/**/*", "!src/core/operations/legacy/**/*"],
web: ["src/web/**/*.{js,mjs}"],
node: ["src/node/**/*.{js,mjs}"],
tests: ["test/**/*.{js,mjs}"],
tests: ["tests/**/*.{js,mjs}"],
},
jsdoc: {
options: {
Expand Down Expand Up @@ -179,37 +185,45 @@ module.exports = function (grunt) {
},
webpack: {
options: webpackConfig,
web: {
mode: "production",
target: "web",
entry: Object.assign({
main: "./src/web/index.js",
sitemap: "./src/web/static/sitemap.js"
}, moduleEntryPoints),
output: {
path: __dirname + "/build/prod"
},
resolve: {
alias: {
"./config/modules/OpModules": "./config/modules/Default"
}
},
plugins: [
new webpack.DefinePlugin(BUILD_CONSTANTS),
new HtmlWebpackPlugin({
filename: "index.html",
template: "./src/web/html/index.html",
chunks: ["main"],
compileTime: compileTime,
version: pkg.version,
minify: {
removeComments: true,
collapseWhitespace: true,
minifyJS: true,
minifyCSS: true
web: () => {
return {
mode: "production",
target: "web",
entry: Object.assign({
main: "./src/web/index.js",
sitemap: "./src/web/static/sitemap.js"
}, moduleEntryPoints),
output: {
path: __dirname + "/build/prod",
globalObject: "this"
},
resolve: {
alias: {
"./config/modules/OpModules": "./config/modules/Default"
}
}),
]
},
plugins: [
new webpack.DefinePlugin(BUILD_CONSTANTS),
new HtmlWebpackPlugin({
filename: "index.html",
template: "./src/web/html/index.html",
chunks: ["main"],
compileTime: compileTime,
version: pkg.version,
minify: {
removeComments: true,
collapseWhitespace: true,
minifyJS: true,
minifyCSS: true
}
}),
new BundleAnalyzerPlugin({
analyzerMode: "static",
reportFilename: "BundleAnalyzerReport.html",
openAnalyzer: false
}),
]
};
},
webInline: {
mode: "production",
Expand Down Expand Up @@ -238,19 +252,6 @@ module.exports = function (grunt) {
}),
]
},
tests: {
mode: "development",
target: "node",
entry: "./test/index.mjs",
externals: [NodeExternals()],
output: {
filename: "index.js",
path: __dirname + "/build/test"
},
plugins: [
new webpack.DefinePlugin(BUILD_CONSTANTS)
]
},
node: {
mode: "production",
target: "node",
Expand Down Expand Up @@ -299,6 +300,9 @@ module.exports = function (grunt) {
"./config/modules/OpModules": "./config/modules/Default"
}
},
output: {
globalObject: "this",
},
plugins: [
new webpack.DefinePlugin(BUILD_CONSTANTS),
new HtmlWebpackPlugin({
Expand All @@ -312,6 +316,14 @@ module.exports = function (grunt) {
}
}
},
connect: {
prod: {
options: {
port: 8000,
base: "build/prod/"
}
}
},
copy: {
ghPages: {
options: {
Expand Down Expand Up @@ -383,16 +395,17 @@ module.exports = function (grunt) {
generateConfig: {
command: [
"echo '\n--- Regenerating config files. ---'",
"mkdir -p src/core/config/modules",
"echo 'export default {};\n' > src/core/config/modules/OpModules.mjs",
"echo '[]\n' > src/core/config/OperationConfig.json",
"echo [] > src/core/config/OperationConfig.json",
"node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateOpsIndex.mjs",
"node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateConfig.mjs",
"echo '--- Config scripts finished. ---\n'"
].join(";")
},
tests: {
command: "node --experimental-modules --no-warnings --no-deprecation test/index.mjs"
opTests: {
command: "node --experimental-modules --no-warnings --no-deprecation tests/operations/index.mjs"
},
browserTests: {
command: "./node_modules/.bin/nightwatch --env prod,inline"
}
},
});
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = function(api) {
}]
],
"plugins": [
"babel-plugin-syntax-dynamic-import",
["babel-plugin-transform-builtin-extend", {
"globals": ["Error"]
}]
Expand Down
34 changes: 34 additions & 0 deletions nightwatch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"src_folders": ["tests/browser"],
"output_folder": "tests/browser/output",

"test_settings": {

"default": {
"launch_url": "http://localhost:8080",
"webdriver": {
"start_process": true,
"server_path": "./node_modules/.bin/chromedriver",
"port": 9515,
"log_path": false
},
"desiredCapabilities": {
"browserName": "chrome"
}
},

"dev": {
"launch_url": "http://localhost:8080"
},

"prod": {
"launch_url": "http://localhost:8000/index.html"
},

"inline": {
"launch_url": "http://localhost:8000/cyberchef.htm"
}

}
}

Loading