Compare commits

..
2 Commits
Author SHA1 Message Date
TrèsAbhi a1e45c2af7 New translations en.json (Russian) 2025-10-05 05:52:38 -05:00
TrèsAbhi 4744eebf3b New translations en.json (Russian) 2025-10-05 04:52:55 -05:00
318 changed files with 4220 additions and 5617 deletions

No files matched your search

+98 -26
View File
@@ -1,4 +1,4 @@
name: Assets
name: Build Assets
on:
push:
@@ -6,30 +6,30 @@ on:
workflow_dispatch:
inputs:
asset_repo:
type: choice
required: false
description: What asset repo to write to
options:
- blitzkit/assets
- blitzkit/assets-preview
- blitzkit/assets-dev
default: blitzkit/assets
archive_url:
cdn_branch:
type: string
required: false
description: Archive URL to download instead of Steam client
default: main
description: What CDN branch to write to
zip_url:
type: string
required: false
description: ZIP URL to download instead of Steam client
zip_root:
type: string
required: false
description: Root dir of ZIP which houses the executable and Data dir
schedule:
- cron: "0 2 * * *"
- cron: '0 2 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.asset_repo }}
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.cdn_branch }}
cancel-in-progress: true
env:
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
VIDEOS_SHEET: ${{ secrets.VIDEOS_SHEET }}
@@ -37,8 +37,8 @@ env:
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
WOTB_DLC_CDN: ${{ secrets.WOTB_DLC_CDN }}
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
PUBLIC_ASSET_REPO: ${{ github.event.inputs.asset_repo != '' && github.event.inputs.asset_repo || secrets.PUBLIC_ASSET_REPO }}
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
PUBLIC_ASSET_REPO: blitzkit/assets
PUBLIC_ASSET_BRANCH: main
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
@@ -54,28 +54,100 @@ env:
PUBLIC_ASSET_FAST_USER: blitzkit
PUBLIC_ASSET_FAST_REPO: assets
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
jobs:
download_client:
name: Download client
runs-on: ubuntu-latest
steps:
- name: (ZIP) Maximize build space
if: github.event.inputs.zip_url != ''
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 512
swap-size-mb: 1024
remove-dotnet: 'true'
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- name: (Steam) Setup bun
uses: oven-sh/setup-bun@v1
if: github.event.inputs.zip_url == ''
- name: (Steam) Install dependencies
if: github.event.inputs.zip_url == ''
run: bun install
- name: (Steam) Setup DepotDownloader
if: github.event.inputs.zip_url == ''
run: bun run setup:depotdownloader
- name: (Steam) Download client
if: github.event.inputs.zip_url == ''
run: |
chmod +x ./temp/depotDownloader/DepotDownloader
./temp/depotDownloader/DepotDownloader -q -os windows -app 444200 -username ${{ secrets.DEPOT_DOWNLOADER_USERNAME }} -password "${{ secrets.DEPOT_DOWNLOADER_PASSWORD }}"
- name: (Steam) Apply patches
if: github.event.inputs.zip_url == ''
run: bun setup:patches --depot
- name: (ZIP) Download client
if: github.event.inputs.zip_url != ''
env:
ZIP_URL: ${{ github.event.inputs.zip_url }}
ZIP_ROOT: ${{ github.event.inputs.zip_root }}
run: |
wget -q -O client.zip $ZIP_URL
unzip -q client.zip -d client
rm client.zip
mkdir -p depots/444202/0
mv client/$ZIP_ROOT/* depots/444202/0
- name: Archive depots
uses: actions/upload-artifact@v4
with:
name: depots
path: depots
build_assets:
name: Build assets
runs-on: ubuntu-latest
needs: download_client
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- uses: arduino/setup-protoc@v3
- name: Setup bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Lint
run: bun run lint:website
- name: Download depots
uses: actions/download-artifact@v4
with:
repo-token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1
- run: bun run setup
name: depots
path: depots
- name: AppArmor hack
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Build assets
run: bun run build:assets --all-targets --manual
- name: Start server and build assets
run: |
bun dev:website --verbosepa &
SERVER_PID=$!
bun run build:assets --all-targets --depot --production
kill $SERVER_PID || true
+6 -11
View File
@@ -3,7 +3,7 @@ name: Averages
on:
workflow_dispatch:
schedule:
- cron: "0 8 * * *"
- cron: '0 8 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -15,7 +15,7 @@ env:
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
ALLOW_ROBOTS: "true"
ALLOW_ROBOTS: 'true'
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
@@ -25,7 +25,6 @@ env:
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
jobs:
build:
@@ -33,20 +32,16 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GH_TOKEN }}
- run: bun run setup
- name: Install dependencies
run: bun install
- name: Build averages
env:
PUBLIC_ASSET_BRANCH: main
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
VIDEOS_SHEET: ${{ secrets.VIDEOS_SHEET }}
+7 -8
View File
@@ -1,4 +1,4 @@
name: Bot
name: Build Bot
on:
push:
@@ -15,14 +15,13 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GH_TOKEN }}
- run: bun run setup
- name: Install dependencies
run: bun install
- name: Build Prisma
run: bun run build:prisma
- name: Build bot
run: bun run build:bot
+6 -10
View File
@@ -1,9 +1,9 @@
name: IDs
name: Discover IDs
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 1"
- cron: '0 0 * * 1'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -11,11 +11,11 @@ concurrency:
env:
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
jobs:
build:
@@ -23,14 +23,10 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GH_TOKEN }}
- run: bun run setup
- name: Install dependencies
run: bun install
- name: Discover IDs
run: bun build:ids --production
+4 -6
View File
@@ -1,10 +1,10 @@
name: Host
name: Host Bot
on:
push:
branches: main
schedule:
- cron: "0 */5 * * *"
- cron: '0 */5 * * *'
workflow_dispatch:
release:
types: [created, published, released, edited]
@@ -35,7 +35,6 @@ env:
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
PUBLIC_GUIDE_WEBSITE: ${{ secrets.PUBLIC_GUIDE_WEBSITE }}
SERVICING: ${{ secrets.SERVICING }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
jobs:
host:
@@ -43,9 +42,8 @@ jobs:
steps:
- uses: oven-sh/setup-bun@v1
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GH_TOKEN }}
# with:
# bun-version: 1.1.33
- name: Download release assets
run: |
+25 -30
View File
@@ -3,29 +3,7 @@ name: Rating Asia
on:
workflow_dispatch:
schedule:
- cron: "0 17 * * *"
env:
PUBLIC_ASSET_BRANCH: main
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
ALLOW_ROBOTS: "true"
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- cron: '0 17 * * *'
jobs:
host:
@@ -33,14 +11,31 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GH_TOKEN }}
- run: bun run setup
- name: Install dependencies
run: bun install
- name: Generate leaderboard
env:
PUBLIC_ASSET_BRANCH: main
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
ALLOW_ROBOTS: 'true'
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
run: bun build:ratingleaderboard --region=asia
+25 -30
View File
@@ -3,29 +3,7 @@ name: Rating Europe
on:
workflow_dispatch:
schedule:
- cron: "0 23 * * *"
env:
PUBLIC_ASSET_BRANCH: main
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
ALLOW_ROBOTS: "true"
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- cron: '0 23 * * *'
jobs:
host:
@@ -33,14 +11,31 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GH_TOKEN }}
- run: bun run setup
- name: Install dependencies
run: bun install
- name: Generate leaderboard
env:
PUBLIC_ASSET_BRANCH: main
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
ALLOW_ROBOTS: 'true'
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
run: bun build:ratingleaderboard --region=eu
+25 -30
View File
@@ -3,29 +3,7 @@ name: Rating North America
on:
workflow_dispatch:
schedule:
- cron: "0 5 * * *"
env:
PUBLIC_ASSET_BRANCH: main
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
ALLOW_ROBOTS: "true"
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- cron: '0 5 * * *'
jobs:
host:
@@ -33,14 +11,31 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GH_TOKEN }}
- run: bun run setup
- name: Install dependencies
run: bun install
- name: Generate leaderboard
env:
PUBLIC_ASSET_BRANCH: main
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
ALLOW_ROBOTS: 'true'
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
run: bun build:ratingleaderboard --region=com
+6 -7
View File
@@ -11,13 +11,12 @@ concurrency:
env:
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
jobs:
build:
@@ -28,11 +27,11 @@ jobs:
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GH_TOKEN }}
- run: bun run setup
- name: Install dependencies
run: bun install
- name: Find reviews
run: bun run build:reviews
run: bun packages/scripts/src/reviews.ts
+5 -6
View File
@@ -5,7 +5,7 @@ on:
workflow_dispatch:
schedule:
- cron: "0 4 * * *"
- cron: '0 4 * * *'
permissions:
contents: read
@@ -31,7 +31,6 @@ env:
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
PUBLIC_GUIDE_WEBSITE: ${{ secrets.PUBLIC_GUIDE_WEBSITE }}
SERVICING: ${{ secrets.SERVICING }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
jobs:
build:
@@ -42,12 +41,12 @@ jobs:
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GH_TOKEN }}
- uses: actions/configure-pages@v5
- run: bun run setup
- name: Install dependencies
run: bun install
- name: Build website
run: bun run build:website
+9 -3
View File
@@ -1,3 +1,9 @@
[submodule "packages/closed"]
path = packages/closed
url = https://github.com/blitzkit/closed.git
[submodule "submodules/blitzkit-closed"]
path = submodules/blitzkit-closed
url = https://github.com/tresabhi/blitzkit-closed
[submodule "submodules/CUE4Parse"]
path = submodules/CUE4Parse
url = https://github.com/FabianFG/CUE4Parse
[submodule "submodules/blitzkit-internal"]
path = submodules/blitzkit-internal
url = https://github.com/blitzkit/internal
-17
View File
@@ -11,7 +11,6 @@
"analyticsreporting",
"APAC",
"apcr",
"appinfo",
"applypatches",
"artefacts",
"astrojs",
@@ -35,14 +34,12 @@
"blitzkit",
"blitzrinth",
"blitzstars",
"bufbuild",
"cacheable",
"Callouts",
"Camo",
"Carro",
"CCPAOPTOUT",
"CDON",
"clanid",
"classname",
"cleandist",
"closedkrieg",
@@ -65,10 +62,8 @@
"deburr",
"decalmask",
"decompressor",
"dedup",
"defence",
"degressive",
"depotdownloader",
"devkrieg",
"diacriticless",
"DIDS",
@@ -79,7 +74,6 @@
"DVPLCRC",
"dvpm",
"dxgi",
"easimon",
"echarts",
"Everytime",
"FASTNAME",
@@ -98,7 +92,6 @@
"GLTF",
"gtag",
"haha",
"Herdbreaker",
"highp",
"iife",
"imgur",
@@ -112,7 +105,6 @@
"leaderboards",
"lerp",
"LINEARSIZE",
"linktarget",
"lmao",
"loadouts",
"loddist",
@@ -135,7 +127,6 @@
"NEGATIVEX",
"NEGATIVEY",
"NEGATIVEZ",
"networkidle",
"NITROPAY",
"nivo",
"nmatname",
@@ -146,13 +137,11 @@
"Oopsy",
"opentest",
"OPTML",
"otemp",
"outdir",
"outfile",
"ownedtanks",
"padder",
"partytown",
"patchnotes",
"PIXELFORMAT",
"playerachievements",
"playerinfo",
@@ -165,15 +154,11 @@
"Promisable",
"proto",
"protobuf",
"protoc",
"protos",
"proxyclient",
"prunestrings",
"Pyogenics",
"ratingleaderboard",
"raycaster",
"Redirector",
"Relogin",
"researchable",
"Resvg",
"rizz",
@@ -222,14 +207,12 @@
"Unregistering",
"unrotate",
"unwrapper",
"userns",
"vercel",
"vickers",
"vitepress",
"Vovko",
"wargaming",
"webp",
"wgpkg",
"whitespaces",
"WHSS",
"winrate",
+7 -5
View File
@@ -16,20 +16,22 @@ If you intend to contribute to the code, note that you may need to check out sen
| [packages/i18n](packages/i18n) | | [Crowdin](https://crowdin.com/project/blitzkrieg) | Translations served as JSON shared across all other packages, including some utility code. |
| [packages/scripts](packages/scripts) | | | CLI utilities for the development and deployment of BlitzKit services. |
| [packages/varuna](packages/varuna) | Varuna | [NPM](https://www.npmjs.com/package/varuna) | React and Astro-oriented state management library, awaiting separation from BlitzKit. Unavailable from NPM at this time. |
| [packages/website](packages/website) | BlitzKit | https://blitzkit.app | The BlitzKit website provides a wide range of tools, APIs, and interconnects all other services. |
| [packages/website](packages/website) | BlitzKit | https://blitzkit.app | The BlitzKit website provides a wide range of tools, APIs, and interconnects all other services. |
## Submodules
| Submodule | Title | Source | Memo |
| ------------------------------------------------------ | --------- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [submodules/blitzkit-closed](packages/blitzkit-closed) | ClosedKit | [blitzkit/closed](https://github.com/blitzkit/closed) | Closed source, sensitive code hidden from the public to prevent bad actors from abusing the game. Discuss with `@tresabhi` on Discord for **special permission** to access. |
| Submodule | Title | Source | Memo |
| ------------------------------------------------------------ | ----------- | ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [submodules/blitzkit-closed](submodules/blitzkit-closed) | ClosedKit | [blitzkit/closed](https://github.com/blitzkit/closed) | Closed source, sensitive code hidden from the public to prevent bad actors from abusing the game. Discuss with `@tresabhi` on Discord for **special permission** to access. |
| [submodules/blitzkit-internal](submodules/blitzkit-internal) | InternalKit | [blitzkit/internal](https://github.com/blitzkit/internal) | Closed source, sensitive internal documentation hidden from the public to prevent bad actors from abusing the game. Access to this submodule is **not negotiable**. |
| [submodules/CUE4Parse](submodules/CUE4Parse) | CUE4Parse | [FabianFG/CUE4Parse](https://github.com/FabianFG/CUE4Parse) | An Unreal Engine archives and packages parsing library in C#. |
## Environment Variables
| Name | Source | BlitzKit Default | Memo |
| ------------------------------------------------------------- | -------------------------------------------------------------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `PUBLIC_WARGAMING_APPLICATION_ID` | [Wargaming Developer's Room](https://developers.wargaming.net/) | | Application ID needed to communicate with Wargaming APIs. |
| `PUBLIC_PROMOTE_OPENTEST` | | `false` | Optional boolean dictating whether the website advertises [the opentest subdomain of BlitzKit](https://opentest.blitzkit.app/). |
| `PUBLIC_PROMOTE_OPENTEST` | | `false` | Optional boolean dictating whether the website advertises [the opentest subdomain of BlitzKit](https://opentest.blitzkit.app/). |
| `ALLOW_ROBOTS` | | `true` | Toggles between `Allow: /` and `Disallow: /` in the website's `/robots.txt`. This is usually `false` for all BlitzKit's subdomains. |
| `WOTB_GLOSSARY`, `WOTB_GLOSSARY_DOMAIN`, `WOTB_GLOSSARY_PATH` | | | |
| `PUBLIC_GOOGLE_TAG_MANAGER_ID` | [Google Tag Manager](https://tagmanager.google.com/) | `G-GL2JVHCGPQ` | Google Tag Manager's unique identifier for analytical purposes. |
+328 -228
View File
File diff suppressed because it is too large. Load diff
-10
View File
@@ -1,10 +0,0 @@
# BlitzKit 1.28.4
## Fixes
- The tank names in the Tankopedia sandbox now have less margin from the navbar
- Controls in the Tankopedia sandbox are now shown in all modes, except for the advanced highlighting button which only appears in the dynamic armor mode
- The settings page now reacts to input again
- The settings page now has a tab title and description for search engines
- Added support for transparent textures, fixing tanks like the Herdbreaker and the WZ-132-1
- The tank filters in the Performance and Tier-List tools work once again
-12
View File
@@ -1,12 +0,0 @@
# BlitzKit 1.29.0
## Features
- Added the Playlist tool
- Don't know what to play today? Let BlitzKit do the thinking!
- Navigate to [the tool on BlitzKit](https://blitzkit.app/playlist)
- Make sure you login with your Wargaming account to unlock all features like live tracking and filtering by owned tanks
- Use filters to pick tiers, nations, etc. then hit Generate playlist
- BlitzKit will generate a checklist for you to go through as you play
- Don't like the order of tanks? Hit Shuffle, Sort by Last played and Least played, or straight up remove tanks from the list by using the (-) button
- If you're logged in, BlitzKit will automatically check off tanks as you play them
-5
View File
@@ -1,5 +0,0 @@
# BlitzKit 1.29.1
## Technical Changes
- Recreated the full dependency tree for BlitzKit
-5
View File
@@ -1,5 +0,0 @@
# BlitzKit 1.29.2
## Technical Changes
- Implemented new workflow capabilities to deploy BlitzKit OpenTest and Preview remotely, from any device
-5
View File
@@ -1,5 +0,0 @@
# BlitzKit 1.29.3
## Technical Changes
- Added a significantly more memory and network efficient AssetUploader abstraction
-5
View File
@@ -1,5 +0,0 @@
# BlitzKit 1.29.4
## Technical Changes
- BlitzKit now partially downloads game files instead of the entire game, allowing for faster updates
-11
View File
@@ -1,11 +0,0 @@
# BlitzKit 1.29.5
## Features
- Added new lighting to be a bit softer on tanks
- Added a button with the sun icon to toggle high graphics
- Added a new reveal and transition animation between tabs
## Fixes
- Track wheels on some tanks no longer look translucent
-18
View File
@@ -1,18 +0,0 @@
# BlitzKit 1.29.6
## Features
- Simplified the ownership and test tank filters in the tank search
- Renamed "Guess the tank" to simply "Guess"
- The player count value in the Performance tool is now set to Total by default
- Added Compare-like red/green highlighting to the Performance tool
## Changes
- Removed the last updated info bar in Performance for some more screen real estate
## Fixes
- The remove played tanks in the Playlist tool now shows even when logged out
- The Guess game now has a page title
- The compare table now occupies the minimum width possible instead of expanding all columns excessively
+30 -15
View File
@@ -1,16 +1,22 @@
{
"name": "blitzkit",
"version": "1.29.6",
"license": "BlitzKit License",
"private": true,
"version": "1.28.3",
"description": "🎉 Tools for everything World of Tanks Blitz",
"type": "module",
"types": "./types.d.ts",
"workspaces": [
"packages/*"
],
"scripts": {
"build:assets": "cd packages/scripts && bun run build:assets",
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
"build:bot": "cd packages/scripts && bun run build:bot",
"build:website": "cd packages/website && bun run build",
"build:website": "bun build:prisma --no-hints && cd packages/website && bun run build",
"build:prisma": "prisma generate",
"build:sitemap": "bun scripts/sitemap.ts",
"build:docs": "vitepress build docs",
"build:proxyclient": "cd packages/scripts && bun run build:proxyclient",
"build:catalogitemaccesssor": "cd packages/scripts && bun run build:catalogitemaccesssor",
"build:ratingleaderboard": "cd packages/scripts && bun run build:ratingleaderboard",
"build:app": "cd packages/app && bun run build",
"dev:bot": "bun run build:bot --dev && bun start:bot",
@@ -30,21 +36,30 @@
"update": "yarn upgrade --latest",
"tunnel": "cloudflared tunnel --url http://localhost:3000",
"discoverids": "scripts/discoverIds.ts",
"build:protos": "cd packages/scripts && bun run build:protos",
"build:protos": "bun packages/scripts/src/protos.ts",
"preview:website": "cd packages/website && bun run preview",
"build:reviews": "cd packages/scripts && bun build:reviews",
"build:ids": "cd packages/scripts && bun build:ids",
"prunestrings": "cd packages/scripts && bun prunestrings",
"setup": "bun install && bun run build:prisma && bun run build:protos && bun run build:proxyclient",
"patchnotes": "cd packages/scripts && bun run patchnotes"
"prunestrings": "cd packages/scripts && bun prunestrings"
},
"type": "module",
"workspaces": [
"packages/*"
],
"license": "MIT",
"dependencies": {
"@prisma/client": "^6.18.0",
"prisma": "^6.18.0",
"typescript": "^5.9.3"
"@types/xmpp__client": "^0.13.3",
"@xmpp/client": "^0.13.6",
"astro-favicons": "^3.1.5",
"cheerio": "^1.1.2",
"googleapis": "^160.0.0",
"lodash-es": "^4.17.21",
"protobufjs": "^7.5.4",
"quicklime": "^1.2.0",
"sharp": "^0.34.4"
},
"devDependencies": {
"@types/bun": "^1.2.22",
"@types/lodash-es": "^4.17.12",
"@types/node": "^24.5.2",
"prettier": "^3.6.2",
"prisma": "^6.16.2",
"typescript": "^5.9.2"
}
}
+14 -22
View File
@@ -1,34 +1,26 @@
{
"name": "@blitzkit/bot",
"private": true,
"type": "module",
"types": "src/types.d.ts",
"dependencies": {
"@blitzkit/core": "workspace:*",
"@blitzkit/i18n": "workspace:*",
"@radix-ui/colors": "^3.0.0",
"@radix-ui/themes": "^3.2.1",
"@resvg/resvg-js": "^2.6.2",
"@types/adm-zip": "^0.5.7",
"@types/lodash-es": "^4.17.12",
"@types/markdown-escape": "^1.1.3",
"@types/react": "^19.2.2",
"adm-zip": "^0.5.16",
"bepaint": "^0.1.0-beta.3",
"discord.js": "^14.22.1",
"dotenv": "^17.2.2",
"fuzzysort": "^3.1.0",
"lodash-es": "^4.17.21",
"markdown-escape": "^2.0.0",
"pickleparser": "^0.2.1",
"prisma": "^6.17.1",
"protobufjs": "^7.5.4",
"react": "^19.2.0",
"satori": "^0.18.3",
"sharp": "^0.34.4"
"@resvg/resvg-js": "^2.6.2",
"discord.js": "^14.22.1",
"react": "^19.1.1",
"@radix-ui/colors": "^3.0.0",
"fuzzysort": "^3.1.0",
"bepaint": "^0.1.0-beta.3",
"dotenv": "^17.2.2",
"markdown-escape": "^2.0.0"
},
"private": true,
"scripts": {
"dev": "bun --watch src/main.ts",
"start": "bun src/main.ts"
},
"type": "module",
"types": "src/types.d.ts"
"devDependencies": {
"@types/markdown-escape": "^1.1.3"
}
}
+19 -22
View File
@@ -1,31 +1,28 @@
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
import { translator } from "../core/localization/translator";
import {
COMMANDS_RAW,
type CommandRegistry,
} from "../events/interactionCreate";
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
import { translator } from '../core/localization/translator';
import { COMMANDS_RAW, CommandRegistry } from '../events/interactionCreate';
const subcommands = [
"embeds",
"introduction",
"invite",
"timezones",
"credits",
'embeds',
'introduction',
'invite',
'timezones',
'credits',
] as const;
type Subcommand = (typeof subcommands)[number];
const DOCS: Record<Subcommand, string> = {
embeds: "guide/embeds",
introduction: "guide/introduction",
invite: "guide/invite",
timezones: "guide/timezones",
credits: "about/credits",
embeds: 'guide/embeds',
introduction: 'guide/introduction',
invite: 'guide/invite',
timezones: 'guide/timezones',
credits: 'about/credits',
};
export const aboutCommand = new Promise<CommandRegistry>(async (resolve) => {
resolve({
command: createLocalizedCommand("about", [
{ subcommand: "commands" },
command: createLocalizedCommand('about', [
{ subcommand: 'commands' },
...subcommands.map((subcommand) => ({ subcommand })),
]),
@@ -33,7 +30,7 @@ export const aboutCommand = new Promise<CommandRegistry>(async (resolve) => {
const subcommand = interaction.options.getSubcommand();
const { strings } = translator(interaction.locale);
if (subcommand === "commands") {
if (subcommand === 'commands') {
return `${strings.bot.commands.about.subcommands.commands.body}${(
await Promise.all(COMMANDS_RAW)
)
@@ -43,7 +40,7 @@ export const aboutCommand = new Promise<CommandRegistry>(async (resolve) => {
(b.command.name_localizations?.[interaction.locale] ??
b.command.name)
? -1
: 1
: 1,
)
.map(
(registry) =>
@@ -54,9 +51,9 @@ export const aboutCommand = new Promise<CommandRegistry>(async (resolve) => {
registry.command.description_localizations?.[
interaction.locale
] ?? registry.command.description
}`
}`,
)
.join("\n")}`;
.join('\n')}`;
}
const url = `https://raw.githubusercontent.com/tresabhi/blitzkit/main/docs/${DOCS[subcommand as Subcommand]}.md`;
@@ -13,7 +13,7 @@ import { resolvePeriodFromButton } from '../../core/discord/resolvePeriodFromBut
import { resolvePeriodFromCommand } from '../../core/discord/resolvePeriodFromCommand';
import { resolvePlayerFromButton } from '../../core/discord/resolvePlayerFromButton';
import { resolvePlayerFromCommand } from '../../core/discord/resolvePlayerFromCommand';
import type { CommandRegistry } from '../../events/interactionCreate';
import { CommandRegistry } from '../../events/interactionCreate';
import { renderBreakdown } from './render';
export const breakdownCommand = new Promise<CommandRegistry>(
@@ -1,5 +1,5 @@
import {
type BlitzStats,
BlitzStats,
calculateWN8,
getAccountInfo,
getClanAccountInfo,
@@ -17,11 +17,11 @@ import { TitleBar } from "../../components/TitleBar";
import { filtersToDescription } from "../../core/blitzkit/filtersToDescription";
import { tankDefinitions } from "../../core/blitzkit/nonBlockingPromises";
import { UserError } from "../../core/blitzkit/userError";
import { filterStats, type StatFilters } from "../../core/blitzstars/filterStats";
import { filterStats, StatFilters } from "../../core/blitzstars/filterStats";
import { getStatsInPeriod } from "../../core/blitzstars/getStatsInPeriod";
import { blitzStarsTankAverages } from "../../core/blitzstars/tankAverages";
import type { ResolvedPeriod } from "../../core/discord/resolvePeriodFromCommand";
import type { ResolvedPlayer } from "../../core/discord/resolvePlayerFromCommand";
import { ResolvedPeriod } from "../../core/discord/resolvePeriodFromCommand";
import { ResolvedPlayer } from "../../core/discord/resolvePlayerFromCommand";
import { translator } from "../../core/localization/translator";
const ROWS_PER_PAGE = 8;
+9 -9
View File
@@ -1,14 +1,14 @@
import packageJSON from "../../../../package.json";
import { client } from "../core/discord/client";
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
import { translator } from "../core/localization/translator";
import type { CommandRegistry } from "../events/interactionCreate";
import packageJSON from '../../../../package.json';
import { client } from '../core/discord/client';
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
import { translator } from '../core/localization/translator';
import { CommandRegistry } from '../events/interactionCreate';
const executionStart = new Date().getTime();
export const debugCommand = new Promise<CommandRegistry>((resolve) => {
resolve({
command: createLocalizedCommand("debug"),
command: createLocalizedCommand('debug'),
async handler(interaction) {
const { strings } = translator(interaction.locale);
@@ -23,15 +23,15 @@ export const debugCommand = new Promise<CommandRegistry>((resolve) => {
[
strings.bot.commands.debug.body.uptime,
`${Math.floor((uptime / 1000 / 60 / 60) % 24)}h ${Math.floor(
(uptime / 1000 / 60) % 60
(uptime / 1000 / 60) % 60,
)}m ${Math.floor((uptime / 1000) % 60)}s ${Math.floor(
uptime % 1000
uptime % 1000,
)}ms`,
],
];
return `${strings.bot.commands.debug.body.title}${list
.map(([key, value]) => `- ${key}: ${value}`)
.join("\n")}`;
.join('\n')}`;
},
});
});
+47 -47
View File
@@ -1,48 +1,48 @@
import { emblemURL, getAccountInfo, getClanAccountInfo } from "@blitzkit/core";
import { Locale, SlashCommandSubcommandGroupBuilder } from "discord.js";
import { CommandWrapper } from "../components/CommandWrapper";
import * as Graph from "../components/Graph";
import { LineColor } from "../components/Graph/components/Line/constants";
import { NoData } from "../components/NoData";
import { TitleBar } from "../components/TitleBar";
import { resolveTankId } from "../core/blitz/resolveTankId";
import { getBlitzStarsLinkButton } from "../core/blitzstars/getBlitzStarsLinkButton";
import { getPlayerHistories } from "../core/blitzstars/getPlayerHistories";
import { getTankHistories } from "../core/blitzstars/getTankHistories";
import { addPeriodSubCommands } from "../core/discord/addPeriodSubCommands";
import { addTankChoices } from "../core/discord/addTankChoices";
import { addUsernameChoices } from "../core/discord/addUsernameChoices";
import { autocompleteTanks } from "../core/discord/autocompleteTanks";
import { autocompleteUsername } from "../core/discord/autocompleteUsername";
import { buttonRefresh } from "../core/discord/buttonRefresh";
import { commandToURL } from "../core/discord/commandToURL";
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
import { getCustomPeriodParams } from "../core/discord/getCustomPeriodParams";
import { resolvePeriodFromButton } from "../core/discord/resolvePeriodFromButton";
import { emblemURL, getAccountInfo, getClanAccountInfo } from '@blitzkit/core';
import { Locale, SlashCommandSubcommandGroupBuilder } from 'discord.js';
import { CommandWrapper } from '../components/CommandWrapper';
import * as Graph from '../components/Graph';
import { LineColor } from '../components/Graph/components/Line/constants';
import { NoData } from '../components/NoData';
import { TitleBar } from '../components/TitleBar';
import { resolveTankId } from '../core/blitz/resolveTankId';
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
import { getPlayerHistories } from '../core/blitzstars/getPlayerHistories';
import { getTankHistories } from '../core/blitzstars/getTankHistories';
import { addPeriodSubCommands } from '../core/discord/addPeriodSubCommands';
import { addTankChoices } from '../core/discord/addTankChoices';
import { addUsernameChoices } from '../core/discord/addUsernameChoices';
import { autocompleteTanks } from '../core/discord/autocompleteTanks';
import { autocompleteUsername } from '../core/discord/autocompleteUsername';
import { buttonRefresh } from '../core/discord/buttonRefresh';
import { commandToURL } from '../core/discord/commandToURL';
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
import { getCustomPeriodParams } from '../core/discord/getCustomPeriodParams';
import { resolvePeriodFromButton } from '../core/discord/resolvePeriodFromButton';
import {
type ResolvedPeriod,
ResolvedPeriod,
resolvePeriodFromCommand,
} from "../core/discord/resolvePeriodFromCommand";
import { resolvePlayerFromButton } from "../core/discord/resolvePlayerFromButton";
} from '../core/discord/resolvePeriodFromCommand';
import { resolvePlayerFromButton } from '../core/discord/resolvePlayerFromButton';
import {
type ResolvedPlayer,
ResolvedPlayer,
resolvePlayerFromCommand,
} from "../core/discord/resolvePlayerFromCommand";
import type { CommandRegistry } from "../events/interactionCreate";
} from '../core/discord/resolvePlayerFromCommand';
import { CommandRegistry } from '../events/interactionCreate';
type EvolutionStatType = "player" | "tank";
type EvolutionStatType = 'player' | 'tank';
async function render(
{ region, id }: ResolvedPlayer,
{ start, end, name }: ResolvedPeriod,
type: "player" | "tank",
type: 'player' | 'tank',
tankId: number | null,
locale: Locale
locale: Locale,
) {
const accountInfo = await getAccountInfo(region, id);
const clan = (await getClanAccountInfo(region, id, ["clan"]))?.clan;
const clan = (await getClanAccountInfo(region, id, ['clan']))?.clan;
const logo = clan ? emblemURL(clan.emblem_set_id) : undefined;
const histories = await (type === "player"
const histories = await (type === 'player'
? getPlayerHistories(region, id, {
start,
end,
@@ -61,7 +61,7 @@ async function render(
[
history.all.battles,
(history.all.wins / history.all.battles) * 100,
] as Graph.PlotItem
] as Graph.PlotItem,
);
const times = histories.map((history) => history.last_battle_time);
const minTime = Math.min(...times);
@@ -82,7 +82,7 @@ async function render(
verticalMargin={{
min: minY,
max: maxY,
suffix: "%",
suffix: '%',
precision: 2,
}}
horizontalMargin={{
@@ -110,22 +110,22 @@ async function render(
export const evolutionCommand = new Promise<CommandRegistry>(
async (resolve) => {
resolve({
command: createLocalizedCommand("evolution", [
command: createLocalizedCommand('evolution', [
{
group: "player",
group: 'player',
modify(option: SlashCommandSubcommandGroupBuilder) {
addPeriodSubCommands(option, (option) =>
option.addStringOption(addUsernameChoices)
option.addStringOption(addUsernameChoices),
);
},
},
{
group: "tank",
group: 'tank',
modify(option: SlashCommandSubcommandGroupBuilder) {
addPeriodSubCommands(option, (option) =>
option
.addStringOption(addTankChoices)
.addStringOption(addUsernameChoices)
.addStringOption(addUsernameChoices),
);
},
},
@@ -136,9 +136,9 @@ export const evolutionCommand = new Promise<CommandRegistry>(
interaction.options.getSubcommandGroup() as EvolutionStatType;
const player = await resolvePlayerFromCommand(interaction);
const period = resolvePeriodFromCommand(player.region, interaction);
const tankIdRaw = interaction.options.getString("tank")!;
const tankIdRaw = interaction.options.getString('tank')!;
const tankId =
commandGroup === "tank"
commandGroup === 'tank'
? await resolveTankId(tankIdRaw, interaction.locale)
: null;
const path = commandToURL(interaction, {
@@ -153,13 +153,13 @@ export const evolutionCommand = new Promise<CommandRegistry>(
period,
commandGroup,
tankId,
interaction.locale
interaction.locale,
),
buttonRefresh(interaction, path),
await getBlitzStarsLinkButton(
player.region,
player.id,
tankId ?? undefined
tankId ?? undefined,
),
];
},
@@ -171,7 +171,7 @@ export const evolutionCommand = new Promise<CommandRegistry>(
async button(interaction) {
const url = new URL(`https://example.com/${interaction.customId}`);
const path = url.pathname.split("/");
const path = url.pathname.split('/');
const commandGroup = path[2] as EvolutionStatType;
const player = await resolvePlayerFromButton(interaction);
const period = resolvePeriodFromButton(player.region, interaction);
@@ -180,10 +180,10 @@ export const evolutionCommand = new Promise<CommandRegistry>(
player,
period,
commandGroup,
parseInt(url.searchParams.get("tankId") ?? "0") || null,
interaction.locale
parseInt(url.searchParams.get('tankId') ?? '0') || null,
interaction.locale,
);
},
});
}
},
);
+4 -4
View File
@@ -11,7 +11,7 @@ import { NoData } from '../components/NoData';
import { TierWeights } from '../components/TierWeights';
import { TitleBar } from '../components/TitleBar';
import { filtersToDescription } from '../core/blitzkit/filtersToDescription';
import { filterStats, type StatFilters } from '../core/blitzstars/filterStats';
import { filterStats, StatFilters } from '../core/blitzstars/filterStats';
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
import { getStatsInPeriod } from '../core/blitzstars/getStatsInPeriod';
import { addPeriodicFilterOptions } from '../core/discord/addPeriodicFilterOptions';
@@ -26,15 +26,15 @@ import { getFiltersFromButton } from '../core/discord/getFiltersFromButton';
import { getFiltersFromCommand } from '../core/discord/getFiltersFromCommand';
import { resolvePeriodFromButton } from '../core/discord/resolvePeriodFromButton';
import {
type ResolvedPeriod,
ResolvedPeriod,
resolvePeriodFromCommand,
} from '../core/discord/resolvePeriodFromCommand';
import { resolvePlayerFromButton } from '../core/discord/resolvePlayerFromButton';
import {
type ResolvedPlayer,
ResolvedPlayer,
resolvePlayerFromCommand,
} from '../core/discord/resolvePlayerFromCommand';
import type { CommandRegistry } from '../events/interactionCreate';
import { CommandRegistry } from '../events/interactionCreate';
async function render(
{ region, id }: ResolvedPlayer,
+1 -1
View File
@@ -11,7 +11,7 @@ import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
import { localizationObject } from "../core/discord/localizationObject";
import { resolveClanFromCommand } from "../core/discord/resolveClanFromCommand";
import { translator } from "../core/localization/translator";
import type { CommandRegistry } from "../events/interactionCreate";
import { CommandRegistry } from "../events/interactionCreate";
const DEFAULT_THRESHOLD = 7;
+1 -1
View File
@@ -9,7 +9,7 @@ import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
import { embedInfo } from '../core/discord/embedInfo';
import { resolvePlayerFromCommand } from '../core/discord/resolvePlayerFromCommand';
import { translator } from '../core/localization/translator';
import type { CommandRegistry } from '../events/interactionCreate';
import { CommandRegistry } from '../events/interactionCreate';
import { theme } from '../stitches.config';
export const verifyCommand = new Promise<CommandRegistry>((resolve) => {
+1 -1
View File
@@ -19,7 +19,7 @@ import { chunkLines } from "../core/discord/chunkLines";
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
import { resolvePlayerFromCommand } from "../core/discord/resolvePlayerFromCommand";
import { translator } from "../core/localization/translator";
import { type CommandRegistry } from "../events/interactionCreate";
import { CommandRegistry } from "../events/interactionCreate";
export const ownedTanksCommand = new Promise<CommandRegistry>((resolve) => {
resolve({
+1 -1
View File
@@ -1,7 +1,7 @@
import { literals } from "@blitzkit/i18n";
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
import { translator } from "../core/localization/translator";
import type { CommandRegistry } from "../events/interactionCreate";
import { CommandRegistry } from "../events/interactionCreate";
export const pingCommand = new Promise<CommandRegistry>((resolve) => {
resolve({
+1 -1
View File
@@ -22,7 +22,7 @@ import { addUsernameChoices } from "../core/discord/addUsernameChoices";
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
import { resolvePlayerFromCommand } from "../core/discord/resolvePlayerFromCommand";
import { translator } from "../core/localization/translator";
import type { CommandRegistry } from "../events/interactionCreate";
import { CommandRegistry } from "../events/interactionCreate";
import { theme } from "../stitches.config";
const LEAGUE_ACCENT = [
@@ -10,13 +10,13 @@ import {
imgur,
isOnGoingRatingSeason,
LEAGUES,
type RatingInfo,
RatingInfo,
RatingLeaderboard,
type Region,
Region,
} from "@blitzkit/core";
import { literals } from "@blitzkit/i18n";
import {
type APIApplicationCommandOptionChoice,
APIApplicationCommandOptionChoice,
Locale,
SlashCommandSubcommandBuilder,
} from "discord.js";
@@ -33,7 +33,7 @@ import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
import { localizationObject } from "../core/discord/localizationObject";
import { resolvePlayerFromCommand } from "../core/discord/resolvePlayerFromCommand";
import { translator } from "../core/localization/translator";
import type { CommandRegistry } from "../events/interactionCreate";
import { CommandRegistry } from "../events/interactionCreate";
interface SimplifiedPlayer {
id: number;
+1 -1
View File
@@ -20,7 +20,7 @@ import { blitzStarsTankAverages } from '../core/blitzstars/tankAverages';
import { buttonLink } from '../core/discord/buttonLink';
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
import { translator } from '../core/localization/translator';
import { type CommandRegistry } from '../events/interactionCreate';
import { CommandRegistry } from '../events/interactionCreate';
import { theme } from '../stitches.config';
type WotInspectorReplaySubmission =
+1 -1
View File
@@ -25,7 +25,7 @@ import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
import { localizationObject } from "../core/discord/localizationObject";
import { resolvePlayerFromCommand } from "../core/discord/resolvePlayerFromCommand";
import { translator } from "../core/localization/translator";
import { type CommandRegistry } from "../events/interactionCreate";
import { CommandRegistry } from "../events/interactionCreate";
import { theme } from "../stitches.config";
export const researchCommand = new Promise<CommandRegistry>((resolve) => {
+2 -2
View File
@@ -1,4 +1,4 @@
import { type ClanList, fetchBlitz, type Region } from "@blitzkit/core";
import { ClanList, fetchBlitz, Region } from "@blitzkit/core";
import { literals } from "@blitzkit/i18n";
import { Locale } from "discord.js";
import markdownEscape from "markdown-escape";
@@ -8,7 +8,7 @@ import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
import { embedInfo } from "../core/discord/embedInfo";
import { localizationObject } from "../core/discord/localizationObject";
import { translator } from "../core/localization/translator";
import type { CommandRegistry } from "../events/interactionCreate";
import { CommandRegistry } from "../events/interactionCreate";
const DEFAULT_LIMIT = 25;
+3 -3
View File
@@ -1,7 +1,7 @@
import {
type AccountList,
AccountList,
fetchBlitz,
type Region,
Region,
usernamePattern,
} from "@blitzkit/core";
import { literals } from "@blitzkit/i18n";
@@ -13,7 +13,7 @@ import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
import { embedInfo } from "../core/discord/embedInfo";
import { localizationObject } from "../core/discord/localizationObject";
import { translator } from "../core/localization/translator";
import type { CommandRegistry } from "../events/interactionCreate";
import { CommandRegistry } from "../events/interactionCreate";
const DEFAULT_LIMIT = 25;
+32 -32
View File
@@ -1,50 +1,50 @@
import { emblemURL, getAccountInfo, getClanAccountInfo } from "@blitzkit/core";
import { Locale } from "discord.js";
import { AllStatsOverview } from "../components/AllStatsOverview";
import { CommandWrapper } from "../components/CommandWrapper";
import { NoData } from "../components/NoData";
import { TitleBar } from "../components/TitleBar";
import { filtersToDescription } from "../core/blitzkit/filtersToDescription";
import { filterStats, type StatFilters } from "../core/blitzstars/filterStats";
import { getBlitzStarsLinkButton } from "../core/blitzstars/getBlitzStarsLinkButton";
import { getStatsInPeriod } from "../core/blitzstars/getStatsInPeriod";
import { addPeriodicFilterOptions } from "../core/discord/addPeriodicFilterOptions";
import { addUsernameChoices } from "../core/discord/addUsernameChoices";
import { autocompleteTanks } from "../core/discord/autocompleteTanks";
import { autocompleteUsername } from "../core/discord/autocompleteUsername";
import { buttonRefresh } from "../core/discord/buttonRefresh";
import { commandToURL } from "../core/discord/commandToURL";
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
import { getCustomPeriodParams } from "../core/discord/getCustomPeriodParams";
import { getFiltersFromButton } from "../core/discord/getFiltersFromButton";
import { getFiltersFromCommand } from "../core/discord/getFiltersFromCommand";
import { resolvePeriodFromButton } from "../core/discord/resolvePeriodFromButton";
import { emblemURL, getAccountInfo, getClanAccountInfo } from '@blitzkit/core';
import { Locale } from 'discord.js';
import { AllStatsOverview } from '../components/AllStatsOverview';
import { CommandWrapper } from '../components/CommandWrapper';
import { NoData } from '../components/NoData';
import { TitleBar } from '../components/TitleBar';
import { filtersToDescription } from '../core/blitzkit/filtersToDescription';
import { filterStats, StatFilters } from '../core/blitzstars/filterStats';
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
import { getStatsInPeriod } from '../core/blitzstars/getStatsInPeriod';
import { addPeriodicFilterOptions } from '../core/discord/addPeriodicFilterOptions';
import { addUsernameChoices } from '../core/discord/addUsernameChoices';
import { autocompleteTanks } from '../core/discord/autocompleteTanks';
import { autocompleteUsername } from '../core/discord/autocompleteUsername';
import { buttonRefresh } from '../core/discord/buttonRefresh';
import { commandToURL } from '../core/discord/commandToURL';
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
import { getCustomPeriodParams } from '../core/discord/getCustomPeriodParams';
import { getFiltersFromButton } from '../core/discord/getFiltersFromButton';
import { getFiltersFromCommand } from '../core/discord/getFiltersFromCommand';
import { resolvePeriodFromButton } from '../core/discord/resolvePeriodFromButton';
import {
type ResolvedPeriod,
ResolvedPeriod,
resolvePeriodFromCommand,
} from "../core/discord/resolvePeriodFromCommand";
import { resolvePlayerFromButton } from "../core/discord/resolvePlayerFromButton";
} from '../core/discord/resolvePeriodFromCommand';
import { resolvePlayerFromButton } from '../core/discord/resolvePlayerFromButton';
import {
type ResolvedPlayer,
ResolvedPlayer,
resolvePlayerFromCommand,
} from "../core/discord/resolvePlayerFromCommand";
import type { CommandRegistry } from "../events/interactionCreate";
} from '../core/discord/resolvePlayerFromCommand';
import { CommandRegistry } from '../events/interactionCreate';
async function render(
{ region, id }: ResolvedPlayer,
{ start, end, name }: ResolvedPeriod,
filters: StatFilters,
locale: Locale
locale: Locale,
) {
const { nickname } = await getAccountInfo(region, id);
const clan = (await getClanAccountInfo(region, id, ["clan"]))?.clan;
const clan = (await getClanAccountInfo(region, id, ['clan']))?.clan;
const clanImage = clan ? emblemURL(clan.emblem_set_id) : undefined;
const diffedTankStats = await getStatsInPeriod(
region,
id,
start,
end,
locale
locale,
);
const { stats, supplementary } = await filterStats(diffedTankStats, filters);
const filterDescriptions = await filtersToDescription(filters, locale);
@@ -72,8 +72,8 @@ async function render(
export const statsCommand = new Promise<CommandRegistry>(async (resolve) => {
resolve({
command: await addPeriodicFilterOptions(
createLocalizedCommand("stats"),
(option) => option.addStringOption(addUsernameChoices)
createLocalizedCommand('stats'),
(option) => option.addStringOption(addUsernameChoices),
),
async handler(interaction) {
+1 -1
View File
@@ -14,7 +14,7 @@ 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 { type CommandRegistry } from '../events/interactionCreate';
import { CommandRegistry } from '../events/interactionCreate';
import { renderBreakdown } from './breakdown/render';
export const todayCommand = new Promise<CommandRegistry>(async (resolve) => {
@@ -1,8 +1,8 @@
import { type ComponentProps } from "react";
import { ComponentProps } from 'react';
export interface GlowProps extends ComponentProps<"div"> {
export interface GlowProps extends ComponentProps<'div'> {
color: string;
direction?: "default" | "reverse";
direction?: 'default' | 'reverse';
rotation?: number;
startOpacity?: number;
endOpacity?: number;
@@ -12,7 +12,7 @@ const width = 16;
export function Glow({
color,
direction = "default",
direction = 'default',
rotation = 0,
style,
startOpacity = 0,
@@ -21,20 +21,20 @@ export function Glow({
}: GlowProps) {
const color1 = `${color}${Math.round(endOpacity * 255)
.toString(16)
.padStart(2, "0")}`;
.padStart(2, '0')}`;
const color2 = `${color}${Math.round(startOpacity * 255)
.toString(16)
.padStart(2, "0")}`;
.padStart(2, '0')}`;
const background = `linear-gradient(${
direction === "default" ? 0 : 180
direction === 'default' ? 0 : 180
}deg, ${color1} 0%, ${color2} 100%)`;
return (
<div
style={{
display: "flex",
alignItems: direction === "default" ? "flex-end" : "flex-start",
justifyContent: "center",
display: 'flex',
alignItems: direction === 'default' ? 'flex-end' : 'flex-start',
justifyContent: 'center',
transform: `rotate(${rotation}deg)`,
...style,
}}
@@ -1,7 +1,7 @@
import {
getWN8Percentile,
Percentile,
type SupplementaryStats,
SupplementaryStats,
} from '@blitzkit/core';
import { Locale } from 'discord.js';
import { translator } from '../../core/localization/translator';
@@ -1,4 +1,4 @@
import { type ReactNode } from "react";
import { ReactNode } from 'react';
interface RootProps {
children: ReactNode;
@@ -8,7 +8,7 @@ export function Root({ children }: RootProps) {
return (
<div
className="session-tracker-root"
style={{ display: "flex", flexDirection: "column", gap: 8 }}
style={{ display: 'flex', flexDirection: 'column', gap: 8 }}
>
{children}
</div>
@@ -6,8 +6,8 @@ import {
} from '@blitzkit/core';
import { createColors } from 'bepaint';
import {
type AccentColor,
type GrayColor,
AccentColor,
GrayColor,
PALETTES,
} from '../../../core/radix/radixColors';
import { RowStat } from './RowStat';
@@ -1,11 +1,11 @@
import { Percentile } from "@blitzkit/core";
import { createColors } from "bepaint";
import { Percentile } from '@blitzkit/core';
import { createColors } from 'bepaint';
import {
type AccentColor,
type GrayColor,
AccentColor,
GrayColor,
PALETTES,
} from "../../../core/radix/radixColors";
import { PercentileIndicator } from "../../PercentileIndicator";
} from '../../../core/radix/radixColors';
import { PercentileIndicator } from '../../PercentileIndicator';
interface RowStatProps {
name: string;
@@ -22,7 +22,7 @@ export function RowStat({
delta,
percentile,
minimized = false,
color = "slate",
color = 'slate',
}: RowStatProps) {
const theme = createColors(PALETTES[`${color}Dark`]);
@@ -30,29 +30,29 @@ export function RowStat({
<div
className="session-tracker-row-stat"
style={{
display: "flex",
flexDirection: "column",
display: 'flex',
flexDirection: 'column',
gap: 4,
alignItems: "center",
justifyContent: "center",
alignItems: 'center',
justifyContent: 'center',
flex: 1,
}}
>
<div
style={{
display: "flex",
display: 'flex',
gap: 4,
alignItems: "center",
justifyContent: "center",
alignItems: 'center',
justifyContent: 'center',
}}
>
{percentile === undefined && delta !== undefined && delta !== 0 && (
<img
alt={delta > 0 ? "Increase" : "Decrease"}
alt={delta > 0 ? 'Increase' : 'Decrease'}
src={
(delta ?? 0) > 0
? "https://i.imgur.com/qbjiXa1.png"
: "https://i.imgur.com/3uyNhun.png"
? 'https://i.imgur.com/qbjiXa1.png'
: 'https://i.imgur.com/3uyNhun.png'
}
style={{ width: 12, height: 12 }}
/>
@@ -66,7 +66,7 @@ export function RowStat({
color: theme.textHighContrast,
fontWeight: 700,
fontSize: 16,
textAlign: "center",
textAlign: 'center',
}}
>
{value}
@@ -77,7 +77,7 @@ export function RowStat({
<span
style={{
color: theme.textLowContrast,
textAlign: "center",
textAlign: 'center',
fontSize: 12,
}}
>
@@ -1,5 +1,5 @@
import { type ReactNode } from "react";
import { theme } from "../stitches.config";
import { ReactNode } from 'react';
import { theme } from '../stitches.config';
interface CommandWrapperProps {
children: ReactNode;
@@ -10,14 +10,14 @@ export function CommandWrapper({ children, fat }: CommandWrapperProps) {
return (
<div
style={{
display: "flex",
flexDirection: "column",
display: 'flex',
flexDirection: 'column',
padding: `16px ${fat ? 0 : 16}px`,
gap: 16,
width: "100%",
width: '100%',
color: theme.colors.textHighContrast,
backgroundColor: theme.colors.appBackground1,
position: "relative",
position: 'relative',
}}
>
{children}
@@ -1,8 +1,8 @@
import {
type BlitzStats,
BlitzStats,
getWN8Percentile,
isNumber,
type SupplementaryStats,
SupplementaryStats,
} from '@blitzkit/core';
import { Locale } from 'discord.js';
import { translator } from '../../core/localization/translator';
@@ -1,5 +1,5 @@
import { type GenericStat } from "..";
import { GenericStatsRow } from "./GenericStatsRow";
import { GenericStat } from '..';
import { GenericStatsRow } from './GenericStatsRow';
interface GenericStatsColumnProps {
stats: GenericStat[];
@@ -7,7 +7,7 @@ interface GenericStatsColumnProps {
export function GenericStatsColumn({ stats }: GenericStatsColumnProps) {
return (
<div style={{ flex: 1, display: "flex", flexDirection: "column", gap: 8 }}>
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', gap: 8 }}>
{stats.map((stat) => (
<GenericStatsRow key={stat[0]} stat={stat} />
))}
@@ -1,6 +1,6 @@
import { type GenericStat } from "..";
import { theme } from "../../../stitches.config";
import { PercentileIndicator } from "../../PercentileIndicator";
import { GenericStat } from '..';
import { theme } from '../../../stitches.config';
import { PercentileIndicator } from '../../PercentileIndicator';
interface GenericStatsRowProps {
stat: GenericStat;
@@ -10,18 +10,18 @@ export function GenericStatsRow({ stat }: GenericStatsRowProps) {
return (
<div
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
}}
>
<span
style={{
color: theme.colors.textLowContrast,
fontSize: 16,
whiteSpace: "nowrap",
whiteSpace: 'nowrap',
maxWidth: 128,
overflow: "hidden",
overflow: 'hidden',
}}
>
{stat[0]}
@@ -32,9 +32,9 @@ export function GenericStatsRow({ stat }: GenericStatsRowProps) {
color: theme.colors.textHighContrast,
fontWeight: 700,
fontSize: 16,
display: "flex",
alignItems: "center",
justifyContent: "center",
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: 4,
}}
>
@@ -1,6 +1,6 @@
import { times } from 'lodash-es';
import { theme } from '../../../../stitches.config';
import { type MarginInputProps } from '../Root';
import { MarginInputProps } from '../Root';
import { MarginOrientation } from './constants';
interface MarginProps extends MarginInputProps {
@@ -1,9 +1,9 @@
import { times } from "lodash-es";
import { type ReactNode } from "react";
import { theme } from "../../../../stitches.config";
import { Margin } from "../Margin";
import { MarginOrientation } from "../Margin/constants";
import { GRAPH_HEIGHT, GRAPH_WIDTH } from "./constants";
import { times } from 'lodash-es';
import { ReactNode } from 'react';
import { theme } from '../../../../stitches.config';
import { Margin } from '../Margin';
import { MarginOrientation } from '../Margin/constants';
import { GRAPH_HEIGHT, GRAPH_WIDTH } from './constants';
export interface MarginInputProps {
min: number;
@@ -32,12 +32,12 @@ export function Root({
xTitle,
}: RootProps) {
return (
<div style={{ display: "flex", flexDirection: "column", gap: 16 }}>
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
<div
style={{
paddingLeft: 64,
display: "flex",
justifyContent: "space-between",
display: 'flex',
justifyContent: 'space-between',
}}
>
<span style={{ fontSize: 16, color: theme.colors.textHighContrast }}>
@@ -48,7 +48,7 @@ export function Root({
</span>
</div>
<div style={{ display: "flex", gap: 16 }}>
<div style={{ display: 'flex', gap: 16 }}>
{verticalMargin && (
<Margin {...verticalMargin} verticalSeparations={separations} />
)}
@@ -94,9 +94,9 @@ export function Root({
<div
style={{
paddingLeft: 64,
display: "flex",
alignItems: "center",
justifyContent: "center",
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
<span style={{ fontSize: 16, color: theme.colors.textLowContrast }}>
@@ -1,7 +1,7 @@
import { type ComponentProps } from "react";
import { theme } from "../../../stitches.config";
import { ComponentProps } from 'react';
import { theme } from '../../../stitches.config';
interface ItemProps extends ComponentProps<"div"> {
interface ItemProps extends ComponentProps<'div'> {
position: number;
deltaPosition?: number;
score?: number;
@@ -25,15 +25,15 @@ export function Item({
<div
{...props}
style={{
cursor: "pointer",
display: "flex",
cursor: 'pointer',
display: 'flex',
padding: 8,
backgroundColor: highlight
? theme.colors.componentInteractive_blue
: theme.colors.componentInteractive,
borderRadius: 4,
alignItems: "center",
justifyContent: "center",
alignItems: 'center',
justifyContent: 'center',
gap: 8,
}}
>
@@ -50,9 +50,9 @@ export function Item({
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "center",
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: 4,
}}
>
@@ -83,22 +83,22 @@ export function Item({
{deltaPosition !== undefined && deltaPosition !== 0 && (
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "center",
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: 4,
}}
>
<img
alt={deltaPosition > 0 ? "Increase" : "Decrease"}
alt={deltaPosition > 0 ? 'Increase' : 'Decrease'}
style={{
width: 8,
height: 8,
}}
src={
deltaPosition > 0
? "https://i.imgur.com/qbjiXa1.png"
: "https://i.imgur.com/3uyNhun.png"
? 'https://i.imgur.com/qbjiXa1.png'
: 'https://i.imgur.com/3uyNhun.png'
}
/>
<span
@@ -119,11 +119,11 @@ export function Item({
<div
style={{
display: "flex",
display: 'flex',
gap: 4,
alignItems: "center",
alignItems: 'center',
width: 96,
justifyContent: "flex-end",
justifyContent: 'flex-end',
}}
>
{deltaScore !== 0 && deltaScore !== undefined && (
@@ -140,15 +140,15 @@ export function Item({
)}
{deltaScore !== 0 && deltaScore !== undefined && (
<img
alt={deltaScore > 0 ? "Increase" : "Decrease"}
alt={deltaScore > 0 ? 'Increase' : 'Decrease'}
style={{
width: 8,
height: 8,
}}
src={
deltaScore > 0
? "https://i.imgur.com/qbjiXa1.png"
: "https://i.imgur.com/3uyNhun.png"
? 'https://i.imgur.com/qbjiXa1.png'
: 'https://i.imgur.com/3uyNhun.png'
}
/>
)}
@@ -1,4 +1,4 @@
import { type ReactNode } from 'react';
import { ReactNode } from 'react';
interface RootProps {
children: ReactNode;
@@ -1,4 +1,4 @@
import { type ReactNode } from 'react';
import { ReactNode } from 'react';
interface ColumnProps {
children: ReactNode;
@@ -1,4 +1,4 @@
import { type ReactNode } from "react";
import { ReactNode } from 'react';
interface RootProps {
children: ReactNode;
@@ -8,8 +8,8 @@ export function Root({ children }: RootProps) {
return (
<div
style={{
display: "flex",
flexDirection: "column",
display: 'flex',
flexDirection: 'column',
gap: 16,
}}
>
@@ -1,4 +1,4 @@
import { type ReactNode } from "react";
import { ReactNode } from 'react';
interface RowProps {
children: ReactNode;
@@ -8,7 +8,7 @@ export function Row({ children }: RowProps) {
return (
<div
style={{
display: "flex",
display: 'flex',
gap: 8,
}}
>
+7 -7
View File
@@ -1,5 +1,5 @@
import type { TierWeightsRecord } from "@blitzkit/core";
import { theme } from "../stitches.config";
import { TierWeightsRecord } from '@blitzkit/core';
import { theme } from '../stitches.config';
interface TierWeightsProps {
weights: TierWeightsRecord;
@@ -7,7 +7,7 @@ interface TierWeightsProps {
export function TierWeights({ weights }: TierWeightsProps) {
return (
<div style={{ display: "flex", gap: 8 }}>
<div style={{ display: 'flex', gap: 8 }}>
{Object.entries(weights).map(([tier, weight]) => (
<div
key={tier}
@@ -15,11 +15,11 @@ export function TierWeights({ weights }: TierWeightsProps) {
backgroundColor: theme.colors.appBackground1_light,
flex: weight,
color: theme.colors.textHighContrast_light,
display: "flex",
alignItems: "center",
justifyContent: "center",
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: 16,
overflow: "hidden",
overflow: 'hidden',
borderRadius: 8,
minWidth: 16,
}}
@@ -1,7 +1,7 @@
import { fetchTankDefinitions, TIER_ROMAN_NUMERALS } from "@blitzkit/core";
import { literals } from "@blitzkit/i18n";
import { Locale } from "discord.js";
import { type StatFilters } from "../blitzstars/filterStats";
import { StatFilters } from "../blitzstars/filterStats";
import { translator } from "../localization/translator";
export async function filtersToDescription(
@@ -1,5 +1,5 @@
import { getTimeDaysAgo, type Region } from '@blitzkit/core';
import type { PeriodSize } from '../discord/addPeriodSubCommands';
import { getTimeDaysAgo, Region } from '@blitzkit/core';
import { PeriodSize } from '../discord/addPeriodSubCommands';
export function getPeriodStart(region: Region, period: PeriodSize) {
if (period === 'career') return 0;
+3 -3
View File
@@ -1,9 +1,9 @@
import sharp from "sharp";
import sharp from 'sharp';
const cache: Record<string, Buffer> = {};
export async function iconPng(url: string) {
if (!url.endsWith(".webp")) return url;
if (!url.endsWith('.webp')) return url;
if (!cache[url]) {
const imageResponse = await fetch(url);
@@ -12,5 +12,5 @@ export async function iconPng(url: string) {
cache[url] = imageBufferPNG;
}
return `data:image/png;base64,${cache[url].toString("base64")}`;
return `data:image/png;base64,${cache[url].toString('base64')}`;
}
+12 -12
View File
@@ -1,10 +1,10 @@
import { TankClass, TankType } from "@blitzkit/core";
import type { SupplementaryStats } from "@blitzkit/core/src/blitz/getAccountInfo";
import { calculateWN8 } from "@blitzkit/core/src/statistics/calculateWN8";
import type { BlitzStats } from "@blitzkit/core/src/statistics/compositeStats";
import { sumAllStats } from "@blitzkit/core/src/statistics/sumAllStats";
import { tankDefinitions } from "../blitzkit/nonBlockingPromises";
import { blitzStarsTankAverages } from "./tankAverages";
import { TankClass, TankType } from '@blitzkit/core';
import { SupplementaryStats } from '@blitzkit/core/src/blitz/getAccountInfo';
import { calculateWN8 } from '@blitzkit/core/src/statistics/calculateWN8';
import { BlitzStats } from '@blitzkit/core/src/statistics/compositeStats';
import { sumAllStats } from '@blitzkit/core/src/statistics/sumAllStats';
import { tankDefinitions } from '../blitzkit/nonBlockingPromises';
import { blitzStarsTankAverages } from './tankAverages';
export interface StatFilters {
nation?: string;
@@ -16,7 +16,7 @@ export interface StatFilters {
export async function filterStats(
{ diff, order }: DiffedTankStats,
filters: StatFilters
filters: StatFilters,
) {
// tank, if provided, takes priority over all other filters
if (filters.tank) filters = { tank: filters.tank };
@@ -45,14 +45,14 @@ export async function filterStats(
const battlesOfTanksWithAverages = filteredOrder.reduce<number>(
(accumulator, id) =>
awaitedTankAverages[id] ? accumulator + diff[id].battles : accumulator,
0
0,
);
const battlesOfTanksWithTankDefinition = filteredOrder.reduce<number>(
(accumulator, id) =>
awaitedTankDefinitions.tanks[id]
? accumulator + diff[id].battles
: accumulator,
0
0,
);
const supplementary = {
WN8:
@@ -63,7 +63,7 @@ export async function filterStats(
calculateWN8(awaitedTankAverages[id].all, diff[id]) *
diff[id].battles
: accumulator,
0
0,
) / battlesOfTanksWithAverages,
tier:
filteredOrder.reduce<number>(
@@ -72,7 +72,7 @@ export async function filterStats(
? accumulator +
awaitedTankDefinitions.tanks[id]!.tier * diff[id].battles
: accumulator,
0
0,
) / battlesOfTanksWithTankDefinition,
} satisfies SupplementaryStats;
@@ -1,17 +1,17 @@
import { getAccountInfo, type Region } from "@blitzkit/core";
import { buttonLink } from "../discord/buttonLink";
import { getAccountInfo, Region } from '@blitzkit/core';
import { buttonLink } from '../discord/buttonLink';
export async function getBlitzStarsLinkButton(
region: Region,
id: number,
tankId?: number
tankId?: number,
) {
const { nickname } = await getAccountInfo(region, id);
return buttonLink(
`https://www.blitzstars.com/player/${region}/${nickname}${
tankId ? `/tank/${tankId!}` : ""
tankId ? `/tank/${tankId!}` : ''
}`,
"BlitzStars"
'BlitzStars',
);
}
@@ -1,11 +1,11 @@
import { type Region, emptyAllStats, getAccountInfo } from '@blitzkit/core';
import { Region, emptyAllStats, getAccountInfo } from '@blitzkit/core';
import {
type GetHistoriesOptions,
type Histories,
type History,
GetHistoriesOptions,
Histories,
History,
getHistoriesDefaultOptions,
} from '../../types/histories';
import type { PlayerStats } from './getPlayerStats';
import { PlayerStats } from './getPlayerStats';
export async function getPlayerHistories(
server: Region,
@@ -1,4 +1,4 @@
import type { BlitzStats, Region } from "@blitzkit/core";
import { BlitzStats, Region } from '@blitzkit/core';
interface IndividualPlayerStats {
clan: { clan_id: number; name: string; tag: string };
@@ -25,13 +25,13 @@ export async function getPlayerStats<
ReturnType = Ids extends number ? PlayerStats : PlayerStats[],
>(region: Region, ids: Ids) {
const stats = await Promise.all(
((typeof ids === "number" ? [ids] : ids) as number[]).map((id) =>
((typeof ids === 'number' ? [ids] : ids) as number[]).map((id) =>
fetch(`https://www.blitzstars.com/api/playerstats/${id}`).then(
(response) => response.json() as Promise<PlayerStats>
)
)
(response) => response.json() as Promise<PlayerStats>,
),
),
);
if (typeof ids === "number") return stats[0] as ReturnType;
if (typeof ids === 'number') return stats[0] as ReturnType;
return stats as ReturnType;
}
@@ -1,11 +1,11 @@
import { type BlitzStats, emptyAllStats, type Region } from "@blitzkit/core";
import { Locale } from "discord.js";
import type { DiffedTankStats } from "./filterStats";
import { BlitzStats, emptyAllStats, Region } from '@blitzkit/core';
import { Locale } from 'discord.js';
import { DiffedTankStats } from './filterStats';
import {
getTankHistories,
type TankHistories,
type TankHistoryRaw,
} from "./getTankHistories";
TankHistories,
TankHistoryRaw,
} from './getTankHistories';
const emptyTankHistoryNode: TankHistoryRaw = {
account_id: 0,
@@ -22,7 +22,7 @@ export async function getStatsInPeriod(
id: number,
start: number,
end: number,
locale: Locale
locale: Locale,
) {
const history = await getTankHistories(server, id, locale, {
includeLatestHistories: true,
@@ -43,8 +43,8 @@ export async function getStatsInPeriod(
// find the ones played within the range
const inRangeTanks = tanks.filter((tankId) =>
tankSortedHistory[tankId].some(
(node) => node.last_battle_time > start && node.last_battle_time < end
)
(node) => node.last_battle_time > start && node.last_battle_time < end,
),
);
const playedTanks: number[] = [];
@@ -1,13 +1,13 @@
import { type Region, emptyAllStats, getTankStats } from "@blitzkit/core";
import { Locale } from "discord.js";
import { Region, emptyAllStats, getTankStats } from '@blitzkit/core';
import { Locale } from 'discord.js';
import {
type GetHistoriesOptions,
type Histories,
type History,
GetHistoriesOptions,
Histories,
History,
getHistoriesDefaultOptions,
} from "../../types/histories";
import { UserError } from "../blitzkit/userError";
import { translator } from "../localization/translator";
} from '../../types/histories';
import { UserError } from '../blitzkit/userError';
import { translator } from '../localization/translator';
export interface TankHistory extends History {
tank_id: number;
@@ -36,12 +36,12 @@ export async function getTankHistories(
server: Region,
id: number,
locale: Locale,
options?: Partial<GetTankHistoriesOptions>
options?: Partial<GetTankHistoriesOptions>,
) {
const { strings } = translator(locale);
const mergedOptions = { ...getTankHistoriesDefaultOptions, ...options };
const tankHistoriesResponse = await fetch(
`https://www.blitzstars.com/api/tankhistories/for/${id}/`
`https://www.blitzstars.com/api/tankhistories/for/${id}/`,
);
const tankHistories = (
(await tankHistoriesResponse.json()) as TankHistoriesRaw
@@ -51,7 +51,7 @@ export 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<number, number> = {};
@@ -73,7 +73,7 @@ export async function getTankHistories(
lastBattles[tank_id] = battles;
return complies;
}
},
);
const latestNodes: TankHistories = [];
@@ -112,7 +112,7 @@ export async function getTankHistories(
all: emptyAllStats,
last_battle_time: -Infinity,
tank_id: tankId,
} satisfies TankHistory)
} satisfies TankHistory),
);
}
});
@@ -4,7 +4,7 @@ import {
TANK_TYPES,
} from '@blitzkit/core';
import {
type APIApplicationCommandOptionChoice,
APIApplicationCommandOptionChoice,
Locale,
SlashCommandBuilder,
SlashCommandSubcommandBuilder,
@@ -1,11 +1,11 @@
import { REGIONS } from "@blitzkit/core";
import { REGIONS } from '@blitzkit/core';
import {
type APIApplicationCommandOptionChoice,
APIApplicationCommandOptionChoice,
Locale,
SlashCommandStringOption,
} from "discord.js";
import { translator } from "../localization/translator";
import { localizationObject } from "./localizationObject";
} from 'discord.js';
import { translator } from '../localization/translator';
import { localizationObject } from './localizationObject';
export function addRegionChoices(option: SlashCommandStringOption) {
const { strings } = translator(Locale.EnglishUS);
@@ -16,14 +16,14 @@ export function addRegionChoices(option: SlashCommandStringOption) {
localizationObject(
(strings) => strings.bot.common.options.region.name,
undefined,
true
)
true,
),
)
.setDescription(strings.bot.common.options.region.description)
.setDescriptionLocalizations(
localizationObject(
(strings) => strings.bot.common.options.region.description
)
(strings) => strings.bot.common.options.region.description,
),
)
.addChoices(
...REGIONS.map(
@@ -32,10 +32,10 @@ export function addRegionChoices(option: SlashCommandStringOption) {
value: region,
name: strings.common.regions.normal[region],
name_localizations: localizationObject(
(strings) => strings.common.regions.normal[region]
(strings) => strings.common.regions.normal[region],
),
}) satisfies APIApplicationCommandOptionChoice
)
}) satisfies APIApplicationCommandOptionChoice,
),
)
.setRequired(true);
}
@@ -1,25 +1,25 @@
import { fetchTankNames, SEARCH_KEYS, TankType } from "@blitzkit/core";
import { fetchTankNames, SEARCH_KEYS, TankType } from '@blitzkit/core';
import {
type ApplicationCommandOptionChoiceData,
ApplicationCommandOptionChoiceData,
AutocompleteInteraction,
type CacheType,
} from "discord.js";
import { go } from "fuzzysort";
import { tankNames } from "../blitzkit/nonBlockingPromises";
import { translator } from "../localization/translator";
CacheType,
} from 'discord.js';
import { go } from 'fuzzysort';
import { tankNames } from '../blitzkit/nonBlockingPromises';
import { translator } from '../localization/translator';
import {
DISCORD_CHOICES_MAX_NAME_SIZE,
OVERFLOW_SUFFIX,
} from "./autocompleteClan/constants";
} from './autocompleteClan/constants';
export const tankNamesTechTreeOnly = fetchTankNames().then((names) =>
names.filter((tank) => tank.treeType === TankType.RESEARCHABLE)
names.filter((tank) => tank.treeType === TankType.RESEARCHABLE),
);
export async function autocompleteTanks(
interaction: AutocompleteInteraction<CacheType>,
techTreeOnly = false,
fields = ["tank"]
fields = ['tank'],
) {
const { unwrap } = translator(interaction.locale);
const focusedOption = interaction.options.getFocused(true);
@@ -31,7 +31,7 @@ export async function autocompleteTanks(
go(
focusedOption.value,
await (techTreeOnly ? tankNamesTechTreeOnly : tankNames),
{ keys: SEARCH_KEYS, limit: 10 }
{ keys: SEARCH_KEYS, limit: 10 },
).map(async (item) => {
let name = unwrap(item.obj.searchableName);
@@ -42,7 +42,7 @@ export async function autocompleteTanks(
0,
unwrap(item.obj.searchableName).length -
overSize -
OVERFLOW_SUFFIX.length
OVERFLOW_SUFFIX.length,
)}${OVERFLOW_SUFFIX}`;
}
@@ -50,8 +50,8 @@ export async function autocompleteTanks(
name,
value: `${item.obj.id}`,
} satisfies ApplicationCommandOptionChoiceData<string>;
})
}),
)
: []
: [],
);
}
+3 -3
View File
@@ -1,13 +1,13 @@
import {
ButtonBuilder,
ButtonStyle,
type ComponentEmojiResolvable,
} from "discord.js";
ComponentEmojiResolvable,
} from 'discord.js';
export function buttonLink(
url: string,
label: string,
emoji?: ComponentEmojiResolvable
emoji?: ComponentEmojiResolvable,
) {
const button = new ButtonBuilder()
.setStyle(ButtonStyle.Link)
@@ -1,13 +1,13 @@
import {
ButtonBuilder,
ButtonStyle,
type ComponentEmojiResolvable,
} from "discord.js";
ComponentEmojiResolvable,
} from 'discord.js';
export function buttonPrimary(
id: string,
label: string,
emoji?: ComponentEmojiResolvable
emoji?: ComponentEmojiResolvable,
) {
const button = new ButtonBuilder()
.setCustomId(id)
@@ -1,4 +1,4 @@
import { type CacheType, ChatInputCommandInteraction } from "discord.js";
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
export interface Parameters {
[key: string]: string | number | boolean | undefined | null;
@@ -9,7 +9,7 @@ export interface Parameters {
export function commandToURL(
interaction: ChatInputCommandInteraction<CacheType>,
parameters?: Parameters
parameters?: Parameters,
) {
const pathname = [
interaction.commandName,
@@ -17,11 +17,11 @@ export function commandToURL(
interaction.options.getSubcommand(false),
]
.filter(Boolean)
.join("/");
.join('/');
const params = (parameters ? Object.entries(parameters) : [])
.filter(([, value]) => value !== undefined && value !== null)
.map(([key, value]) => `${key}=${value}`)
.join("&");
.join('&');
return `${pathname}${params.length > 0 ? `?${params}` : ""}`;
return `${pathname}${params.length > 0 ? `?${params}` : ''}`;
}
@@ -1,12 +1,12 @@
import { type BlitzKitStrings } from "@blitzkit/i18n";
import { BlitzKitStrings } from '@blitzkit/i18n';
import {
Locale,
SlashCommandBuilder,
SlashCommandSubcommandBuilder,
SlashCommandSubcommandGroupBuilder,
} from "discord.js";
import { translator } from "../localization/translator";
import { localizationObject } from "./localizationObject";
} from 'discord.js';
import { translator } from '../localization/translator';
import { localizationObject } from './localizationObject';
interface CreateLocalizedCommandSubcommand {
subcommand: string;
@@ -22,12 +22,12 @@ export function createLocalizedCommand(
command: string,
sub?:
| CreateLocalizedCommandSubcommand[]
| CreateLocalizedCommandSubcommandGroup[]
| CreateLocalizedCommandSubcommandGroup[],
) {
const commandPathItem = command.replaceAll(
"-",
"_"
) as keyof BlitzKitStrings["bot"]["commands"];
'-',
'_',
) as keyof BlitzKitStrings['bot']['commands'];
const { strings } = translator(Locale.EnglishUS);
const slashCommand = new SlashCommandBuilder()
.setName(command)
@@ -35,19 +35,19 @@ export function createLocalizedCommand(
localizationObject(
(strings) => strings.bot.commands[commandPathItem].name,
undefined,
true
)
true,
),
)
.setDescription(strings.bot.commands[commandPathItem].description)
.setDescriptionLocalizations(
localizationObject(
(strings) => strings.bot.commands[commandPathItem].description
)
(strings) => strings.bot.commands[commandPathItem].description,
),
);
if (sub) {
sub.map((subItem) => {
if ("subcommand" in subItem) {
if ('subcommand' in subItem) {
const subcommandNameLocalizations = localizationObject(
(strings) =>
(
@@ -56,7 +56,7 @@ export function createLocalizedCommand(
}
).subcommands[subItem.subcommand].name,
undefined,
true
true,
);
const subcommandDescriptionLocalizations = localizationObject(
(strings) =>
@@ -64,7 +64,7 @@ export function createLocalizedCommand(
strings.bot.commands[commandPathItem] as unknown as {
subcommands: Record<string, { description: string }>;
}
).subcommands[subItem.subcommand].description
).subcommands[subItem.subcommand].description,
);
slashCommand.addSubcommand((option) => {
@@ -78,7 +78,7 @@ export function createLocalizedCommand(
strings.bot.commands[commandPathItem] as unknown as {
subcommands: Record<string, { description: string }>;
}
).subcommands[subItem.subcommand].description
).subcommands[subItem.subcommand].description,
)
.setDescriptionLocalizations(subcommandDescriptionLocalizations);
});
@@ -91,7 +91,7 @@ export function createLocalizedCommand(
}
).groups[subItem.group].name,
undefined,
true
true,
);
const subcommandDescriptionLocalizations = localizationObject(
(strings) =>
@@ -99,7 +99,7 @@ export function createLocalizedCommand(
strings.bot.commands[commandPathItem] as unknown as {
groups: Record<string, { description: string }>;
}
).groups[subItem.group].description
).groups[subItem.group].description,
);
slashCommand.addSubcommandGroup((option) => {
@@ -113,7 +113,7 @@ export function createLocalizedCommand(
strings.bot.commands[commandPathItem] as unknown as {
groups: Record<string, { description: string }>;
}
).groups[subItem.group].description
).groups[subItem.group].description,
)
.setDescriptionLocalizations(subcommandDescriptionLocalizations);
});
@@ -1,17 +1,17 @@
import { ChatInputCommandInteraction } from "discord.js";
import type { PeriodType } from "./addPeriodSubCommands";
import { ChatInputCommandInteraction } from 'discord.js';
import { PeriodType } from './addPeriodSubCommands';
export function getCustomPeriodParams(
interaction: ChatInputCommandInteraction,
forcedNonCustomPeriod = false
forcedNonCustomPeriod = false,
) {
if (
!forcedNonCustomPeriod &&
(interaction.options.getSubcommand() as PeriodType) === "custom"
(interaction.options.getSubcommand() as PeriodType) === 'custom'
) {
return {
start: interaction.options.getInteger("start", true),
end: interaction.options.getInteger("end", true),
start: interaction.options.getInteger('start', true),
end: interaction.options.getInteger('end', true),
};
}
@@ -1,19 +1,19 @@
import { TankClass, TankType } from "@blitzkit/core";
import { ButtonInteraction } from "discord.js";
import type { StatFilters } from "../blitzstars/filterStats";
import { TankClass, TankType } from '@blitzkit/core';
import { ButtonInteraction } from 'discord.js';
import { StatFilters } from '../blitzstars/filterStats';
export function getFiltersFromButton(interaction: ButtonInteraction) {
const url = new URL(`https://example.com/${interaction.customId}`);
return {
nation: url.searchParams.get("nation") ?? undefined,
tank: parseInt(url.searchParams.get("tank") ?? "0") || undefined,
nation: url.searchParams.get('nation') ?? undefined,
tank: parseInt(url.searchParams.get('tank') ?? '0') || undefined,
class:
(Number(url.searchParams.get("class")) as TankClass | undefined) ??
(Number(url.searchParams.get('class')) as TankClass | undefined) ??
undefined,
type:
(Number(url.searchParams.get("type")) as TankType | undefined) ??
(Number(url.searchParams.get('type')) as TankType | undefined) ??
undefined,
tier: parseInt(url.searchParams.get("tier") ?? "0") || undefined,
tier: parseInt(url.searchParams.get('tier') ?? '0') || undefined,
} satisfies StatFilters;
}
@@ -1,6 +1,6 @@
import { ChatInputCommandInteraction } from 'discord.js';
import { resolveTankId } from '../blitz/resolveTankId';
import type { StatFilters } from '../blitzstars/filterStats';
import { StatFilters } from '../blitzstars/filterStats';
export async function getFiltersFromCommand(
interaction: ChatInputCommandInteraction,
@@ -1,7 +1,7 @@
import { literals } from "@blitzkit/i18n";
import { Locale } from "discord.js";
import { translator } from "../localization/translator";
import type { PeriodSize } from "./addPeriodSubCommands";
import { PeriodSize } from "./addPeriodSubCommands";
export function getPeriodOptionName(period: PeriodSize, locale: Locale) {
const { strings } = translator(locale);
@@ -1,4 +1,4 @@
import { type BlitzKitStrings, literals as literalsFunc } from "@blitzkit/i18n";
import { BlitzKitStrings, literals as literalsFunc } from "@blitzkit/i18n";
import { Locale } from "discord.js";
import { SUPPORTED_LOCALES_DISCORD } from "../localization/strings/constants";
import { translator } from "../localization/translator";
@@ -3,12 +3,12 @@ import {
AttachmentBuilder,
ButtonBuilder,
EmbedBuilder,
type InteractionEditReplyOptions,
type InteractionReplyOptions,
type MessageEditOptions,
InteractionEditReplyOptions,
InteractionReplyOptions,
MessageEditOptions,
} from "discord.js";
import type { InteractionReturnable } from "../../events/interactionCreate";
import type { Writeable } from "../../types/writable";
import { InteractionReturnable } from "../../events/interactionCreate";
import { Writeable } from "../../types/writable";
import { jsxToPngThreaded } from "../blitzkit/jsxToPngThreaded";
import { RenderConfiguration } from "../blitzkit/renderConfiguration";
@@ -1,4 +1,4 @@
import type { Region } from "@blitzkit/core";
import { Region } from "@blitzkit/core";
import { literals } from "@blitzkit/i18n";
import { ChatInputCommandInteraction } from "discord.js";
import markdownEscape from "markdown-escape";
@@ -1,25 +1,25 @@
import { getTimeDaysAgo, type Region } from "@blitzkit/core";
import { ButtonInteraction } from "discord.js";
import { getPeriodNow } from "../blitzkit/getPeriodNow";
import { getPeriodStart } from "../blitzkit/getPeriodStart";
import type { PeriodType } from "./addPeriodSubCommands";
import { getPeriodOptionName } from "./getPeriodOptionName";
import type { ResolvedPeriod } from "./resolvePeriodFromCommand";
import { getTimeDaysAgo, Region } from '@blitzkit/core';
import { ButtonInteraction } from 'discord.js';
import { getPeriodNow } from '../blitzkit/getPeriodNow';
import { getPeriodStart } from '../blitzkit/getPeriodStart';
import { PeriodType } from './addPeriodSubCommands';
import { getPeriodOptionName } from './getPeriodOptionName';
import { ResolvedPeriod } from './resolvePeriodFromCommand';
export function resolvePeriodFromButton(
region: Region,
interaction: ButtonInteraction
interaction: ButtonInteraction,
) {
let name: string;
let start: number;
let end: number;
const url = new URL(`https://example.com/${interaction.customId}`);
const path = url.pathname.split("/");
const path = url.pathname.split('/');
const periodSubcommand = path.at(-1) as PeriodType;
if (periodSubcommand === "custom") {
const startRaw = parseInt(url!.searchParams.get("start")!);
const endRaw = parseInt(url!.searchParams.get("end")!);
if (periodSubcommand === 'custom') {
const startRaw = parseInt(url!.searchParams.get('start')!);
const endRaw = parseInt(url!.searchParams.get('end')!);
const startDaysAgoMin = Math.min(startRaw, endRaw);
const endDaysAgoMax = Math.max(startRaw, endRaw);
@@ -1,10 +1,10 @@
import { getTimeDaysAgo, type Region } from "@blitzkit/core";
import { getTimeDaysAgo, Region } from "@blitzkit/core";
import { literals } from "@blitzkit/i18n";
import { type CacheType, ChatInputCommandInteraction } from "discord.js";
import { CacheType, ChatInputCommandInteraction } from "discord.js";
import { getPeriodNow } from "../blitzkit/getPeriodNow";
import { getPeriodStart } from "../blitzkit/getPeriodStart";
import { translator } from "../localization/translator";
import type { PeriodType } from "./addPeriodSubCommands";
import { PeriodType } from "./addPeriodSubCommands";
import { getPeriodOptionName } from "./getPeriodOptionName";
export interface ResolvedPeriod {
@@ -1,12 +1,12 @@
import type { Region } from "@blitzkit/core";
import { ButtonInteraction } from "discord.js";
import type { ResolvedPlayer } from "./resolvePlayerFromCommand";
import { Region } from '@blitzkit/core';
import { ButtonInteraction } from 'discord.js';
import { ResolvedPlayer } from './resolvePlayerFromCommand';
export async function resolvePlayerFromButton(interaction: ButtonInteraction) {
const url = new URL(`https://exmaple.com/${interaction.customId}`);
return {
id: parseInt(url.searchParams.get("id")!),
region: url.searchParams.get("region") as Region,
id: parseInt(url.searchParams.get('id')!),
region: url.searchParams.get('region') as Region,
} satisfies ResolvedPlayer;
}
@@ -1,6 +1,6 @@
import { idToRegion, type Region } from "@blitzkit/core";
import { idToRegion, Region } from "@blitzkit/core";
import { literals } from "@blitzkit/i18n";
import { type CacheType, ChatInputCommandInteraction } from "discord.js";
import { CacheType, ChatInputCommandInteraction } from "discord.js";
import markdownEscape from "markdown-escape";
import { searchPlayersAcrossRegionsBotWrapper } from "../../blitz/searchPlayersAcrossRegionsBotWrapper";
import { getBlitzFromDiscord } from "../../blitzkit/getBlitzFromDiscord";
+38 -38
View File
@@ -1,52 +1,52 @@
import * as colors from "@radix-ui/colors";
import { Theme } from "@radix-ui/themes";
import type { ComponentProps } from "react";
import * as colors from '@radix-ui/colors';
import { Theme } from '@radix-ui/themes';
import { ComponentProps } from 'react';
export type AccentColor = Exclude<
ComponentProps<typeof Theme>["accentColor"],
"gray" | undefined
ComponentProps<typeof Theme>['accentColor'],
'gray' | undefined
>;
export type AccentColorDark = `${AccentColor}Dark`;
export type GrayColor = Exclude<
ComponentProps<typeof Theme>["grayColor"],
"auto" | undefined
ComponentProps<typeof Theme>['grayColor'],
'auto' | undefined
>;
export type GrayColorDark = `${GrayColor}Dark`;
export const ACCENT_COLORS: AccentColor[] = [
"tomato",
"red",
"ruby",
"crimson",
"pink",
"plum",
"purple",
"violet",
"iris",
"indigo",
"blue",
"cyan",
"teal",
"jade",
"green",
"grass",
"brown",
"orange",
"sky",
"mint",
"lime",
"yellow",
"amber",
"gold",
"bronze",
'tomato',
'red',
'ruby',
'crimson',
'pink',
'plum',
'purple',
'violet',
'iris',
'indigo',
'blue',
'cyan',
'teal',
'jade',
'green',
'grass',
'brown',
'orange',
'sky',
'mint',
'lime',
'yellow',
'amber',
'gold',
'bronze',
];
export const GRAY_COLORS: GrayColor[] = [
"gray",
"mauve",
"slate",
"sage",
"olive",
"sand",
'gray',
'mauve',
'slate',
'sage',
'olive',
'sand',
];
export const PALETTES: Record<
@@ -3,21 +3,21 @@ import {
AttachmentBuilder,
ButtonBuilder,
ButtonStyle,
type CacheType,
CacheType,
ChatInputCommandInteraction,
type InteractionReplyOptions,
} from "discord.js";
import { type InteractionRawReturnable, commands } from "..";
import { UserError } from "../../../core/blitzkit/userError";
import { buttonLink } from "../../../core/discord/buttonLink";
import { embedWarning } from "../../../core/discord/embedWarning";
import { normalizeInteractionReturnable } from "../../../core/discord/normalizeInteractionReturnable";
import { psa } from "../../../core/discord/psa";
import { translator } from "../../../core/localization/translator";
import type { Writeable } from "../../../types/writable";
InteractionReplyOptions,
} from 'discord.js';
import { InteractionRawReturnable, commands } from '..';
import { UserError } from '../../../core/blitzkit/userError';
import { buttonLink } from '../../../core/discord/buttonLink';
import { embedWarning } from '../../../core/discord/embedWarning';
import { normalizeInteractionReturnable } from '../../../core/discord/normalizeInteractionReturnable';
import { psa } from '../../../core/discord/psa';
import { translator } from '../../../core/localization/translator';
import { Writeable } from '../../../types/writable';
export async function handleChatInputCommand(
interaction: ChatInputCommandInteraction<CacheType>
interaction: ChatInputCommandInteraction<CacheType>,
) {
await interaction.deferReply();
@@ -33,10 +33,10 @@ export async function handleChatInputCommand(
(Array.isArray(returnable) ? returnable : [returnable]).forEach(
(object) => {
if (typeof object === "string") {
if (typeof object === 'string') {
chunks.push([object]);
} else chunks.at(-1)?.push(object!);
}
},
);
let index = 0;
@@ -49,17 +49,17 @@ export async function handleChatInputCommand(
(psa.data.commands === undefined ||
psa.data.commands.includes(interaction.commandName))
) {
if (psa.data.type === undefined || psa.data.type === "embed") {
if (psa.data.type === undefined || psa.data.type === 'embed') {
if (!reply.embeds) reply.embeds = [];
const embed = embedWarning(psa.data.title, psa.data.description);
if (psa.data.image) embed.setImage(psa.data.image);
(reply.embeds as Writeable<typeof reply.embeds>).push(embed);
} else if (psa.data.type === "image") {
} else if (psa.data.type === 'image') {
if (!reply.files) reply.files = [];
(reply.files as Writeable<typeof reply.files>).push(
new AttachmentBuilder(psa.data.image)
new AttachmentBuilder(psa.data.image),
);
reply.content = reply.content ?? psa.data.title;
}
@@ -72,7 +72,7 @@ export async function handleChatInputCommand(
(
reply.components[0] as ActionRowBuilder<ButtonBuilder>
).addComponents(
psa.data.links.map(({ title, url }) => buttonLink(url, title))
psa.data.links.map(({ title, url }) => buttonLink(url, title)),
);
}
}
@@ -93,17 +93,17 @@ export async function handleChatInputCommand(
ephemeral: true,
};
if (psa.data.type === undefined || psa.data.type === "embed") {
if (psa.data.type === undefined || psa.data.type === 'embed') {
if (!followUp.embeds) followUp.embeds = [];
const embed = embedWarning(psa.data.title, psa.data.description);
if (psa.data.image) embed.setImage(psa.data.image);
(followUp.embeds as Writeable<typeof followUp.embeds>).push(embed);
} else if (psa.data.type === "image") {
} else if (psa.data.type === 'image') {
if (!followUp.files) followUp.files = [];
(followUp.files as Writeable<typeof followUp.files>).push(
new AttachmentBuilder(psa.data.image)
new AttachmentBuilder(psa.data.image),
);
followUp.content = followUp.content ?? psa.data.title;
}
@@ -116,7 +116,7 @@ export async function handleChatInputCommand(
(
followUp.components[0] as ActionRowBuilder<ButtonBuilder>
).addComponents(
psa.data.links.map(({ title, url }) => buttonLink(url, title))
psa.data.links.map(({ title, url }) => buttonLink(url, title)),
);
}
@@ -132,8 +132,8 @@ export async function handleChatInputCommand(
new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setLabel(strings.bot.common.errors.get_help)
.setURL("https://discord.gg/nDt7AjGJQH")
.setStyle(ButtonStyle.Link)
.setURL('https://discord.gg/nDt7AjGJQH')
.setStyle(ButtonStyle.Link),
),
];
if (error instanceof UserError) {
@@ -4,15 +4,15 @@ import {
AutocompleteInteraction,
ButtonBuilder,
ButtonInteraction,
type CacheType,
CacheType,
ChatInputCommandInteraction,
EmbedBuilder,
type Interaction,
Interaction,
REST,
Routes,
SlashCommandBuilder,
type SlashCommandOptionsOnlyBuilder,
type SlashCommandSubcommandsOnlyBuilder,
SlashCommandOptionsOnlyBuilder,
SlashCommandSubcommandsOnlyBuilder,
} from "discord.js";
import { aboutCommand } from "../../commands/about";
import { breakdownCommand } from "../../commands/breakdown";
+1 -1
View File
@@ -1,6 +1,6 @@
// a cleaner simplification of Blitz Stars' histories because it's a mess there
import { type BlitzStats } from '@blitzkit/core';
import { BlitzStats } from '@blitzkit/core';
export interface History {
all: BlitzStats;
Submodule packages/closed deleted from 5b4a85d503.
+4 -10
View File
@@ -4,26 +4,20 @@
"type": "module",
"main": "src/index.ts",
"dependencies": {
"@blitzkit/i18n": "workspace:*",
"@bufbuild/protobuf": "^2.9.0",
"@octokit/plugin-throttling": "^11.0.1",
"@octokit/rest": "^22.0.0",
"@prisma/client": "^6.16.2",
"@types/adm-zip": "^0.5.7",
"@types/bun": "^1.3.1",
"@types/lodash-es": "^4.17.12",
"@types/lz4js": "^0.2.1",
"@types/three": "^0.180.0",
"adm-zip": "^0.5.16",
"crc": "^4.3.2",
"dotenv": "^17.2.2",
"fast-xml-parser": "^5.3.2",
"lodash-es": "^4.17.21",
"lz4js": "^0.2.0",
"pickleparser": "^0.2.1",
"protobufjs": "^7.5.4",
"three": "^0.180.0",
"ts-proto": "^2.7.7",
"yaml": "^2.8.1"
},
"devDependencies": {
"@types/adm-zip": "^0.5.7",
"@types/lz4js": "^0.2.1"
}
}
-25
View File
@@ -1,25 +0,0 @@
export enum BlitzVFSSourceType {
Steam,
}
type BlitzVFSSource = {
type: BlitzVFSSourceType;
username: string;
password: string;
app: number;
os: "windows";
};
export class BlitzVFS {
constructor(private source: BlitzVFSSource) {}
async init() {
return this;
}
async file(path: string) {
return new Uint8Array();
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
import { ShellDefinition, ShellType } from "../protos";
import { type ShellDefinition, ShellType } from '@blitzkit/core';
export function canSplash(type: ShellDefinition["type"]): type is ShellType.HE {
export function canSplash(type: ShellDefinition['type']): type is ShellType.HE {
return type === ShellType.HE;
}
+5 -5
View File
@@ -1,5 +1,5 @@
import { TankClass, TankType } from "../protos";
import type { BlitzStats } from "../statistics";
import { TankClass, TankType } from '../protos';
import { BlitzStats } from '../statistics';
export const TANK_TYPES = [
TankType.RESEARCHABLE,
@@ -8,9 +8,9 @@ export const TANK_TYPES = [
];
export const TANK_TYPE_COMMAND_NAMES = {
[TankType.RESEARCHABLE]: "researchable",
[TankType.PREMIUM]: "premium",
[TankType.COLLECTOR]: "collector",
[TankType.RESEARCHABLE]: 'researchable',
[TankType.PREMIUM]: 'premium',
[TankType.COLLECTOR]: 'collector',
};
export const TANK_CLASSES = [
+1 -1
View File
@@ -1,4 +1,4 @@
import type { Vector3Tuple } from "three";
import { Vector3Tuple } from 'three';
export const equipmentPriceMatrix: Record<number, Vector3Tuple> = {
1: [100, 200, 300],
+11 -11
View File
@@ -1,19 +1,19 @@
import { assertSecret, EventManager } from "../blitzkit";
import { patientFetch } from "../blitzkit/patientFetch";
import type { Region } from "./regions";
import { assertSecret, EventManager } from '../blitzkit';
import { patientFetch } from '../blitzkit/patientFetch';
import { Region } from './regions';
const RETRY_ERRORS = ["REQUEST_LIMIT_EXCEEDED", "SOURCE_NOT_AVAILABLE"];
const RETRY_ERRORS = ['REQUEST_LIMIT_EXCEEDED', 'SOURCE_NOT_AVAILABLE'];
export const retryAbleBlitzFetchEvent = new EventManager();
export const blitzFetchQueueAvailableEvent = new EventManager();
type BlitzResponse<Data extends object> =
| {
status: "error";
status: 'error';
error: { field: string; message: string; code: 402; value: null };
}
| {
status: "ok";
status: 'ok';
data: Data;
};
@@ -36,11 +36,11 @@ async function manageQueue() {
const request = queue.shift()!;
const data = (await patientFetch(request.url)
.then((response) => response.json())
.catch((error) => ({ status: "error", error }))) as BlitzResponse<
.catch((error) => ({ status: 'error', error }))) as BlitzResponse<
typeof request.resolve
>;
if (data.status === "ok") {
if (data.status === 'ok') {
request.resolve(data.data);
} else {
if (RETRY_ERRORS.includes(data.error.message)) {
@@ -67,19 +67,19 @@ export type FetchBlitzParams = Record<string, string | number | undefined>;
export function fetchBlitz<Data extends object>(
region: Region,
path: string,
params: FetchBlitzParams = {}
params: FetchBlitzParams = {},
) {
return new Promise<Data>((resolve) => {
queue.push({
url: `https://api.wotblitz.${region}/wotb/${path}/?${Object.entries({
application_id: assertSecret(
import.meta.env.PUBLIC_WARGAMING_APPLICATION_ID
import.meta.env.PUBLIC_WARGAMING_APPLICATION_ID,
),
...params,
})
.filter(([_, value]) => value !== undefined)
.map(([key, value]) => `${key}=${encodeURIComponent(value!)}`)
.join("&")}`,
.join('&')}`,
resolve(data) {
resolve(data as Data);
},
+4 -4
View File
@@ -1,11 +1,11 @@
import { assertSecret } from "../blitzkit";
import type { BlitzGlossary } from "../types";
import { assertSecret } from '../blitzkit';
import { BlitzGlossary } from '../types';
export async function fetchGlossary(locale: string) {
const response = await fetch(
`${assertSecret(
import.meta.env.WOTB_GLOSSARY_DOMAIN
)}/${locale}${assertSecret(import.meta.env.WOTB_GLOSSARY_PATH)}`
import.meta.env.WOTB_GLOSSARY_DOMAIN,
)}/${locale}${assertSecret(import.meta.env.WOTB_GLOSSARY_PATH)}`,
);
return (await response.json()) as BlitzGlossary;
}
+8 -8
View File
@@ -1,14 +1,14 @@
import { type BlitzStats, calculateWN8 } from "../statistics";
import { BlitzStats, calculateWN8 } from '@blitzkit/core';
export type Stat = keyof ReturnType<typeof generateStats>;
export const STAT_NAMES: Record<Stat, string> = {
battles: "Battles",
winrate: "Winrate",
wn8: "WN8",
averageDamage: "Damage",
damage: "Accumulated damage",
wins: "Wins",
battles: 'Battles',
winrate: 'Winrate',
wn8: 'WN8',
averageDamage: 'Damage',
damage: 'Accumulated damage',
wins: 'Wins',
};
export const STAT_KEYS = Object.keys(STAT_NAMES) as Stat[];
@@ -29,7 +29,7 @@ export function prettifyStats(s: ReturnType<typeof generateStats>) {
battles: `${s.battles}`,
wins: `${s.wins}`,
winrate: `${(s.winrate * 100).toFixed(0)}%`,
wn8: s.wn8 ? s.wn8.toFixed(0) : "--",
wn8: s.wn8 ? s.wn8.toFixed(0) : '--',
damage: `${s.damage}`,
averageDamage: s.averageDamage.toFixed(0),
} satisfies Record<Stat, string>;
@@ -1,6 +1,5 @@
import { fetchBlitz } from "./fetchBlitz";
import { normalizeIds } from "./normalizeIds";
import type { Region } from "./regions";
import { fetchBlitz, Region } from '@blitzkit/core';
import { normalizeIds } from './normalizeIds';
interface IndividualAccountAchievements {
achievements: {
@@ -23,11 +22,11 @@ export async function getAccountAchievements<
>(region: Region, ids: Ids) {
const object = await fetchBlitz<AccountAchievements>(
region,
"account/achievements",
{ account_id: normalizeIds(ids) }
'account/achievements',
{ account_id: normalizeIds(ids) },
);
if (typeof ids === "number") {
if (typeof ids === 'number') {
return object[ids as number] as ReturnType;
} else {
return ids.map((id) => object[id]) as ReturnType;
Loaded 100 of 318 files, more files were not shown because too many files have changed in this diff. Show more