Files
zkldi_Tachi/server/package.json
T
zkldi 0e36b17827 fix(critical): Pin prudence to an exact version
This is a long one.

So, `instanceof` in Typescript is incredibly flimsy. There's a
documented bug with what happens when you extend built-in classes, such
as Error or Array. You can read more about it here: https://github.com/Microsoft/TypeScript/wiki/FAQ#why-doesnt-extending-built-ins-like-error-array-and-map-work

However, this normally works fine. A previous commit moved some schemas
from server/ to common/, our gameSpecific UGPT settings schemas. This
caused them to break in an interesting way. For any schema recursive
with a depth greater than 1, all errors would be ignored. Why on earth
was this happening?

Well Prudence passes errors up the stack with a "return Err" -> "if
ret instanceof Err: return Err" kind of approach. This normally works
fine.

The real kicker here is that because server/ and common/ were on 0.9.7
and 0.9.8 respectively, the "Err" instance in question would actually be
erased when ran at runtime. The "if ret instance of Err" would fail,
because the Err would be from 0.9.7, not 0.9.8. This subtle difference
in file results in catastrophic damage.

In short. InstanceOf is a footgun. I hate it. Lets never do it again.
Thanks.
2022-10-14 01:09:31 +01:00

110 lines
3.1 KiB
JSON

{
"name": "tachi-server",
"version": "2.2.0-dev",
"description": "A score tracking server.",
"main": "js/server/src/main.js",
"private": true,
"scripts": {
"test": "tap",
"snap": "TAP_SNAPSHOT=1 tap",
"watchtest": "tap --watch",
"build": "tsc --project tsconfig.build.json",
"typecheck": "tsc --project tsconfig.build.json --noEmit",
"lint": "eslint ./src --ext .ts --fix",
"start": "pnpm build && pnpm start-no-build",
"start-no-build": "node -r ts-node/register -r tsconfig-paths/register js/server/src/main.js",
"runscoreworker": "node -r ts-node/register -r tsconfig-paths/register js/server/src/lib/score-import/worker/worker.js",
"sync-database": "ts-node src/scripts/sync-database",
"sync-database-local": "ts-node src/scripts/sync-database --localPath '../database-seeds/collections'",
"recalc-everything": "ts-node src/scripts/state-sync/sync-state.ts"
},
"author": "zkldi",
"license": "AGPL3",
"devDependencies": {
"@types/supertest": "2.0.11",
"@types/tap": "15.0.5",
"express-request-mock": "3.1.0",
"glob": "^7.2.0",
"node-mocks-http": "1.11.0",
"supertest": "6.2.2",
"tap": "15.1.6"
},
"dependencies": {
"@aws-sdk/client-s3": "3.49.0",
"@aws-sdk/signature-v4-crt": "3.49.0",
"@types/bcryptjs": "^2.4.2",
"@types/bson": "1.0.11",
"@types/bunyan": "^1.8.8",
"@types/connect-redis": "0.0.18",
"@types/express": "4.17.13",
"@types/express-rate-limit": "5.1.3",
"@types/express-serve-static-core": "4.17.29",
"@types/express-session": "1.17.4",
"@types/glob": "^7.2.0",
"@types/mkdirp": "1.0.2",
"@types/mongodb": "3.6.18",
"@types/multer": "1.4.7",
"@types/node": "16.11.7",
"@types/node-fetch": "2.5.12",
"@types/nodemailer": "^6.4.4",
"@types/rate-limit-redis": "1.7.4",
"@types/redis": "2.8.32",
"@types/rimraf": "3.0.2",
"@types/safe-json-stringify": "1.1.2",
"@types/semver": "^7.3.9",
"@valuabletouch/winston-seq": "1.3.0",
"bcryptjs": "2.4.3",
"bms-table-loader": "1.0.1",
"bullmq": "1.68.4",
"bunyan": "1.8.15",
"commander": "9.0.0",
"connect-redis": "6.1.1",
"deepmerge": "4.2.2",
"dotenv": "16.0.0",
"express": "4.17.2",
"express-async-errors": "3.1.1",
"express-rate-limit": "5.5.1",
"express-session": "1.17.2",
"fast-json-stable-hash": "1.0.3",
"fast-xml-parser": "4.0.2",
"helmet": "5.0.2",
"html-entities": "^2.3.2",
"json5": "2.2.0",
"mkdirp": "1.0.4",
"mongodb": "3.6.3",
"monk": "7.3.4",
"multer": "1.4.4",
"node-cache": "5.1.2",
"node-fetch": "2.6.7",
"node-html-parser": "^5.3.3",
"nodemailer": "6.7.2",
"prudence": "0.9.8",
"rate-limit-redis": "2.1.0",
"redis": "3.1.2",
"rg-stats": "^0.3.0",
"rimraf": "3.0.2",
"safe-json-stringify": "1.2.0",
"semver": "^7.3.7",
"seq-logging": "1.1.1",
"ts-node": "10.0.0",
"tsconfig-paths": "3.12.0",
"typescript": "4.5.5",
"winston": "3.5.1",
"winston-daily-rotate-file": "4.6.0",
"winston-transport": "4.5.0"
},
"nyc": {
"reporter": [
"html",
"lcov"
],
"all": true,
"include": [
"src/*/!(test-utils)/**/*.ts"
],
"exclude": [
"src/**/*.test.ts",
"src/external/mongo/schemas.ts"
]
}
}