From 0b119a08ec137dc1268c9ac74ccb38da511fffcc Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Mon, 3 Nov 2025 14:15:09 -0500 Subject: [PATCH 1/5] Clean up js/ts choices --- .gitignore | 2 + .parcelrc | 2 +- package-lock.json | 3 +- package.json | 11 ++-- scripts/createBackendLicenses.js | 59 +++++++++---------- scripts/createBackendLicenses.ts | 36 +++++++++++ scripts/frontendScripts.js | 4 +- .../{parcelResolver.js => parcelResolver.ts} | 0 scripts/setupMongo.js | 5 ++ scripts/setupMongo.ts | 9 --- src/react-app-env.d.ts | 2 +- 11 files changed, 83 insertions(+), 50 deletions(-) create mode 100644 scripts/createBackendLicenses.ts rename scripts/{parcelResolver.js => parcelResolver.ts} (100%) create mode 100644 scripts/setupMongo.js delete mode 100644 scripts/setupMongo.ts diff --git a/.gitignore b/.gitignore index eef90ba0dc..942e892ad4 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,8 @@ public/scripts/ .eslintcache Session.vim scripts/*.js +!scripts/frontendScripts.js +!scripts/setupMongo.js *.log *-debug.log* *-error.log* diff --git a/.parcelrc b/.parcelrc index 2f43ddbdd4..d8f9012212 100644 --- a/.parcelrc +++ b/.parcelrc @@ -7,7 +7,7 @@ "parcel-reporter-static-files-copy" ], "resolvers": [ - "./scripts/parcelResolver.js", + "./scripts/parcelResolver.ts", "..." ] } diff --git a/package-lock.json b/package-lock.json index cebf5163dd..87131474a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,6 @@ "i18next-http-backend": "~2.7.3", "js-base64": "~3.7.7", "levenshtein-search": "~0.1.2", - "make-dir": "~4.0.0", "material-react-table": "~3.2.1", "motion": "~12.4.9", "mui-language-picker": "~2.4.1", @@ -12722,6 +12721,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, "license": "MIT", "dependencies": { "semver": "^7.5.3" @@ -12737,6 +12737,7 @@ "version": "7.7.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" diff --git a/package.json b/package.json index 5b31d15556..ee3a9a8487 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "backend": "dotnet watch --project Backend/BackendFramework.csproj", "build": "parcel build", "build:analyze": "npm run build -- --reporter @parcel/reporter-bundle-analyzer", - "predatabase": "tsc scripts/setupMongo.ts && node scripts/setupMongo.js", + "predatabase": "node scripts/setupMongo.js", "database": "mongod --dbpath=./mongo_database", "drop-database": "tsc scripts/dropDB.ts && node scripts/dropDB.js", "find-circular-deps": "npx -y madge -c src/index.tsx --ts-config tsconfig.json", @@ -19,7 +19,8 @@ "prefrontend": "node scripts/frontendScripts.js", "frontend": "parcel --open", "gen-backend-coverage-report": "tsc scripts/genBackendCoverageReport.ts && node scripts/genBackendCoverageReport.js", - "license-report-backend": " nuget-license --include-transitive --input ./Backend/BackendFramework.csproj --output JsonPretty > docs/user_guide/assets/licenses/backend_licenses.json | exit 0 && node scripts/createBackendLicenses.js", + "prelicense-report-backend": "nuget-license --include-transitive --input ./Backend/BackendFramework.csproj --output JsonPretty > docs/user_guide/assets/licenses/backend_licenses.json | exit 0", + "license-report-backend": "tsc scripts/createBackendLicenses.ts && node scripts/createBackendLicenses.js", "license-summary-backend": "nuget-license --include-transitive --input ./Backend/BackendFramework.csproj", "license-report-frontend": " npm i && license-checker-rseidelsohn --production --excludePrivatePackages --plainVertical --out docs/user_guide/assets/licenses/frontend_licenses.txt", "license-summary-frontend": "npm i && license-checker-rseidelsohn --production --excludePrivatePackages --summary", @@ -30,9 +31,9 @@ "test": "run-s test-backend test-frontend", "test-backend": " dotnet test Backend.Tests/Backend.Tests.csproj", "test-backend:coverage": "dotnet test Backend.Tests/Backend.Tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:Threshold=77", - "test-frontend": " node scripts/jestTest.js", - "test-frontend:coverage": "node scripts/jestTest.js --coverage --watchAll=false", - "test-frontend:debug": " node --inspect-brk scripts/jestTest.js --runInBand --no-cache", + "test-frontend": "node scripts/jestTest.js", + "test-frontend:coverage": "npm run test-frontend -- --coverage --watchAll=false", + "test-frontend:debug": "node --inspect-brk scripts/jestTest.js --runInBand --no-cache", "wordlist": "npx -y hunspell-reader words" }, "dependencies": { diff --git a/scripts/createBackendLicenses.js b/scripts/createBackendLicenses.js index 3c9c667809..a4379d6b3d 100644 --- a/scripts/createBackendLicenses.js +++ b/scripts/createBackendLicenses.js @@ -1,36 +1,33 @@ +"use strict"; // To be run after generating a JSON license file with nuget-license - -const fs = require("fs"); - -const fileNameNoExt = "docs/user_guide/assets/licenses/backend_licenses"; -const fileNameIn = `${fileNameNoExt}.json`; -const fileNameOut = `${fileNameNoExt}.txt`; - -console.log(`Reading JSON data from ${fileNameIn}`); -const licenseData = JSON.parse(fs.readFileSync(fileNameIn)); - +Object.defineProperty(exports, "__esModule", { value: true }); +var fs_1 = require("fs"); +var fileNameNoExt = "docs/user_guide/assets/licenses/backend_licenses"; +var fileNameIn = "".concat(fileNameNoExt, ".json"); +var fileNameOut = "".concat(fileNameNoExt, ".txt"); +console.log("Reading JSON data from ".concat(fileNameIn)); +var licenseData = JSON.parse((0, fs_1.readFileSync)(fileNameIn, "utf-8")); // Ignore "LicenseInformationOrigin", "ValidationErrors" -const infoKeys = [ - "PackageId", - "PackageVersion", - "PackageProjectUrl", - "Authors", - "License", - "LicenseUrl", +var infoKeys = [ + "PackageId", + "PackageVersion", + "PackageProjectUrl", + "Authors", + "License", + "LicenseUrl", ]; - -const sep = "###############################################################\n"; -let licensesString = ""; - -for (const data of licenseData) { - licensesString += sep; - for (const key of infoKeys) { - const datum = data[key]; - if (datum) { - licensesString += `${key}: ${datum}\n`; +var sep = "###############################################################\n"; +var licensesString = ""; +for (var _i = 0, licenseData_1 = licenseData; _i < licenseData_1.length; _i++) { + var data = licenseData_1[_i]; + licensesString += sep; + for (var _a = 0, infoKeys_1 = infoKeys; _a < infoKeys_1.length; _a++) { + var key = infoKeys_1[_a]; + var datum = data[key]; + if (datum) { + licensesString += "".concat(key, ": ").concat(datum, "\n"); + } } - } } - -console.log(`Writing license data to ${fileNameOut}`); -fs.writeFileSync(fileNameOut, licensesString); +console.log("Writing license data to ".concat(fileNameOut)); +(0, fs_1.writeFileSync)(fileNameOut, licensesString); diff --git a/scripts/createBackendLicenses.ts b/scripts/createBackendLicenses.ts new file mode 100644 index 0000000000..7e05596885 --- /dev/null +++ b/scripts/createBackendLicenses.ts @@ -0,0 +1,36 @@ +// To be run after generating a JSON license file with nuget-license + +import { readFileSync, writeFileSync } from "fs"; + +const fileNameNoExt = "docs/user_guide/assets/licenses/backend_licenses"; +const fileNameIn = `${fileNameNoExt}.json`; +const fileNameOut = `${fileNameNoExt}.txt`; + +console.log(`Reading JSON data from ${fileNameIn}`); +const licenseData = JSON.parse(readFileSync(fileNameIn, "utf-8")); + +// Ignore "LicenseInformationOrigin", "ValidationErrors" +const infoKeys = [ + "PackageId", + "PackageVersion", + "PackageProjectUrl", + "Authors", + "License", + "LicenseUrl", +]; + +const sep = "###############################################################\n"; +let licensesString = ""; + +for (const data of licenseData) { + licensesString += sep; + for (const key of infoKeys) { + const datum = data[key]; + if (datum) { + licensesString += `${key}: ${datum}\n`; + } + } +} + +console.log(`Writing license data to ${fileNameOut}`); +writeFileSync(fileNameOut, licensesString); diff --git a/scripts/frontendScripts.js b/scripts/frontendScripts.js index 72901134d8..b89ff39d27 100644 --- a/scripts/frontendScripts.js +++ b/scripts/frontendScripts.js @@ -4,13 +4,13 @@ const folder = "./dist/scripts/"; // config.js: empty in dev -const ensureFile = require("fs-extra").ensureFile; +const { ensureFile } = require("fs-extra"); ensureFile(folder + "config.js"); // release.js: holds current version of The Combine -const spawnSync = require("child_process").spawnSync; +const { spawnSync } = require("child_process"); function runPy() { if (arguments.length > 0) { diff --git a/scripts/parcelResolver.js b/scripts/parcelResolver.ts similarity index 100% rename from scripts/parcelResolver.js rename to scripts/parcelResolver.ts diff --git a/scripts/setupMongo.js b/scripts/setupMongo.js new file mode 100644 index 0000000000..69aa30aa1f --- /dev/null +++ b/scripts/setupMongo.js @@ -0,0 +1,5 @@ +const { ensureDir } = require("fs-extra"); + +const directory = "./mongo_database"; + +ensureDir(directory); diff --git a/scripts/setupMongo.ts b/scripts/setupMongo.ts deleted file mode 100644 index 7f8f85a906..0000000000 --- a/scripts/setupMongo.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as makeDir from "make-dir"; - -const directory = "./mongo_database"; - -const makeMongoDirectory = async (): Promise => { - await makeDir(directory); -}; - -makeMongoDirectory().catch(console.error); diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index c41473c7cb..30d3198c6c 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -4,7 +4,7 @@ declare namespace NodeJS { interface ProcessEnv { - readonly NODE_ENV: "development" | "production" | "test"; + NODE_ENV: "development" | "production" | "test"; } } From 735d97342a706a9a5d17d2dd01d1b178bb479f0c Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Tue, 4 Nov 2025 15:29:59 -0500 Subject: [PATCH 2/5] Clean up js/ts choices --- .gitignore | 1 + package.json | 10 +++++----- scripts/createBackendLicenses.js | 33 -------------------------------- scripts/frontendScripts.js | 2 ++ 4 files changed, 8 insertions(+), 38 deletions(-) delete mode 100644 scripts/createBackendLicenses.js diff --git a/.gitignore b/.gitignore index 942e892ad4..a6d362e66d 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ public/scripts/ Session.vim scripts/*.js !scripts/frontendScripts.js +!scripts/jestTest.js !scripts/setupMongo.js *.log *-debug.log* diff --git a/package.json b/package.json index ee3a9a8487..b8ab26bcf0 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,8 @@ "prefrontend": "node scripts/frontendScripts.js", "frontend": "parcel --open", "gen-backend-coverage-report": "tsc scripts/genBackendCoverageReport.ts && node scripts/genBackendCoverageReport.js", - "prelicense-report-backend": "nuget-license --include-transitive --input ./Backend/BackendFramework.csproj --output JsonPretty > docs/user_guide/assets/licenses/backend_licenses.json | exit 0", - "license-report-backend": "tsc scripts/createBackendLicenses.ts && node scripts/createBackendLicenses.js", + "license-report-backend": "nuget-license --include-transitive --input ./Backend/BackendFramework.csproj --output JsonPretty > docs/user_guide/assets/licenses/backend_licenses.json | exit 0", + "postlicense-report-backend": "tsc scripts/createBackendLicenses.ts && node scripts/createBackendLicenses.js", "license-summary-backend": "nuget-license --include-transitive --input ./Backend/BackendFramework.csproj", "license-report-frontend": " npm i && license-checker-rseidelsohn --production --excludePrivatePackages --plainVertical --out docs/user_guide/assets/licenses/frontend_licenses.txt", "license-summary-frontend": "npm i && license-checker-rseidelsohn --production --excludePrivatePackages --summary", @@ -31,9 +31,9 @@ "test": "run-s test-backend test-frontend", "test-backend": " dotnet test Backend.Tests/Backend.Tests.csproj", "test-backend:coverage": "dotnet test Backend.Tests/Backend.Tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:Threshold=77", - "test-frontend": "node scripts/jestTest.js", - "test-frontend:coverage": "npm run test-frontend -- --coverage --watchAll=false", - "test-frontend:debug": "node --inspect-brk scripts/jestTest.js --runInBand --no-cache", + "test-frontend": " node scripts/jestTest.js", + "test-frontend:coverage": "node scripts/jestTest.js --coverage --watchAll=false", + "test-frontend:debug": " node --inspect-brk scripts/jestTest.js --runInBand --no-cache", "wordlist": "npx -y hunspell-reader words" }, "dependencies": { diff --git a/scripts/createBackendLicenses.js b/scripts/createBackendLicenses.js deleted file mode 100644 index a4379d6b3d..0000000000 --- a/scripts/createBackendLicenses.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -// To be run after generating a JSON license file with nuget-license -Object.defineProperty(exports, "__esModule", { value: true }); -var fs_1 = require("fs"); -var fileNameNoExt = "docs/user_guide/assets/licenses/backend_licenses"; -var fileNameIn = "".concat(fileNameNoExt, ".json"); -var fileNameOut = "".concat(fileNameNoExt, ".txt"); -console.log("Reading JSON data from ".concat(fileNameIn)); -var licenseData = JSON.parse((0, fs_1.readFileSync)(fileNameIn, "utf-8")); -// Ignore "LicenseInformationOrigin", "ValidationErrors" -var infoKeys = [ - "PackageId", - "PackageVersion", - "PackageProjectUrl", - "Authors", - "License", - "LicenseUrl", -]; -var sep = "###############################################################\n"; -var licensesString = ""; -for (var _i = 0, licenseData_1 = licenseData; _i < licenseData_1.length; _i++) { - var data = licenseData_1[_i]; - licensesString += sep; - for (var _a = 0, infoKeys_1 = infoKeys; _a < infoKeys_1.length; _a++) { - var key = infoKeys_1[_a]; - var datum = data[key]; - if (datum) { - licensesString += "".concat(key, ": ").concat(datum, "\n"); - } - } -} -console.log("Writing license data to ".concat(fileNameOut)); -(0, fs_1.writeFileSync)(fileNameOut, licensesString); diff --git a/scripts/frontendScripts.js b/scripts/frontendScripts.js index b89ff39d27..536e593cbd 100644 --- a/scripts/frontendScripts.js +++ b/scripts/frontendScripts.js @@ -1,3 +1,5 @@ +"use strict"; + // Create scripts files for frontend use const folder = "./dist/scripts/"; From 89ad4b8755dd7eaa18d200aa42030f00e47bef49 Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Tue, 4 Nov 2025 15:36:36 -0500 Subject: [PATCH 3/5] Update frontend license report --- .../assets/licenses/frontend_licenses.txt | 32 ------------------- package.json | 1 - 2 files changed, 33 deletions(-) diff --git a/docs/user_guide/assets/licenses/frontend_licenses.txt b/docs/user_guide/assets/licenses/frontend_licenses.txt index efb2b759ed..61487365bd 100644 --- a/docs/user_guide/assets/licenses/frontend_licenses.txt +++ b/docs/user_guide/assets/licenses/frontend_licenses.txt @@ -3330,19 +3330,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -make-dir 4.0.0 -MIT -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - material-react-table 3.2.1 MIT MIT License @@ -4428,25 +4415,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -semver 7.7.3 -ISC -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - set-cookie-parser 2.7.2 MIT The MIT License (MIT) diff --git a/package.json b/package.json index b8ab26bcf0..331c6603dc 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "i18next-http-backend": "~2.7.3", "js-base64": "~3.7.7", "levenshtein-search": "~0.1.2", - "make-dir": "~4.0.0", "material-react-table": "~3.2.1", "motion": "~12.4.9", "mui-language-picker": "~2.4.1", From 1b9b1c03b12dd1dc6b53b6dc9d452c4b2810479e Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Tue, 4 Nov 2025 15:45:43 -0500 Subject: [PATCH 4/5] Use strict --- scripts/setupMongo.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/setupMongo.js b/scripts/setupMongo.js index 69aa30aa1f..6bd1bbb0cb 100644 --- a/scripts/setupMongo.js +++ b/scripts/setupMongo.js @@ -1,3 +1,5 @@ +"use strict"; + const { ensureDir } = require("fs-extra"); const directory = "./mongo_database"; From abce455f5841bbb3f4d91da6ca3934fa49e4138a Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Tue, 4 Nov 2025 15:47:48 -0500 Subject: [PATCH 5/5] Update .dockerignore --- .dockerignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 49d42505f2..cd72327409 100644 --- a/.dockerignore +++ b/.dockerignore @@ -10,7 +10,7 @@ !nginx !package*.json !public -!scripts/parcelResolver.js +!scripts/parcelResolver.ts !src !tox.ini !tsconfig.json