diff --git a/package-lock.json b/package-lock.json index 654a66e809..a0b78c88d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "@turf/turf": "^7.2.0", "@types/dompurify": "^3.0.2", "@types/follow-redirects": "^1.14.4", + "@types/node": "^22.13.5", "@types/pg": "^8.11.11", "@types/qrcode-generator": "^1.0.6", "@types/showdown": "^2.0.0", @@ -103,7 +104,6 @@ "@types/jsonld": "^1.5.13", "@types/lz-string": "^1.3.34", "@types/mocha": "^10.0.1", - "@types/node": "^18.19.75", "@types/papaparse": "^5.3.15", "@types/prompt-sync": "^4.2.3", "@types/xml2js": "^0.4.9", @@ -125,7 +125,7 @@ "standard-version": "^9.5.0", "svelte-check": "^3.0.2", "svelte-preprocess": "^5.0.1", - "ts2json-schema": "^1.4.0", + "ts-json-schema-generator": "^2.3.0", "tslib": "^2.5.0", "typescript": "^4.7.4", "vite": "^4.5.9", @@ -11392,7 +11392,9 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.12", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true, "license": "MIT" }, @@ -11437,11 +11439,12 @@ } }, "node_modules/@types/node": { - "version": "18.19.75", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.75.tgz", - "integrity": "sha512-UIksWtThob6ZVSyxcOqCLOUNg/dyO1Qvx4McgeuhrEtHTLFTf7BBhEazaE4K806FGTPtzd/2sE90qn4fVr7cyw==", + "version": "22.13.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.5.tgz", + "integrity": "sha512-+lTU0PxZXn0Dr1NBtC7Y8cR21AJr87dLLU953CWA6pMxxv/UDc7jYAY90upcrie1nRcD6XNG5HOYEDtgW5TxAg==", + "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.20.0" } }, "node_modules/@types/normalize-package-data": { @@ -12203,14 +12206,6 @@ "svg.select.js": "^3.0.1" } }, - "node_modules/app-root-path": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6.0.0" - } - }, "node_modules/arg": { "version": "5.0.2", "license": "MIT" @@ -13016,6 +13011,14 @@ "componentsjs-compile-config": "bin/compile-config.js" } }, + "node_modules/componentsjs/node_modules/@types/node": { + "version": "18.19.76", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.76.tgz", + "integrity": "sha512-yvR7Q9LdPz2vGpmpJX5LolrgRdWvB67MJKDPSgIIzpFbaf9a1j/f5DnLp5VDyHGMR0QZHlTr1afsD87QCXFHKw==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, "node_modules/componentsjs/node_modules/lru-cache": { "version": "6.0.0", "license": "ISC", @@ -13039,6 +13042,11 @@ "node": ">=10" } }, + "node_modules/componentsjs/node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, "node_modules/componentsjs/node_modules/yallist": { "version": "4.0.0", "license": "ISC" @@ -17206,17 +17214,6 @@ "version": "0.4.0", "license": "(AFL-2.1 OR BSD-3-Clause)" }, - "node_modules/json-stable-stringify": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "jsonify": "^0.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "dev": true, @@ -17261,14 +17258,6 @@ "node": ">= 10.0.0" } }, - "node_modules/jsonify": { - "version": "0.0.1", - "dev": true, - "license": "Public Domain", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/jsonld": { "version": "8.3.3", "resolved": "https://registry.npmjs.org/jsonld/-/jsonld-8.3.3.tgz", @@ -17297,6 +17286,14 @@ "jsonld-context-parse": "bin/jsonld-context-parse.js" } }, + "node_modules/jsonld-context-parser/node_modules/@types/node": { + "version": "18.19.76", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.76.tgz", + "integrity": "sha512-yvR7Q9LdPz2vGpmpJX5LolrgRdWvB67MJKDPSgIIzpFbaf9a1j/f5DnLp5VDyHGMR0QZHlTr1afsD87QCXFHKw==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, "node_modules/jsonld-context-parser/node_modules/cross-fetch": { "version": "3.1.8", "license": "MIT", @@ -17328,6 +17325,11 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, + "node_modules/jsonld-context-parser/node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, "node_modules/jsonld-context-parser/node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -25632,6 +25634,8 @@ "version": "0.5.21", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -26915,27 +26919,99 @@ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" }, "node_modules/ts-json-schema-generator": { - "version": "0.95.0", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-2.3.0.tgz", + "integrity": "sha512-t4lBQAwZc0sOJq9LJt3NgbznIcslVnm0JeEMFq8qIRklpMRY8jlYD0YmnRWbqBKANxkby91P1XanSSlSOFpUmg==", "dev": true, "license": "MIT", "dependencies": { - "@types/json-schema": "^7.0.7", - "commander": "^8.0.0", - "fast-json-stable-stringify": "^2.1.0", - "glob": "^7.1.7", - "json-stable-stringify": "^1.0.1", - "json5": "^2.2.0", - "typescript": "~4.3.4" + "@types/json-schema": "^7.0.15", + "commander": "^12.0.0", + "glob": "^10.3.12", + "json5": "^2.2.3", + "normalize-path": "^3.0.0", + "safe-stable-stringify": "^2.4.3", + "tslib": "^2.6.2", + "typescript": "^5.4.5" }, "bin": { - "ts-json-schema-generator": "bin/ts-json-schema-generator" + "ts-json-schema-generator": "bin/ts-json-schema-generator.js" }, "engines": { - "node": ">=10.0.0" + "node": ">=18.0.0" + } + }, + "node_modules/ts-json-schema-generator/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/ts-json-schema-generator/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/ts-json-schema-generator/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ts-json-schema-generator/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ts-json-schema-generator/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" } }, "node_modules/ts-json-schema-generator/node_modules/typescript": { - "version": "4.3.5", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -26943,7 +27019,7 @@ "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/ts-node": { @@ -26999,23 +27075,6 @@ "node": ">=0.3.1" } }, - "node_modules/ts2json-schema": { - "version": "1.4.0", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "app-root-path": "^3.0.0", - "commander": "^8.0.0", - "ts-json-schema-generator": "^0.95.0", - "typescript-json-schema": "^0.50.1" - }, - "bin": { - "ts2json-schema": "bin/ts2json-schema.bin.js" - }, - "engines": { - "node": ">=10.17.0" - } - }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -27535,77 +27594,6 @@ "node": ">=4.2.0" } }, - "node_modules/typescript-json-schema": { - "version": "0.50.1", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.7", - "@types/node": "^14.14.33", - "glob": "^7.1.6", - "json-stable-stringify": "^1.0.1", - "ts-node": "^9.1.1", - "typescript": "~4.2.3", - "yargs": "^16.2.0" - }, - "bin": { - "typescript-json-schema": "bin/typescript-json-schema" - } - }, - "node_modules/typescript-json-schema/node_modules/@types/node": { - "version": "14.18.36", - "dev": true, - "license": "MIT" - }, - "node_modules/typescript-json-schema/node_modules/arg": { - "version": "4.1.3", - "dev": true, - "license": "MIT" - }, - "node_modules/typescript-json-schema/node_modules/diff": { - "version": "4.0.2", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/typescript-json-schema/node_modules/ts-node": { - "version": "9.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.17", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "typescript": ">=2.7" - } - }, - "node_modules/typescript-json-schema/node_modules/typescript": { - "version": "4.2.4", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, "node_modules/uglify-js": { "version": "3.19.3", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", @@ -27649,9 +27637,9 @@ } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==" }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", @@ -38305,7 +38293,9 @@ } }, "@types/json-schema": { - "version": "7.0.12", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "@types/jsonld": { @@ -38342,11 +38332,11 @@ } }, "@types/node": { - "version": "18.19.75", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.75.tgz", - "integrity": "sha512-UIksWtThob6ZVSyxcOqCLOUNg/dyO1Qvx4McgeuhrEtHTLFTf7BBhEazaE4K806FGTPtzd/2sE90qn4fVr7cyw==", + "version": "22.13.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.5.tgz", + "integrity": "sha512-+lTU0PxZXn0Dr1NBtC7Y8cR21AJr87dLLU953CWA6pMxxv/UDc7jYAY90upcrie1nRcD6XNG5HOYEDtgW5TxAg==", "requires": { - "undici-types": "~5.26.4" + "undici-types": "~6.20.0" } }, "@types/normalize-package-data": { @@ -38869,10 +38859,6 @@ "svg.select.js": "^3.0.1" } }, - "app-root-path": { - "version": "3.1.0", - "dev": true - }, "arg": { "version": "5.0.2" }, @@ -39383,6 +39369,14 @@ "winston": "^3.3.3" }, "dependencies": { + "@types/node": { + "version": "18.19.76", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.76.tgz", + "integrity": "sha512-yvR7Q9LdPz2vGpmpJX5LolrgRdWvB67MJKDPSgIIzpFbaf9a1j/f5DnLp5VDyHGMR0QZHlTr1afsD87QCXFHKw==", + "requires": { + "undici-types": "~5.26.4" + } + }, "lru-cache": { "version": "6.0.0", "requires": { @@ -39395,6 +39389,11 @@ "lru-cache": "^6.0.0" } }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, "yallist": { "version": "4.0.0" } @@ -42160,13 +42159,6 @@ "json-schema": { "version": "0.4.0" }, - "json-stable-stringify": { - "version": "1.0.2", - "dev": true, - "requires": { - "jsonify": "^0.0.1" - } - }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "dev": true @@ -42199,10 +42191,6 @@ } } }, - "jsonify": { - "version": "0.0.1", - "dev": true - }, "jsonld": { "version": "8.3.3", "resolved": "https://registry.npmjs.org/jsonld/-/jsonld-8.3.3.tgz", @@ -42235,6 +42223,14 @@ "relative-to-absolute-iri": "^1.0.5" }, "dependencies": { + "@types/node": { + "version": "18.19.76", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.76.tgz", + "integrity": "sha512-yvR7Q9LdPz2vGpmpJX5LolrgRdWvB67MJKDPSgIIzpFbaf9a1j/f5DnLp5VDyHGMR0QZHlTr1afsD87QCXFHKw==", + "requires": { + "undici-types": "~5.26.4" + } + }, "cross-fetch": { "version": "3.1.8", "requires": { @@ -42254,6 +42250,11 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, "webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -48015,6 +48016,8 @@ "source-map-support": { "version": "0.5.21", "dev": true, + "optional": true, + "peer": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -48901,20 +48904,69 @@ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" }, "ts-json-schema-generator": { - "version": "0.95.0", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-2.3.0.tgz", + "integrity": "sha512-t4lBQAwZc0sOJq9LJt3NgbznIcslVnm0JeEMFq8qIRklpMRY8jlYD0YmnRWbqBKANxkby91P1XanSSlSOFpUmg==", "dev": true, "requires": { - "@types/json-schema": "^7.0.7", - "commander": "^8.0.0", - "fast-json-stable-stringify": "^2.1.0", - "glob": "^7.1.7", - "json-stable-stringify": "^1.0.1", - "json5": "^2.2.0", - "typescript": "~4.3.4" + "@types/json-schema": "^7.0.15", + "commander": "^12.0.0", + "glob": "^10.3.12", + "json5": "^2.2.3", + "normalize-path": "^3.0.0", + "safe-stable-stringify": "^2.4.3", + "tslib": "^2.6.2", + "typescript": "^5.4.5" }, "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true + }, + "glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + } + }, + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true + }, "typescript": { - "version": "4.3.5", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "dev": true } } @@ -48947,16 +48999,6 @@ } } }, - "ts2json-schema": { - "version": "1.4.0", - "dev": true, - "requires": { - "app-root-path": "^3.0.0", - "commander": "^8.0.0", - "ts-json-schema-generator": "^0.95.0", - "typescript-json-schema": "^0.50.1" - } - }, "tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -49394,49 +49436,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==" }, - "typescript-json-schema": { - "version": "0.50.1", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.7", - "@types/node": "^14.14.33", - "glob": "^7.1.6", - "json-stable-stringify": "^1.0.1", - "ts-node": "^9.1.1", - "typescript": "~4.2.3", - "yargs": "^16.2.0" - }, - "dependencies": { - "@types/node": { - "version": "14.18.36", - "dev": true - }, - "arg": { - "version": "4.1.3", - "dev": true - }, - "diff": { - "version": "4.0.2", - "dev": true - }, - "ts-node": { - "version": "9.1.1", - "dev": true, - "requires": { - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.17", - "yn": "3.1.1" - } - }, - "typescript": { - "version": "4.2.4", - "dev": true - } - } - }, "uglify-js": { "version": "3.19.3", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", @@ -49464,9 +49463,9 @@ } }, "undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==" }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", diff --git a/package.json b/package.json index 3ed4ad3833..04950c9b6d 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "optimize-images-png": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'", "optimize-images-jpg": "cd assets/ && find . -regextype sed -regex \".*/.*.\\(jpg\\|JPG\\|JPEG\\|jpeg\\)\" -exec jpegoptim '{}' \\; && echo 'JPGs are optimized'", "optimize-images-scaledown-jpg": "cd assets/ && find . -regextype sed -regex \".*/.*.\\(jpg\\|JPG\\|JPEG\\|jpeg\\)\" -exec mogrify -resize 640x640\\> '{}' \\; && echo 'JPGs are optimized'", - "generate:schemas": "export NODE_OPTIONS=\"--max-old-space-size=8192\" && ts2json-schema -p src/Models/ThemeConfig/Json/ -o Docs/Schemas/ -t tsconfig.json -R . -m \".*ConfigJson\" && echo 'tsjson is done' && vite-node scripts/fixSchemas.ts ", + "generate:schemas": "export NODE_OPTIONS=\"--max-old-space-size=8192\" && ./scripts/generateSchemas.sh && echo 'tsjson is done' && vite-node scripts/fixSchemas.ts ", "reuse-compliance": "reuse lint", "housekeeping": "export NODE_OPTIONS=\"--max-old-space-size=1200\" && git pull && npx update-browserslist-db@latest && npm run generate && npm run generate:docs && npm run generate:schemas && npm run generate:contributor-list && vite-node scripts/fetchLanguages.ts && vite-node scripts/generateSunnyUnlabeled.ts && npm run format && git add assets/ langs/ Docs/ **/*.ts Docs/* src/* && git commit -m 'chore: automated housekeeping...'", "###": "MICROSERVICES AND SERVER MAINTAINENCE", @@ -190,6 +190,7 @@ "@turf/turf": "^7.2.0", "@types/dompurify": "^3.0.2", "@types/follow-redirects": "^1.14.4", + "@types/node": "^22.13.5", "@types/pg": "^8.11.11", "@types/qrcode-generator": "^1.0.6", "@types/showdown": "^2.0.0", @@ -265,7 +266,6 @@ "@types/jsonld": "^1.5.13", "@types/lz-string": "^1.3.34", "@types/mocha": "^10.0.1", - "@types/node": "^18.19.75", "@types/papaparse": "^5.3.15", "@types/prompt-sync": "^4.2.3", "@types/xml2js": "^0.4.9", @@ -287,7 +287,7 @@ "standard-version": "^9.5.0", "svelte-check": "^3.0.2", "svelte-preprocess": "^5.0.1", - "ts2json-schema": "^1.4.0", + "ts-json-schema-generator": "^2.3.0", "tslib": "^2.5.0", "typescript": "^4.7.4", "vite": "^4.5.9", diff --git a/scripts/fixSchemas.ts b/scripts/fixSchemas.ts index 0931bbb032..efbd7e5420 100644 --- a/scripts/fixSchemas.ts +++ b/scripts/fixSchemas.ts @@ -81,7 +81,7 @@ function WalkScheme( fullScheme = fullScheme ?? scheme if (!skipRoot) { - let t = onEach(scheme, path) + const t = onEach(scheme, path) if (t !== undefined) { const isRequired = required?.indexOf(path.at(-1)) >= 0 results.push({ @@ -385,7 +385,7 @@ function main() { console.log("Trying to read", path) let content = readFileSync(path, { encoding: "utf8" }) content = content.substring("export default ".length) - let parsed = JSON.parse(content) + const parsed = JSON.parse(content) parsed["additionalProperties"] = false for (const key in parsed.definitions) { diff --git a/scripts/generateSchemas.sh b/scripts/generateSchemas.sh new file mode 100755 index 0000000000..88ed907cc8 --- /dev/null +++ b/scripts/generateSchemas.sh @@ -0,0 +1,10 @@ +#! /bin/bash + +for file in src/Models/ThemeConfig/Json/*Json.ts; do + echo "Processing $file" + filename=$(basename "$file" .${file##*.}) + echo $filename + npx ts-json-schema-generator --unstable --no-top-ref -p $file > Docs/Schemas/$filename.schema.json +done + +