Update deps (#2675)

This commit is contained in:
Kalle 2025-12-27 10:28:31 +02:00 committed by GitHub
parent 97d9cd149d
commit c1aa970d01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 2639 additions and 1898 deletions

View File

@ -24,9 +24,10 @@ import type {
} from "~/modules/in-game-lists/types";
import type { JSONColumnTypeNullable } from "~/utils/kysely.server";
type Generated<T> = T extends ColumnType<infer S, infer I, infer U>
? ColumnType<S, I | undefined, U>
: ColumnType<T, T | undefined, T>;
type Generated<T> =
T extends ColumnType<infer S, infer I, infer U>
? ColumnType<S, I | undefined, U>
: ColumnType<T, T | undefined, T>;
export type MemberRole = (typeof TEAM_MEMBER_ROLES)[number];

View File

@ -127,7 +127,7 @@ function TierListMakerContent() {
flushSync(() => setScreenshotMode(true));
await snapdom.download(tierListRef.current, {
format: "png",
type: "png",
filename: "tier-list",
quality: 1,
scale: 1.75,

View File

@ -170,97 +170,89 @@ describe("Swiss", () => {
const PAIR_UP_TEST_CASES = [RUSH_WEEKEND_3, LOW_INK_AUGUST_2025];
describe("pairUp()", () => {
it.for(PAIR_UP_TEST_CASES)(
"all teams have matches (pair up test cases idx %#)",
(testCase) => {
const result = Swiss.pairUp(testCase);
it.for(
PAIR_UP_TEST_CASES,
)("all teams have matches (pair up test cases idx %#)", (testCase) => {
const result = Swiss.pairUp(testCase);
const inputTeams = testCase
.map((team) => team.id)
.sort((a, b) => a - b);
const resultTeams = result
.flatMap((match) => [match.opponentOne, match.opponentTwo])
.filter((val) => val !== null)
.sort((a, b) => a - b);
const inputTeams = testCase.map((team) => team.id).sort((a, b) => a - b);
const resultTeams = result
.flatMap((match) => [match.opponentOne, match.opponentTwo])
.filter((val) => val !== null)
.sort((a, b) => a - b);
expect(inputTeams).toEqual(resultTeams);
},
);
expect(inputTeams).toEqual(resultTeams);
});
it.for(PAIR_UP_TEST_CASES)(
"every pair is max one set win from each other (pair up test cases idx %#)",
(testCase) => {
const result = Swiss.pairUp(testCase);
it.for(
PAIR_UP_TEST_CASES,
)("every pair is max one set win from each other (pair up test cases idx %#)", (testCase) => {
const result = Swiss.pairUp(testCase);
for (const match of result) {
if (match.opponentOne === null || match.opponentTwo === null)
continue;
for (const match of result) {
if (match.opponentOne === null || match.opponentTwo === null) continue;
const opponentOneScore = testCase.find(
(t) => t.id === match.opponentOne,
)!.score;
const opponentTwoScore = testCase.find(
(t) => t.id === match.opponentTwo,
)!.score;
const opponentOneScore = testCase.find(
(t) => t.id === match.opponentOne,
)!.score;
const opponentTwoScore = testCase.find(
(t) => t.id === match.opponentTwo,
)!.score;
expect(
Math.abs(opponentOneScore - opponentTwoScore),
`Teams ${match.opponentOne} and ${match.opponentTwo} have too large score difference (${opponentOneScore} vs ${opponentTwoScore})`,
).toBeLessThanOrEqual(1);
}
},
);
expect(
Math.abs(opponentOneScore - opponentTwoScore),
`Teams ${match.opponentOne} and ${match.opponentTwo} have too large score difference (${opponentOneScore} vs ${opponentTwoScore})`,
).toBeLessThanOrEqual(1);
}
});
it.for(PAIR_UP_TEST_CASES)(
"should match perfect records against each other as much as possible (pair up test cases idx %#)",
(testCase) => {
const result = Swiss.pairUp(testCase);
it.for(
PAIR_UP_TEST_CASES,
)("should match perfect records against each other as much as possible (pair up test cases idx %#)", (testCase) => {
const result = Swiss.pairUp(testCase);
const maxScore = testCase.reduce(
(max, team) => Math.max(max, team.score),
0,
const maxScore = testCase.reduce(
(max, team) => Math.max(max, team.score),
0,
);
const perfectRecordsCount = testCase.filter(
(team) => team.score === maxScore,
).length;
let perfectRecordsPlayingEachOtherCount = 0;
for (const match of result) {
if (match.opponentOne === null || match.opponentTwo === null) continue;
const oneIsPerfectScore = testCase.some(
(team) => team.id === match.opponentOne && team.score === maxScore,
);
const perfectRecordsCount = testCase.filter(
(team) => team.score === maxScore,
).length;
let perfectRecordsPlayingEachOtherCount = 0;
for (const match of result) {
if (match.opponentOne === null || match.opponentTwo === null)
continue;
const oneIsPerfectScore = testCase.some(
(team) => team.id === match.opponentOne && team.score === maxScore,
);
const twoIsPerfectScore = testCase.some(
(team) => team.id === match.opponentTwo && team.score === maxScore,
);
if (oneIsPerfectScore && twoIsPerfectScore) {
perfectRecordsPlayingEachOtherCount++;
}
}
expect(perfectRecordsPlayingEachOtherCount).toBe(
Math.floor(perfectRecordsCount / 2),
const twoIsPerfectScore = testCase.some(
(team) => team.id === match.opponentTwo && team.score === maxScore,
);
},
);
it.for(PAIR_UP_TEST_CASES)(
"generates max one bye (pair up test cases idx %#)",
(testCase) => {
const result = Swiss.pairUp(testCase);
let byes = 0;
for (const match of result) {
if (match.opponentOne === null || match.opponentTwo === null) byes++;
if (oneIsPerfectScore && twoIsPerfectScore) {
perfectRecordsPlayingEachOtherCount++;
}
}
expect(byes).toBeLessThanOrEqual(1);
},
);
expect(perfectRecordsPlayingEachOtherCount).toBe(
Math.floor(perfectRecordsCount / 2),
);
});
it.for(
PAIR_UP_TEST_CASES,
)("generates max one bye (pair up test cases idx %#)", (testCase) => {
const result = Swiss.pairUp(testCase);
let byes = 0;
for (const match of result) {
if (match.opponentOne === null || match.opponentTwo === null) byes++;
}
expect(byes).toBeLessThanOrEqual(1);
});
});
describe("calculateTeamStatus()", () => {

View File

@ -7,6 +7,7 @@ import type {
PreparedMaps,
Tables,
TournamentSettings,
TournamentSub,
} from "~/db/tables";
import * as Progression from "~/features/tournament-bracket/core/Progression";
import { Status } from "~/modules/brackets-model";
@ -289,6 +290,11 @@ export async function findById(id: number) {
return {
...result,
// TODO: types broke with dependency update somehow
subCounts: result.subCounts as Array<{
visibility: TournamentSub["visibility"];
count: number;
}>,
teams: result.teams.map((team) => ({
...team,
members: team.members.map(({ ordinal, ...member }) => member),

View File

@ -11,8 +11,6 @@
"babel-plugin-react-compiler"
],
"entry": [
"app/entry.server.tsx",
"app/entry.client.tsx",
"app/routes.ts",
"app/features/*/routes/**/*.{ts,tsx}",
"migrations/**/*.js",

4298
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -30,23 +30,23 @@
"knip": "knip"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.797.0",
"@aws-sdk/lib-storage": "^3.797.0",
"@date-fns/tz": "^1.2.0",
"@aws-sdk/client-s3": "^3.958.0",
"@aws-sdk/lib-storage": "^3.958.0",
"@date-fns/tz": "^1.4.1",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/modifiers": "^9.0.0",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@epic-web/cachified": "^5.5.2",
"@faker-js/faker": "^9.7.0",
"@hookform/resolvers": "^5.1.1",
"@internationalized/date": "^3.10.0",
"@remix-run/node": "^2.16.8",
"@remix-run/react": "^2.16.8",
"@remix-run/serve": "^2.16.8",
"@epic-web/cachified": "^5.6.0",
"@faker-js/faker": "^10.1.0",
"@hookform/resolvers": "^5.2.2",
"@internationalized/date": "^3.10.1",
"@remix-run/node": "^2.17.2",
"@remix-run/react": "^2.17.2",
"@remix-run/serve": "^2.17.2",
"@tldraw/tldraw": "^3.12.1",
"@zumer/snapdom": "^1.9.14",
"aws-sdk": "^2.1692.0",
"@zumer/snapdom": "^2.0.1",
"aws-sdk": "^2.1693.0",
"better-sqlite3": "^11.9.1",
"clsx": "^2.1.1",
"compressorjs": "^1.2.1",
@ -54,67 +54,67 @@
"edmonds-blossom-fixed": "^1.0.1",
"gray-matter": "^4.0.3",
"i18next": "^23.16.8",
"i18next-browser-languagedetector": "^8.0.5",
"i18next-browser-languagedetector": "^8.2.0",
"i18next-http-backend": "^2.6.2",
"ics": "^3.8.1",
"isbot": "^5.1.27",
"isbot": "^5.1.32",
"jsoncrush": "^1.1.8",
"kysely": "^0.28.2",
"lru-cache": "^11.1.0",
"markdown-to-jsx": "^7.7.6",
"nanoid": "^5.1.5",
"kysely": "^0.28.9",
"lru-cache": "^11.2.4",
"markdown-to-jsx": "^9.5.0",
"nanoid": "^5.1.6",
"neverthrow": "^8.2.0",
"node-cron": "3.0.3",
"node-cron": "4.2.1",
"nprogress": "^0.2.0",
"openskill": "^4.1.0",
"p-limit": "^6.2.0",
"partysocket": "^1.1.3",
"p-limit": "^7.2.0",
"partysocket": "^1.1.10",
"react": "^18.3.1",
"react-aria-components": "^1.13.0",
"react-aria-components": "^1.14.0",
"react-charts": "^3.0.0-beta.57",
"react-compiler-runtime": "^19.1.0-rc.2",
"react-dom": "^18.3.1",
"react-error-boundary": "^5.0.0",
"react-error-boundary": "^6.0.0",
"react-flip-toolkit": "7.2.4",
"react-hook-form": "^7.56.1",
"react-hook-form": "^7.69.0",
"react-i18next": "^15.5.1",
"react-use": "^17.6.0",
"react-use-draggable-scroll": "^0.4.7",
"remeda": "^2.21.3",
"remeda": "^2.32.0",
"remix-auth": "^4.2.0",
"remix-auth-oauth2": "^3.4.0",
"remix-auth-oauth2": "^3.4.1",
"remix-i18next": "^6.4.1",
"remix-utils": "^7.7.0",
"slugify": "^1.6.6",
"swr": "^2.3.3",
"swr": "^2.3.8",
"web-push": "^3.6.7",
"zod": "^3.25.61"
},
"devDependencies": {
"@biomejs/biome": "2.3.1",
"@biomejs/biome": "2.3.10",
"@playwright/test": "^1.52.0",
"@remix-run/dev": "^2.16.8",
"@remix-run/route-config": "^2.16.8",
"@remix-run/dev": "^2.17.2",
"@remix-run/route-config": "^2.17.2",
"@types/better-sqlite3": "^7.6.13",
"@types/node": "^25.0.2",
"@types/node": "^25.0.3",
"@types/node-cron": "^3.0.11",
"@types/nprogress": "^0.2.3",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/web-push": "^3.6.4",
"babel-plugin-react-compiler": "^19.1.0-rc.2",
"cross-env": "^7.0.3",
"cross-env": "^10.1.0",
"dotenv": "^17.2.3",
"i18next-locales-sync": "^2.1.1",
"knip": "^5.73.4",
"knip": "^5.77.4",
"ley": "^0.8.1",
"sql-formatter": "^15.6.1",
"tsx": "^4.19.4",
"sql-formatter": "^15.6.12",
"tsx": "^4.21.0",
"typescript": "^5.9.3",
"vite": "^6.4.1",
"vite-node": "^3.2.4",
"vite-node": "^5.2.0",
"vite-plugin-babel": "^1.3.2",
"vite-tsconfig-paths": "^5.1.4",
"vite-tsconfig-paths": "^6.0.3",
"vitest": "^3.2.4"
}
}