mirror of
https://github.com/gchq/CyberChef
synced 2024-11-14 08:37:07 +00:00
Merge branch 'nodejs16' of https://github.com/john19696/CyberChef into john19696-nodejs16
This commit is contained in:
commit
e43e010163
12 changed files with 18639 additions and 244 deletions
2
.github/workflows/master.yml
vendored
2
.github/workflows/master.yml
vendored
|
@ -14,7 +14,7 @@ jobs:
|
||||||
- name: Set node version
|
- name: Set node version
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '10.x'
|
node-version: '16.x'
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
run: |
|
run: |
|
||||||
|
|
2
.github/workflows/pull_requests.yml
vendored
2
.github/workflows/pull_requests.yml
vendored
|
@ -13,7 +13,7 @@ jobs:
|
||||||
- name: Set node version
|
- name: Set node version
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '10.x'
|
node-version: '16.x'
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
run: |
|
run: |
|
||||||
|
|
2
.github/workflows/releases.yml
vendored
2
.github/workflows/releases.yml
vendored
|
@ -14,7 +14,7 @@ jobs:
|
||||||
- name: Set node version
|
- name: Set node version
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '10.x'
|
node-version: '16.x'
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
run: |
|
run: |
|
||||||
|
|
2
.nvmrc
2
.nvmrc
|
@ -1 +1 @@
|
||||||
lts/dubnium
|
lts/gallium
|
||||||
|
|
16
Gruntfile.js
16
Gruntfile.js
|
@ -6,6 +6,8 @@ const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPl
|
||||||
const glob = require("glob");
|
const glob = require("glob");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
|
const nodeFlags = "--experimental-modules --experimental-json-modules --experimental-specifier-resolution=node --no-warnings --no-deprecation";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grunt configuration for building the app in various formats.
|
* Grunt configuration for building the app in various formats.
|
||||||
*
|
*
|
||||||
|
@ -349,15 +351,15 @@ module.exports = function (grunt) {
|
||||||
command: "git gc --prune=now --aggressive"
|
command: "git gc --prune=now --aggressive"
|
||||||
},
|
},
|
||||||
sitemap: {
|
sitemap: {
|
||||||
command: "node --experimental-modules --no-warnings --no-deprecation src/web/static/sitemap.mjs > build/prod/sitemap.xml",
|
command: `node ${nodeFlags} src/web/static/sitemap.mjs > build/prod/sitemap.xml`,
|
||||||
sync: true
|
sync: true
|
||||||
},
|
},
|
||||||
generateConfig: {
|
generateConfig: {
|
||||||
command: chainCommands([
|
command: chainCommands([
|
||||||
"echo '\n--- Regenerating config files. ---'",
|
"echo '\n--- Regenerating config files. ---'",
|
||||||
"echo [] > 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 ${nodeFlags} src/core/config/scripts/generateOpsIndex.mjs`,
|
||||||
"node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateConfig.mjs",
|
`node ${nodeFlags} src/core/config/scripts/generateConfig.mjs`,
|
||||||
"echo '--- Config scripts finished. ---\n'"
|
"echo '--- Config scripts finished. ---\n'"
|
||||||
]),
|
]),
|
||||||
sync: true
|
sync: true
|
||||||
|
@ -365,7 +367,7 @@ module.exports = function (grunt) {
|
||||||
generateNodeIndex: {
|
generateNodeIndex: {
|
||||||
command: chainCommands([
|
command: chainCommands([
|
||||||
"echo '\n--- Regenerating node index ---'",
|
"echo '\n--- Regenerating node index ---'",
|
||||||
"node --experimental-modules --no-warnings --no-deprecation src/node/config/scripts/generateNodeIndex.mjs",
|
`node ${nodeFlags} src/node/config/scripts/generateNodeIndex.mjs`,
|
||||||
"echo '--- Node index generated. ---\n'"
|
"echo '--- Node index generated. ---\n'"
|
||||||
]),
|
]),
|
||||||
sync: true
|
sync: true
|
||||||
|
@ -393,21 +395,21 @@ module.exports = function (grunt) {
|
||||||
testCJSNodeConsumer: {
|
testCJSNodeConsumer: {
|
||||||
command: chainCommands([
|
command: chainCommands([
|
||||||
`cd ${nodeConsumerTestPath}`,
|
`cd ${nodeConsumerTestPath}`,
|
||||||
"node --no-warnings cjs-consumer.js",
|
`node ${nodeFlags} cjs-consumer.js`,
|
||||||
]),
|
]),
|
||||||
stdout: false,
|
stdout: false,
|
||||||
},
|
},
|
||||||
testESMNodeConsumer: {
|
testESMNodeConsumer: {
|
||||||
command: chainCommands([
|
command: chainCommands([
|
||||||
`cd ${nodeConsumerTestPath}`,
|
`cd ${nodeConsumerTestPath}`,
|
||||||
"node --no-warnings --experimental-modules esm-consumer.mjs",
|
`node ${nodeFlags} esm-consumer.mjs`,
|
||||||
]),
|
]),
|
||||||
stdout: false,
|
stdout: false,
|
||||||
},
|
},
|
||||||
testESMDeepImportNodeConsumer: {
|
testESMDeepImportNodeConsumer: {
|
||||||
command: chainCommands([
|
command: chainCommands([
|
||||||
`cd ${nodeConsumerTestPath}`,
|
`cd ${nodeConsumerTestPath}`,
|
||||||
"node --no-warnings --experimental-modules esm-deep-import-consumer.mjs",
|
`node ${nodeFlags} esm-deep-import-consumer.mjs`,
|
||||||
]),
|
]),
|
||||||
stdout: false,
|
stdout: false,
|
||||||
},
|
},
|
||||||
|
|
18837
package-lock.json
generated
18837
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -43,7 +43,7 @@
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"babel-loader": "^8.2.2",
|
"babel-loader": "^8.2.2",
|
||||||
"babel-plugin-dynamic-import-node": "^2.3.3",
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
||||||
"chromedriver": "^92.0.1",
|
"chromedriver": "^97.0.1",
|
||||||
"cli-progress": "^3.9.0",
|
"cli-progress": "^3.9.0",
|
||||||
"colors": "^1.4.0",
|
"colors": "^1.4.0",
|
||||||
"copy-webpack-plugin": "^9.0.1",
|
"copy-webpack-plugin": "^9.0.1",
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
"imports-loader": "^3.0.0",
|
"imports-loader": "^3.0.0",
|
||||||
"mini-css-extract-plugin": "1.3.7",
|
"mini-css-extract-plugin": "1.3.7",
|
||||||
"nightwatch": "^1.7.8",
|
"nightwatch": "^1.7.8",
|
||||||
"node-sass": "^5.0.0",
|
"node-sass": "^6.0.0",
|
||||||
"postcss": "^8.3.6",
|
"postcss": "^8.3.6",
|
||||||
"postcss-css-variables": "^0.18.0",
|
"postcss-css-variables": "^0.18.0",
|
||||||
"postcss-import": "^14.0.2",
|
"postcss-import": "^14.0.2",
|
||||||
|
@ -169,13 +169,13 @@
|
||||||
"start": "npx grunt dev",
|
"start": "npx grunt dev",
|
||||||
"build": "npx grunt prod",
|
"build": "npx grunt prod",
|
||||||
"repl": "node src/node/repl.js",
|
"repl": "node src/node/repl.js",
|
||||||
"test": "npx grunt configTests && node --experimental-modules --no-warnings --no-deprecation tests/node/index.mjs && node --experimental-modules --no-warnings --no-deprecation tests/operations/index.mjs",
|
"test": "npx grunt configTests && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation tests/node/index.mjs && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation tests/operations/index.mjs",
|
||||||
"test-node-consumer": "npx grunt testnodeconsumer",
|
"test-node-consumer": "npx grunt testnodeconsumer",
|
||||||
"testui": "npx grunt testui",
|
"testui": "npx grunt testui",
|
||||||
"testuidev": "npx nightwatch --env=dev",
|
"testuidev": "npx nightwatch --env=dev",
|
||||||
"lint": "npx grunt lint",
|
"lint": "npx grunt lint",
|
||||||
"postinstall": "npx grunt exec:fixCryptoApiImports",
|
"postinstall": "npx grunt exec:fixCryptoApiImports",
|
||||||
"newop": "node --experimental-modules src/core/config/scripts/newOperation.mjs",
|
"newop": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newOperation.mjs",
|
||||||
"getheapsize": "node -e 'console.log(`node heap limit = ${require(\"v8\").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'",
|
"getheapsize": "node -e 'console.log(`node heap limit = ${require(\"v8\").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'",
|
||||||
"setheapsize": "export NODE_OPTIONS=--max_old_space_size=2048"
|
"setheapsize": "export NODE_OPTIONS=--max_old_space_size=2048"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import OperationError from "./OperationError.mjs";
|
import OperationError from "./OperationError.mjs";
|
||||||
import DishError from "./DishError.mjs";
|
import DishError from "./DishError.mjs";
|
||||||
import ExcludedOperationError from "./ExcludedOperationError";
|
import ExcludedOperationError from "./ExcludedOperationError.mjs";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
OperationError,
|
OperationError,
|
||||||
|
|
|
@ -41,7 +41,7 @@ let code = `/**
|
||||||
import NodeDish from "./NodeDish.mjs";
|
import NodeDish from "./NodeDish.mjs";
|
||||||
import { _wrap, help, bake, _explainExcludedFunction } from "./api.mjs";
|
import { _wrap, help, bake, _explainExcludedFunction } from "./api.mjs";
|
||||||
import File from "./File.mjs";
|
import File from "./File.mjs";
|
||||||
import { OperationError, DishError, ExcludedOperationError } from "../core/errors/index";
|
import { OperationError, DishError, ExcludedOperationError } from "../core/errors/index.mjs";
|
||||||
import {
|
import {
|
||||||
// import as core_ to avoid name clashes after wrap.
|
// import as core_ to avoid name clashes after wrap.
|
||||||
`;
|
`;
|
||||||
|
@ -52,7 +52,7 @@ includedOperations.forEach((op) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
code +=`
|
code +=`
|
||||||
} from "../core/operations/index";
|
} from "../core/operations/index.mjs";
|
||||||
|
|
||||||
global.File = File;
|
global.File = File;
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ import {
|
||||||
CSSMinify,
|
CSSMinify,
|
||||||
toBase64,
|
toBase64,
|
||||||
toHex
|
toHex
|
||||||
} from "../../../src/node/index";
|
} from "../../../src/node/index.mjs";
|
||||||
import chef from "../../../src/node/index.mjs";
|
import chef from "../../../src/node/index.mjs";
|
||||||
import TestRegister from "../../lib/TestRegister.mjs";
|
import TestRegister from "../../lib/TestRegister.mjs";
|
||||||
import File from "../../../src/node/File.mjs";
|
import File from "../../../src/node/File.mjs";
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* @license Apache-2.0
|
* @license Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import TestRegister from "../../lib/TestRegister";
|
import TestRegister from "../../lib/TestRegister.mjs";
|
||||||
|
|
||||||
TestRegister.addTests([
|
TestRegister.addTests([
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
* @copyright Karsten Silkenbäumer 2019
|
* @copyright Karsten Silkenbäumer 2019
|
||||||
* @license Apache-2.0
|
* @license Apache-2.0
|
||||||
*/
|
*/
|
||||||
import TestRegister from "../../lib/TestRegister";
|
import TestRegister from "../../lib/TestRegister.mjs";
|
||||||
import { BACON_ALPHABETS, BACON_TRANSLATIONS } from "../../../src/core/lib/Bacon";
|
import { BACON_ALPHABETS, BACON_TRANSLATIONS } from "../../../src/core/lib/Bacon.mjs";
|
||||||
|
|
||||||
const alphabets = Object.keys(BACON_ALPHABETS);
|
const alphabets = Object.keys(BACON_ALPHABETS);
|
||||||
const translations = BACON_TRANSLATIONS;
|
const translations = BACON_TRANSLATIONS;
|
||||||
|
|
Loading…
Reference in a new issue