From 1d4ac2f133378e014089fdde1a7850c796d1a337 Mon Sep 17 00:00:00 2001 From: tresabhi Date: Tue, 11 Jul 2023 19:54:57 +0000 Subject: [PATCH] feat: switched to Node module resolution --- CODE_OF_CONDUCT.md | 22 ++++---- docs/.vitepress/theme/index.ts | 12 ++--- docs/.vitepress/theme/style.css | 3 +- package.json | 4 +- src/bot.ts | 10 ++-- src/commands/debug.ts | 14 ++--- src/commands/eligible.ts | 34 ++++++------ src/commands/evolution.tsx | 36 ++++++------- src/commands/fullStats.tsx | 34 ++++++------ src/commands/help.ts | 5 +- src/commands/inactive.tsx | 28 +++++----- src/commands/ownedTanks.tsx | 36 ++++++------- src/commands/ping.ts | 2 +- src/commands/playerAchievements.ts | 22 ++++---- src/commands/playerInfo.ts | 18 +++---- src/commands/searchClans.ts | 16 +++--- src/commands/searchPlayers.ts | 18 +++---- src/commands/searchTanks.ts | 8 +-- src/commands/stats.tsx | 36 ++++++------- src/commands/today.tsx | 26 +++++----- src/commands/verify.ts | 20 +++---- .../components/WN8Display/components/Glow.tsx | 6 +-- .../components/WN8Display/index.tsx | 10 ++-- .../components/WN8SurroundingStat.tsx | 2 +- src/components/AllStatsOverview/index.tsx | 6 +-- src/components/Breakdown/components/Row.tsx | 8 +-- .../Breakdown/components/RowDiscriminator.tsx | 2 +- .../Breakdown/components/RowStat.tsx | 6 +-- src/components/Breakdown/index.ts | 8 +-- .../GenericAllStats/components/Card.tsx | 6 +-- src/components/GenericAllStats/index.tsx | 12 ++--- .../components/GenericStatsColumn.tsx | 4 +- .../components/GenericStatsRow.tsx | 6 +-- src/components/GenericStats/index.tsx | 4 +- src/components/Graph/components/Line.tsx | 2 +- src/components/Graph/components/Margin.tsx | 4 +- src/components/Graph/components/Root.tsx | 4 +- src/components/Graph/index.ts | 6 +-- src/components/NoData.tsx | 2 +- src/components/PercentileIndicator.tsx | 2 +- src/components/PoweredBy.tsx | 2 +- src/components/Tanks/components/Item.tsx | 4 +- src/components/Tanks/index.ts | 6 +-- src/components/TierWeights.tsx | 4 +- src/components/TitleBar.tsx | 4 +- src/components/Wrapper.tsx | 2 +- src/core/blitz/calculateWN8.ts | 2 +- src/core/blitz/diffStats.ts | 2 +- src/core/blitz/getBlitzClan.ts | 8 +-- src/core/blitz/getTankStats.ts | 10 ++-- src/core/blitz/getTreeType.ts | 4 +- src/core/blitz/getWN8Percentile.ts | 2 +- src/core/blitz/getWargamingResponse.ts | 2 +- src/core/blitz/listClans.ts | 8 +-- src/core/blitz/listPlayers.ts | 8 +-- src/core/blitz/resolveTankId.ts | 4 +- src/core/blitz/resolveTankName.ts | 2 +- src/core/blitz/sumStats.ts | 4 +- src/core/blitzstars/getDiffedTankStats.ts | 6 +-- src/core/blitzstars/getPeriodStart.ts | 6 +-- src/core/blitzstars/getPlayerHistories.ts | 14 ++--- src/core/blitzstars/getTankHistories.ts | 10 ++-- src/core/blitzstars/getTimeDaysAgo.ts | 2 +- src/core/blitzstars/playerAverage.ts | 6 +-- src/core/blitzstars/tankAverages.ts | 2 +- src/core/discord/addPeriodSubCommands.ts | 2 +- src/core/discord/addServerChoices.ts | 2 +- .../discord/addStatTypeSubCommandGroups.ts | 6 +-- src/core/discord/autocompleteClan.ts | 6 +-- src/core/discord/autocompleteTanks.ts | 11 ++-- src/core/discord/autocompleteUsername.ts | 6 +-- src/core/discord/embedInfo.ts | 2 +- src/core/discord/embedNegative.ts | 2 +- src/core/discord/embedPositive.ts | 2 +- src/core/discord/embedWarning.ts | 2 +- .../discord/normalizeInteractionReturnable.ts | 4 +- src/core/discord/resolvePeriodFromButton.ts | 6 +-- src/core/discord/resolvePeriodFromCommand.ts | 10 ++-- src/core/discord/resolvePlayerFromButton.ts | 4 +- src/core/discord/resolvePlayerFromCommand.ts | 6 +-- src/core/express/normalizeRouteReturnable.ts | 4 +- src/core/express/resolvePeriodFromRequest.ts | 6 +-- src/core/express/resolvePeriodFromURL.ts | 12 ++--- src/core/express/resolvePlayerFromRequest.ts | 4 +- src/core/express/resolvePlayerFromURL.ts | 4 +- src/core/node/getClientId.ts | 2 +- src/core/node/jsxToPng.ts | 4 +- src/core/node/svgToPng.ts | 6 +-- src/events/error.ts | 6 +-- src/events/guildMemberAdd.ts | 2 +- .../handlers/autocomplete.ts | 2 +- .../interactionCreate/handlers/button.tsx | 8 +-- .../handlers/chatInputCommand.ts | 12 ++--- src/events/interactionCreate/index.ts | 44 ++++++++-------- src/events/ready.ts | 2 +- src/renderers/evolution.tsx | 36 ++++++------- src/renderers/fullStats.tsx | 40 +++++++------- src/renderers/stats.tsx | 42 +++++++-------- src/renderers/today.tsx | 42 +++++++-------- src/routes/stats.tsx | 8 +-- src/routes/today.tsx | 6 +-- src/server.ts | 12 ++--- src/types/clanInfo.ts | 52 ++++++++++--------- src/types/histories.ts | 2 +- src/types/possiblyPromise.ts | 2 +- src/types/tanksStats.ts | 2 +- tsconfig.json | 8 +-- yarn.lock | 5 ++ 108 files changed, 541 insertions(+), 533 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 5bb61952c..c8195926a 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or +- The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an +standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index bdd506d91..107d0ae71 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -1,16 +1,16 @@ // https://vitepress.dev/guide/custom-theme -import { h } from 'vue' -import Theme from 'vitepress/theme' -import './style.css' +import { h } from 'vue'; +import Theme from 'vitepress/theme'; +import './style.css'; export default { extends: Theme, Layout: () => { return h(Theme.Layout, null, { // https://vitepress.dev/guide/extending-default-theme#layout-slots - }) + }); }, enhanceApp({ app, router, siteData }) { // ... - } -} + }, +}; diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css index c23c17ac7..45d673a9e 100644 --- a/docs/.vitepress/theme/style.css +++ b/docs/.vitepress/theme/style.css @@ -7,7 +7,7 @@ * Colors * -------------------------------------------------------------------------- */ - :root { +:root { --vp-c-brand: #646cff; --vp-c-brand-light: #747bff; --vp-c-brand-lighter: #9499ff; @@ -88,4 +88,3 @@ .DocSearch { --docsearch-primary-color: var(--vp-c-brand) !important; } - diff --git a/package.json b/package.json index f01ffccb2..296a85345 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "start:server": "node --enable-source-maps --trace-warnings dist/server.cjs", "host:docs": "vitepress preview docs", "zip": "zip -r dist.zip dist", - "lint": "npx tsc" + "lint": "npx tsc", + "format": "prettier --write \"**/*.@(json|js|jsx|css|md|ts|tsx|html|xml|yml|gltf)\"" }, "license": "MIT", "dependencies": { @@ -42,6 +43,7 @@ "@types/markdown-escape": "^1.1.0", "@types/node": "^20.2.1", "@types/react": "^18.2.7", + "prettier": "^3.0.0", "typescript": "^5.0.4", "vitepress": "^1.0.0-beta.3" } diff --git a/src/bot.ts b/src/bot.ts index 8d66081c8..8297d739e 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -1,9 +1,9 @@ import { Client, GatewayIntentBits } from 'discord.js'; -import { DISCORD_TOKEN } from './core/node/arguments.js'; -import { registerErrorHandlers } from './events/error.js'; -import guildMemberAdd from './events/guildMemberAdd.js'; -import interactionCreate from './events/interactionCreate/index.js'; -import ready from './events/ready.js'; +import { DISCORD_TOKEN } from './core/node/arguments'; +import { registerErrorHandlers } from './events/error'; +import guildMemberAdd from './events/guildMemberAdd'; +import interactionCreate from './events/interactionCreate'; +import ready from './events/ready'; export const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers], diff --git a/src/commands/debug.ts b/src/commands/debug.ts index 59a47d30b..76bd7c807 100644 --- a/src/commands/debug.ts +++ b/src/commands/debug.ts @@ -1,12 +1,12 @@ import { SlashCommandBuilder } from 'discord.js'; import packageJSON from '../../package.json' assert { type: 'json' }; -import { client } from '../bot.js'; -import { tankopedia } from '../core/blitz/tankopedia.js'; -import { tankAverages } from '../core/blitzstars/tankAverages.js'; -import embedInfo from '../core/discord/embedInfo.js'; -import markdownTable from '../core/discord/markdownTable.js'; -import getClientId from '../core/node/getClientId.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; +import { client } from '../bot'; +import { tankopedia } from '../core/blitz/tankopedia'; +import { tankAverages } from '../core/blitzstars/tankAverages'; +import embedInfo from '../core/discord/embedInfo'; +import markdownTable from '../core/discord/markdownTable'; +import getClientId from '../core/node/getClientId'; +import { CommandRegistry } from '../events/interactionCreate'; const executionStart = new Date().getTime(); diff --git a/src/commands/eligible.ts b/src/commands/eligible.ts index db3c77e00..43c6991d6 100644 --- a/src/commands/eligible.ts +++ b/src/commands/eligible.ts @@ -1,21 +1,21 @@ import { SlashCommandBuilder } from 'discord.js'; -import calculateWN8 from '../core/blitz/calculateWN8.js'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import sumStats from '../core/blitz/sumStats.js'; -import { tankopedia } from '../core/blitz/tankopedia.js'; -import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats.js'; -import getPeriodNow from '../core/blitzstars/getPeriodNow.js'; -import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo.js'; -import { tankAverages } from '../core/blitzstars/tankAverages.js'; -import addUsernameChoices from '../core/discord/addUsernameChoices.js'; -import embedNegative from '../core/discord/embedNegative.js'; -import embedPositive from '../core/discord/embedPositive.js'; -import markdownTable, { TableInput } from '../core/discord/markdownTable.js'; -import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; -import { AccountInfo } from '../types/accountInfo.js'; -import { PossiblyPromise } from '../types/possiblyPromise.js'; +import calculateWN8 from '../core/blitz/calculateWN8'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import sumStats from '../core/blitz/sumStats'; +import { tankopedia } from '../core/blitz/tankopedia'; +import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats'; +import getPeriodNow from '../core/blitzstars/getPeriodNow'; +import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo'; +import { tankAverages } from '../core/blitzstars/tankAverages'; +import addUsernameChoices from '../core/discord/addUsernameChoices'; +import embedNegative from '../core/discord/embedNegative'; +import embedPositive from '../core/discord/embedPositive'; +import markdownTable, { TableInput } from '../core/discord/markdownTable'; +import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { CommandRegistry } from '../events/interactionCreate'; +import { AccountInfo } from '../types/accountInfo'; +import { PossiblyPromise } from '../types/possiblyPromise'; export type SkilledClan = 'SKLLD' | 'SMRI'; diff --git a/src/commands/evolution.tsx b/src/commands/evolution.tsx index 555f1dd1f..e3b62fbe4 100644 --- a/src/commands/evolution.tsx +++ b/src/commands/evolution.tsx @@ -1,22 +1,22 @@ import { SlashCommandBuilder } from 'discord.js'; -import { CYCLIC_API } from '../constants/cyclic.js'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import resolveTankId from '../core/blitz/resolveTankId.js'; -import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups.js'; -import autocompleteTanks from '../core/discord/autocompleteTanks.js'; -import autocompleteUsername from '../core/discord/autocompleteUsername.js'; -import interactionToURL from '../core/discord/interactionToURL.js'; -import linkButton from '../core/discord/linkButton.js'; -import primaryButton from '../core/discord/primaryButton.js'; -import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton.js'; -import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand.js'; -import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton.js'; -import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; -import evolution from '../renderers/evolution.js'; -import { StatType } from '../renderers/fullStats.js'; -import { AccountInfo } from '../types/accountInfo.js'; +import { CYCLIC_API } from '../constants/cyclic'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import resolveTankId from '../core/blitz/resolveTankId'; +import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups'; +import autocompleteTanks from '../core/discord/autocompleteTanks'; +import autocompleteUsername from '../core/discord/autocompleteUsername'; +import interactionToURL from '../core/discord/interactionToURL'; +import linkButton from '../core/discord/linkButton'; +import primaryButton from '../core/discord/primaryButton'; +import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton'; +import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand'; +import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton'; +import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { CommandRegistry } from '../events/interactionCreate'; +import evolution from '../renderers/evolution'; +import { StatType } from '../renderers/fullStats'; +import { AccountInfo } from '../types/accountInfo'; export const evolutionCommand: CommandRegistry = { inProduction: true, diff --git a/src/commands/fullStats.tsx b/src/commands/fullStats.tsx index cfe3bdace..de1cdaa85 100644 --- a/src/commands/fullStats.tsx +++ b/src/commands/fullStats.tsx @@ -1,21 +1,21 @@ import { SlashCommandBuilder } from 'discord.js'; -import { CYCLIC_API } from '../constants/cyclic.js'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import resolveTankId from '../core/blitz/resolveTankId.js'; -import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups.js'; -import autocompleteTanks from '../core/discord/autocompleteTanks.js'; -import autocompleteUsername from '../core/discord/autocompleteUsername.js'; -import interactionToURL from '../core/discord/interactionToURL.js'; -import linkButton from '../core/discord/linkButton.js'; -import primaryButton from '../core/discord/primaryButton.js'; -import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton.js'; -import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand.js'; -import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton.js'; -import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; -import fullStats, { StatType } from '../renderers/fullStats.js'; -import { AccountInfo } from '../types/accountInfo.js'; +import { CYCLIC_API } from '../constants/cyclic'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import resolveTankId from '../core/blitz/resolveTankId'; +import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups'; +import autocompleteTanks from '../core/discord/autocompleteTanks'; +import autocompleteUsername from '../core/discord/autocompleteUsername'; +import interactionToURL from '../core/discord/interactionToURL'; +import linkButton from '../core/discord/linkButton'; +import primaryButton from '../core/discord/primaryButton'; +import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton'; +import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand'; +import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton'; +import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { CommandRegistry } from '../events/interactionCreate'; +import fullStats, { StatType } from '../renderers/fullStats'; +import { AccountInfo } from '../types/accountInfo'; export const fullStatsCommand: CommandRegistry = { inProduction: true, diff --git a/src/commands/help.ts b/src/commands/help.ts index 711041db2..2052fd12a 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -2,10 +2,7 @@ import { SlashCommandBuilder, SlashCommandSubcommandsOnlyBuilder, } from 'discord.js'; -import { - COMMANDS_RAW, - CommandRegistry, -} from '../events/interactionCreate/index.js'; +import { COMMANDS_RAW, CommandRegistry } from '../events/interactionCreate'; const RAW_PATH = `https://raw.githubusercontent.com/tresabhi/blitzkrieg/main/docs/`; const DOCS = { diff --git a/src/commands/inactive.tsx b/src/commands/inactive.tsx index 987f6568d..4b904833d 100644 --- a/src/commands/inactive.tsx +++ b/src/commands/inactive.tsx @@ -1,18 +1,18 @@ import { SlashCommandBuilder } from 'discord.js'; -import GenericStats from '../components/GenericStats/index.js'; -import NoData, { NoDataType } from '../components/NoData.js'; -import PoweredBy, { PoweredByType } from '../components/PoweredBy.js'; -import TitleBar from '../components/TitleBar.js'; -import Wrapper from '../components/Wrapper.js'; -import { BLITZ_SERVERS } from '../constants/servers.js'; -import getBlitzClan from '../core/blitz/getBlitzClan.js'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import addClanChoices from '../core/discord/addClanChoices.js'; -import autocompleteClan from '../core/discord/autocompleteClan.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; -import { AccountInfo } from '../types/accountInfo.js'; -import { ClanInfo } from '../types/clanInfo.js'; +import GenericStats from '../components/GenericStats'; +import NoData, { NoDataType } from '../components/NoData'; +import PoweredBy, { PoweredByType } from '../components/PoweredBy'; +import TitleBar from '../components/TitleBar'; +import Wrapper from '../components/Wrapper'; +import { BLITZ_SERVERS } from '../constants/servers'; +import getBlitzClan from '../core/blitz/getBlitzClan'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import addClanChoices from '../core/discord/addClanChoices'; +import autocompleteClan from '../core/discord/autocompleteClan'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { CommandRegistry } from '../events/interactionCreate'; +import { AccountInfo } from '../types/accountInfo'; +import { ClanInfo } from '../types/clanInfo'; const DEFAULT_THRESHOLD = 7; diff --git a/src/commands/ownedTanks.tsx b/src/commands/ownedTanks.tsx index d02575688..b43aafd68 100644 --- a/src/commands/ownedTanks.tsx +++ b/src/commands/ownedTanks.tsx @@ -1,26 +1,26 @@ import { SlashCommandBuilder } from 'discord.js'; -import NoData, { NoDataType } from '../components/NoData.js'; -import PoweredBy, { PoweredByType } from '../components/PoweredBy.js'; -import * as Tanks from '../components/Tanks/index.js'; -import TitleBar from '../components/TitleBar.js'; -import Wrapper from '../components/Wrapper.js'; -import { BLITZ_SERVERS } from '../constants/servers.js'; -import getTankStats from '../core/blitz/getTankStats.js'; -import getTreeType from '../core/blitz/getTreeType.js'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import resolveTankName from '../core/blitz/resolveTankName.js'; +import NoData, { NoDataType } from '../components/NoData'; +import PoweredBy, { PoweredByType } from '../components/PoweredBy'; +import * as Tanks from '../components/Tanks'; +import TitleBar from '../components/TitleBar'; +import Wrapper from '../components/Wrapper'; +import { BLITZ_SERVERS } from '../constants/servers'; +import getTankStats from '../core/blitz/getTankStats'; +import getTreeType from '../core/blitz/getTreeType'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import resolveTankName from '../core/blitz/resolveTankName'; import { TIER_ROMAN_NUMERALS, Tier, tankopedia, -} from '../core/blitz/tankopedia.js'; -import addUsernameChoices from '../core/discord/addUsernameChoices.js'; -import autocompleteUsername from '../core/discord/autocompleteUsername.js'; -import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; -import { AccountInfo } from '../types/accountInfo.js'; -import { PlayerClanData } from '../types/playerClanData.js'; +} from '../core/blitz/tankopedia'; +import addUsernameChoices from '../core/discord/addUsernameChoices'; +import autocompleteUsername from '../core/discord/autocompleteUsername'; +import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { CommandRegistry } from '../events/interactionCreate'; +import { AccountInfo } from '../types/accountInfo'; +import { PlayerClanData } from '../types/playerClanData'; const COMP_TANKS = [ // light tanks diff --git a/src/commands/ping.ts b/src/commands/ping.ts index 71e2bde94..2005400f0 100644 --- a/src/commands/ping.ts +++ b/src/commands/ping.ts @@ -1,5 +1,5 @@ import { SlashCommandBuilder } from 'discord.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; +import { CommandRegistry } from '../events/interactionCreate'; export const pingCommand: CommandRegistry = { inProduction: true, diff --git a/src/commands/playerAchievements.ts b/src/commands/playerAchievements.ts index a0a6d41d9..3301e5542 100644 --- a/src/commands/playerAchievements.ts +++ b/src/commands/playerAchievements.ts @@ -1,18 +1,16 @@ import { SlashCommandBuilder } from 'discord.js'; import { startCase } from 'lodash'; import markdownEscape from 'markdown-escape'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import addUsernameChoices from '../core/discord/addUsernameChoices.js'; -import autocompleteUsername from '../core/discord/autocompleteUsername.js'; -import embedInfo from '../core/discord/embedInfo.js'; -import markdownTable, { - TableInputEntry, -} from '../core/discord/markdownTable.js'; -import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; -import { AccountAchievements } from '../types/accountAchievements.js'; -import { AccountInfo } from '../types/accountInfo.js'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import addUsernameChoices from '../core/discord/addUsernameChoices'; +import autocompleteUsername from '../core/discord/autocompleteUsername'; +import embedInfo from '../core/discord/embedInfo'; +import markdownTable, { TableInputEntry } from '../core/discord/markdownTable'; +import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { CommandRegistry } from '../events/interactionCreate'; +import { AccountAchievements } from '../types/accountAchievements'; +import { AccountInfo } from '../types/accountInfo'; type SortBy = 'name' | 'count'; diff --git a/src/commands/playerInfo.ts b/src/commands/playerInfo.ts index d33e2f06a..d6661373f 100644 --- a/src/commands/playerInfo.ts +++ b/src/commands/playerInfo.ts @@ -1,14 +1,14 @@ import { SlashCommandBuilder } from 'discord.js'; import markdownEscape from 'markdown-escape'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import addUsernameChoices from '../core/discord/addUsernameChoices.js'; -import autocompleteUsername from '../core/discord/autocompleteUsername.js'; -import embedInfo from '../core/discord/embedInfo.js'; -import markdownTable from '../core/discord/markdownTable.js'; -import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; -import { AccountInfo } from '../types/accountInfo.js'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import addUsernameChoices from '../core/discord/addUsernameChoices'; +import autocompleteUsername from '../core/discord/autocompleteUsername'; +import embedInfo from '../core/discord/embedInfo'; +import markdownTable from '../core/discord/markdownTable'; +import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { CommandRegistry } from '../events/interactionCreate'; +import { AccountInfo } from '../types/accountInfo'; export const playerInfoCommand: CommandRegistry = { inProduction: true, diff --git a/src/commands/searchClans.ts b/src/commands/searchClans.ts index 64980acde..6b0e9581c 100644 --- a/src/commands/searchClans.ts +++ b/src/commands/searchClans.ts @@ -1,13 +1,13 @@ import { SlashCommandBuilder } from 'discord.js'; import markdownEscape from 'markdown-escape'; -import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import addClanChoices from '../core/discord/addClanChoices.js'; -import addServerChoices from '../core/discord/addServerChoices.js'; -import embedInfo from '../core/discord/embedInfo.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; -import { ClanList } from '../types/clanList.js'; +import { BLITZ_SERVERS, BlitzServer } from '../constants/servers'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import addClanChoices from '../core/discord/addClanChoices'; +import addServerChoices from '../core/discord/addServerChoices'; +import embedInfo from '../core/discord/embedInfo'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { CommandRegistry } from '../events/interactionCreate'; +import { ClanList } from '../types/clanList'; export const searchClansCommand: CommandRegistry = { inProduction: true, diff --git a/src/commands/searchPlayers.ts b/src/commands/searchPlayers.ts index 4db2f37e4..ad6f0bbc5 100644 --- a/src/commands/searchPlayers.ts +++ b/src/commands/searchPlayers.ts @@ -1,14 +1,14 @@ import { SlashCommandBuilder } from 'discord.js'; import markdownEscape from 'markdown-escape'; -import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import { usernamePattern } from '../core/blitz/listPlayers.js'; -import addServerChoices from '../core/discord/addServerChoices.js'; -import addUsernameChoices from '../core/discord/addUsernameChoices.js'; -import embedInfo from '../core/discord/embedInfo.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; -import { AccountList } from '../types/accountList.js'; +import { BLITZ_SERVERS, BlitzServer } from '../constants/servers'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import { usernamePattern } from '../core/blitz/listPlayers'; +import addServerChoices from '../core/discord/addServerChoices'; +import addUsernameChoices from '../core/discord/addUsernameChoices'; +import embedInfo from '../core/discord/embedInfo'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { CommandRegistry } from '../events/interactionCreate'; +import { AccountList } from '../types/accountList'; export const searchPlayersCommand: CommandRegistry = { inProduction: true, diff --git a/src/commands/searchTanks.ts b/src/commands/searchTanks.ts index ac859b7d1..7f1e87ab3 100644 --- a/src/commands/searchTanks.ts +++ b/src/commands/searchTanks.ts @@ -1,10 +1,10 @@ import { SlashCommandBuilder } from 'discord.js'; import { go } from 'fuzzysort'; import markdownEscape from 'markdown-escape'; -import { TANK_NAMES } from '../core/blitz/tankopedia.js'; -import addTankChoices from '../core/discord/addTankChoices.js'; -import embedInfo from '../core/discord/embedInfo.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; +import { TANK_NAMES } from '../core/blitz/tankopedia'; +import addTankChoices from '../core/discord/addTankChoices'; +import embedInfo from '../core/discord/embedInfo'; +import { CommandRegistry } from '../events/interactionCreate'; export const searchTanksCommand: CommandRegistry = { inProduction: true, diff --git a/src/commands/stats.tsx b/src/commands/stats.tsx index d302a286e..4f5f5721f 100644 --- a/src/commands/stats.tsx +++ b/src/commands/stats.tsx @@ -1,22 +1,22 @@ import { SlashCommandBuilder } from 'discord.js'; -import { CYCLIC_API } from '../constants/cyclic.js'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import resolveTankId from '../core/blitz/resolveTankId.js'; -import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups.js'; -import autocompleteTanks from '../core/discord/autocompleteTanks.js'; -import autocompleteUsername from '../core/discord/autocompleteUsername.js'; -import interactionToURL from '../core/discord/interactionToURL.js'; -import linkButton from '../core/discord/linkButton.js'; -import primaryButton from '../core/discord/primaryButton.js'; -import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton.js'; -import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand.js'; -import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton.js'; -import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; -import { StatType } from '../renderers/fullStats.js'; -import stats from '../renderers/stats.js'; -import { AccountInfo } from '../types/accountInfo.js'; +import { CYCLIC_API } from '../constants/cyclic'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import resolveTankId from '../core/blitz/resolveTankId'; +import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups'; +import autocompleteTanks from '../core/discord/autocompleteTanks'; +import autocompleteUsername from '../core/discord/autocompleteUsername'; +import interactionToURL from '../core/discord/interactionToURL'; +import linkButton from '../core/discord/linkButton'; +import primaryButton from '../core/discord/primaryButton'; +import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton'; +import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand'; +import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton'; +import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { CommandRegistry } from '../events/interactionCreate'; +import { StatType } from '../renderers/fullStats'; +import stats from '../renderers/stats'; +import { AccountInfo } from '../types/accountInfo'; export const statsCommand: CommandRegistry = { inProduction: true, diff --git a/src/commands/today.tsx b/src/commands/today.tsx index 3b269819c..7026723fd 100644 --- a/src/commands/today.tsx +++ b/src/commands/today.tsx @@ -1,17 +1,17 @@ import { SlashCommandBuilder } from 'discord.js'; -import { CYCLIC_API } from '../constants/cyclic.js'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import addUsernameChoices from '../core/discord/addUsernameChoices.js'; -import autocompleteUsername from '../core/discord/autocompleteUsername.js'; -import interactionToURL from '../core/discord/interactionToURL.js'; -import linkButton from '../core/discord/linkButton.js'; -import primaryButton from '../core/discord/primaryButton.js'; -import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton.js'; -import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; -import today from '../renderers/today.js'; -import { AccountInfo } from '../types/accountInfo.js'; +import { CYCLIC_API } from '../constants/cyclic'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import addUsernameChoices from '../core/discord/addUsernameChoices'; +import autocompleteUsername from '../core/discord/autocompleteUsername'; +import interactionToURL from '../core/discord/interactionToURL'; +import linkButton from '../core/discord/linkButton'; +import primaryButton from '../core/discord/primaryButton'; +import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton'; +import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { CommandRegistry } from '../events/interactionCreate'; +import today from '../renderers/today'; +import { AccountInfo } from '../types/accountInfo'; export const todayCommand: CommandRegistry = { inProduction: true, diff --git a/src/commands/verify.ts b/src/commands/verify.ts index c3cfb4b59..66c78d35e 100644 --- a/src/commands/verify.ts +++ b/src/commands/verify.ts @@ -1,16 +1,16 @@ import { SlashCommandBuilder } from 'discord.js'; import markdownEscape from 'markdown-escape'; import discord from '../../discord.json' assert { type: 'json' }; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import addUsernameChoices from '../core/discord/addUsernameChoices.js'; -import autocompleteUsername from '../core/discord/autocompleteUsername.js'; -import embedNegative from '../core/discord/embedNegative.js'; -import embedPositive from '../core/discord/embedPositive.js'; -import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { CommandRegistry } from '../events/interactionCreate/index.js'; -import { AccountInfo } from '../types/accountInfo.js'; -import { PlayerClanData } from '../types/playerClanData.js'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import addUsernameChoices from '../core/discord/addUsernameChoices'; +import autocompleteUsername from '../core/discord/autocompleteUsername'; +import embedNegative from '../core/discord/embedNegative'; +import embedPositive from '../core/discord/embedPositive'; +import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { CommandRegistry } from '../events/interactionCreate'; +import { AccountInfo } from '../types/accountInfo'; +import { PlayerClanData } from '../types/playerClanData'; export const verifyCommand: CommandRegistry = { inProduction: true, diff --git a/src/components/AllStatsOverview/components/WN8Display/components/Glow.tsx b/src/components/AllStatsOverview/components/WN8Display/components/Glow.tsx index 7c5d2f93e..d1acbffd4 100644 --- a/src/components/AllStatsOverview/components/WN8Display/components/Glow.tsx +++ b/src/components/AllStatsOverview/components/WN8Display/components/Glow.tsx @@ -1,6 +1,6 @@ -import { Percentile } from '../../../../../constants/percentiles.js'; -import hslToHex from '../../../../../core/node/hslToHex.js'; -import { PERCENTILE_COLORS } from '../../../../PercentileIndicator.js'; +import { Percentile } from '../../../../../constants/percentiles'; +import hslToHex from '../../../../../core/node/hslToHex'; +import { PERCENTILE_COLORS } from '../../../../PercentileIndicator'; export enum GlowSide { Top, diff --git a/src/components/AllStatsOverview/components/WN8Display/index.tsx b/src/components/AllStatsOverview/components/WN8Display/index.tsx index 08f257fe2..4fd0da495 100644 --- a/src/components/AllStatsOverview/components/WN8Display/index.tsx +++ b/src/components/AllStatsOverview/components/WN8Display/index.tsx @@ -1,8 +1,8 @@ -import { Percentile } from '../../../../constants/percentiles.js'; -import getWN8Percentile from '../../../../core/blitz/getWN8Percentile.js'; -import { theme } from '../../../../stitches.config.js'; -import { PERCENTILE_COLORS } from '../../../PercentileIndicator.js'; -import { Glow, GlowSide } from './components/Glow.js'; +import { Percentile } from '../../../../constants/percentiles'; +import getWN8Percentile from '../../../../core/blitz/getWN8Percentile'; +import { theme } from '../../../../stitches.config'; +import { PERCENTILE_COLORS } from '../../../PercentileIndicator'; +import { Glow, GlowSide } from './components/Glow'; export interface WN8DisplayProps { WN8?: number; diff --git a/src/components/AllStatsOverview/components/WN8SurroundingStat.tsx b/src/components/AllStatsOverview/components/WN8SurroundingStat.tsx index 4c48d00fa..807e2eb50 100644 --- a/src/components/AllStatsOverview/components/WN8SurroundingStat.tsx +++ b/src/components/AllStatsOverview/components/WN8SurroundingStat.tsx @@ -1,4 +1,4 @@ -import { theme } from '../../../stitches.config.js'; +import { theme } from '../../../stitches.config'; export enum WN8SurroundingStatAlign { Left, diff --git a/src/components/AllStatsOverview/index.tsx b/src/components/AllStatsOverview/index.tsx index e1d309e4e..da7ba6c34 100644 --- a/src/components/AllStatsOverview/index.tsx +++ b/src/components/AllStatsOverview/index.tsx @@ -1,9 +1,9 @@ -import { AllStats, SupplementaryStats } from '../../types/accountInfo.js'; -import { WN8Display } from './components/WN8Display/index.js'; +import { AllStats, SupplementaryStats } from '../../types/accountInfo'; +import { WN8Display } from './components/WN8Display'; import { WN8SurroundingStat, WN8SurroundingStatAlign, -} from './components/WN8SurroundingStat.js'; +} from './components/WN8SurroundingStat'; export interface AllStatsOverviewProps { stats: AllStats; diff --git a/src/components/Breakdown/components/Row.tsx b/src/components/Breakdown/components/Row.tsx index e418f4b52..c92f28ced 100644 --- a/src/components/Breakdown/components/Row.tsx +++ b/src/components/Breakdown/components/Row.tsx @@ -1,7 +1,7 @@ -import getWN8Percentile from '../../../core/blitz/getWN8Percentile.js'; -import { theme } from '../../../stitches.config.js'; -import { RowDiscriminator } from './RowDiscriminator.js'; -import { RowStat } from './RowStat.js'; +import getWN8Percentile from '../../../core/blitz/getWN8Percentile'; +import { theme } from '../../../stitches.config'; +import { RowDiscriminator } from './RowDiscriminator'; +import { RowStat } from './RowStat'; export interface RowProps { name: string; diff --git a/src/components/Breakdown/components/RowDiscriminator.tsx b/src/components/Breakdown/components/RowDiscriminator.tsx index d70e6fa26..04bc4c2d3 100644 --- a/src/components/Breakdown/components/RowDiscriminator.tsx +++ b/src/components/Breakdown/components/RowDiscriminator.tsx @@ -1,4 +1,4 @@ -import { theme } from '../../../stitches.config.js'; +import { theme } from '../../../stitches.config'; export interface RowDiscriminatorProps { name: string; diff --git a/src/components/Breakdown/components/RowStat.tsx b/src/components/Breakdown/components/RowStat.tsx index c4303b3ef..cf58e3a14 100644 --- a/src/components/Breakdown/components/RowStat.tsx +++ b/src/components/Breakdown/components/RowStat.tsx @@ -1,6 +1,6 @@ -import { Percentile } from '../../../constants/percentiles.js'; -import { theme } from '../../../stitches.config.js'; -import PercentileIndicator from '../../PercentileIndicator.js'; +import { Percentile } from '../../../constants/percentiles'; +import { theme } from '../../../stitches.config'; +import PercentileIndicator from '../../PercentileIndicator'; export interface RowStatProps { name: string; diff --git a/src/components/Breakdown/index.ts b/src/components/Breakdown/index.ts index c66d8dee9..8bb31e1ff 100644 --- a/src/components/Breakdown/index.ts +++ b/src/components/Breakdown/index.ts @@ -1,4 +1,4 @@ -export * from './components/Root.js'; -export * from './components/Row.js'; -export * from './components/RowDiscriminator.js'; -export * from './components/RowStat.js'; +export * from './components/Root'; +export * from './components/Row'; +export * from './components/RowDiscriminator'; +export * from './components/RowStat'; diff --git a/src/components/GenericAllStats/components/Card.tsx b/src/components/GenericAllStats/components/Card.tsx index 518c7e5d1..71fb3d6e5 100644 --- a/src/components/GenericAllStats/components/Card.tsx +++ b/src/components/GenericAllStats/components/Card.tsx @@ -1,6 +1,6 @@ -import { Percentile } from '../../../constants/percentiles.js'; -import { theme } from '../../../stitches.config.js'; -import PercentileIndicator from '../../PercentileIndicator.js'; +import { Percentile } from '../../../constants/percentiles'; +import { theme } from '../../../stitches.config'; +import PercentileIndicator from '../../PercentileIndicator'; export interface CardItem { label: string; diff --git a/src/components/GenericAllStats/index.tsx b/src/components/GenericAllStats/index.tsx index bb1821b4f..2a7784a4b 100644 --- a/src/components/GenericAllStats/index.tsx +++ b/src/components/GenericAllStats/index.tsx @@ -1,9 +1,9 @@ -import getWN8Percentile from '../../core/blitz/getWN8Percentile.js'; -import isNumber from '../../core/node/isNumber.js'; -import { AllStats, SupplementaryStats } from '../../types/accountInfo.js'; -import { Card } from './components/Card.js'; -import { Root } from './components/Root.js'; -import { Row } from './components/Row.js'; +import getWN8Percentile from '../../core/blitz/getWN8Percentile'; +import isNumber from '../../core/node/isNumber'; +import { AllStats, SupplementaryStats } from '../../types/accountInfo'; +import { Card } from './components/Card'; +import { Root } from './components/Root'; +import { Row } from './components/Row'; // TODO: remove the .js endings diff --git a/src/components/GenericStats/components/GenericStatsColumn.tsx b/src/components/GenericStats/components/GenericStatsColumn.tsx index bece9ff4e..e8b3e6f00 100644 --- a/src/components/GenericStats/components/GenericStatsColumn.tsx +++ b/src/components/GenericStats/components/GenericStatsColumn.tsx @@ -1,5 +1,5 @@ -import { Stat } from '../index.js'; -import GenericStatsRow from './GenericStatsRow.js'; +import { Stat } from '..'; +import GenericStatsRow from './GenericStatsRow'; export interface GenericStatsColumnProps { stats: Stat[]; diff --git a/src/components/GenericStats/components/GenericStatsRow.tsx b/src/components/GenericStats/components/GenericStatsRow.tsx index 1630cccb8..1a4e5c7a0 100644 --- a/src/components/GenericStats/components/GenericStatsRow.tsx +++ b/src/components/GenericStats/components/GenericStatsRow.tsx @@ -1,6 +1,6 @@ -import { theme } from '../../../stitches.config.js'; -import PercentileIndicator from '../../PercentileIndicator.js'; -import { Stat } from '../index.js'; +import { Stat } from '..'; +import { theme } from '../../../stitches.config'; +import PercentileIndicator from '../../PercentileIndicator'; export interface GenericStatsRowProps { stat: Stat; diff --git a/src/components/GenericStats/index.tsx b/src/components/GenericStats/index.tsx index 94414baad..b22dce987 100644 --- a/src/components/GenericStats/index.tsx +++ b/src/components/GenericStats/index.tsx @@ -1,5 +1,5 @@ -import { Percentile } from '../../constants/percentiles.js'; -import GenericStatsColumn from './components/GenericStatsColumn.js'; +import { Percentile } from '../../constants/percentiles'; +import GenericStatsColumn from './components/GenericStatsColumn'; export type Stat = | [string, string | number | undefined] diff --git a/src/components/Graph/components/Line.tsx b/src/components/Graph/components/Line.tsx index 3c170eead..8a3e0d0ec 100644 --- a/src/components/Graph/components/Line.tsx +++ b/src/components/Graph/components/Line.tsx @@ -1,5 +1,5 @@ import { blue, green, red, slateDark } from '@radix-ui/colors'; -import { GRAPH_HEIGHT, GRAPH_WIDTH } from './Root.js'; +import { GRAPH_HEIGHT, GRAPH_WIDTH } from './Root'; export enum LineColor { Red, diff --git a/src/components/Graph/components/Margin.tsx b/src/components/Graph/components/Margin.tsx index 6a47082c9..292847455 100644 --- a/src/components/Graph/components/Margin.tsx +++ b/src/components/Graph/components/Margin.tsx @@ -1,6 +1,6 @@ import { times } from 'lodash'; -import { theme } from '../../../stitches.config.js'; -import { MarginInputProps } from './Root.js'; +import { theme } from '../../../stitches.config'; +import { MarginInputProps } from './Root'; export enum MarginOrientation { Vertical, diff --git a/src/components/Graph/components/Root.tsx b/src/components/Graph/components/Root.tsx index ebadd058c..cc5d6df8a 100644 --- a/src/components/Graph/components/Root.tsx +++ b/src/components/Graph/components/Root.tsx @@ -1,7 +1,7 @@ import { times } from 'lodash'; import { ReactNode } from 'react'; -import { theme } from '../../../stitches.config.js'; -import { Margin, MarginOrientation } from './Margin.js'; +import { theme } from '../../../stitches.config'; +import { Margin, MarginOrientation } from './Margin'; export const GRAPH_WIDTH = 544; export const GRAPH_HEIGHT = 320; diff --git a/src/components/Graph/index.ts b/src/components/Graph/index.ts index eceb36006..5aaadb77e 100644 --- a/src/components/Graph/index.ts +++ b/src/components/Graph/index.ts @@ -1,3 +1,3 @@ -export * from './components/Line.js'; -export * from './components/Margin.js'; -export * from './components/Root.js'; +export * from './components/Line'; +export * from './components/Margin'; +export * from './components/Root'; diff --git a/src/components/NoData.tsx b/src/components/NoData.tsx index 003ed8040..3bf47967b 100644 --- a/src/components/NoData.tsx +++ b/src/components/NoData.tsx @@ -1,4 +1,4 @@ -import { theme } from '../stitches.config.js'; +import { theme } from '../stitches.config'; export enum NoDataType { BattlesInPeriod, diff --git a/src/components/PercentileIndicator.tsx b/src/components/PercentileIndicator.tsx index 9a466a562..548a46039 100644 --- a/src/components/PercentileIndicator.tsx +++ b/src/components/PercentileIndicator.tsx @@ -10,7 +10,7 @@ import { teal, yellow, } from '@radix-ui/colors'; -import { Percentile } from '../constants/percentiles.js'; +import { Percentile } from '../constants/percentiles'; export interface PercentileIndicatorProps { percentile: Percentile; diff --git a/src/components/PoweredBy.tsx b/src/components/PoweredBy.tsx index fc376f057..8b224b1d7 100644 --- a/src/components/PoweredBy.tsx +++ b/src/components/PoweredBy.tsx @@ -1,5 +1,5 @@ import { ReactNode } from 'react'; -import { theme } from '../stitches.config.js'; +import { theme } from '../stitches.config'; export enum PoweredByType { BlitzStars, diff --git a/src/components/Tanks/components/Item.tsx b/src/components/Tanks/components/Item.tsx index e0458eeca..d7d2cd546 100644 --- a/src/components/Tanks/components/Item.tsx +++ b/src/components/Tanks/components/Item.tsx @@ -2,8 +2,8 @@ import { TANK_ICONS, TANK_ICONS_COLLECTOR, TANK_ICONS_PREMIUM, -} from '../../../core/blitz/tankopedia.js'; -import { theme } from '../../../stitches.config.js'; +} from '../../../core/blitz/tankopedia'; +import { theme } from '../../../stitches.config'; export enum TreeType { TechTree, diff --git a/src/components/Tanks/index.ts b/src/components/Tanks/index.ts index 4f3bf3609..25362d8dd 100644 --- a/src/components/Tanks/index.ts +++ b/src/components/Tanks/index.ts @@ -1,3 +1,3 @@ -export * from './components/Column.js'; -export * from './components/Item.js'; -export * from './components/Root.js'; +export * from './components/Column'; +export * from './components/Item'; +export * from './components/Root'; diff --git a/src/components/TierWeights.tsx b/src/components/TierWeights.tsx index 21421c11f..f08a7046f 100644 --- a/src/components/TierWeights.tsx +++ b/src/components/TierWeights.tsx @@ -1,5 +1,5 @@ -import { TIER_ROMAN_NUMERALS, Tier } from '../core/blitz/tankopedia.js'; -import { theme } from '../stitches.config.js'; +import { TIER_ROMAN_NUMERALS, Tier } from '../core/blitz/tankopedia'; +import { theme } from '../stitches.config'; export type TierWeightsRecord = Partial>; diff --git a/src/components/TitleBar.tsx b/src/components/TitleBar.tsx index 0366b4fb1..7b5f88a7d 100644 --- a/src/components/TitleBar.tsx +++ b/src/components/TitleBar.tsx @@ -1,5 +1,5 @@ -import isDev from '../core/node/isDev.js'; -import { theme } from '../stitches.config.js'; +import isDev from '../core/node/isDev'; +import { theme } from '../stitches.config'; export interface TitleBarProps { name: string; diff --git a/src/components/Wrapper.tsx b/src/components/Wrapper.tsx index 7062bb7a9..41fadd94a 100644 --- a/src/components/Wrapper.tsx +++ b/src/components/Wrapper.tsx @@ -1,5 +1,5 @@ import { ReactNode } from 'react'; -import { theme } from '../stitches.config.js'; +import { theme } from '../stitches.config'; export interface WrapperProps { children: ReactNode; diff --git a/src/core/blitz/calculateWN8.ts b/src/core/blitz/calculateWN8.ts index 850c2f6ea..1c3a1fc24 100644 --- a/src/core/blitz/calculateWN8.ts +++ b/src/core/blitz/calculateWN8.ts @@ -1,4 +1,4 @@ -import { AllStats } from '../../types/accountInfo.js'; +import { AllStats } from '../../types/accountInfo'; /** * Formula from https://web.archive.org/web/20190105064817/http://wiki.wnefficiency.net/pages/WN8 diff --git a/src/core/blitz/diffStats.ts b/src/core/blitz/diffStats.ts index 3c336d4d2..96cc3694d 100644 --- a/src/core/blitz/diffStats.ts +++ b/src/core/blitz/diffStats.ts @@ -1,4 +1,4 @@ -import { AllStats } from '../../types/accountInfo.js'; +import { AllStats } from '../../types/accountInfo'; export default function diffStats(stats1: AllStats, stats2: AllStats) { function diff(value: (allStats: AllStats) => number) { diff --git a/src/core/blitz/getBlitzClan.ts b/src/core/blitz/getBlitzClan.ts index d8e7c5311..fb4785996 100644 --- a/src/core/blitz/getBlitzClan.ts +++ b/src/core/blitz/getBlitzClan.ts @@ -1,7 +1,7 @@ -import { BlitzServer } from '../../constants/servers.js'; -import { serverAndIdPattern } from '../discord/resolvePlayerFromCommand.js'; -import throwError from '../node/throwError.js'; -import listClans from './listClans.js'; +import { BlitzServer } from '../../constants/servers'; +import { serverAndIdPattern } from '../discord/resolvePlayerFromCommand'; +import throwError from '../node/throwError'; +import listClans from './listClans'; export default async function getBlitzClan(clan: string) { if (serverAndIdPattern.test(clan)) { diff --git a/src/core/blitz/getTankStats.ts b/src/core/blitz/getTankStats.ts index 2f75efd05..c8b2e7508 100644 --- a/src/core/blitz/getTankStats.ts +++ b/src/core/blitz/getTankStats.ts @@ -1,8 +1,8 @@ -import { BLITZ_SERVERS, BlitzServer } from '../../constants/servers.js'; -import { TanksStats } from '../../types/tanksStats.js'; -import { WARGAMING_APPLICATION_ID } from '../node/arguments.js'; -import throwError from '../node/throwError.js'; -import getWargamingResponse from './getWargamingResponse.js'; +import { BLITZ_SERVERS, BlitzServer } from '../../constants/servers'; +import { TanksStats } from '../../types/tanksStats'; +import { WARGAMING_APPLICATION_ID } from '../node/arguments'; +import throwError from '../node/throwError'; +import getWargamingResponse from './getWargamingResponse'; export default async function getTankStats(server: BlitzServer, id: number) { const tankStats = await getWargamingResponse( diff --git a/src/core/blitz/getTreeType.ts b/src/core/blitz/getTreeType.ts index 6bedbe83e..bdbf303be 100644 --- a/src/core/blitz/getTreeType.ts +++ b/src/core/blitz/getTreeType.ts @@ -1,5 +1,5 @@ -import { TreeType } from '../../components/Tanks/index.js'; -import { tankopedia } from './tankopedia.js'; +import { TreeType } from '../../components/Tanks'; +import { tankopedia } from './tankopedia'; export default async function getTreeType(id: number) { const entry = (await tankopedia)[id]; diff --git a/src/core/blitz/getWN8Percentile.ts b/src/core/blitz/getWN8Percentile.ts index e153cad4e..b0ece4d77 100644 --- a/src/core/blitz/getWN8Percentile.ts +++ b/src/core/blitz/getWN8Percentile.ts @@ -1,4 +1,4 @@ -import { Percentile } from '../../constants/percentiles.js'; +import { Percentile } from '../../constants/percentiles'; export const WN8_PERCENTILES: [number, Percentile][] = [ [0, Percentile.VeryBad], diff --git a/src/core/blitz/getWargamingResponse.ts b/src/core/blitz/getWargamingResponse.ts index 78edbaa93..d0ce1d917 100644 --- a/src/core/blitz/getWargamingResponse.ts +++ b/src/core/blitz/getWargamingResponse.ts @@ -1,4 +1,4 @@ -import throwError from '../node/throwError.js'; +import throwError from '../node/throwError'; export type WargamingResponse = | { diff --git a/src/core/blitz/listClans.ts b/src/core/blitz/listClans.ts index d751e2de7..5c83d6c48 100644 --- a/src/core/blitz/listClans.ts +++ b/src/core/blitz/listClans.ts @@ -1,7 +1,7 @@ -import { BlitzServer } from '../../constants/servers.js'; -import { Clan, ClanList } from '../../types/clanList.js'; -import { WARGAMING_APPLICATION_ID } from '../node/arguments.js'; -import getWargamingResponse from './getWargamingResponse.js'; +import { BlitzServer } from '../../constants/servers'; +import { Clan, ClanList } from '../../types/clanList'; +import { WARGAMING_APPLICATION_ID } from '../node/arguments'; +import getWargamingResponse from './getWargamingResponse'; export type ClanListWithServer = (Clan & { server: 'com' | 'eu' | 'asia'; diff --git a/src/core/blitz/listPlayers.ts b/src/core/blitz/listPlayers.ts index 5820e59d5..4ee46bcd0 100644 --- a/src/core/blitz/listPlayers.ts +++ b/src/core/blitz/listPlayers.ts @@ -1,7 +1,7 @@ -import { BlitzServer } from '../../constants/servers.js'; -import { Account, AccountList } from '../../types/accountList.js'; -import { WARGAMING_APPLICATION_ID } from '../node/arguments.js'; -import getWargamingResponse from './getWargamingResponse.js'; +import { BlitzServer } from '../../constants/servers'; +import { Account, AccountList } from '../../types/accountList'; +import { WARGAMING_APPLICATION_ID } from '../node/arguments'; +import getWargamingResponse from './getWargamingResponse'; export type AccountListWithServer = (Account & { server: 'com' | 'eu' | 'asia'; diff --git a/src/core/blitz/resolveTankId.ts b/src/core/blitz/resolveTankId.ts index 76c74a824..a7bb5d8a2 100644 --- a/src/core/blitz/resolveTankId.ts +++ b/src/core/blitz/resolveTankId.ts @@ -1,6 +1,6 @@ import { go } from 'fuzzysort'; -import throwError from '../node/throwError.js'; -import { TANKS, tankopedia } from './tankopedia.js'; +import throwError from '../node/throwError'; +import { TANKS, tankopedia } from './tankopedia'; export default async function resolveTankId(tank: string) { const number = parseInt(tank); diff --git a/src/core/blitz/resolveTankName.ts b/src/core/blitz/resolveTankName.ts index 8d3405c71..6d3d38a8d 100644 --- a/src/core/blitz/resolveTankName.ts +++ b/src/core/blitz/resolveTankName.ts @@ -1,4 +1,4 @@ -import { tankopedia } from './tankopedia.js'; +import { tankopedia } from './tankopedia'; export default async function resolveTankName(tankId: number) { const tankopediaName = (await tankopedia)[tankId]?.name; diff --git a/src/core/blitz/sumStats.ts b/src/core/blitz/sumStats.ts index 31bf53d6f..160ddf593 100644 --- a/src/core/blitz/sumStats.ts +++ b/src/core/blitz/sumStats.ts @@ -1,5 +1,5 @@ -import { AllStats } from '../../types/accountInfo.js'; -import { emptyAllStats } from '../blitzstars/getDiffedTankStats.js'; +import { AllStats } from '../../types/accountInfo'; +import { emptyAllStats } from '../blitzstars/getDiffedTankStats'; export default function sumStats(allStatsCollection: AllStats[]) { return allStatsCollection.reduce((accumulated, current) => { diff --git a/src/core/blitzstars/getDiffedTankStats.ts b/src/core/blitzstars/getDiffedTankStats.ts index 208b816ad..bdbab3773 100644 --- a/src/core/blitzstars/getDiffedTankStats.ts +++ b/src/core/blitzstars/getDiffedTankStats.ts @@ -1,9 +1,9 @@ -import { BlitzServer } from '../../constants/servers.js'; -import { AllStats } from '../../types/accountInfo.js'; +import { BlitzServer } from '../../constants/servers'; +import { AllStats } from '../../types/accountInfo'; import getTankHistories, { TankHistories, TankHistoryRaw, -} from './getTankHistories.js'; +} from './getTankHistories'; export const emptyAllStats: AllStats = { battles: 0, diff --git a/src/core/blitzstars/getPeriodStart.ts b/src/core/blitzstars/getPeriodStart.ts index d1d820428..8357aab44 100644 --- a/src/core/blitzstars/getPeriodStart.ts +++ b/src/core/blitzstars/getPeriodStart.ts @@ -1,6 +1,6 @@ -import { BlitzServer } from '../../constants/servers.js'; -import { Period } from '../discord/addPeriodSubCommands.js'; -import getTimeDaysAgo from './getTimeDaysAgo.js'; +import { BlitzServer } from '../../constants/servers'; +import { Period } from '../discord/addPeriodSubCommands'; +import getTimeDaysAgo from './getTimeDaysAgo'; export default function getPeriodStart( server: BlitzServer, diff --git a/src/core/blitzstars/getPlayerHistories.ts b/src/core/blitzstars/getPlayerHistories.ts index fcbf625be..ac0419b93 100644 --- a/src/core/blitzstars/getPlayerHistories.ts +++ b/src/core/blitzstars/getPlayerHistories.ts @@ -1,14 +1,14 @@ -import { BlitzServer } from '../../constants/servers.js'; -import { AccountInfo, AllStats } from '../../types/accountInfo.js'; +import { BlitzServer } from '../../constants/servers'; +import { AccountInfo, AllStats } from '../../types/accountInfo'; import { GetHistoriesOptions, Histories, History, getHistoriesDefaultOptions, -} from '../../types/histories.js'; -import getWargamingResponse from '../blitz/getWargamingResponse.js'; -import { WARGAMING_APPLICATION_ID } from '../node/arguments.js'; -import { emptyAllStats } from './getDiffedTankStats.js'; +} from '../../types/histories'; +import getWargamingResponse from '../blitz/getWargamingResponse'; +import { WARGAMING_APPLICATION_ID } from '../node/arguments'; +import { emptyAllStats } from './getDiffedTankStats'; export interface PlayerHistoryRaw { clan: { clan_id: number; name: string; tag: string }; @@ -44,7 +44,7 @@ export default async function getPlayerHistories( ({ all: history.statistics.all, last_battle_time: history.last_battle_time, - } satisfies History), + }) satisfies History, ); let lastNonCompliantIndex = -1; let hasCompliedOnce = false; diff --git a/src/core/blitzstars/getTankHistories.ts b/src/core/blitzstars/getTankHistories.ts index b2a7aa713..e6fb78415 100644 --- a/src/core/blitzstars/getTankHistories.ts +++ b/src/core/blitzstars/getTankHistories.ts @@ -1,12 +1,12 @@ -import { BlitzServer } from '../../constants/servers.js'; +import { BlitzServer } from '../../constants/servers'; import { GetHistoriesOptions, Histories, History, getHistoriesDefaultOptions, -} from '../../types/histories.js'; -import getTankStats from '../blitz/getTankStats.js'; -import { emptyAllStats } from './getDiffedTankStats.js'; +} from '../../types/histories'; +import getTankStats from '../blitz/getTankStats'; +import { emptyAllStats } from './getDiffedTankStats'; export interface TankHistory extends History { tank_id: number; @@ -48,7 +48,7 @@ export default async function getTankHistories( all: history.all, last_battle_time: history.last_battle_time, tank_id: history.tank_id, - } satisfies TankHistory), + }) satisfies TankHistory, ); const compliantTanks: number[] = []; const lastBattles: Record = {}; diff --git a/src/core/blitzstars/getTimeDaysAgo.ts b/src/core/blitzstars/getTimeDaysAgo.ts index 357bca538..ff8452ec2 100644 --- a/src/core/blitzstars/getTimeDaysAgo.ts +++ b/src/core/blitzstars/getTimeDaysAgo.ts @@ -1,4 +1,4 @@ -import { BlitzServer } from '../../constants/servers.js'; +import { BlitzServer } from '../../constants/servers'; export const TIME_ZONE_MAPPINGS: Record = { com: -5, // Central North American Time diff --git a/src/core/blitzstars/playerAverage.ts b/src/core/blitzstars/playerAverage.ts index 4f79f77af..b9b750957 100644 --- a/src/core/blitzstars/playerAverage.ts +++ b/src/core/blitzstars/playerAverage.ts @@ -1,6 +1,6 @@ -import sumStats from '../blitz/sumStats.js'; -import { emptyAllStats } from './getDiffedTankStats.js'; -import { tankAverages } from './tankAverages.js'; +import sumStats from '../blitz/sumStats'; +import { emptyAllStats } from './getDiffedTankStats'; +import { tankAverages } from './tankAverages'; console.log('Calculating player average...'); export const playerAverage = Object.entries(await tankAverages).reduce( diff --git a/src/core/blitzstars/tankAverages.ts b/src/core/blitzstars/tankAverages.ts index 84733e336..c36b554ca 100644 --- a/src/core/blitzstars/tankAverages.ts +++ b/src/core/blitzstars/tankAverages.ts @@ -1,4 +1,4 @@ -import { AllStats } from '../../types/accountInfo.js'; +import { AllStats } from '../../types/accountInfo'; export interface SpecialStats { winrate: number; diff --git a/src/core/discord/addPeriodSubCommands.ts b/src/core/discord/addPeriodSubCommands.ts index 74fd61087..35d7a4dda 100644 --- a/src/core/discord/addPeriodSubCommands.ts +++ b/src/core/discord/addPeriodSubCommands.ts @@ -2,7 +2,7 @@ import { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, } from 'discord.js'; -import { PERIOD_NAMES } from '../discord/resolvePeriodFromCommand.js'; +import { PERIOD_NAMES } from '../discord/resolvePeriodFromCommand'; export type Period = 'today' | '30' | '60' | '90' | 'career' | 'custom'; diff --git a/src/core/discord/addServerChoices.ts b/src/core/discord/addServerChoices.ts index 5c6ad5def..e3f806aa9 100644 --- a/src/core/discord/addServerChoices.ts +++ b/src/core/discord/addServerChoices.ts @@ -1,5 +1,5 @@ import { SlashCommandStringOption } from 'discord.js'; -import { BLITZ_SERVERS } from '../../constants/servers.js'; +import { BLITZ_SERVERS } from '../../constants/servers'; export default function addServerChoices(option: SlashCommandStringOption) { return option diff --git a/src/core/discord/addStatTypeSubCommandGroups.ts b/src/core/discord/addStatTypeSubCommandGroups.ts index a5657db10..66fe7f586 100644 --- a/src/core/discord/addStatTypeSubCommandGroups.ts +++ b/src/core/discord/addStatTypeSubCommandGroups.ts @@ -1,7 +1,7 @@ import { SlashCommandBuilder } from 'discord.js'; -import addPeriodSubCommands from './addPeriodSubCommands.js'; -import addTankChoices from './addTankChoices.js'; -import addUsernameChoices from './addUsernameChoices.js'; +import addPeriodSubCommands from './addPeriodSubCommands'; +import addTankChoices from './addTankChoices'; +import addUsernameChoices from './addUsernameChoices'; export default function addStatTypeSubCommandGroups( option: SlashCommandBuilder, diff --git a/src/core/discord/autocompleteClan.ts b/src/core/discord/autocompleteClan.ts index 78c7df143..fb5296ddc 100644 --- a/src/core/discord/autocompleteClan.ts +++ b/src/core/discord/autocompleteClan.ts @@ -3,8 +3,8 @@ import { AutocompleteInteraction, CacheType, } from 'discord.js'; -import { BLITZ_SERVERS } from '../../constants/servers.js'; -import listClans from '../blitz/listClans.js'; +import { BLITZ_SERVERS } from '../../constants/servers'; +import listClans from '../blitz/listClans'; export default async function autocompleteClan( interaction: AutocompleteInteraction, @@ -20,7 +20,7 @@ export default async function autocompleteClan( ({ name: `${player.name} (${BLITZ_SERVERS[player.server]})`, value: `${player.server}/${player.clan_id}`, - } satisfies ApplicationCommandOptionChoiceData), + }) satisfies ApplicationCommandOptionChoiceData, ) : [], ); diff --git a/src/core/discord/autocompleteTanks.ts b/src/core/discord/autocompleteTanks.ts index ec75c052c..a7a1cdbaa 100644 --- a/src/core/discord/autocompleteTanks.ts +++ b/src/core/discord/autocompleteTanks.ts @@ -4,8 +4,8 @@ import { CacheType, } from 'discord.js'; import { go } from 'fuzzysort'; -import resolveTankName from '../blitz/resolveTankName.js'; -import { TANKS } from '../blitz/tankopedia.js'; +import resolveTankName from '../blitz/resolveTankName'; +import { TANKS } from '../blitz/tankopedia'; export default async function autocompleteTanks( interaction: AutocompleteInteraction, @@ -16,14 +16,17 @@ export default async function autocompleteTanks( await interaction.respond( focusedOption.value ? await Promise.all( - go(focusedOption.value, await TANKS, { keys: ['name'], limit: 10 }).map( + go(focusedOption.value, await TANKS, { + keys: ['name'], + limit: 10, + }).map( async (item) => ({ name: item.obj.name ? item.obj.name : await resolveTankName(item.obj.tank_id), value: `${item.obj.tank_id}`, - } satisfies ApplicationCommandOptionChoiceData), + }) satisfies ApplicationCommandOptionChoiceData, ), ) : [], diff --git a/src/core/discord/autocompleteUsername.ts b/src/core/discord/autocompleteUsername.ts index 871f424f2..2ee5b3464 100644 --- a/src/core/discord/autocompleteUsername.ts +++ b/src/core/discord/autocompleteUsername.ts @@ -3,8 +3,8 @@ import { AutocompleteInteraction, CacheType, } from 'discord.js'; -import { BLITZ_SERVERS } from '../../constants/servers.js'; -import listPlayers from '../blitz/listPlayers.js'; +import { BLITZ_SERVERS } from '../../constants/servers'; +import listPlayers from '../blitz/listPlayers'; export default async function autocompleteUsername( interaction: AutocompleteInteraction, @@ -21,7 +21,7 @@ export default async function autocompleteUsername( ({ name: `${player.nickname} (${BLITZ_SERVERS[player.server]})`, value: `${player.server}/${player.account_id}`, - } satisfies ApplicationCommandOptionChoiceData), + }) satisfies ApplicationCommandOptionChoiceData, ) : [], ); diff --git a/src/core/discord/embedInfo.ts b/src/core/discord/embedInfo.ts index a188a1643..75ac86c80 100644 --- a/src/core/discord/embedInfo.ts +++ b/src/core/discord/embedInfo.ts @@ -1,5 +1,5 @@ import { EmbedBuilder } from 'discord.js'; -import { ACCENT_COLOR } from '../../constants/colors.js'; +import { ACCENT_COLOR } from '../../constants/colors'; export default function embedInfo(title: string, description: string) { const embed = new EmbedBuilder() diff --git a/src/core/discord/embedNegative.ts b/src/core/discord/embedNegative.ts index 54e11ab8b..35704b20e 100644 --- a/src/core/discord/embedNegative.ts +++ b/src/core/discord/embedNegative.ts @@ -1,5 +1,5 @@ import { EmbedBuilder } from 'discord.js'; -import { NEGATIVE_COLOR } from '../../constants/colors.js'; +import { NEGATIVE_COLOR } from '../../constants/colors'; export default function embedNegative(title: string, description: string) { return new EmbedBuilder() diff --git a/src/core/discord/embedPositive.ts b/src/core/discord/embedPositive.ts index c9067d818..47174a0d1 100644 --- a/src/core/discord/embedPositive.ts +++ b/src/core/discord/embedPositive.ts @@ -1,5 +1,5 @@ import { EmbedBuilder } from 'discord.js'; -import { POSITIVE_COLOR } from '../../constants/colors.js'; +import { POSITIVE_COLOR } from '../../constants/colors'; export default function embedPositive(title: string, description: string) { return new EmbedBuilder() diff --git a/src/core/discord/embedWarning.ts b/src/core/discord/embedWarning.ts index 45ee01909..3148f7a7a 100644 --- a/src/core/discord/embedWarning.ts +++ b/src/core/discord/embedWarning.ts @@ -1,5 +1,5 @@ import { EmbedBuilder } from 'discord.js'; -import { WARNING_COLOR } from '../../constants/colors.js'; +import { WARNING_COLOR } from '../../constants/colors'; export default function embedWarning(title: string, description: string) { return new EmbedBuilder() diff --git a/src/core/discord/normalizeInteractionReturnable.ts b/src/core/discord/normalizeInteractionReturnable.ts index 828812eb2..3f354735b 100644 --- a/src/core/discord/normalizeInteractionReturnable.ts +++ b/src/core/discord/normalizeInteractionReturnable.ts @@ -4,8 +4,8 @@ import { EmbedBuilder, InteractionEditReplyOptions, } from 'discord.js'; -import { InteractionReturnable } from '../../events/interactionCreate/index.js'; -import jsxToPng from '../node/jsxToPng.js'; +import { InteractionReturnable } from '../../events/interactionCreate'; +import jsxToPng from '../node/jsxToPng'; export default async function normalizeInteractionReturnable( returnable: InteractionReturnable, diff --git a/src/core/discord/resolvePeriodFromButton.ts b/src/core/discord/resolvePeriodFromButton.ts index 823780c75..0c31e65e4 100644 --- a/src/core/discord/resolvePeriodFromButton.ts +++ b/src/core/discord/resolvePeriodFromButton.ts @@ -1,7 +1,7 @@ import { ButtonInteraction, CacheType } from 'discord.js'; -import { CYCLIC_API } from '../../constants/cyclic.js'; -import { BlitzServer } from '../../constants/servers.js'; -import resolvePeriodFromURL from '../express/resolvePeriodFromURL.js'; +import { CYCLIC_API } from '../../constants/cyclic'; +import { BlitzServer } from '../../constants/servers'; +import resolvePeriodFromURL from '../express/resolvePeriodFromURL'; export default function resolvePeriodFromButton( server: BlitzServer, diff --git a/src/core/discord/resolvePeriodFromCommand.ts b/src/core/discord/resolvePeriodFromCommand.ts index c3d8816d6..6672f41fb 100644 --- a/src/core/discord/resolvePeriodFromCommand.ts +++ b/src/core/discord/resolvePeriodFromCommand.ts @@ -1,9 +1,9 @@ import { CacheType, ChatInputCommandInteraction } from 'discord.js'; -import { BlitzServer } from '../../constants/servers.js'; -import getPeriodNow from '../blitzstars/getPeriodNow.js'; -import getPeriodStart from '../blitzstars/getPeriodStart.js'; -import getTimeDaysAgo from '../blitzstars/getTimeDaysAgo.js'; -import { Period } from '../discord/addPeriodSubCommands.js'; +import { BlitzServer } from '../../constants/servers'; +import getPeriodNow from '../blitzstars/getPeriodNow'; +import getPeriodStart from '../blitzstars/getPeriodStart'; +import getTimeDaysAgo from '../blitzstars/getTimeDaysAgo'; +import { Period } from '../discord/addPeriodSubCommands'; export const PERIOD_NAMES: Record = { today: "Today's statistics", diff --git a/src/core/discord/resolvePlayerFromButton.ts b/src/core/discord/resolvePlayerFromButton.ts index c6b956359..eb469366b 100644 --- a/src/core/discord/resolvePlayerFromButton.ts +++ b/src/core/discord/resolvePlayerFromButton.ts @@ -1,6 +1,6 @@ import { ButtonInteraction, CacheType } from 'discord.js'; -import { CYCLIC_API } from '../../constants/cyclic.js'; -import resolvePlayerFromURL from '../express/resolvePlayerFromURL.js'; +import { CYCLIC_API } from '../../constants/cyclic'; +import resolvePlayerFromURL from '../express/resolvePlayerFromURL'; export default async function resolvePlayerFromButton( interaction: ButtonInteraction, diff --git a/src/core/discord/resolvePlayerFromCommand.ts b/src/core/discord/resolvePlayerFromCommand.ts index 084b8c52f..7c30bfa27 100644 --- a/src/core/discord/resolvePlayerFromCommand.ts +++ b/src/core/discord/resolvePlayerFromCommand.ts @@ -1,9 +1,9 @@ import { CacheType, ChatInputCommandInteraction } from 'discord.js'; -import { BlitzServer } from '../../constants/servers.js'; +import { BlitzServer } from '../../constants/servers'; import listPlayers, { usernamePatternWithoutPosition, -} from '../blitz/listPlayers.js'; -import throwError from '../node/throwError.js'; +} from '../blitz/listPlayers'; +import throwError from '../node/throwError'; export const serverAndIdPattern = /(com|eu|asia)\/[0-9]+/; diff --git a/src/core/express/normalizeRouteReturnable.ts b/src/core/express/normalizeRouteReturnable.ts index f630232da..8f3ecfd1c 100644 --- a/src/core/express/normalizeRouteReturnable.ts +++ b/src/core/express/normalizeRouteReturnable.ts @@ -1,5 +1,5 @@ -import { RouteReturnable } from '../../server.js'; -import jsxToSvg from '../node/jsxToSvg.js'; +import { RouteReturnable } from '../../server'; +import jsxToSvg from '../node/jsxToSvg'; export default async function normalizeRouteReturnable( returnable: RouteReturnable, diff --git a/src/core/express/resolvePeriodFromRequest.ts b/src/core/express/resolvePeriodFromRequest.ts index 2350d09e0..b0e964ad8 100644 --- a/src/core/express/resolvePeriodFromRequest.ts +++ b/src/core/express/resolvePeriodFromRequest.ts @@ -1,7 +1,7 @@ import { Request } from 'express'; -import { CYCLIC_API } from '../../constants/cyclic.js'; -import { BlitzServer } from '../../constants/servers.js'; -import resolvePeriodFromURL from './resolvePeriodFromURL.js'; +import { CYCLIC_API } from '../../constants/cyclic'; +import { BlitzServer } from '../../constants/servers'; +import resolvePeriodFromURL from './resolvePeriodFromURL'; export default function resolvePeriodFromRequest( server: BlitzServer, diff --git a/src/core/express/resolvePeriodFromURL.ts b/src/core/express/resolvePeriodFromURL.ts index e490a15aa..d478126c6 100644 --- a/src/core/express/resolvePeriodFromURL.ts +++ b/src/core/express/resolvePeriodFromURL.ts @@ -1,13 +1,13 @@ -import { BlitzServer } from '../../constants/servers.js'; -import getPeriodNow from '../blitzstars/getPeriodNow.js'; -import getPeriodStart from '../blitzstars/getPeriodStart.js'; -import getTimeDaysAgo from '../blitzstars/getTimeDaysAgo.js'; -import { Period } from '../discord/addPeriodSubCommands.js'; +import { BlitzServer } from '../../constants/servers'; +import getPeriodNow from '../blitzstars/getPeriodNow'; +import getPeriodStart from '../blitzstars/getPeriodStart'; +import getTimeDaysAgo from '../blitzstars/getTimeDaysAgo'; +import { Period } from '../discord/addPeriodSubCommands'; import { EVOLUTION_PERIOD_NAMES, PERIOD_NAMES, ResolvedPeriod, -} from '../discord/resolvePeriodFromCommand.js'; +} from '../discord/resolvePeriodFromCommand'; export default function resolvePeriodFromURL( server: BlitzServer, diff --git a/src/core/express/resolvePlayerFromRequest.ts b/src/core/express/resolvePlayerFromRequest.ts index 2fe5bd578..600c39fdb 100644 --- a/src/core/express/resolvePlayerFromRequest.ts +++ b/src/core/express/resolvePlayerFromRequest.ts @@ -1,6 +1,6 @@ import { Request } from 'express'; -import { CYCLIC_API } from '../../constants/cyclic.js'; -import resolvePlayerFromURL from './resolvePlayerFromURL.js'; +import { CYCLIC_API } from '../../constants/cyclic'; +import resolvePlayerFromURL from './resolvePlayerFromURL'; export default function resolvePlayerFromRequest(request: Request) { return resolvePlayerFromURL(`${CYCLIC_API}${request.originalUrl}`); diff --git a/src/core/express/resolvePlayerFromURL.ts b/src/core/express/resolvePlayerFromURL.ts index 81608ab13..983fa11b8 100644 --- a/src/core/express/resolvePlayerFromURL.ts +++ b/src/core/express/resolvePlayerFromURL.ts @@ -1,5 +1,5 @@ -import { BlitzServer } from '../../constants/servers.js'; -import { ResolvedPlayer } from '../discord/resolvePlayerFromCommand.js'; +import { BlitzServer } from '../../constants/servers'; +import { ResolvedPlayer } from '../discord/resolvePlayerFromCommand'; export default function resolvePlayerFromURL(urlString: string) { const url = new URL(urlString); diff --git a/src/core/node/getClientId.ts b/src/core/node/getClientId.ts index bbc2506ed..4f292d07e 100644 --- a/src/core/node/getClientId.ts +++ b/src/core/node/getClientId.ts @@ -1,5 +1,5 @@ import discord from '../../../discord.json' assert { type: 'json' }; -import isDev from './isDev.js'; +import isDev from './isDev'; export default function getClientId() { return isDev() ? discord.client_id_dev : discord.client_id; diff --git a/src/core/node/jsxToPng.ts b/src/core/node/jsxToPng.ts index e48d3b1f5..b558dcd2b 100644 --- a/src/core/node/jsxToPng.ts +++ b/src/core/node/jsxToPng.ts @@ -1,5 +1,5 @@ -import jsxToSvg from './jsxToSvg.js'; -import svgToPng from './svgToPng.js'; +import jsxToSvg from './jsxToSvg'; +import svgToPng from './svgToPng'; export default async function jsxToPng(jsx: JSX.Element) { const svg = await jsxToSvg(jsx); diff --git a/src/core/node/svgToPng.ts b/src/core/node/svgToPng.ts index 3a221097d..601c8648c 100644 --- a/src/core/node/svgToPng.ts +++ b/src/core/node/svgToPng.ts @@ -1,5 +1,5 @@ -import { Resvg } from "@resvg/resvg-js"; +import { Resvg } from '@resvg/resvg-js'; export default function svgToPng(svg: string) { - return new Resvg(svg).render().asPng() -} \ No newline at end of file + return new Resvg(svg).render().asPng(); +} diff --git a/src/events/error.ts b/src/events/error.ts index 8dec386de..c4104b5ff 100644 --- a/src/events/error.ts +++ b/src/events/error.ts @@ -1,8 +1,8 @@ import { EmbedBuilder, TextChannel } from 'discord.js'; import discord from '../../discord.json' assert { type: 'json' }; -import { client } from '../bot.js'; -import { NEGATIVE_COLOR } from '../constants/colors.js'; -import isDev from '../core/node/isDev.js'; +import { client } from '../bot'; +import { NEGATIVE_COLOR } from '../constants/colors'; +import isDev from '../core/node/isDev'; const PROCESS_ERROR_EVENTS = ['uncaughtException']; const CLIENT_ERROR_EVENTS = ['error']; diff --git a/src/events/guildMemberAdd.ts b/src/events/guildMemberAdd.ts index 60b0abb3a..4e57ef9d9 100644 --- a/src/events/guildMemberAdd.ts +++ b/src/events/guildMemberAdd.ts @@ -1,6 +1,6 @@ import { EmbedBuilder, GuildMember, TextChannel } from 'discord.js'; import discord from '../../discord.json' assert { type: 'json' }; -import { ACCENT_COLOR } from '../constants/colors.js'; +import { ACCENT_COLOR } from '../constants/colors'; export default async function (member: GuildMember) { if (member.guild.id === discord.sklld_guild_id) { diff --git a/src/events/interactionCreate/handlers/autocomplete.ts b/src/events/interactionCreate/handlers/autocomplete.ts index 0a9383bed..af4b81bed 100644 --- a/src/events/interactionCreate/handlers/autocomplete.ts +++ b/src/events/interactionCreate/handlers/autocomplete.ts @@ -1,5 +1,5 @@ import { AutocompleteInteraction, CacheType } from 'discord.js'; -import { commands } from '../index.js'; +import { commands } from '..'; export default function handleAutocomplete( interaction: AutocompleteInteraction, diff --git a/src/events/interactionCreate/handlers/button.tsx b/src/events/interactionCreate/handlers/button.tsx index 657a0bcc8..7fc55ae21 100644 --- a/src/events/interactionCreate/handlers/button.tsx +++ b/src/events/interactionCreate/handlers/button.tsx @@ -1,8 +1,8 @@ import { ButtonInteraction, CacheType } from 'discord.js'; -import { CYCLIC_API } from '../../../constants/cyclic.js'; -import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable.js'; -import throwError from '../../../core/node/throwError.js'; -import { commands } from '../index.js'; +import { commands } from '..'; +import { CYCLIC_API } from '../../../constants/cyclic'; +import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable'; +import throwError from '../../../core/node/throwError'; export default async function handleButton( interaction: ButtonInteraction, diff --git a/src/events/interactionCreate/handlers/chatInputCommand.ts b/src/events/interactionCreate/handlers/chatInputCommand.ts index 3422b8121..f7b1a855d 100644 --- a/src/events/interactionCreate/handlers/chatInputCommand.ts +++ b/src/events/interactionCreate/handlers/chatInputCommand.ts @@ -5,12 +5,12 @@ import { CacheType, ChatInputCommandInteraction, } from 'discord.js'; -import embedNegative from '../../../core/discord/embedNegative.js'; -import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable.js'; -import embedWarning from '../../../core/discord/embedWarning.js'; -import { psa } from '../../../core/discord/psa.js'; -import { handleError } from '../../error.js'; -import { commands } from '../index.js'; +import { commands } from '..'; +import embedNegative from '../../../core/discord/embedNegative'; +import embedWarning from '../../../core/discord/embedWarning'; +import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable'; +import { psa } from '../../../core/discord/psa'; +import { handleError } from '../../error'; export default async function handleChatInputCommand( interaction: ChatInputCommandInteraction, diff --git a/src/events/interactionCreate/index.ts b/src/events/interactionCreate/index.ts index 952155d16..af2ba8d27 100644 --- a/src/events/interactionCreate/index.ts +++ b/src/events/interactionCreate/index.ts @@ -13,28 +13,28 @@ import { SlashCommandSubcommandsOnlyBuilder, } from 'discord.js'; import discord from '../../../discord.json' assert { type: 'json' }; -import { debugCommand } from '../../commands/debug.js'; -import { eligibleCommand } from '../../commands/eligible.js'; -import { evolutionCommand } from '../../commands/evolution.js'; -import { fullStatsCommand } from '../../commands/fullStats.js'; -import { helpCommand } from '../../commands/help.js'; -import { inactiveCommand } from '../../commands/inactive.js'; -import { ownedTanksCommand } from '../../commands/ownedTanks.js'; -import { pingCommand } from '../../commands/ping.js'; -import { playerAchievementsCommand } from '../../commands/playerAchievements.js'; -import { playerInfoCommand } from '../../commands/playerInfo.js'; -import { searchClansCommand } from '../../commands/searchClans.js'; -import { searchPlayersCommand } from '../../commands/searchPlayers.js'; -import { searchTanksCommand } from '../../commands/searchTanks.js'; -import { statsCommand } from '../../commands/stats.js'; -import { todayCommand } from '../../commands/today.js'; -import { verifyCommand } from '../../commands/verify.js'; -import { DISCORD_TOKEN } from '../../core/node/arguments.js'; -import getClientId from '../../core/node/getClientId.js'; -import isDev from '../../core/node/isDev.js'; -import handleAutocomplete from './handlers/autocomplete.js'; -import handleButton from './handlers/button.js'; -import handleChatInputCommand from './handlers/chatInputCommand.js'; +import { debugCommand } from '../../commands/debug'; +import { eligibleCommand } from '../../commands/eligible'; +import { evolutionCommand } from '../../commands/evolution'; +import { fullStatsCommand } from '../../commands/fullStats'; +import { helpCommand } from '../../commands/help'; +import { inactiveCommand } from '../../commands/inactive'; +import { ownedTanksCommand } from '../../commands/ownedTanks'; +import { pingCommand } from '../../commands/ping'; +import { playerAchievementsCommand } from '../../commands/playerAchievements'; +import { playerInfoCommand } from '../../commands/playerInfo'; +import { searchClansCommand } from '../../commands/searchClans'; +import { searchPlayersCommand } from '../../commands/searchPlayers'; +import { searchTanksCommand } from '../../commands/searchTanks'; +import { statsCommand } from '../../commands/stats'; +import { todayCommand } from '../../commands/today'; +import { verifyCommand } from '../../commands/verify'; +import { DISCORD_TOKEN } from '../../core/node/arguments'; +import getClientId from '../../core/node/getClientId'; +import isDev from '../../core/node/isDev'; +import handleAutocomplete from './handlers/autocomplete'; +import handleButton from './handlers/button'; +import handleChatInputCommand from './handlers/chatInputCommand'; export type InteractionRawReturnable = | string diff --git a/src/events/ready.ts b/src/events/ready.ts index e84016295..cf6996d04 100644 --- a/src/events/ready.ts +++ b/src/events/ready.ts @@ -1,5 +1,5 @@ import { Client } from 'discord.js'; -import isDev from '../core/node/isDev.js'; +import isDev from '../core/node/isDev'; export default function ready(client: Client) { console.log( diff --git a/src/renderers/evolution.tsx b/src/renderers/evolution.tsx index e54417630..19d4f85e6 100644 --- a/src/renderers/evolution.tsx +++ b/src/renderers/evolution.tsx @@ -1,21 +1,21 @@ -import * as Graph from '../components/Graph/index.js'; -import NoData, { NoDataType } from '../components/NoData.js'; -import PoweredBy, { PoweredByType } from '../components/PoweredBy.js'; -import TitleBar from '../components/TitleBar.js'; -import Wrapper from '../components/Wrapper.js'; -import { BLITZ_SERVERS } from '../constants/servers.js'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import resolveTankName from '../core/blitz/resolveTankName.js'; -import { tankopedia } from '../core/blitz/tankopedia.js'; -import getPlayerHistories from '../core/blitzstars/getPlayerHistories.js'; -import getTankHistories from '../core/blitzstars/getTankHistories.js'; -import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand.js'; -import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { AccountInfo } from '../types/accountInfo.js'; -import { Histories } from '../types/histories.js'; -import { PlayerClanData } from '../types/playerClanData.js'; -import { StatType } from './fullStats.js'; +import * as Graph from '../components/Graph'; +import NoData, { NoDataType } from '../components/NoData'; +import PoweredBy, { PoweredByType } from '../components/PoweredBy'; +import TitleBar from '../components/TitleBar'; +import Wrapper from '../components/Wrapper'; +import { BLITZ_SERVERS } from '../constants/servers'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import resolveTankName from '../core/blitz/resolveTankName'; +import { tankopedia } from '../core/blitz/tankopedia'; +import getPlayerHistories from '../core/blitzstars/getPlayerHistories'; +import getTankHistories from '../core/blitzstars/getTankHistories'; +import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand'; +import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { AccountInfo } from '../types/accountInfo'; +import { Histories } from '../types/histories'; +import { PlayerClanData } from '../types/playerClanData'; +import { StatType } from './fullStats'; export default async function evolution( type: Type, diff --git a/src/renderers/fullStats.tsx b/src/renderers/fullStats.tsx index a9ecae06e..1a2b20d2d 100644 --- a/src/renderers/fullStats.tsx +++ b/src/renderers/fullStats.tsx @@ -1,27 +1,27 @@ -import GenericAllStats from '../components/GenericAllStats/index.js'; -import NoData, { NoDataType } from '../components/NoData.js'; -import PoweredBy, { PoweredByType } from '../components/PoweredBy.js'; -import TierWeights, { TierWeightsRecord } from '../components/TierWeights.js'; -import TitleBar from '../components/TitleBar.js'; -import Wrapper from '../components/Wrapper.js'; -import { BLITZ_SERVERS } from '../constants/servers.js'; -import calculateWN8 from '../core/blitz/calculateWN8.js'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import resolveTankName from '../core/blitz/resolveTankName.js'; -import sumStats from '../core/blitz/sumStats.js'; -import { Tier, tankopedia } from '../core/blitz/tankopedia.js'; -import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats.js'; -import { tankAverages } from '../core/blitzstars/tankAverages.js'; -import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand.js'; -import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; +import GenericAllStats from '../components/GenericAllStats'; +import NoData, { NoDataType } from '../components/NoData'; +import PoweredBy, { PoweredByType } from '../components/PoweredBy'; +import TierWeights, { TierWeightsRecord } from '../components/TierWeights'; +import TitleBar from '../components/TitleBar'; +import Wrapper from '../components/Wrapper'; +import { BLITZ_SERVERS } from '../constants/servers'; +import calculateWN8 from '../core/blitz/calculateWN8'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import resolveTankName from '../core/blitz/resolveTankName'; +import sumStats from '../core/blitz/sumStats'; +import { Tier, tankopedia } from '../core/blitz/tankopedia'; +import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats'; +import { tankAverages } from '../core/blitzstars/tankAverages'; +import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand'; +import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; import { AccountInfo, AllStats, SupplementaryStats, -} from '../types/accountInfo.js'; -import { PlayerClanData } from '../types/playerClanData.js'; -import { PossiblyPromise } from '../types/possiblyPromise.js'; +} from '../types/accountInfo'; +import { PlayerClanData } from '../types/playerClanData'; +import { PossiblyPromise } from '../types/possiblyPromise'; export type StatType = 'player' | 'tank'; diff --git a/src/renderers/stats.tsx b/src/renderers/stats.tsx index 5756da28a..9fe5e2629 100644 --- a/src/renderers/stats.tsx +++ b/src/renderers/stats.tsx @@ -1,28 +1,28 @@ -import AllStatsOverview from '../components/AllStatsOverview/index.js'; -import NoData, { NoDataType } from '../components/NoData.js'; -import PoweredBy, { PoweredByType } from '../components/PoweredBy.js'; -import { TierWeightsRecord } from '../components/TierWeights.js'; -import TitleBar from '../components/TitleBar.js'; -import Wrapper from '../components/Wrapper.js'; -import { BLITZ_SERVERS } from '../constants/servers.js'; -import calculateWN8 from '../core/blitz/calculateWN8.js'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import resolveTankName from '../core/blitz/resolveTankName.js'; -import sumStats from '../core/blitz/sumStats.js'; -import { Tier, tankopedia } from '../core/blitz/tankopedia.js'; -import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats.js'; -import { tankAverages } from '../core/blitzstars/tankAverages.js'; -import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand.js'; -import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { theme } from '../stitches.config.js'; +import AllStatsOverview from '../components/AllStatsOverview'; +import NoData, { NoDataType } from '../components/NoData'; +import PoweredBy, { PoweredByType } from '../components/PoweredBy'; +import { TierWeightsRecord } from '../components/TierWeights'; +import TitleBar from '../components/TitleBar'; +import Wrapper from '../components/Wrapper'; +import { BLITZ_SERVERS } from '../constants/servers'; +import calculateWN8 from '../core/blitz/calculateWN8'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import resolveTankName from '../core/blitz/resolveTankName'; +import sumStats from '../core/blitz/sumStats'; +import { Tier, tankopedia } from '../core/blitz/tankopedia'; +import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats'; +import { tankAverages } from '../core/blitzstars/tankAverages'; +import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand'; +import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { theme } from '../stitches.config'; import { AccountInfo, AllStats, SupplementaryStats, -} from '../types/accountInfo.js'; -import { PlayerClanData } from '../types/playerClanData.js'; -import { PossiblyPromise } from '../types/possiblyPromise.js'; +} from '../types/accountInfo'; +import { PlayerClanData } from '../types/playerClanData'; +import { PossiblyPromise } from '../types/possiblyPromise'; export type StatType = 'player' | 'tank'; diff --git a/src/renderers/today.tsx b/src/renderers/today.tsx index 9a0c96839..24028604f 100644 --- a/src/renderers/today.tsx +++ b/src/renderers/today.tsx @@ -1,24 +1,24 @@ -import * as Breakdown from '../components/Breakdown/index.js'; -import NoData, { NoDataType } from '../components/NoData.js'; -import PoweredBy, { PoweredByType } from '../components/PoweredBy.js'; -import TitleBar from '../components/TitleBar.js'; -import Wrapper from '../components/Wrapper.js'; -import { BLITZ_SERVERS } from '../constants/servers.js'; -import calculateWN8 from '../core/blitz/calculateWN8.js'; -import getTankStats from '../core/blitz/getTankStats.js'; -import getWargamingResponse from '../core/blitz/getWargamingResponse.js'; -import resolveTankName from '../core/blitz/resolveTankName.js'; -import sumStats from '../core/blitz/sumStats.js'; -import { tankopedia } from '../core/blitz/tankopedia.js'; -import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats.js'; -import getPeriodNow from '../core/blitzstars/getPeriodNow.js'; -import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo.js'; -import { tankAverages } from '../core/blitzstars/tankAverages.js'; -import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand.js'; -import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js'; -import { AccountInfo, AllStats } from '../types/accountInfo.js'; -import { PlayerClanData } from '../types/playerClanData.js'; -import { PossiblyPromise } from '../types/possiblyPromise.js'; +import * as Breakdown from '../components/Breakdown'; +import NoData, { NoDataType } from '../components/NoData'; +import PoweredBy, { PoweredByType } from '../components/PoweredBy'; +import TitleBar from '../components/TitleBar'; +import Wrapper from '../components/Wrapper'; +import { BLITZ_SERVERS } from '../constants/servers'; +import calculateWN8 from '../core/blitz/calculateWN8'; +import getTankStats from '../core/blitz/getTankStats'; +import getWargamingResponse from '../core/blitz/getWargamingResponse'; +import resolveTankName from '../core/blitz/resolveTankName'; +import sumStats from '../core/blitz/sumStats'; +import { tankopedia } from '../core/blitz/tankopedia'; +import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats'; +import getPeriodNow from '../core/blitzstars/getPeriodNow'; +import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo'; +import { tankAverages } from '../core/blitzstars/tankAverages'; +import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand'; +import { WARGAMING_APPLICATION_ID } from '../core/node/arguments'; +import { AccountInfo, AllStats } from '../types/accountInfo'; +import { PlayerClanData } from '../types/playerClanData'; +import { PossiblyPromise } from '../types/possiblyPromise'; export default async function today( { server, id }: ResolvedPlayer, diff --git a/src/routes/stats.tsx b/src/routes/stats.tsx index f67840232..b9f79752a 100644 --- a/src/routes/stats.tsx +++ b/src/routes/stats.tsx @@ -1,7 +1,7 @@ -import resolvePeriodFromRequest from '../core/express/resolvePeriodFromRequest.js'; -import resolvePlayerFromRequest from '../core/express/resolvePlayerFromRequest.js'; -import stats, { StatType } from '../renderers/stats.js'; -import { RouteRegistry } from '../server.js'; +import resolvePeriodFromRequest from '../core/express/resolvePeriodFromRequest'; +import resolvePlayerFromRequest from '../core/express/resolvePlayerFromRequest'; +import stats, { StatType } from '../renderers/stats'; +import { RouteRegistry } from '../server'; export const statsRoute: RouteRegistry = { route: '/stats/:type/:period', diff --git a/src/routes/today.tsx b/src/routes/today.tsx index 257c79473..8a5f193ed 100644 --- a/src/routes/today.tsx +++ b/src/routes/today.tsx @@ -1,6 +1,6 @@ -import resolvePlayerFromRequest from '../core/express/resolvePlayerFromRequest.js'; -import today from '../renderers/today.js'; -import { RouteRegistry } from '../server.js'; +import resolvePlayerFromRequest from '../core/express/resolvePlayerFromRequest'; +import today from '../renderers/today'; +import { RouteRegistry } from '../server'; export const todayRoute: RouteRegistry = { route: '/today', diff --git a/src/server.ts b/src/server.ts index 2db9ec1c1..998ff4d8f 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,10 +1,10 @@ import express, { Request, Response } from 'express'; -import normalizeRouteReturnable from './core/express/normalizeRouteReturnable.js'; -import withAutoRefresh from './core/express/withAutoRefresh.js'; -import isDev from './core/node/isDev.js'; -import { Registry } from './events/interactionCreate/index.js'; -import { statsRoute } from './routes/stats.js'; -import { todayRoute } from './routes/today.js'; +import normalizeRouteReturnable from './core/express/normalizeRouteReturnable'; +import withAutoRefresh from './core/express/withAutoRefresh'; +import isDev from './core/node/isDev'; +import { Registry } from './events/interactionCreate'; +import { statsRoute } from './routes/stats'; +import { todayRoute } from './routes/today'; export type RouteReturnable = JSX.Element | Promise; diff --git a/src/types/clanInfo.ts b/src/types/clanInfo.ts index db1f412f6..7ac8e8d5e 100644 --- a/src/types/clanInfo.ts +++ b/src/types/clanInfo.ts @@ -1,28 +1,30 @@ export interface ClanInfo { - [clanId:number]:{recruiting_options: { - vehicles_level: number; - wins_ratio: number; - average_battles_per_day: number; - battles: number; - average_damage: number; + [clanId: number]: { + recruiting_options: { + vehicles_level: number; + wins_ratio: number; + average_battles_per_day: number; + battles: number; + average_damage: number; + }; + members_count: number; + name: string; + creator_name: string; + clan_id: number; + created_at: number; + updated_at: number; + leader_name: string; + members_ids: number[]; + recruiting_policy: string; + tag: string; + is_clan_disbanded: boolean; + old_name: string; + emblem_set_id: number; + creator_id: number; + motto: string; + renamed_at: number; + old_tag: null; + leader_id: number; + description: string; }; - members_count: number; - name: string; - creator_name: string; - clan_id: number; - created_at: number; - updated_at: number; - leader_name: string; - members_ids: number[]; - recruiting_policy: string; - tag: string; - is_clan_disbanded: boolean; - old_name: string; - emblem_set_id: number; - creator_id: number; - motto: string; - renamed_at: number; - old_tag: null; - leader_id: number; - description: string;} } diff --git a/src/types/histories.ts b/src/types/histories.ts index 9258831f7..d2c5ae8be 100644 --- a/src/types/histories.ts +++ b/src/types/histories.ts @@ -1,6 +1,6 @@ // a cleaner simplification of Blitz Stars' histories because it's a mess there -import { AllStats } from './accountInfo.js'; +import { AllStats } from './accountInfo'; export interface History { all: AllStats; diff --git a/src/types/possiblyPromise.ts b/src/types/possiblyPromise.ts index 005f03fa7..a4658c873 100644 --- a/src/types/possiblyPromise.ts +++ b/src/types/possiblyPromise.ts @@ -1 +1 @@ -export type PossiblyPromise = Promise | Type; \ No newline at end of file +export type PossiblyPromise = Promise | Type; diff --git a/src/types/tanksStats.ts b/src/types/tanksStats.ts index 6cce62112..493f2c75f 100644 --- a/src/types/tanksStats.ts +++ b/src/types/tanksStats.ts @@ -1,4 +1,4 @@ -import { AllStats } from './accountInfo.js'; +import { AllStats } from './accountInfo'; export interface IndividualTankStats { all: AllStats; diff --git a/tsconfig.json b/tsconfig.json index d47b9a960..5f2ace03b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "target": "ESNext", "module": "ESNext", - // "moduleResolution": "Node", TODO: implement Node module resolution - "moduleResolution": "nodenext", + "moduleResolution": "Node", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, @@ -12,5 +11,8 @@ "resolveJsonModule": true, "jsx": "react-jsx" }, - "include": ["src/**/*.ts", "src/components/AllStatsOverview/components/WN8SurroundingStat.tsx"] + "include": [ + "src/**/*.ts", + "src/components/AllStatsOverview/components/WN8SurroundingStat.tsx" + ] } diff --git a/yarn.lock b/yarn.lock index bcaab4082..e74fb6d32 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1447,6 +1447,11 @@ preact@^10.0.0: resolved "https://registry.yarnpkg.com/preact/-/preact-10.15.1.tgz#a1de60c9fc0c79a522d969c65dcaddc5d994eede" integrity sha512-qs2ansoQEwzNiV5eAcRT1p1EC/dmEzaATVDJNiB3g2sRDWdA7b7MurXdJjB2+/WQktGWZwxvDrnuRFbWuIr64g== +prettier@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae" + integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== + proxy-addr@~2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"