Fix for updated JSON Against Humanity.

This commit is contained in:
Gareth Latty
2020-10-11 04:18:35 +01:00
parent a9a49afd2f
commit 6446e90fa8
8 changed files with 1310 additions and 2686 deletions
+1185 -2512
View File
File diff suppressed because it is too large Load Diff
+24 -24
View File
@@ -22,20 +22,20 @@
"> 0.2%"
],
"dependencies": {
"@fortawesome/fontawesome-free": "^5.14.0",
"@fortawesome/fontawesome-free": "^5.15.1",
"@material/card": "^7.0.0",
"@material/mwc-button": "^0.18.0",
"@material/mwc-fab": "^0.18.0",
"@material/mwc-icon-button": "^0.18.0",
"@material/mwc-linear-progress": "^0.18.0",
"@material/mwc-menu": "^0.18.0",
"@material/mwc-select": "^0.18.0",
"@material/mwc-slider": "^0.18.0",
"@material/mwc-switch": "^0.18.0",
"@material/mwc-tab": "^0.18.0",
"@material/mwc-tab-bar": "^0.18.0",
"@material/mwc-textarea": "^0.18.0",
"@material/mwc-textfield": "^0.18.0",
"@material/mwc-button": "^0.19.1",
"@material/mwc-fab": "^0.19.1",
"@material/mwc-icon-button": "^0.19.1",
"@material/mwc-linear-progress": "^0.19.1",
"@material/mwc-menu": "^0.19.1",
"@material/mwc-select": "^0.19.1",
"@material/mwc-slider": "^0.19.1",
"@material/mwc-switch": "^0.19.1",
"@material/mwc-tab": "^0.19.1",
"@material/mwc-tab-bar": "^0.19.1",
"@material/mwc-textarea": "^0.19.1",
"@material/mwc-textfield": "^0.19.1",
"@polymer/paper-tooltip": "^3.0.1",
"@webcomponents/webcomponentsjs": "^2.4.4",
"canvas-confetti": "^1.3.0"
@@ -43,13 +43,13 @@
"devDependencies": {
"@types/canvas-confetti": "^1.0.0",
"@types/chrome": "^0.0.124",
"@types/chromecast-caf-sender": "^1.0.3",
"@types/chromecast-caf-receiver": "^5.0.11",
"@types/chromecast-caf-sender": "^1.0.3",
"app-manifest-loader": "^2.4.1",
"chromecast-device-emulator": "^1.2.7",
"clean-webpack-plugin": "^3.0.0",
"closure-webpack-plugin": "^2.3.0",
"compression-webpack-plugin": "^6.0.2",
"compression-webpack-plugin": "^6.0.3",
"css-hot-loader": "^1.4.4",
"css-loader": "^4.3.0",
"cssnano": "^4.1.10",
@@ -59,24 +59,24 @@
"elm-webpack-loader": "^6.0.1",
"extract-loader": "^5.1.0",
"fibers": "^5.0.0",
"file-loader": "^6.1.0",
"google-closure-compiler": "^20200920.0.0",
"html-loader": "^1.3.1",
"file-loader": "^6.1.1",
"google-closure-compiler": "^20201006.0.0",
"html-loader": "^1.3.2",
"html-webpack-plugin": "^4.5.0",
"postcss-import": "^12.0.1",
"postcss-loader": "^4.0.2",
"postcss-loader": "^4.0.4",
"postcss-preset-env": "^6.7.0",
"prettier": "2.1.2",
"prettier-plugin-elm": "^0.7.0",
"resolve-url-loader": "^3.1.1",
"sass": "^1.26.11",
"sass-loader": "^10.0.2",
"style-loader": "^1.2.1",
"terser-webpack-plugin": "^4.2.2",
"sass": "^1.27.0",
"sass-loader": "^10.0.3",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^4.2.3",
"ts-loader": "^8.0.4",
"tsickle-loader": "^0.5.0",
"typescript": "^4.0.3",
"webpack": "^4.44.2",
"webpack": "^5.0.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
}
+1 -13
View File
@@ -136,10 +136,7 @@ module.exports = (env, argv) => {
output: {
path: dist,
publicPath: "/",
filename:
mode === "production"
? "assets/scripts/[name].[chunkhash].js"
: "assets/scripts/[name].[hash].js",
filename: "assets/scripts/[name].[contenthash].js",
},
module: {
rules: [
@@ -234,15 +231,6 @@ module.exports = (env, argv) => {
plugins: plugins,
optimization: {
runtimeChunk: "single",
splitChunks: {
cacheGroups: {
vendors: {
test: /[\\/]node_modules[\\/]/,
name: "vendors",
chunks: "all",
},
},
},
minimizer: [
new ClosurePlugin(
{
+1 -1
View File
@@ -46,7 +46,7 @@
// Allows players to use decks from JSON Against Humanity
jsonAgainstHumanity: {
aboutUrl: "https://github.com/crhallberg/json-against-humanity",
url: "https://raw.githubusercontent.com/crhallberg/json-against-humanity/v2/compact.md.json",
url: "https://raw.githubusercontent.com/crhallberg/json-against-humanity/v2/cah-all-compact.json",
},
},
+68 -83
View File
@@ -356,13 +356,13 @@
"dev": true
},
"@typescript-eslint/eslint-plugin": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.2.0.tgz",
"integrity": "sha512-zBNRkzvLSwo6y5TG0DVcmshZIYBHKtmzD4N+LYnfTFpzc4bc79o8jNRSb728WV7A4Cegbs+MV5IRAj8BKBgOVQ==",
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.4.0.tgz",
"integrity": "sha512-RVt5wU9H/2H+N/ZrCasTXdGbUTkbf7Hfi9eLiA8vPQkzUJ/bLDCC3CsoZioPrNcnoyN8r0gT153dC++A4hKBQQ==",
"dev": true,
"requires": {
"@typescript-eslint/experimental-utils": "4.2.0",
"@typescript-eslint/scope-manager": "4.2.0",
"@typescript-eslint/experimental-utils": "4.4.0",
"@typescript-eslint/scope-manager": "4.4.0",
"debug": "^4.1.1",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.0.0",
@@ -394,28 +394,28 @@
}
},
"@typescript-eslint/experimental-utils": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.2.0.tgz",
"integrity": "sha512-5BBj6BjgHEndBaQQpUVzRIPERz03LBc0MCQkHwUaH044FJFL08SwWv/sQftk7gf0ShZ2xZysz0LTwCwNt4Xu3w==",
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.4.0.tgz",
"integrity": "sha512-01+OtK/oWeSJTjQcyzDztfLF1YjvKpLFo+JZmurK/qjSRcyObpIecJ4rckDoRCSh5Etw+jKfdSzVEHevh9gJ1w==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
"@typescript-eslint/scope-manager": "4.2.0",
"@typescript-eslint/types": "4.2.0",
"@typescript-eslint/typescript-estree": "4.2.0",
"@typescript-eslint/scope-manager": "4.4.0",
"@typescript-eslint/types": "4.4.0",
"@typescript-eslint/typescript-estree": "4.4.0",
"eslint-scope": "^5.0.0",
"eslint-utils": "^2.0.0"
}
},
"@typescript-eslint/parser": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.2.0.tgz",
"integrity": "sha512-54jJ6MwkOtowpE48C0QJF9iTz2/NZxfKVJzv1ha5imigzHbNSLN9yvbxFFH1KdlRPQrlR8qxqyOvLHHxd397VA==",
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.4.0.tgz",
"integrity": "sha512-yc14iEItCxoGb7W4Nx30FlTyGpU9r+j+n1LUK/exlq2eJeFxczrz/xFRZUk2f6yzWfK+pr1DOTyQnmDkcC4TnA==",
"dev": true,
"requires": {
"@typescript-eslint/scope-manager": "4.2.0",
"@typescript-eslint/types": "4.2.0",
"@typescript-eslint/typescript-estree": "4.2.0",
"@typescript-eslint/scope-manager": "4.4.0",
"@typescript-eslint/types": "4.4.0",
"@typescript-eslint/typescript-estree": "4.4.0",
"debug": "^4.1.1"
},
"dependencies": {
@@ -437,29 +437,29 @@
}
},
"@typescript-eslint/scope-manager": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.2.0.tgz",
"integrity": "sha512-Tb402cxxObSxWIVT+PnBp5ruT2V/36yj6gG4C9AjkgRlZpxrLAzWDk3neen6ToMBGeGdxtnfFLoJRUecGz9mYQ==",
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.4.0.tgz",
"integrity": "sha512-r2FIeeU1lmW4K3CxgOAt8djI5c6Q/5ULAgdVo9AF3hPMpu0B14WznBAtxrmB/qFVbVIB6fSx2a+EVXuhSVMEyA==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.2.0",
"@typescript-eslint/visitor-keys": "4.2.0"
"@typescript-eslint/types": "4.4.0",
"@typescript-eslint/visitor-keys": "4.4.0"
}
},
"@typescript-eslint/types": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.2.0.tgz",
"integrity": "sha512-xkv5nIsxfI/Di9eVwN+G9reWl7Me9R5jpzmZUch58uQ7g0/hHVuGUbbn4NcxcM5y/R4wuJIIEPKPDb5l4Fdmwg==",
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.4.0.tgz",
"integrity": "sha512-nU0VUpzanFw3jjX+50OTQy6MehVvf8pkqFcURPAE06xFNFenMj1GPEI6IESvp7UOHAnq+n/brMirZdR+7rCrlA==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.2.0.tgz",
"integrity": "sha512-iWDLCB7z4MGkLipduF6EOotdHNtgxuNKnYD54nMS/oitFnsk4S3S/TE/UYXQTra550lHtlv9eGmp+dvN9pUDtA==",
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.4.0.tgz",
"integrity": "sha512-Fh85feshKXwki4nZ1uhCJHmqKJqCMba+8ZicQIhNi5d5jSQFteWiGeF96DTjO8br7fn+prTP+t3Cz/a/3yOKqw==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.2.0",
"@typescript-eslint/visitor-keys": "4.2.0",
"@typescript-eslint/types": "4.4.0",
"@typescript-eslint/visitor-keys": "4.4.0",
"debug": "^4.1.1",
"globby": "^11.0.1",
"is-glob": "^4.0.1",
@@ -492,12 +492,12 @@
}
},
"@typescript-eslint/visitor-keys": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.2.0.tgz",
"integrity": "sha512-WIf4BNOlFOH2W+YqGWa6YKLcK/EB3gEj2apCrqLw6mme1RzBy0jtJ9ewJgnrZDB640zfnv8L+/gwGH5sYp/rGw==",
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.4.0.tgz",
"integrity": "sha512-oBWeroUZCVsHLiWRdcTXJB7s1nB3taFY8WGvS23tiAlT6jXVvsdAV4rs581bgdEjOhn43q6ro7NkOiLKu6kFqA==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.2.0",
"@typescript-eslint/types": "4.4.0",
"eslint-visitor-keys": "^2.0.0"
}
},
@@ -517,9 +517,9 @@
}
},
"acorn": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz",
"integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==",
"version": "7.4.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"dev": true
},
"acorn-jsx": {
@@ -529,9 +529,9 @@
"dev": true
},
"ajv": {
"version": "6.12.5",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz",
"integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==",
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
@@ -1164,9 +1164,9 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"eslint": {
"version": "7.10.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.10.0.tgz",
"integrity": "sha512-BDVffmqWl7JJXqCjAK6lWtcQThZB/aP1HXSH1JKwGwv0LQEdvpR7qzNrUT487RM39B5goWuboFad5ovMBmD8yA==",
"version": "7.11.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.11.0.tgz",
"integrity": "sha512-G9+qtYVCHaDi1ZuWzBsOWo2wSwd70TXnU6UHA3cTYHp7gCTXZcpggWFoUVAMRarg68qtPoNfFbzPh+VdOgmwmw==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
@@ -1179,7 +1179,7 @@
"enquirer": "^2.3.5",
"eslint-scope": "^5.1.1",
"eslint-utils": "^2.1.0",
"eslint-visitor-keys": "^1.3.0",
"eslint-visitor-keys": "^2.0.0",
"espree": "^7.3.0",
"esquery": "^1.2.0",
"esutils": "^2.0.2",
@@ -1209,12 +1209,11 @@
},
"dependencies": {
"ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
}
},
@@ -1252,12 +1251,6 @@
"ms": "2.1.2"
}
},
"eslint-visitor-keys": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
"integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
"dev": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
@@ -2263,9 +2256,9 @@
}
},
"moment": {
"version": "2.29.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.0.tgz",
"integrity": "sha512-z6IJ5HXYiuxvFTI6eiQ9dm77uE0gyy1yXNApVHqTcnIKfY9tIwEjlzsZ6u1LQXvVgKeTnv9Xm7NDvJ7lso3MtA=="
"version": "2.29.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
},
"ms": {
"version": "2.0.0",
@@ -2489,31 +2482,23 @@
"dev": true
},
"pg": {
"version": "8.3.3",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.3.3.tgz",
"integrity": "sha512-wmUyoQM/Xzmo62wgOdQAn5tl7u+IA1ZYK7qbuppi+3E+Gj4hlUxVHjInulieWrd0SfHi/ADriTb5ILJ/lsJrSg==",
"version": "8.4.1",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.4.1.tgz",
"integrity": "sha512-NRsH0aGMXmX1z8Dd0iaPCxWUw4ffu+lIAmGm+sTCwuDDWkpEgRCAHZYDwqaNhC5hG5DRMOjSUFasMWhvcmLN1A==",
"requires": {
"buffer-writer": "2.0.0",
"packet-reader": "1.0.0",
"pg-connection-string": "^2.3.0",
"pg-connection-string": "^2.4.0",
"pg-pool": "^3.2.1",
"pg-protocol": "^1.2.5",
"pg-protocol": "^1.3.0",
"pg-types": "^2.1.0",
"pgpass": "1.x",
"semver": "4.3.2"
},
"dependencies": {
"semver": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-4.3.2.tgz",
"integrity": "sha1-x6BxWKgL7dBSNVt3DYLWZA+AO+c="
}
"pgpass": "1.x"
}
},
"pg-connection-string": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.3.0.tgz",
"integrity": "sha512-ukMTJXLI7/hZIwTW7hGMZJ0Lj0S2XQBCJ4Shv4y1zgQ/vqVea+FLhzywvPj0ujSuofu+yA4MYHGZPTsgjBgJ+w=="
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.4.0.tgz",
"integrity": "sha512-3iBXuv7XKvxeMrIgym7njT+HlZkwZqqGX4Bu9cci8xHZNT+Um1gWKqCsAzcC0d95rcKMU5WBg6YRUcHyV0HZKQ=="
},
"pg-int8": {
"version": "1.0.1",
@@ -2526,9 +2511,9 @@
"integrity": "sha512-BQDPWUeKenVrMMDN9opfns/kZo4lxmSWhIqo+cSAF7+lfi9ZclQbr9vfnlNaPr8wYF3UYjm5X0yPAhbcgqNOdA=="
},
"pg-protocol": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.2.5.tgz",
"integrity": "sha512-1uYCckkuTfzz/FCefvavRywkowa6M5FohNMF5OjKrqo9PSR8gYc8poVmwwYQaBxhmQdBjhtP514eXy9/Us2xKg=="
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.3.0.tgz",
"integrity": "sha512-64/bYByMrhWULUaCd+6/72c9PMWhiVFs3EVxl9Ct6a3v/U8+rKgqP2w+kKg/BIGgMJyB+Bk/eNivT32Al+Jghw=="
},
"pg-types": {
"version": "2.2.0",
@@ -3120,9 +3105,9 @@
}
},
"tslib": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
"integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==",
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"tsutils": {
@@ -3382,9 +3367,9 @@
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"uuid": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz",
"integrity": "sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ=="
"version": "8.3.1",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.1.tgz",
"integrity": "sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg=="
},
"v8-compile-cache": {
"version": "2.1.1",
+8 -8
View File
@@ -7,7 +7,7 @@
"private": true,
"repository": "github:Lattyware/massivedecks",
"engines": {
"node": "13.x.x"
"node": "14.x.x"
},
"type": "module",
"module": "dist/index.js",
@@ -28,7 +28,7 @@
"config.json5"
],
"dependencies": {
"ajv": "^6.12.5",
"ajv": "^6.12.6",
"axios": "^0.20.0",
"body-parser": "^1.19.0",
"express": "^4.17.1",
@@ -42,11 +42,11 @@
"http-status-codes": "^2.1.4",
"json5": "^2.1.3",
"jsonwebtoken": "^8.5.1",
"moment": "^2.29.0",
"pg": "^8.3.3",
"moment": "^2.29.1",
"pg": "^8.4.1",
"rfc6902": "^4.0.1",
"source-map-support": "^0.5.19",
"uuid": "^8.3.0",
"uuid": "^8.3.1",
"winston": "^3.3.3",
"wu": "^2.1.0"
},
@@ -65,9 +65,9 @@
"@types/source-map-support": "^0.5.3",
"@types/uuid": "^8.3.0",
"@types/wu": "^2.1.42",
"@typescript-eslint/eslint-plugin": "^4.2.0",
"@typescript-eslint/parser": "^4.2.0",
"eslint": "^7.10.0",
"@typescript-eslint/eslint-plugin": "^4.4.0",
"@typescript-eslint/parser": "^4.4.0",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.12.0",
"eslint-plugin-prettier": "^3.1.4",
"nodemon": "^2.0.4",
@@ -21,19 +21,15 @@ export interface ClientInfo {
}[];
}
interface RawDecks {
cards: {
white: { text: string }[];
black: { text: string; pick: number }[];
};
decks: { [id: string]: RawDeck };
interface Packs {
white: string[];
black: { text: string; pick: number }[];
packs: Pack[];
}
interface RawDeck {
interface Pack {
name: string;
description: string;
official: boolean;
icon: string | number;
white: number[];
black: number[];
}
@@ -58,21 +54,20 @@ function* introduceSlots(line: string): Iterable<Card.Part> {
}
function rawDeckToSummaryAndTemplates(
raw: RawDecks,
raw: Packs,
pack: Pack,
id: string
): {
summary: Source.Summary;
templates: Decks.Templates;
} {
const pack = raw.decks[id];
const source: JsonAgainstHumanity = {
source: "JAH",
id,
};
function call(index: number): Card.Call {
const from = raw.cards.black[index];
const from = raw.black[index];
const parts = from.text.split("\n").map((t) => [...introduceSlots(t)]);
const slots = Card.slotCount(parts);
const extraSlots = Math.max(0, from.pick - slots);
@@ -84,8 +79,8 @@ function rawDeckToSummaryAndTemplates(
}
function response(index: number): Card.Response {
const from = raw.cards.white[index];
const stripped = from.text.replace("\n", "");
const from = raw.white[index];
const stripped = from.replace("\n", "");
return {
id: Card.id(),
source,
@@ -178,42 +173,25 @@ export class MetaResolver implements Source.MetaResolver<JsonAgainstHumanity> {
private readonly order: string[];
public readonly cache = false;
public constructor(config: Config.JsonAgainstHumanity, decks: RawDecks) {
public constructor(config: Config.JsonAgainstHumanity, decks: Packs) {
this.config = config;
this.decks = new Map();
const protoOrder: [string, RawDeck][] = [];
for (const id in decks.decks) {
this.decks.set(id, rawDeckToSummaryAndTemplates(decks, id));
protoOrder.push([id, decks.decks[id]]);
const protoOrder: [string, Pack][] = [];
for (let index = 0; index < decks.packs.length; index++) {
const id = index.toString();
const pack = decks.packs[index];
this.decks.set(id, rawDeckToSummaryAndTemplates(decks, pack, id));
protoOrder.push([id, pack]);
}
protoOrder.sort(MetaResolver.compare);
this.order = protoOrder.map(([id, _]) => id);
}
private static compare(
[_idA, a]: [string, RawDeck],
[_idB, b]: [string, RawDeck]
[_idA, a]: [string, Pack],
[_idB, b]: [string, Pack]
): number {
const official = MetaResolver.boolCompare(a, b, (v) => v.official);
if (official !== 0) {
return official;
} else {
const isThirdParty = MetaResolver.boolCompare(a, b, (v) =>
v.name.startsWith("[$]")
);
if (isThirdParty !== 0) {
return isThirdParty;
} else {
const isCommunity = MetaResolver.boolCompare(a, b, (v) =>
v.name.startsWith("[C]")
);
if (isCommunity !== 0) {
return isCommunity;
} else {
return 0;
}
}
}
return MetaResolver.boolCompare(a, b, (v) => v.official);
}
private static boolCompare<T>(a: T, b: T, f: (t: T) => boolean): number {
+3 -3
View File
@@ -17,6 +17,7 @@ import * as Decks from "./cards/decks";
import * as Play from "./cards/play";
import * as Round from "./game/round";
import * as PublicRound from "./game/round/public";
import { StoredPlay } from "./game/round/storedPlay";
import * as Player from "./player";
import * as Rules from "./rules";
@@ -255,9 +256,8 @@ export class Game {
Game.isPlayerInRound(czar, this.players, id, lobby.users[id])
)
);
this.decks.responses.discard(
(this.round as Round.Base<Round.Stage>).plays.flatMap((play) => play.play)
);
const plays: StoredPlay[] = this.round.plays;
this.decks.responses.discard(plays.flatMap((play) => play.play));
this.round = new Round.Playing(roundId, czar, playersInRound, call);
const updatedGame = this as Game & { round: Round.Playing };
const atStart = Game.atStartOfRound(server, false, updatedGame);