Browse Source

Updated to Node 17

n1474335 3 năm trước cách đây
mục cha
commit
b09f98fbb4

+ 1 - 1
.github/workflows/master.yml

@@ -14,7 +14,7 @@ jobs:
     - name: Set node version
       uses: actions/setup-node@v1
       with:
-        node-version: '16.x'
+        node-version: '17.x'
 
     - name: Install
       run: |

+ 1 - 1
.github/workflows/pull_requests.yml

@@ -13,7 +13,7 @@ jobs:
     - name: Set node version
       uses: actions/setup-node@v1
       with:
-        node-version: '16.x'
+        node-version: '17.x'
 
     - name: Install
       run: |

+ 1 - 1
.github/workflows/releases.yml

@@ -14,7 +14,7 @@ jobs:
     - name: Set node version
       uses: actions/setup-node@v1
       with:
-        node-version: '16.x'
+        node-version: '17.x'
 
     - name: Install
       run: |

+ 1 - 1
.nvmrc

@@ -1 +1 @@
-lts/gallium
+17.*

+ 1 - 0
babel.config.js

@@ -11,6 +11,7 @@ module.exports = function(api) {
         ],
         "plugins": [
             "dynamic-import-node",
+            "@babel/plugin-syntax-import-assertions",
             [
                 "babel-plugin-transform-builtin-extend", {
                     "globals": ["Error"]

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 302 - 254
package-lock.json


+ 9 - 8
package.json

@@ -36,17 +36,20 @@
     "node >= 10"
   ],
   "devDependencies": {
-    "@babel/core": "^7.15.0",
-    "@babel/plugin-transform-runtime": "^7.15.0",
-    "@babel/preset-env": "^7.15.0",
+    "@babel/core": "^7.17.8",
+    "@babel/plugin-syntax-import-assertions": "^7.16.7",
+    "@babel/plugin-transform-runtime": "^7.17.0",
+    "@babel/preset-env": "^7.16.11",
+    "@babel/runtime": "^7.17.8",
     "autoprefixer": "^10.3.1",
     "babel-eslint": "^10.1.0",
-    "babel-loader": "^8.2.2",
+    "babel-loader": "^8.2.4",
     "babel-plugin-dynamic-import-node": "^2.3.3",
-    "chromedriver": "^97.0.1",
+    "chromedriver": "^99.0.0",
     "cli-progress": "^3.9.0",
     "colors": "^1.4.0",
     "copy-webpack-plugin": "^9.0.1",
+    "core-js": "^3.21.1",
     "css-loader": "5.2.7",
     "eslint": "^7.32.0",
     "exports-loader": "^3.0.0",
@@ -77,7 +80,7 @@
     "style-loader": "^3.2.1",
     "svg-url-loader": "^7.1.1",
     "url-loader": "^4.1.1",
-    "webpack": "^5.51.0",
+    "webpack": "^5.70.0",
     "webpack-bundle-analyzer": "^4.4.2",
     "webpack-dev-server": "3.11.2",
     "webpack-node-externals": "^3.0.0",
@@ -85,7 +88,6 @@
   },
   "dependencies": {
     "@babel/polyfill": "^7.12.1",
-    "@babel/runtime": "^7.15.3",
     "arrive": "^2.4.1",
     "avsc": "^5.7.3",
     "babel-plugin-transform-builtin-extend": "1.1.2",
@@ -101,7 +103,6 @@
     "cbor": "5.0.1",
     "chi-squared": "^1.1.0",
     "codepage": "^1.15.0",
-    "core-js": "^3.16.2",
     "crypto-api": "^0.8.5",
     "crypto-browserify": "^3.12.0",
     "crypto-js": "^4.1.1",

+ 1 - 1
src/core/ChefWorker.js

@@ -7,7 +7,7 @@
  */
 
 import Chef from "./Chef.mjs";
-import OperationConfig from "./config/OperationConfig.json";
+import OperationConfig from "./config/OperationConfig.json" assert {type: "json"};
 import OpModules from "./config/modules/OpModules.mjs";
 
 // Add ">" to the start of all log messages in the Chef Worker

+ 1 - 1
src/core/Recipe.mjs

@@ -4,7 +4,7 @@
  * @license Apache-2.0
  */
 
-import OperationConfig from "./config/OperationConfig.json";
+import OperationConfig from "./config/OperationConfig.json" assert {type: "json"};
 import OperationError from "./errors/OperationError.mjs";
 import Operation from "./Operation.mjs";
 import DishError from "./errors/DishError.mjs";

+ 1 - 1
src/core/lib/Magic.mjs

@@ -1,4 +1,4 @@
-import OperationConfig from "../config/OperationConfig.json";
+import OperationConfig from "../config/OperationConfig.json" assert {type: "json"};
 import Utils, { isWorkerEnvironment } from "../Utils.mjs";
 import Recipe from "../Recipe.mjs";
 import Dish from "../Dish.mjs";

+ 1 - 1
src/node/api.mjs

@@ -10,7 +10,7 @@
 
 import NodeDish from "./NodeDish.mjs";
 import NodeRecipe from "./NodeRecipe.mjs";
-import OperationConfig from "../core/config/OperationConfig.json";
+import OperationConfig from "../core/config/OperationConfig.json" assert {type: "json"};
 import { sanitise, removeSubheadingsFromArray, sentenceToCamelCase } from "./apiUtils.mjs";
 import ExcludedOperationError from "../core/errors/ExcludedOperationError.mjs";
 

+ 2 - 2
src/web/index.js

@@ -17,8 +17,8 @@ import * as CanvasComponents from "../core/lib/CanvasComponents.mjs";
 
 // CyberChef
 import App from "./App.mjs";
-import Categories from "../core/config/Categories.json";
-import OperationConfig from "../core/config/OperationConfig.json";
+import Categories from "../core/config/Categories.json" assert {type: "json"};
+import OperationConfig from "../core/config/OperationConfig.json" assert {type: "json"};
 
 
 /**

+ 1 - 1
src/web/static/sitemap.mjs

@@ -1,5 +1,5 @@
 import sm from "sitemap";
-import OperationConfig from "../../core/config/OperationConfig.json";
+import OperationConfig from "../../core/config/OperationConfig.json" assert {type: "json"};
 
 
 /**

+ 2 - 2
tests/node/tests/Categories.mjs

@@ -1,6 +1,6 @@
 import TestRegister from "../../lib/TestRegister.mjs";
-import Categories from "../../../src/core/config/Categories.json";
-import OperationConfig from "../../../src/core/config/OperationConfig.json";
+import Categories from "../../../src/core/config/Categories.json" assert {type: "json"};
+import OperationConfig from "../../../src/core/config/OperationConfig.json" assert {type: "json"};
 import it from "../assertionHandler.mjs";
 import assert from "assert";
 

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác