From 2c9a7f9a99bfdb86c464de31deeb0ff9e5cd71a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Sat, 7 Sep 2024 23:11:44 -0500 Subject: [PATCH] feat: split up some more --- .../src/app}/[region]/rating/current/info/route.ts | 2 +- .../rating/current/league/[league]/route.ts | 2 +- .../rating/current/search/[username]/route.ts | 2 +- .../src/app}/patreon/auth/[code]/route.ts | 0 .../src/app}/patreon/membership/[token]/route.ts | 0 .../src/app}/patreon/refresh/[token]/route.ts | 0 .../app/api => api/src/app}/tank-averages/route.ts | 0 .../src/app}/tank-voting/[id]/average/route.ts | 4 ++-- .../src/app}/tank-voting/[id]/cast/route.ts | 6 +++--- packages/api/tsconfig.json | 2 +- packages/bot/src/commands/searchClans.ts | 3 +-- packages/bot/src/core/discord/addFilterOptions.ts | 1 - packages/bot/src/types/ttf.d.ts | 4 ++++ packages/bot/tsconfig.json | 7 ++----- packages/core/tsconfig.json | 4 ++++ packages/scripts/src/buildRatingLeaderboard.ts | 3 ++- packages/scripts/tsconfig.json | 4 ++++ packages/website/src/app/tools/rating/page.tsx | 2 +- .../src/core/blitzkit/getArchivedRatingInfo.ts | 3 +-- packages/website/src/types/glsl.d.ts | 4 ++++ packages/website/src/types/proto.d.ts | 4 ++++ packages/website/tsconfig.json | 1 - tsconfig.json | 1 - types.d.ts | 14 -------------- 24 files changed, 36 insertions(+), 37 deletions(-) rename packages/{website/src/app/api => api/src/app}/[region]/rating/current/info/route.ts (73%) rename packages/{website/src/app/api => api/src/app}/[region]/rating/current/league/[league]/route.ts (74%) rename packages/{website/src/app/api => api/src/app}/[region]/rating/current/search/[username]/route.ts (86%) rename packages/{website/src/app/api => api/src/app}/patreon/auth/[code]/route.ts (100%) rename packages/{website/src/app/api => api/src/app}/patreon/membership/[token]/route.ts (100%) rename packages/{website/src/app/api => api/src/app}/patreon/refresh/[token]/route.ts (100%) rename packages/{website/src/app/api => api/src/app}/tank-averages/route.ts (100%) rename packages/{website/src/app/api => api/src/app}/tank-voting/[id]/average/route.ts (93%) rename packages/{website/src/app/api => api/src/app}/tank-voting/[id]/cast/route.ts (91%) create mode 100644 packages/bot/src/types/ttf.d.ts create mode 100644 packages/core/tsconfig.json create mode 100644 packages/scripts/tsconfig.json create mode 100644 packages/website/src/types/glsl.d.ts create mode 100644 packages/website/src/types/proto.d.ts delete mode 100644 types.d.ts diff --git a/packages/website/src/app/api/[region]/rating/current/info/route.ts b/packages/api/src/app/[region]/rating/current/info/route.ts similarity index 73% rename from packages/website/src/app/api/[region]/rating/current/info/route.ts rename to packages/api/src/app/[region]/rating/current/info/route.ts index fdd613f79..0b2af6866 100644 --- a/packages/website/src/app/api/[region]/rating/current/info/route.ts +++ b/packages/api/src/app/[region]/rating/current/info/route.ts @@ -1,6 +1,6 @@ import { Region } from '@blitzkit/core'; import { NextResponse } from 'next/server'; -import getRatingInfo from '../../../../../../core/blitz/getRatingInfo'; +import getRatingInfo from '../../../../../../../../website/src/core/blitz/getRatingInfo'; export async function GET( request: Request, diff --git a/packages/website/src/app/api/[region]/rating/current/league/[league]/route.ts b/packages/api/src/app/[region]/rating/current/league/[league]/route.ts similarity index 74% rename from packages/website/src/app/api/[region]/rating/current/league/[league]/route.ts rename to packages/api/src/app/[region]/rating/current/league/[league]/route.ts index 05e30e467..38214d8a2 100644 --- a/packages/website/src/app/api/[region]/rating/current/league/[league]/route.ts +++ b/packages/api/src/app/[region]/rating/current/league/[league]/route.ts @@ -1,6 +1,6 @@ import { Region } from '@blitzkit/core'; import { NextResponse } from 'next/server'; -import { getRatingLeague } from '../../../../../../../core/blitz/getRatingLeague'; +import { getRatingLeague } from '../../../../../../../../../website/src/core/blitz/getRatingLeague'; export async function GET( request: Request, diff --git a/packages/website/src/app/api/[region]/rating/current/search/[username]/route.ts b/packages/api/src/app/[region]/rating/current/search/[username]/route.ts similarity index 86% rename from packages/website/src/app/api/[region]/rating/current/search/[username]/route.ts rename to packages/api/src/app/[region]/rating/current/search/[username]/route.ts index 3681ec814..4785bc346 100644 --- a/packages/website/src/app/api/[region]/rating/current/search/[username]/route.ts +++ b/packages/api/src/app/[region]/rating/current/search/[username]/route.ts @@ -1,6 +1,6 @@ import { Region } from '@blitzkit/core'; import { NextResponse } from 'next/server'; -import { searchCurrentRatingPlayers } from '../../../../../../../core/blitz/searchCurrentRatingPlayers'; +import { searchCurrentRatingPlayers } from '../../../../../../../../../website/src/core/blitz/searchCurrentRatingPlayers'; export async function GET( request: Request, diff --git a/packages/website/src/app/api/patreon/auth/[code]/route.ts b/packages/api/src/app/patreon/auth/[code]/route.ts similarity index 100% rename from packages/website/src/app/api/patreon/auth/[code]/route.ts rename to packages/api/src/app/patreon/auth/[code]/route.ts diff --git a/packages/website/src/app/api/patreon/membership/[token]/route.ts b/packages/api/src/app/patreon/membership/[token]/route.ts similarity index 100% rename from packages/website/src/app/api/patreon/membership/[token]/route.ts rename to packages/api/src/app/patreon/membership/[token]/route.ts diff --git a/packages/website/src/app/api/patreon/refresh/[token]/route.ts b/packages/api/src/app/patreon/refresh/[token]/route.ts similarity index 100% rename from packages/website/src/app/api/patreon/refresh/[token]/route.ts rename to packages/api/src/app/patreon/refresh/[token]/route.ts diff --git a/packages/website/src/app/api/tank-averages/route.ts b/packages/api/src/app/tank-averages/route.ts similarity index 100% rename from packages/website/src/app/api/tank-averages/route.ts rename to packages/api/src/app/tank-averages/route.ts diff --git a/packages/website/src/app/api/tank-voting/[id]/average/route.ts b/packages/api/src/app/tank-voting/[id]/average/route.ts similarity index 93% rename from packages/website/src/app/api/tank-voting/[id]/average/route.ts rename to packages/api/src/app/tank-voting/[id]/average/route.ts index 322703302..970cd6d2b 100644 --- a/packages/website/src/app/api/tank-voting/[id]/average/route.ts +++ b/packages/api/src/app/tank-voting/[id]/average/route.ts @@ -1,10 +1,10 @@ import { tankDefinitions, usersDatabase } from '@blitzkit/core'; import { NextRequest, NextResponse } from 'next/server'; -import { isValidBlitzId } from '../../../../../core/blitz/isValidBlitzId'; +import { isValidBlitzId } from '../../../../../../../website/src/core/blitz/isValidBlitzId'; import { BlitzkitResponse, BlitzkitResponseError, -} from '../../../../../hooks/useTankVotes'; +} from '../../../../../../../website/src/hooks/useTankVotes'; import { TankVoteCategory } from '../cast/route'; export interface TankVotes { diff --git a/packages/website/src/app/api/tank-voting/[id]/cast/route.ts b/packages/api/src/app/tank-voting/[id]/cast/route.ts similarity index 91% rename from packages/website/src/app/api/tank-voting/[id]/cast/route.ts rename to packages/api/src/app/tank-voting/[id]/cast/route.ts index f3e5e8327..9f4703fdf 100644 --- a/packages/website/src/app/api/tank-voting/[id]/cast/route.ts +++ b/packages/api/src/app/tank-voting/[id]/cast/route.ts @@ -1,11 +1,11 @@ import { tankDefinitions, usersDatabase } from '@blitzkit/core'; import { NextRequest, NextResponse } from 'next/server'; -import { isValidBlitzId } from '../../../../../core/blitz/isValidBlitzId'; +import { StarsInt } from '../../../../../../../website/src/app/tools/tankopedia/[id]/components/Model/MetaSection/components/Stars'; +import { isValidBlitzId } from '../../../../../../../website/src/core/blitz/isValidBlitzId'; import { BlitzkitResponse, BlitzkitResponseError, -} from '../../../../../hooks/useTankVotes'; -import { StarsInt } from '../../../../tools/tankopedia/[id]/components/Model/MetaSection/components/Stars'; +} from '../../../../../../../website/src/hooks/useTankVotes'; export const TANK_VOTE_CATEGORIES = [ 'easiness', diff --git a/packages/api/tsconfig.json b/packages/api/tsconfig.json index 4c3b321ed..379ca5245 100644 --- a/packages/api/tsconfig.json +++ b/packages/api/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "plugins": [{ "name": "next" }] }, - "include": ["src/**/*", "dist/website/types/**/*.ts"] + "include": ["src/**/*"] } diff --git a/packages/bot/src/commands/searchClans.ts b/packages/bot/src/commands/searchClans.ts index 133f3973d..2f73f5319 100644 --- a/packages/bot/src/commands/searchClans.ts +++ b/packages/bot/src/commands/searchClans.ts @@ -1,5 +1,4 @@ -import { Region } from '@blitzkit/core'; -import { ClanList } from '@blitzkit/core/src/blitz/clanList'; +import { ClanList, Region } from '@blitzkit/core'; import { Locale } from 'discord.js'; import markdownEscape from 'markdown-escape'; import fetchBlitz from '../../../website/src/core/blitz/fetchBlitz'; diff --git a/packages/bot/src/core/discord/addFilterOptions.ts b/packages/bot/src/core/discord/addFilterOptions.ts index 377378f3b..a1b300bf6 100644 --- a/packages/bot/src/core/discord/addFilterOptions.ts +++ b/packages/bot/src/core/discord/addFilterOptions.ts @@ -5,7 +5,6 @@ import { SlashCommandBuilder, SlashCommandSubcommandBuilder, } from 'discord.js'; -import {} from '../../components/Tanks/components/Item/constants'; import { translator } from '../localization/translator'; import addTankChoices from './addTankChoices'; import addTierChoices from './addTierChoices'; diff --git a/packages/bot/src/types/ttf.d.ts b/packages/bot/src/types/ttf.d.ts new file mode 100644 index 000000000..29102695c --- /dev/null +++ b/packages/bot/src/types/ttf.d.ts @@ -0,0 +1,4 @@ +declare module '*.ttf' { + const path: string; + export default path; +} diff --git a/packages/bot/tsconfig.json b/packages/bot/tsconfig.json index 6f36fe638..52d43eaaa 100644 --- a/packages/bot/tsconfig.json +++ b/packages/bot/tsconfig.json @@ -1,7 +1,4 @@ { - "compilerOptions": { - "noEmit": true, - "declaration": true - }, - "extends": "../../tsconfig.json" + "extends": "../../tsconfig.json", + "include": ["src/**/*"] } diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json new file mode 100644 index 000000000..52d43eaaa --- /dev/null +++ b/packages/core/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src/**/*"] +} diff --git a/packages/scripts/src/buildRatingLeaderboard.ts b/packages/scripts/src/buildRatingLeaderboard.ts index 11f54f303..6c0c4f589 100644 --- a/packages/scripts/src/buildRatingLeaderboard.ts +++ b/packages/scripts/src/buildRatingLeaderboard.ts @@ -5,10 +5,11 @@ import { BkrlWriteStream, CdonValue, CdonWriteStream, + RatingInfo, + RatingNeighbors, RegionSubdomain, superCompress, } from '@blitzkit/core'; -import { RatingInfo, RatingNeighbors } from '@blitzkit/core/src/blitz/leagues'; import { RatingPlayer } from '@blitzkit/core/src/statistics/deltaBkrlBlitzStats'; import { chunk } from 'lodash'; import { argv } from 'process'; diff --git a/packages/scripts/tsconfig.json b/packages/scripts/tsconfig.json new file mode 100644 index 000000000..52d43eaaa --- /dev/null +++ b/packages/scripts/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src/**/*"] +} diff --git a/packages/website/src/app/tools/rating/page.tsx b/packages/website/src/app/tools/rating/page.tsx index 2cb8edc09..5f9eda585 100644 --- a/packages/website/src/app/tools/rating/page.tsx +++ b/packages/website/src/app/tools/rating/page.tsx @@ -3,12 +3,12 @@ import { FIRST_MINIMAL_ARCHIVED_RATING_SEASON, LEAGUES, + RatingInfo, Region, REGIONS, UNLOCALIZED_REGION_NAMES, Var, } from '@blitzkit/core'; -import { RatingInfo } from '@blitzkit/core/src/blitz/leagues'; import { RatingPlayer } from '@blitzkit/core/src/statistics/deltaBkrlBlitzStats'; import { blackA, orangeDark } from '@radix-ui/colors'; import { MagnifyingGlassIcon } from '@radix-ui/react-icons'; diff --git a/packages/website/src/core/blitzkit/getArchivedRatingInfo.ts b/packages/website/src/core/blitzkit/getArchivedRatingInfo.ts index 57fce5232..dc8afb6ef 100644 --- a/packages/website/src/core/blitzkit/getArchivedRatingInfo.ts +++ b/packages/website/src/core/blitzkit/getArchivedRatingInfo.ts @@ -1,5 +1,4 @@ -import { Region, asset } from '@blitzkit/core'; -import { RatingInfo } from '@blitzkit/core/src/blitz/leagues'; +import { RatingInfo, Region, asset } from '@blitzkit/core'; import { superDecompress } from '@blitzkit/core/src/blitzkit/superDecompress'; const cache: Record< diff --git a/packages/website/src/types/glsl.d.ts b/packages/website/src/types/glsl.d.ts new file mode 100644 index 000000000..77ffce2fc --- /dev/null +++ b/packages/website/src/types/glsl.d.ts @@ -0,0 +1,4 @@ +declare module '*.glsl' { + const value: string; + export default value; +} diff --git a/packages/website/src/types/proto.d.ts b/packages/website/src/types/proto.d.ts new file mode 100644 index 000000000..aa9769548 --- /dev/null +++ b/packages/website/src/types/proto.d.ts @@ -0,0 +1,4 @@ +declare module '*.proto' { + const value: string; + export default value; +} diff --git a/packages/website/tsconfig.json b/packages/website/tsconfig.json index a549a9571..1d5ca033c 100644 --- a/packages/website/tsconfig.json +++ b/packages/website/tsconfig.json @@ -9,7 +9,6 @@ }, "include": [ "src/**/*", - "dist/website/types/**/*.ts", ".next/types/**/*.ts" ] } diff --git a/tsconfig.json b/tsconfig.json index 7bd6d5893..0c072721f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,6 +20,5 @@ } ] }, - "include": ["packages/**/*", "types.d.ts"], "exclude": ["node_modules/**/*", "dist"] } diff --git a/types.d.ts b/types.d.ts deleted file mode 100644 index 56c1a6f38..000000000 --- a/types.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -declare module '*.glsl' { - const value: string; - export default value; -} - -declare module '*.proto' { - const value: string; - export default value; -} - -declare module '*.ttf' { - const path: string; - export default path; -}