From b40f899840a736569f1a4f450f2416414c60b79e Mon Sep 17 00:00:00 2001 From: jszuminski Date: Tue, 16 Jul 2024 15:25:45 +0200 Subject: [PATCH 1/6] Remove colors, add test_utils, slight logging refactor. --- install.js | 16 +- lib/index.js | 2 - lib/logger.js | 30 ++- lib/utils.js | 14 +- package-lock.json | 344 +++++++++++++------------- package.json | 1 - tests/cli/cli_test_runner.js | 43 ++-- tests/cli/cli_test_runner_single.js | 33 +-- tests/http/http_test_runner.js | 47 ++-- tests/http/http_test_runner_single.js | 40 ++- tests/node/node_test_runner.js | 34 +-- tests/node/node_test_runner_single.js | 27 +- tests/other/private_range_url.js | 7 +- tests/other/side_by_side.js | 17 +- tests/other/stress_test.js | 10 +- tests/test_utils.js | 43 ++++ 16 files changed, 354 insertions(+), 354 deletions(-) create mode 100644 tests/test_utils.js diff --git a/install.js b/install.js index d376b51a..c773094d 100644 --- a/install.js +++ b/install.js @@ -16,21 +16,23 @@ import { readFileSync } from 'fs'; import { join } from 'path'; import { __dirname } from './lib/utils.js'; - -import 'colors'; +import { style } from './lib/logger.js'; const pkgFile = JSON.parse(readFileSync(join(__dirname, 'package.json'))); console.log( - ` -Highcharts Export Server V${pkgFile.version} + `${style.green} +Highcharts Export Server v${pkgFile.version} -${'This software requires a valid Highcharts license for commercial use.'.yellow} +${style.yellow}This software requires a valid Highcharts license for commercial use.${style.reset} +${style.yellow} If you do not have a license, one can be obtained here: -${'https://shop.highsoft.com/'.green} +https://shop.highsoft.com/ +${style.reset} To customize your installation (include additional/fewer modules and so on), please refer to the readme file. -`.green +${style.reset} +` ); diff --git a/lib/index.js b/lib/index.js index 57eeb303..2ea15ef4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -12,8 +12,6 @@ See LICENSE file in root for details. *******************************************************************************/ -import 'colors'; - import { checkAndUpdateCache } from './cache.js'; import { batchExport, diff --git a/lib/logger.js b/lib/logger.js index 8d7374fd..48f3a384 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -14,6 +14,20 @@ See LICENSE file in root for details. import { appendFile, existsSync, mkdirSync } from 'fs'; +// Map of styles (colors, thickness) and their ANSI escape codes +// used instead of the 'colors' package; +export const style = { + red: '\x1b[31m', + yellow: '\x1b[33m', + blue: '\x1b[34m', + green: '\x1b[32m', + white: '\x1b[37m', + gray: '\x1b[90m', + reset: '\x1b[0m', + bold: '\x1b[1m', + underline: '\x1b[4m' +}; + // The available colors const colors = ['red', 'yellow', 'blue', 'gray', 'green']; @@ -118,7 +132,11 @@ export const log = (...args) => { if (logging.toConsole) { console.log.apply( undefined, - [prefix.toString()[logging.levelsDesc[newLevel - 1].color]].concat(texts) + [ + `${style[logging.levelsDesc[newLevel - 1].color]}`, + prefix.toString(), + `${style.reset}` + ].concat(texts) ); } @@ -168,11 +186,11 @@ export const logWithStack = (newLevel, error, customMessage) => { if (logging.toConsole) { console.log.apply( undefined, - [prefix.toString()[logging.levelsDesc[newLevel - 1].color]].concat([ - mainMessage[colors[newLevel - 1]], - '\n', - stackMessage - ]) + [ + `${style[logging.levelsDesc[newLevel - 1].color]}`, + prefix.toString(), + `${style.reset}` + ].concat([mainMessage[colors[newLevel - 1]], '\n', stackMessage]) ); } diff --git a/lib/utils.js b/lib/utils.js index 6823c003..f7b48055 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -17,7 +17,7 @@ import { join } from 'path'; import { fileURLToPath } from 'url'; import { defaultConfig } from '../lib/schemas/config.js'; -import { log, logWithStack } from './logger.js'; +import { log, style, logWithStack } from './logger.js'; const MAX_BACKOFF_ATTEMPTS = 6; @@ -327,8 +327,8 @@ export const printLogo = (noLogo) => { // Print the logo console.log( - readFileSync(__dirname + '/msg/startup.msg').toString().bold.yellow, - `v${packageVersion}\n`.bold + `${style.bold} ${style.yellow} ${readFileSync(__dirname + '/msg/startup.msg').toString()}`, + `${style.bold}v${packageVersion}${style.reset}\n` ); }; @@ -342,9 +342,9 @@ export function printUsage() { // Display readme information console.log( - '\nUsage of CLI arguments:'.bold, - '\n------', - `\nFor more detailed information, visit the readme at: ${readme.bold.yellow}.` + `${style.bold}\nUsage of CLI arguments:${style.reset} + \n------', + \nFor more detailed information, visit the readme at: ${style.bold}${style.yellow}${readme}${style.reset}.` ); const cycleCategories = (options) => { @@ -366,7 +366,7 @@ export function printUsage() { console.log( descName, option.description, - `[Default: ${option.value.toString().bold}]`.blue + `${style.blue}${style.bold}[Default: ${option.value.toString()}] ${style.reset}` ); } } diff --git a/package-lock.json b/package-lock.json index 63ce1fdb..cde28d7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "colors": "1.4.0", "cors": "^2.8.5", "dompurify": "^3.1.5", "dotenv": "^16.4.5", @@ -73,9 +72,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.7.tgz", - "integrity": "sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==", + "version": "7.24.9", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.9.tgz", + "integrity": "sha512-e701mcfApCJqMMueQI0Fb68Amflj83+dvAvHawoBpAz+GDjCIyGHzNwnefjsWJ3xiYAqqiQFoWbspGYBdb2/ng==", "dev": true, "license": "MIT", "engines": { @@ -83,22 +82,22 @@ } }, "node_modules/@babel/core": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.7.tgz", - "integrity": "sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==", + "version": "7.24.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.9.tgz", + "integrity": "sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==", "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.24.7", - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helpers": "^7.24.7", - "@babel/parser": "^7.24.7", + "@babel/generator": "^7.24.9", + "@babel/helper-compilation-targets": "^7.24.8", + "@babel/helper-module-transforms": "^7.24.9", + "@babel/helpers": "^7.24.8", + "@babel/parser": "^7.24.8", "@babel/template": "^7.24.7", - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7", + "@babel/traverse": "^7.24.8", + "@babel/types": "^7.24.9", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -114,13 +113,13 @@ } }, "node_modules/@babel/generator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", - "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", + "version": "7.24.10", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.10.tgz", + "integrity": "sha512-o9HBZL1G2129luEUlG1hB4N/nlYNWHnpwlND9eOMclRqqu1YDy2sSYVCFUZwl8I1Gxh+QSRrP2vD7EpUmFVXxg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.24.7", + "@babel/types": "^7.24.9", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" @@ -130,15 +129,15 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.7.tgz", - "integrity": "sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.8.tgz", + "integrity": "sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.24.7", - "@babel/helper-validator-option": "^7.24.7", - "browserslist": "^4.22.2", + "@babel/compat-data": "^7.24.8", + "@babel/helper-validator-option": "^7.24.8", + "browserslist": "^4.23.1", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -201,9 +200,9 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.24.7.tgz", - "integrity": "sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==", + "version": "7.24.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.24.9.tgz", + "integrity": "sha512-oYbh+rtFKj/HwBQkFlUzvcybzklmVdVV3UU+mN7n2t/q3yGHbuVdNxyFvSBO1tfvjyArpHNcWMAzsSPdyI46hw==", "dev": true, "license": "MIT", "dependencies": { @@ -221,9 +220,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.7.tgz", - "integrity": "sha512-Rq76wjt7yz9AAc1KnlRKNAi/dMSVWgDRx43FHoJEbcYU6xOWaE2dVPwcdTukJrjxS65GITyfbvEYHvkirZ6uEg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", + "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", "dev": true, "license": "MIT", "engines": { @@ -258,9 +257,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", - "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", "dev": true, "license": "MIT", "engines": { @@ -277,9 +276,9 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.7.tgz", - "integrity": "sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", + "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", "dev": true, "license": "MIT", "engines": { @@ -287,14 +286,14 @@ } }, "node_modules/@babel/helpers": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.7.tgz", - "integrity": "sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.8.tgz", + "integrity": "sha512-gV2265Nkcz7weJJfvDoAEVzC1e2OTDpkGbEsebse8koXUJUXPsCMi7sRo/+SPMuMZ9MtUPnGwITTnQnU5YjyaQ==", "dev": true, "license": "MIT", "dependencies": { "@babel/template": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/types": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -387,9 +386,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", - "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.8.tgz", + "integrity": "sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w==", "dev": true, "license": "MIT", "bin": { @@ -606,20 +605,20 @@ } }, "node_modules/@babel/traverse": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.7.tgz", - "integrity": "sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.8.tgz", + "integrity": "sha512-t0P1xxAPzEDcEPmjprAQq19NWum4K0EQPjMwZQZbHt+GiZqvjCHjj755Weq1YRPVzBI+3zSfvScfpnuIecVFJQ==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.24.7", + "@babel/generator": "^7.24.8", "@babel/helper-environment-visitor": "^7.24.7", "@babel/helper-function-name": "^7.24.7", "@babel/helper-hoist-variables": "^7.24.7", "@babel/helper-split-export-declaration": "^7.24.7", - "@babel/parser": "^7.24.7", - "@babel/types": "^7.24.7", + "@babel/parser": "^7.24.8", + "@babel/types": "^7.24.8", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -638,13 +637,13 @@ } }, "node_modules/@babel/types": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", - "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "version": "7.24.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.9.tgz", + "integrity": "sha512-xm8XrMKz0IlUdocVbYJe0Z9xEgidU7msskG8BbhnTPK/HZ2z/7FP7ykqPgrUH+C+r414mNfNWam1f2vqOjqjYQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-string-parser": "^7.24.8", "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, @@ -1220,9 +1219,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true, "license": "MIT" }, @@ -1384,9 +1383,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", - "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.1.tgz", + "integrity": "sha512-lncuC4aHicncmbORnx+dUaAgzee9cm/PbIqgWz1PpXuwc+sa1Ct83tnqUDy/GFKleLiN7ZIeytM6KJ4cAn1SxA==", "cpu": [ "arm" ], @@ -1398,9 +1397,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", - "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.1.tgz", + "integrity": "sha512-F/tkdw0WSs4ojqz5Ovrw5r9odqzFjb5LIgHdHZG65dFI1lWTWRVy32KDJLKRISHgJvqUeUhdIvy43fX41znyDg==", "cpu": [ "arm64" ], @@ -1412,9 +1411,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", - "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.1.tgz", + "integrity": "sha512-vk+ma8iC1ebje/ahpxpnrfVQJibTMyHdWpOGZ3JpQ7Mgn/3QNHmPq7YwjZbIE7km73dH5M1e6MRRsnEBW7v5CQ==", "cpu": [ "arm64" ], @@ -1426,9 +1425,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", - "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.1.tgz", + "integrity": "sha512-IgpzXKauRe1Tafcej9STjSSuG0Ghu/xGYH+qG6JwsAUxXrnkvNHcq/NL6nz1+jzvWAnQkuAJ4uIwGB48K9OCGA==", "cpu": [ "x64" ], @@ -1440,9 +1439,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", - "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.1.tgz", + "integrity": "sha512-P9bSiAUnSSM7EmyRK+e5wgpqai86QOSv8BwvkGjLwYuOpaeomiZWifEos517CwbG+aZl1T4clSE1YqqH2JRs+g==", "cpu": [ "arm" ], @@ -1454,9 +1453,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", - "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.1.tgz", + "integrity": "sha512-5RnjpACoxtS+aWOI1dURKno11d7krfpGDEn19jI8BuWmSBbUC4ytIADfROM1FZrFhQPSoP+KEa3NlEScznBTyQ==", "cpu": [ "arm" ], @@ -1468,9 +1467,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", - "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.1.tgz", + "integrity": "sha512-8mwmGD668m8WaGbthrEYZ9CBmPug2QPGWxhJxh/vCgBjro5o96gL04WLlg5BA233OCWLqERy4YUzX3bJGXaJgQ==", "cpu": [ "arm64" ], @@ -1482,9 +1481,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", - "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.1.tgz", + "integrity": "sha512-dJX9u4r4bqInMGOAQoGYdwDP8lQiisWb9et+T84l2WXk41yEej8v2iGKodmdKimT8cTAYt0jFb+UEBxnPkbXEQ==", "cpu": [ "arm64" ], @@ -1496,9 +1495,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", - "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.1.tgz", + "integrity": "sha512-V72cXdTl4EI0x6FNmho4D502sy7ed+LuVW6Ym8aI6DRQ9hQZdp5sj0a2usYOlqvFBNKQnLQGwmYnujo2HvjCxQ==", "cpu": [ "ppc64" ], @@ -1510,9 +1509,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", - "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.1.tgz", + "integrity": "sha512-f+pJih7sxoKmbjghrM2RkWo2WHUW8UbfxIQiWo5yeCaCM0TveMEuAzKJte4QskBp1TIinpnRcxkquY+4WuY/tg==", "cpu": [ "riscv64" ], @@ -1524,9 +1523,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", - "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.1.tgz", + "integrity": "sha512-qb1hMMT3Fr/Qz1OKovCuUM11MUNLUuHeBC2DPPAWUYYUAOFWaxInaTwTQmc7Fl5La7DShTEpmYwgdt2hG+4TEg==", "cpu": [ "s390x" ], @@ -1538,9 +1537,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", - "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.1.tgz", + "integrity": "sha512-7O5u/p6oKUFYjRbZkL2FLbwsyoJAjyeXHCU3O4ndvzg2OFO2GinFPSJFGbiwFDaCFc+k7gs9CF243PwdPQFh5g==", "cpu": [ "x64" ], @@ -1552,9 +1551,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", - "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.1.tgz", + "integrity": "sha512-pDLkYITdYrH/9Cv/Vlj8HppDuLMDUBmgsM0+N+xLtFd18aXgM9Nyqupb/Uw+HeidhfYg2lD6CXvz6CjoVOaKjQ==", "cpu": [ "x64" ], @@ -1566,9 +1565,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", - "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.1.tgz", + "integrity": "sha512-W2ZNI323O/8pJdBGil1oCauuCzmVd9lDmWBBqxYZcOqWD6aWqJtVBQ1dFrF4dYpZPks6F+xCZHfzG5hYlSHZ6g==", "cpu": [ "arm64" ], @@ -1580,9 +1579,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", - "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.1.tgz", + "integrity": "sha512-ELfEX1/+eGZYMaCIbK4jqLxO1gyTSOIlZr6pbC4SRYFaSIDVKOnZNMdoZ+ON0mrFDp4+H5MhwNC1H/AhE3zQLg==", "cpu": [ "ia32" ], @@ -1594,9 +1593,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", - "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.1.tgz", + "integrity": "sha512-yjk2MAkQmoaPYCSu35RLJ62+dz358nE83VfTePJRp8CG7aMg25mEJYpXFiD+NcevhX8LxD5OP5tktPXnXN7GDw==", "cpu": [ "x64" ], @@ -1737,9 +1736,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.14.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", - "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", + "version": "20.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", + "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", "devOptional": true, "license": "MIT", "dependencies": { @@ -2369,9 +2368,9 @@ } }, "node_modules/browserslist": { - "version": "4.23.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", - "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", + "version": "4.23.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz", + "integrity": "sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==", "dev": true, "funding": [ { @@ -2389,10 +2388,10 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001629", - "electron-to-chromium": "^1.4.796", + "caniuse-lite": "^1.0.30001640", + "electron-to-chromium": "^1.4.820", "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.16" + "update-browserslist-db": "^1.1.0" }, "bin": { "browserslist": "cli.js" @@ -2509,9 +2508,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001640", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001640.tgz", - "integrity": "sha512-lA4VMpW0PSUrFnkmVuEKBUovSWKhj7puyCg8StBChgu298N1AtuF1sKWEvfDuimSEDbhlb/KqPKC3fs1HbuQUA==", + "version": "1.0.30001642", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001642.tgz", + "integrity": "sha512-3XQ0DoRgLijXJErLSl+bLnJ+Et4KqV1PY6JJBGAFlsNsz31zeAIncyeZfLCabHK/jtSh+671RM9YMldxjUPZtA==", "dev": true, "funding": [ { @@ -2595,9 +2594,9 @@ } }, "node_modules/chromium-bidi": { - "version": "0.5.24", - "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.5.24.tgz", - "integrity": "sha512-5xQNN2SVBdZv4TxeMLaI+PelrnZsHDhn8h2JtyriLr+0qHcZS8BMuo93qN6J1VmtmrgYP+rmcLHcbpnA8QJh+w==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.6.0.tgz", + "integrity": "sha512-VnxVrpGojAjkiGFN2I+KtsDILFAjiGWVEDizOEnKzEDkT93eQT1cqTfUkqmOyLq33i1q4a1KDYbH+52CUe4Ufw==", "license": "Apache-2.0", "dependencies": { "mitt": "3.0.1", @@ -2767,15 +2766,6 @@ "dev": true, "license": "MIT" }, - "node_modules/colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "license": "MIT", - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -3211,9 +3201,9 @@ } }, "node_modules/dompurify": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.5.tgz", - "integrity": "sha512-lwG+n5h8QNpxtyrJW/gJWckL+1/DQiYMX8f7t8Z2AZTPw1esVrqjI63i7Zc2Gz0aKzLVMYC1V1PL/ky+aY/NgA==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.6.tgz", + "integrity": "sha512-cTOAhc36AalkjtBpfG6O8JimdTMWNXjiePT2xQH/ppBGi/4uIpmj8eKyIkMJErXWARyINV/sB38yf8JCLF5pbQ==", "license": "(MPL-2.0 OR Apache-2.0)" }, "node_modules/dotenv": { @@ -3235,9 +3225,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.4.816", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.816.tgz", - "integrity": "sha512-EKH5X5oqC6hLmiS7/vYtZHZFTNdhsYG5NVPRN6Yn0kQHNBlT59+xSM8HBy66P5fxWpKgZbPqb+diC64ng295Jw==", + "version": "1.4.828", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.828.tgz", + "integrity": "sha512-QOIJiWpQJDHAVO4P58pwb133Cwee0nbvy/MV1CwzZVGpkH1RX33N3vsaWRCpR6bF63AAq366neZrRTu7Qlsbbw==", "dev": true, "license": "ISC" }, @@ -3763,9 +3753,9 @@ } }, "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -6659,9 +6649,9 @@ } }, "node_modules/nwsapi": { - "version": "2.2.10", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.10.tgz", - "integrity": "sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ==", + "version": "2.2.12", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.12.tgz", + "integrity": "sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==", "license": "MIT" }, "node_modules/object-assign": { @@ -7127,9 +7117,9 @@ } }, "node_modules/prettier": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", - "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, "license": "MIT", "bin": { @@ -7291,16 +7281,16 @@ } }, "node_modules/puppeteer": { - "version": "22.12.1", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-22.12.1.tgz", - "integrity": "sha512-1GxY8dnEnHr1SLzdSDr0FCjM6JQfAh2E2I/EqzeF8a58DbGVk9oVjj4lFdqNoVbpgFSpAbz7VER9St7S1wDpNg==", + "version": "22.13.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-22.13.0.tgz", + "integrity": "sha512-nmICzeHTBtZiu+y4vs0fboe/NKIFwH5W8RZuxmEVAKNfBQg/8u5FEQAvPlWmyVpJoAVM5kXD5PEl3GlK3F9pPA==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { "@puppeteer/browsers": "2.2.3", "cosmiconfig": "^9.0.0", "devtools-protocol": "0.0.1299070", - "puppeteer-core": "22.12.1" + "puppeteer-core": "22.13.0" }, "bin": { "puppeteer": "lib/esm/puppeteer/node/cli.js" @@ -7310,16 +7300,16 @@ } }, "node_modules/puppeteer-core": { - "version": "22.12.1", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-22.12.1.tgz", - "integrity": "sha512-XmqeDPVdC5/3nGJys1jbgeoZ02wP0WV1GBlPtr/ULRbGXJFuqgXMcKQ3eeNtFpBzGRbpeoCGWHge1ZWKWl0Exw==", + "version": "22.13.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-22.13.0.tgz", + "integrity": "sha512-ZkpRX8nm/S39BnpcCverMzIc6oGWBPOUeOeaWRLKHqiKVCZ1l28HxPTYLitJlDiB16xZATSKpjul+sl+ZEm0HQ==", "license": "Apache-2.0", "dependencies": { "@puppeteer/browsers": "2.2.3", - "chromium-bidi": "0.5.24", + "chromium-bidi": "0.6.0", "debug": "^4.3.5", "devtools-protocol": "0.0.1299070", - "ws": "^8.17.1" + "ws": "^8.18.0" }, "engines": { "node": ">=18" @@ -7612,9 +7602,9 @@ } }, "node_modules/rollup": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", - "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.1.tgz", + "integrity": "sha512-Elx2UT8lzxxOXMpy5HWQGZqkrQOtrVDDa/bm9l10+U4rQnVzbL/LgZ4NOM1MPIDyHk69W4InuYDF5dzRh4Kw1A==", "dev": true, "license": "MIT", "dependencies": { @@ -7628,22 +7618,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.18.0", - "@rollup/rollup-android-arm64": "4.18.0", - "@rollup/rollup-darwin-arm64": "4.18.0", - "@rollup/rollup-darwin-x64": "4.18.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", - "@rollup/rollup-linux-arm-musleabihf": "4.18.0", - "@rollup/rollup-linux-arm64-gnu": "4.18.0", - "@rollup/rollup-linux-arm64-musl": "4.18.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", - "@rollup/rollup-linux-riscv64-gnu": "4.18.0", - "@rollup/rollup-linux-s390x-gnu": "4.18.0", - "@rollup/rollup-linux-x64-gnu": "4.18.0", - "@rollup/rollup-linux-x64-musl": "4.18.0", - "@rollup/rollup-win32-arm64-msvc": "4.18.0", - "@rollup/rollup-win32-ia32-msvc": "4.18.0", - "@rollup/rollup-win32-x64-msvc": "4.18.0", + "@rollup/rollup-android-arm-eabi": "4.18.1", + "@rollup/rollup-android-arm64": "4.18.1", + "@rollup/rollup-darwin-arm64": "4.18.1", + "@rollup/rollup-darwin-x64": "4.18.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.18.1", + "@rollup/rollup-linux-arm-musleabihf": "4.18.1", + "@rollup/rollup-linux-arm64-gnu": "4.18.1", + "@rollup/rollup-linux-arm64-musl": "4.18.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.18.1", + "@rollup/rollup-linux-riscv64-gnu": "4.18.1", + "@rollup/rollup-linux-s390x-gnu": "4.18.1", + "@rollup/rollup-linux-x64-gnu": "4.18.1", + "@rollup/rollup-linux-x64-musl": "4.18.1", + "@rollup/rollup-win32-arm64-msvc": "4.18.1", + "@rollup/rollup-win32-ia32-msvc": "4.18.1", + "@rollup/rollup-win32-x64-msvc": "4.18.1", "fsevents": "~2.3.2" } }, @@ -8391,9 +8381,9 @@ } }, "node_modules/terser": { - "version": "5.31.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.1.tgz", - "integrity": "sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg==", + "version": "5.31.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.2.tgz", + "integrity": "sha512-LGyRZVFm/QElZHy/CPr/O4eNZOZIzsrQ92y4v9UJe/pFJjypje2yI3C2FmPtvUEnhadlSbmG2nXtdcjHOjCfxw==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -8443,9 +8433,9 @@ } }, "node_modules/text-decoder": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.1.0.tgz", - "integrity": "sha512-TmLJNj6UgX8xcUZo4UDStGQtDiTzF7BzWlzn9g7UWrjkpHr5uJTK1ld16wZ3LXb2vb6jH8qU89dW5whuMdXYdw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.1.1.tgz", + "integrity": "sha512-8zll7REEv4GDD3x4/0pW+ppIxSNs7H1J10IKFZsuOMscumCdM2a+toDGLPA3T+1+fLBql4zbt5z83GEQGGV5VA==", "license": "Apache-2.0", "dependencies": { "b4a": "^1.6.4" diff --git a/package.json b/package.json index fffe9b8b..f79ac423 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "rollup": "^4.18.0" }, "dependencies": { - "colors": "1.4.0", "cors": "^2.8.5", "dompurify": "^3.1.5", "dotenv": "^16.4.5", diff --git a/tests/cli/cli_test_runner.js b/tests/cli/cli_test_runner.js index 5bd02a4c..830ec042 100644 --- a/tests/cli/cli_test_runner.js +++ b/tests/cli/cli_test_runner.js @@ -17,23 +17,19 @@ import { existsSync, mkdirSync, readdirSync, readFileSync } from 'fs'; import { join } from 'path'; import { promisify } from 'util'; -import 'colors'; - import { __dirname } from '../../lib/utils.js'; +import { + showStartingTestMessage, + showProcessingTestMessage, + showFailOrSuccessMessage, + showTestResults +} from '../test_utils.js'; + +showStartingTestMessage(); // Convert from callback to promise const spawn = promisify(exec); -// Test runner message -console.log( - 'Highcharts Export Server CLI Test Runner'.yellow.bold.underline, - '\nThis tool simulates the CLI commands sent to Highcharts Export Server.' - .green, - '\nLoads all JSON files from the ./tests/cli folder and runs them sequentially.' - .green, - '\nThe results are stored in the ./tests/cli/_results.\n'.green -); - // Results and scenarios paths const resultsPath = join(__dirname, 'tests', 'cli', '_results'); const scenariosPath = join(__dirname, 'tests', 'cli', 'scenarios'); @@ -52,7 +48,7 @@ for (const file of files.filter((file) => file.endsWith('.json'))) { // For a separate CLI command trigger await (async (file) => { try { - console.log('[Test runner]'.blue, `Processing test ${file}.`); + showProcessingTestMessage(file); // Read a CLI file const cliJson = JSON.parse(readFileSync(join(scenariosPath, file))); @@ -93,13 +89,11 @@ for (const file of files.filter((file) => file.endsWith('.json'))) { } testCounter++; - const endMessage = `CLI command from file: ${file}, took ${ - new Date().getTime() - startDate - }ms.`; - - console.log( - didFail ? `[Fail] ${endMessage}`.red : `[Success] ${endMessage}`.green, - '\n' + showFailOrSuccessMessage( + didFail, + `CLI command from file: ${file}, took ${ + new Date().getTime() - startDate + }ms.` ); } catch (error) { console.error(error); @@ -107,11 +101,4 @@ for (const file of files.filter((file) => file.endsWith('.json'))) { })(file); } -// Display the results in numbers -console.log( - '--------------------------------', - failsCounter - ? `\n${testCounter} tests done, ${failsCounter} error(s) found!`.red - : `\n${testCounter} tests done, errors not found!`.green, - '\n--------------------------------' -); +showTestResults(testCounter, failsCounter); diff --git a/tests/cli/cli_test_runner_single.js b/tests/cli/cli_test_runner_single.js index 985f6ea8..d5b2a5be 100644 --- a/tests/cli/cli_test_runner_single.js +++ b/tests/cli/cli_test_runner_single.js @@ -16,17 +16,14 @@ import { exec as spawn } from 'child_process'; import { existsSync, mkdirSync, readFileSync } from 'fs'; import { basename, join } from 'path'; -import 'colors'; - import { __dirname } from '../../lib/utils.js'; +import { + showStartingTestMessage, + showProcessingTestMessage, + showFailOrSuccessMessage +} from '../test_utils.js'; -// Test runner message -console.log( - 'Highcharts Export Server CLI Test Runner'.yellow.bold.underline, - '\nThis tool simulates the CLI commands to Highcharts Export Server.'.green, - '\nLoads a specified JSON file and runs it'.green, - '(results are stored in the ./tests/cli/_results).\n'.green -); +showStartingTestMessage(); // Results and scenarios paths const resultsPath = join(__dirname, 'tests', 'cli', '_results'); @@ -40,7 +37,7 @@ const file = process.argv[2]; // Check if file even exists and if it is a JSON if (existsSync(file) && file.endsWith('.json')) { try { - console.log('[Test runner]'.blue, `Processing test ${file}.`); + showProcessingTestMessage(file); // Read a CLI file const cliJson = JSON.parse(readFileSync(file)); @@ -77,16 +74,12 @@ if (existsSync(file) && file.endsWith('.json')) { // Close event for a process process.on('exit', (code) => { - const endMessage = `CLI command from file: ${file}, took ${ - new Date().getTime() - startDate - }ms.`; - - // If code is 1, it means that export server thrown an error - if (code === 1) { - return console.error(`[Fail] ${endMessage}`.red); - } - - console.log(`[Success] ${endMessage}`.green); + showFailOrSuccessMessage( + code === 1, + `CLI command from file: ${file}, took ${ + new Date().getTime() - startDate + }ms.` + ); }); } catch (error) { console.error(error); diff --git a/tests/http/http_test_runner.js b/tests/http/http_test_runner.js index fbb0cec0..24dddd7d 100644 --- a/tests/http/http_test_runner.js +++ b/tests/http/http_test_runner.js @@ -22,19 +22,18 @@ import { import http from 'http'; import { join } from 'path'; -import 'colors'; - import { fetch } from '../../lib/fetch.js'; import { __dirname, clearText } from '../../lib/utils.js'; +import { style } from '../../lib/logger.js'; +import { + showStartingTestMessage, + showProcessingTestMessage, + showFailOrSuccessMessage, + showTestResults, + showConnectionErrorMessage +} from '../test_utils.js'; -// Test runner message -console.log( - 'Highcharts Export Server HTTP Requests Test Runner'.yellow.bold.underline, - '\nThis tool simulates POST requests to Highcharts Export Server.'.green, - '\nThe server needs to be started before running this test.'.green, - '\nLoads all JSON files from the ./tests/http folder and runs them'.green, - '(results are stored in the ./tests/http/_results).\n'.green -); +showStartingTestMessage(); // Url of Puppeteer export server const url = 'http://127.0.0.1:7801'; @@ -63,7 +62,7 @@ fetch(`${url}/health`) .filter((file) => file.endsWith('.json')) .map(async (file) => { try { - console.log('[Test runner]'.blue, `Processing test ${file}.`); + showProcessingTestMessage(file); // A file path const filePath = join(scenariosPath, file); @@ -109,18 +108,19 @@ fetch(`${url}/health`) response.on('end', () => { fileStream.end(); - const endMessage = `HTTP request with a payload from file: ${file}, took ${ - new Date().getTime() - startDate - }ms.`; + showFailOrSuccessMessage( + response.statusCode >= 400, + `HTTP request with a payload from file: ${file}, took ${ + new Date().getTime() - startDate + }ms.` + ); - // Based on received status code check if requests failed if (response.statusCode >= 400) { failsCounter++; - console.log(`[Fail] ${endMessage}`.red); } else { testCounter++; - console.log(`[Success] ${endMessage}`.green); } + resolve(); }); } @@ -133,20 +133,11 @@ fetch(`${url}/health`) } }) ).then(() => { - console.log( - '\n--------------------------------', - failsCounter - ? `\n${testCounter} tests done, ${failsCounter} error(s) found!`.red - : `\n${testCounter} tests done, errors not found!`.green, - '\n--------------------------------' - ); + showTestResults(testCounter, failsCounter); }); }) .catch((error) => { if (error.code === 'ECONNREFUSED') { - return console.log( - `[ERROR] Couldn't connect to ${url}.`.red, - `Set your server before running tests.`.red - ); + return showConnectionErrorMessage(url); } }); diff --git a/tests/http/http_test_runner_single.js b/tests/http/http_test_runner_single.js index 12241029..ebf90ca7 100644 --- a/tests/http/http_test_runner_single.js +++ b/tests/http/http_test_runner_single.js @@ -16,19 +16,16 @@ import { createWriteStream, existsSync, mkdirSync, readFileSync } from 'fs'; import http from 'http'; import { basename, join } from 'path'; -import 'colors'; - import { fetch } from '../../lib/fetch.js'; import { __dirname, clearText } from '../../lib/utils.js'; +import { + showStartingTestMessage, + showProcessingTestMessage, + showFailOrSuccessMessage, + showConnectionErrorMessage +} from '../test_utils.js'; -// Test runner message -console.log( - 'Highcharts Export Server HTTP Requests Test Runner'.yellow.bold.underline, - '\nThis tool simulates POST requests to Highcharts Export Server.'.green, - '\nThe server needs to be started before running this test.'.green, - '\nLoads a specified JSON file and runs it'.green, - '(results are stored in the ./tests/http/_results).\n'.green -); +showStartingTestMessage(); // Url of Puppeteer export server const url = 'http://127.0.0.1:7801'; @@ -48,7 +45,7 @@ fetch(`${url}/health`) // Check if file even exists and if it is a JSON if (existsSync(file) && file.endsWith('.json')) { try { - console.log('[Test runner]'.blue, `Processing test ${file}.`); + showProcessingTestMessage(file); // Read a payload file const payload = clearText(readFileSync(file).toString(), /\s\s+/g, ''); @@ -86,16 +83,12 @@ fetch(`${url}/health`) response.on('end', () => { fileStream.end(); - const endMessage = `HTTP request with a payload from file: ${file}, took ${ - new Date().getTime() - startDate - }ms.`; - - // Based on received status code check if requests failed - if (response.statusCode >= 400) { - console.log(`[Fail] ${endMessage}`.red); - } else { - console.log(`[Success] ${endMessage}`.green); - } + showFailOrSuccessMessage( + response.statusCode >= 400, + `HTTP request with a payload from file: ${file}, took ${ + new Date().getTime() - startDate + }ms.` + ); }); } ); @@ -108,9 +101,6 @@ fetch(`${url}/health`) }) .catch((error) => { if (error.code === 'ECONNREFUSED') { - return console.log( - `[ERROR] Couldn't connect to ${url}.`.red, - `Set your server before running tests.`.red - ); + return showConnectionErrorMessage(url); } }); diff --git a/tests/node/node_test_runner.js b/tests/node/node_test_runner.js index 9119aa70..4d8a87a3 100644 --- a/tests/node/node_test_runner.js +++ b/tests/node/node_test_runner.js @@ -21,18 +21,16 @@ import { } from 'fs'; import { basename, join } from 'path'; -import 'colors'; - import exporter from '../../lib/index.js'; import { __dirname } from '../../lib/utils.js'; +import { style } from '../../lib/logger.js'; +import { + showProcessingTestMessage, + showStartingTestMessage, + showTestResults +} from '../test_utils.js'; -console.log( - 'Highcharts Export Server Node Test Runner'.yellow.bold.underline, - '\nThis tool simulates NodeJS module execution by using selected'.green, - 'functions (initExport and startExport) of Highcharts Export Server.'.green, - '\nLoads all JSON files from the ./tests/node folder and runs them'.green, - '(results are stored in the ./test/node/_results).\n'.green -); +showStartingTestMessage(); (async () => { try { @@ -70,7 +68,7 @@ console.log( .map( (file) => new Promise((resolve) => { - console.log('[Test runner]'.blue, `Processing test ${file}.`); + showProcessingTestMessage(file); // Options from a file const fileOptions = JSON.parse( @@ -108,17 +106,17 @@ console.log( // Information about the results and the time it took console.log( - `[Success] Node module from file: ${file}, took: ${ + `${style.green}[Success] Node module from file: ${file}, took: ${ new Date().getTime() - startTime - }ms.`.green + }ms.${style.green}` ); }) .catch((error) => { // Information about the error and the time it took console.log( - `[Fail] Node module from file: ${file}, took: ${ + `${style.red}[Fail] Node module from file: ${file}, took: ${ new Date().getTime() - startTime - }ms.`.red + }ms.${style.reset}` ); exporter.setLogLevel(1); exporter.logWithStack(1, error); @@ -133,13 +131,7 @@ console.log( ) ).then(async () => { // Summarize the run and kill the pool - console.log( - '\n--------------------------------', - failsCounter - ? `\n${testCounter} tests done, ${failsCounter} error(s) found!`.red - : `\n${testCounter} tests done, errors not found!`.green, - '\n--------------------------------' - ); + showTestResults(testCounter, failsCounter); await exporter.killPool(); }); } catch (error) { diff --git a/tests/node/node_test_runner_single.js b/tests/node/node_test_runner_single.js index af7b1ae2..7bd8433f 100644 --- a/tests/node/node_test_runner_single.js +++ b/tests/node/node_test_runner_single.js @@ -15,18 +15,15 @@ See LICENSE file in root for details. import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs'; import { basename, join } from 'path'; -import 'colors'; - import exporter from '../../lib/index.js'; import { __dirname } from '../../lib/utils.js'; +import { style } from '../../lib/logger.js'; +import { + showStartingTestMessage, + showProcessingTestMessage +} from '../test_utils.js'; -console.log( - 'Highcharts Export Server Node Test Runner'.yellow.bold.underline, - '\nThis tool simulates NodeJS module execution by using selected'.green, - 'functions (initExport and startExport) of Highcharts Export Server.'.green, - '\nLoads a specified JSON file and runs it'.green, - '(results are stored in the ./test/node/_results).\n'.green -); +showStartingTestMessage(); // Create a promise for the export (async () => { @@ -57,7 +54,7 @@ console.log( await exporter.initExport(options); // Start the export - console.log('[Test runner]'.blue, `Processing test ${file}.`); + showProcessingTestMessage(file); // Options from a file const fileOptions = JSON.parse(readFileSync(file)); @@ -93,17 +90,17 @@ console.log( // Information about the results and the time it took console.log( - `[Success] Node module from file: ${file}, took: ${ + `${style.green} [Success] Node module from file: ${file}, took: ${ new Date().getTime() - startTime - }ms.`.green + }ms. ${style.reset}` ); }); } catch (error) { // Information about the error and the time it took console.log( - `[Fail] Node module from file: ${file}, took: ${ + `${style.red}[Fail] Node module from file: ${file}, took: ${ new Date().getTime() - startTime - }ms.`.red + }ms.${style.reset}` ); } @@ -111,7 +108,7 @@ console.log( await exporter.killPool(); } else { console.log( - 'The test does not exist. Please give a full path starting from ./tests.' + `${style.red}The test does not exist. Please give a full path starting from ./tests.${style.reset}` ); } } catch (error) { diff --git a/tests/other/private_range_url.js b/tests/other/private_range_url.js index eff3e1d5..62677c4e 100644 --- a/tests/other/private_range_url.js +++ b/tests/other/private_range_url.js @@ -12,14 +12,13 @@ See LICENSE file in root for details. *******************************************************************************/ -import 'colors'; - import { isPrivateRangeUrlFound } from '../../lib/utils.js'; +import { style } from '../../lib/logger.js'; // Test message console.log( - 'The isPrivateRangeUrlFound utility test'.yellow, - `\nIt checks multiple IPs and finds which are public and private.\n`.green + `${style.yellow}The isPrivateRangeUrlFound utility test${style.reset}`, + `${style.green}\nIt checks multiple IPs and finds which are public and private.${style.reset}\n` ); // IP adresses to test diff --git a/tests/other/side_by_side.js b/tests/other/side_by_side.js index 31f08ece..eddcab4c 100644 --- a/tests/other/side_by_side.js +++ b/tests/other/side_by_side.js @@ -17,8 +17,7 @@ import { exec as spawn } from 'child_process'; import { existsSync, mkdirSync } from 'fs'; import { join } from 'path'; -import 'colors'; - +import { style } from '../../lib/logger.js'; import { __dirname } from '../../lib/utils.js'; // Results paths @@ -32,9 +31,9 @@ const urls = ['http://127.0.0.1:7801', 'http://127.0.0.1:7802']; // Test message console.log( - 'Highcharts Export Server side by side comparator'.yellow, - `\nPuppeteer: ${urls[0]}`.green, - `\nPhantomJS: ${urls[1]}\n`.blue + `${style.yellow}Highcharts Export Server side by side comparator${style.reset}`, + `${style.green}\nPuppeteer: ${urls[0]}${style.reset}`, + `${style.blue}\nPhantomJS: ${urls[1]}\n${style.reset}` ); try { @@ -105,15 +104,17 @@ try { index ? '[PhantomJS]' : '[Puppeteer]' } ${type} export, took ${new Date().getTime() - startDate}ms.`; - console.log(index ? message.blue : message.green); + console.log( + `${index ? style.blue : style.green}${message}${style.reset}` + ); }); } }) .catch((error) => { if (error.code === 'ECONNREFUSED') { return console.log( - `[ERROR] Couldn't connect to ${url}.`.red, - `Set your server before running tests.`.red + `${style.red}[ERROR] Couldn't connect to ${url}.${style.reset}`, + `${style.red}Set your server before running tests.${style.reset}` ); } }); diff --git a/tests/other/stress_test.js b/tests/other/stress_test.js index 26bd1841..3c9089bc 100644 --- a/tests/other/stress_test.js +++ b/tests/other/stress_test.js @@ -13,12 +13,12 @@ See LICENSE file in root for details. *******************************************************************************/ import { fetch, post } from '../../lib/fetch.js'; -import 'colors'; +import { style } from '../../lib/logger.js'; // Test message console.log( - 'Highcharts Export Server stress test'.yellow, - `\nIt sends a certain number of requests in a certain interval`.green + `${style.yellow}Highcharts Export Server stress test${style.reset}`, + `${style.green}\nIt sends a certain number of requests in a certain interval${style.reset}` ); // The request options @@ -69,8 +69,8 @@ fetch(`${url}/health`) .catch((error) => { if (error.code === 'ECONNREFUSED') { return console.log( - `[ERROR] Couldn't connect to ${url}.`.red, - `Set your server before running tests.`.red + `${style.red}[ERROR] Couldn't connect to ${url}.${style.reset}`, + `${style.red}Set your server before running tests.${style.reset}` ); } }); diff --git a/tests/test_utils.js b/tests/test_utils.js new file mode 100644 index 00000000..029555c0 --- /dev/null +++ b/tests/test_utils.js @@ -0,0 +1,43 @@ +import { style } from '../lib/logger.js'; + +export function showStartingTestMessage() { + console.log( + `${style.yellow} ${style.bold} Highcharts Export Server CLI Test Runner ${style.reset} + \n${style.green} This tool simulates the CLI commands sent to Highcharts Export Server. + \nLoads all JSON files from the ./tests/cli folder and runs them sequentially.' + \nThe results are stored in the ./tests/cli/_results.\n${style.reset}` + ); +} + +export function showProcessingTestMessage(file) { + console.log( + `${style.blue} [Test runner] ${style.reset}`, + `Processing test ${file}.` + ); +} + +export function showFailOrSuccessMessage(didFail, message) { + console.log( + didFail + ? `${style.red} [Fail] ${message} ${style.reset}` + : `${style.green} [Success] ${message} ${style.reset}`, + '\n' + ); +} + +export function showTestResults(testCounter, failsCounter) { + console.log( + '--------------------------------', + failsCounter + ? `\n${style.red} ${testCounter} tests done, ${failsCounter} error(s) found!${style.reset}` + : `\n${style.green} ${testCounter} tests done, errors not found!${style.reset}`, + '\n--------------------------------' + ); +} + +export function showConnectionErrorMessage(url) { + console.log( + `${style.red}[ERROR] Couldn't connect to ${url}.${style.reset}`, + `${style.red}Set your server before running tests.${style.reset}` + ); +} From f75aa8590feb0ce495f69cae6c7a72aafc4ef6a3 Mon Sep 17 00:00:00 2001 From: jszuminski Date: Tue, 16 Jul 2024 15:30:27 +0200 Subject: [PATCH 2/6] Update changelog to reflect 'colors' changes. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cce67244..73af88dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ _New Features:_ _Enhancements:_ +- Got rid of the `colors` package (unnecessary dependency) and replaced it with our internal logic. - Improved server-related error handling by introducing new centralized error middlewares. - Improved overall error handling by adding a main try-catch block to correctly capture and log errors occurring throughout the code. - Introduced two new types of custom errors: `ExportError` for functionality-related errors and `HttpError` for server-related errors. From 0429e3f9bde70fa78f8bbcd5145aa6553ccca7b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Szumi=C5=84ski?= <70104233+jszuminski@users.noreply.github.com> Date: Wed, 17 Jul 2024 09:55:55 +0200 Subject: [PATCH 3/6] Update tests/test_utils.js Co-authored-by: Burkhard Vogel-Kreykenbohm --- tests/test_utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_utils.js b/tests/test_utils.js index 029555c0..07c14a01 100644 --- a/tests/test_utils.js +++ b/tests/test_utils.js @@ -27,11 +27,11 @@ export function showFailOrSuccessMessage(didFail, message) { export function showTestResults(testCounter, failsCounter) { console.log( - '--------------------------------', + '--------------------------------\n', failsCounter - ? `\n${style.red} ${testCounter} tests done, ${failsCounter} error(s) found!${style.reset}` - : `\n${style.green} ${testCounter} tests done, errors not found!${style.reset}`, - '\n--------------------------------' + ? `${style.red}${testCounter} tests done, ${failsCounter} error(s) found!${style.reset}\n` + : `${style.green}${testCounter} tests done, no errors found.${style.reset}\n`, + '--------------------------------' ); } From 3948d6bae568baf48c9e6be2f1ea831655d2e561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Szumi=C5=84ski?= <70104233+jszuminski@users.noreply.github.com> Date: Wed, 17 Jul 2024 09:56:23 +0200 Subject: [PATCH 4/6] Update tests/test_utils.js Co-authored-by: Burkhard Vogel-Kreykenbohm --- tests/test_utils.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test_utils.js b/tests/test_utils.js index 07c14a01..310237bd 100644 --- a/tests/test_utils.js +++ b/tests/test_utils.js @@ -18,10 +18,8 @@ export function showProcessingTestMessage(file) { export function showFailOrSuccessMessage(didFail, message) { console.log( - didFail - ? `${style.red} [Fail] ${message} ${style.reset}` - : `${style.green} [Success] ${message} ${style.reset}`, - '\n' + didFail ? `${style.red}[Fail] ` : `${style.green}[Success] `, + `${message} ${style.reset}\n` ); } From 26e86ec619887d495c83941a17497d68a9070e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Szumi=C5=84ski?= <70104233+jszuminski@users.noreply.github.com> Date: Wed, 17 Jul 2024 09:56:38 +0200 Subject: [PATCH 5/6] Update tests/test_utils.js Co-authored-by: Burkhard Vogel-Kreykenbohm --- tests/test_utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_utils.js b/tests/test_utils.js index 310237bd..94c86877 100644 --- a/tests/test_utils.js +++ b/tests/test_utils.js @@ -11,7 +11,7 @@ export function showStartingTestMessage() { export function showProcessingTestMessage(file) { console.log( - `${style.blue} [Test runner] ${style.reset}`, + `${style.blue}[Test runner]${style.reset}`, `Processing test ${file}.` ); } From adb9caf37580a64746c59eedcffac676eb8c42d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Szumi=C5=84ski?= <70104233+jszuminski@users.noreply.github.com> Date: Wed, 17 Jul 2024 09:57:57 +0200 Subject: [PATCH 6/6] Apply suggestions from code review Co-authored-by: Burkhard Vogel-Kreykenbohm --- lib/utils.js | 4 ++-- tests/node/node_test_runner_single.js | 4 ++-- tests/other/private_range_url.js | 4 ++-- tests/other/side_by_side.js | 6 +++--- tests/other/stress_test.js | 4 ++-- tests/test_utils.js | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/utils.js b/lib/utils.js index f7b48055..60819534 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -327,7 +327,7 @@ export const printLogo = (noLogo) => { // Print the logo console.log( - `${style.bold} ${style.yellow} ${readFileSync(__dirname + '/msg/startup.msg').toString()}`, + `${style.bold}${style.yellow}${readFileSync(__dirname + '/msg/startup.msg').toString()}`, `${style.bold}v${packageVersion}${style.reset}\n` ); }; @@ -366,7 +366,7 @@ export function printUsage() { console.log( descName, option.description, - `${style.blue}${style.bold}[Default: ${option.value.toString()}] ${style.reset}` + `${style.blue}${style.bold}[Default: ${option.value.toString()}]${style.reset}` ); } } diff --git a/tests/node/node_test_runner_single.js b/tests/node/node_test_runner_single.js index 7bd8433f..dd4f4409 100644 --- a/tests/node/node_test_runner_single.js +++ b/tests/node/node_test_runner_single.js @@ -90,9 +90,9 @@ showStartingTestMessage(); // Information about the results and the time it took console.log( - `${style.green} [Success] Node module from file: ${file}, took: ${ + `${style.green}[Success] Node module from file: ${file}, took: ${ new Date().getTime() - startTime - }ms. ${style.reset}` + }ms.${style.reset}` ); }); } catch (error) { diff --git a/tests/other/private_range_url.js b/tests/other/private_range_url.js index 62677c4e..05ea5386 100644 --- a/tests/other/private_range_url.js +++ b/tests/other/private_range_url.js @@ -17,8 +17,8 @@ import { style } from '../../lib/logger.js'; // Test message console.log( - `${style.yellow}The isPrivateRangeUrlFound utility test${style.reset}`, - `${style.green}\nIt checks multiple IPs and finds which are public and private.${style.reset}\n` + `${style.yellow}The isPrivateRangeUrlFound utility test${style.reset}\n`, + `${style.green}It checks multiple IPs and finds which are public and private.${style.reset}\n` ); // IP adresses to test diff --git a/tests/other/side_by_side.js b/tests/other/side_by_side.js index eddcab4c..e8a2c501 100644 --- a/tests/other/side_by_side.js +++ b/tests/other/side_by_side.js @@ -31,9 +31,9 @@ const urls = ['http://127.0.0.1:7801', 'http://127.0.0.1:7802']; // Test message console.log( - `${style.yellow}Highcharts Export Server side by side comparator${style.reset}`, - `${style.green}\nPuppeteer: ${urls[0]}${style.reset}`, - `${style.blue}\nPhantomJS: ${urls[1]}\n${style.reset}` + `${style.yellow}Highcharts Export Server side by side comparator${style.reset}\n`, + `${style.green}Puppeteer: ${urls[0]}${style.reset}\n`, + `${style.blue}PhantomJS: ${urls[1]}${style.reset}\n` ); try { diff --git a/tests/other/stress_test.js b/tests/other/stress_test.js index 3c9089bc..c4d2c78d 100644 --- a/tests/other/stress_test.js +++ b/tests/other/stress_test.js @@ -17,8 +17,8 @@ import { style } from '../../lib/logger.js'; // Test message console.log( - `${style.yellow}Highcharts Export Server stress test${style.reset}`, - `${style.green}\nIt sends a certain number of requests in a certain interval${style.reset}` + `${style.yellow}Highcharts Export Server stress test${style.reset}\n`, + `${style.green}It sends a certain number of requests in a certain interval${style.reset}` ); // The request options diff --git a/tests/test_utils.js b/tests/test_utils.js index 94c86877..aa0c4ced 100644 --- a/tests/test_utils.js +++ b/tests/test_utils.js @@ -2,10 +2,10 @@ import { style } from '../lib/logger.js'; export function showStartingTestMessage() { console.log( - `${style.yellow} ${style.bold} Highcharts Export Server CLI Test Runner ${style.reset} - \n${style.green} This tool simulates the CLI commands sent to Highcharts Export Server. - \nLoads all JSON files from the ./tests/cli folder and runs them sequentially.' - \nThe results are stored in the ./tests/cli/_results.\n${style.reset}` + `${style.yellow} ${style.bold} Highcharts Export Server CLI Test Runner ${style.reset}\n + ${style.green}This tool simulates the CLI commands sent to Highcharts Export Server.\n + Loads all JSON files from the ./tests/cli folder and runs them sequentially.\n + The results are stored in the ./tests/cli/_results.${style.reset}\n` ); }