diff --git a/client/package.json b/client/package.json index ef69e5588..724121059 100644 --- a/client/package.json +++ b/client/package.json @@ -6,7 +6,8 @@ "scripts": { "start": "vite", "build": "vite build", - "lint": "eslint src --fix" + "lint": "eslint src --fix", + "preview": "vite preview" }, "browserslist": { "production": [ diff --git a/common/src/config/config.ts b/common/src/config/config.ts index c7c78c6ac..1169d5b22 100644 --- a/common/src/config/config.ts +++ b/common/src/config/config.ts @@ -1,3 +1,4 @@ +import { FormatSieglindeBMS, FormatSieglindePMS } from "./internal-utils"; import { COLOUR_SET } from "../constants/colour-set"; import { BMSDPSlDans, @@ -16,7 +17,6 @@ import { WaccaColours, WaccaStageUps, } from "../game-classes"; -import { FormatSieglindeBMS, FormatSieglindePMS } from "../utils/util"; import type { GPTTierlists } from ".."; import type { ClassInfo, GameClassSets } from "../game-classes"; import type { ESDJudgementFormat } from "../lib/esd"; diff --git a/common/src/config/internal-utils.ts b/common/src/config/internal-utils.ts new file mode 100644 index 000000000..86a355885 --- /dev/null +++ b/common/src/config/internal-utils.ts @@ -0,0 +1,18 @@ +// putting these in "utils/util.ts" would result in dependency cycles +// which are generally pretty awful + +export function FormatSieglindeBMS(sgl: number): string { + if (sgl < 13) { + return `☆${sgl.toFixed(2)}`; + } + + return `★${(sgl - 12).toFixed(2)}`; +} + +export function FormatSieglindePMS(sgl: number): string { + if (sgl < 13) { + return `○${sgl.toFixed(2)}`; + } + + return `●${(sgl - 12).toFixed(2)}`; +} diff --git a/common/src/lib/schemas.ts b/common/src/lib/schemas.ts index 682b558b7..18221cc01 100644 --- a/common/src/lib/schemas.ts +++ b/common/src/lib/schemas.ts @@ -2,13 +2,13 @@ // their name in the database to the object they schemaify. // The schemas themselves are wrapped in functions that throw on error. +import { GetGameConfig, GetGamePTConfig } from "../config/config"; import { allIDStrings, allImportTypes, allSupportedGames } from "../config/static-config"; import { ALL_PERMISSIONS } from "../constants/permissions"; -import { GetGameConfig, GetGamePTConfig } from "../index"; import { UserAuthLevels } from "../types"; import deepmerge from "deepmerge"; import p from "prudence"; -import type { GamePTConfig } from "../index"; +import type { GamePTConfig } from "../config/config"; import type { Game, IDStrings, NotificationBody, Playtype, Playtypes } from "../types"; import type { PrudenceSchema, @@ -1135,6 +1135,11 @@ const PRE_SCHEMAS = { }; break; } + + case "SITE_ANNOUNCEMENT": { + subSchema = {}; + break; + } } const err = p(self, subSchema); diff --git a/common/src/utils/util.ts b/common/src/utils/util.ts index f967f378d..344e654f1 100644 --- a/common/src/utils/util.ts +++ b/common/src/utils/util.ts @@ -305,22 +305,6 @@ export function GetCloserGradeDelta( return lower; } -export function FormatSieglindeBMS(sgl: number): string { - if (sgl < 13) { - return `☆${sgl.toFixed(2)}`; - } - - return `★${(sgl - 12).toFixed(2)}`; -} - -export function FormatSieglindePMS(sgl: number): string { - if (sgl < 13) { - return `○${sgl.toFixed(2)}`; - } - - return `●${(sgl - 12).toFixed(2)}`; -} - export function CreateSongMap(songs: Array>) { const songMap = new Map>();