mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-26 20:19:50 +01:00
feat: prep builder
This commit is contained in:
1 parent
8373fb1b7a
commit
8c14c3d093
20 files changed
+45
-422
No files matched your search
@@ -1,152 +0,0 @@
|
|||||||
name: Build Assets
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: main
|
|
||||||
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
cdn_branch:
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
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 * * *'
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
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.ASSET_BOT }}
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
VIDEOS_SHEET: ${{ secrets.VIDEOS_SHEET }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
|
||||||
WOTB_DLC_CDN: ${{ secrets.WOTB_DLC_CDN }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
PUBLIC_ASSET_BRANCH: ${{ github.event.inputs.cdn_branch || secrets.PUBLIC_ASSET_BRANCH }}
|
|
||||||
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
|
||||||
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
|
||||||
ALLOW_ROBOTS: true
|
|
||||||
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
|
||||||
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
|
||||||
PUBLIC_PATREON_CLIENT_ID: ${{ secrets.PUBLIC_PATREON_CLIENT_ID }}
|
|
||||||
PUBLIC_PATREON_REDIRECT_URI: ${{ secrets.PUBLIC_PATREON_REDIRECT_URI }}
|
|
||||||
PATREON_CLIENT_SECRET: ${{ secrets.PATREON_CLIENT_SECRET }}
|
|
||||||
PUBLIC_NITROPAY_ID: ${{ secrets.PUBLIC_NITROPAY_ID }}
|
|
||||||
PUBLIC_DEBUG_MISSING_I18N: false
|
|
||||||
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
|
||||||
|
|
||||||
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 }}
|
|
||||||
|
|
||||||
- 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:
|
|
||||||
name: depots
|
|
||||||
path: depots
|
|
||||||
|
|
||||||
- name: AppArmor hack
|
|
||||||
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
|
|
||||||
|
|
||||||
- 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
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
name: Averages
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 8 * * *'
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
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 }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: oven-sh/setup-bun@v1
|
|
||||||
|
|
||||||
- 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 }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
run: bun run build:averages --production
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
name: Discover IDs
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 * * 1'
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
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 }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: oven-sh/setup-bun@v1
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: bun install
|
|
||||||
|
|
||||||
- name: Discover IDs
|
|
||||||
run: bun build:ids --production
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
name: Rating Asia
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 17 * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
host:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: oven-sh/setup-bun@v1
|
|
||||||
|
|
||||||
- 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 }}
|
|
||||||
run: bun build:ratingleaderboard --region=asia
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
name: Rating Europe
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 23 * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
host:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: oven-sh/setup-bun@v1
|
|
||||||
|
|
||||||
- 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 }}
|
|
||||||
run: bun build:ratingleaderboard --region=eu
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
name: Rating North America
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
host:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: oven-sh/setup-bun@v1
|
|
||||||
|
|
||||||
- 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 }}
|
|
||||||
run: bun build:ratingleaderboard --region=com
|
|
||||||
@@ -17,20 +17,9 @@ concurrency:
|
|||||||
cancel-in-progress: ${{ github.ref == 'refs/heads/main' }}
|
cancel-in-progress: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
AUTO_PROXY_ORIGIN: ${{ secrets.AUTO_PROXY_ORIGIN }}
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
|
|
||||||
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_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
||||||
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_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_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "blitzkit",
|
"name": "blitzkit",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.27.11",
|
"version": "1.28.0-beta.1",
|
||||||
"description": "🎉 Tools for everything World of Tanks Blitz",
|
"description": "🎉 Tools for everything World of Tanks Blitz",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"types": "./types.d.ts",
|
"types": "./types.d.ts",
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
"build:assets": "cd packages/scripts && bun run build:assets",
|
"build:assets": "cd packages/scripts && bun run build:assets",
|
||||||
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
|
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
|
||||||
"build:bot": "cd packages/scripts && bun run build:bot",
|
"build:bot": "cd packages/scripts && bun run build:bot",
|
||||||
"build:website": "bun build:prisma --no-hints && cd packages/website && bun run build",
|
"build:website": "bun build:prisma --no-hints && cd packages/website-ue && bun run build",
|
||||||
"build:prisma": "prisma generate",
|
"build:prisma": "prisma generate",
|
||||||
"build:sitemap": "bun scripts/sitemap.ts",
|
"build:sitemap": "bun scripts/sitemap.ts",
|
||||||
"build:docs": "vitepress build docs",
|
"build:docs": "vitepress build docs",
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import { assertSecret } from './assertSecret';
|
import { assertSecret } from './assertSecret';
|
||||||
|
|
||||||
const repo = assertSecret(import.meta.env.PUBLIC_ASSET_REPO);
|
|
||||||
const branch = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
|
||||||
const fastUser = assertSecret(import.meta.env.PUBLIC_ASSET_FAST_USER);
|
|
||||||
const fastRepo = assertSecret(import.meta.env.PUBLIC_ASSET_FAST_REPO);
|
|
||||||
|
|
||||||
export function asset(path: string) {
|
export function asset(path: string) {
|
||||||
return branch === 'main'
|
return assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH) === 'main'
|
||||||
? `https://${fastUser}.github.io/${fastRepo}/${path}`
|
? `https://${assertSecret(
|
||||||
: `https://raw.githubusercontent.com/${repo}/${branch}/${path}`;
|
import.meta.env.PUBLIC_ASSET_FAST_USER,
|
||||||
|
)}.github.io/${assertSecret(
|
||||||
|
import.meta.env.PUBLIC_ASSET_FAST_REPO,
|
||||||
|
)}/${path}`
|
||||||
|
: `https://raw.githubusercontent.com/${assertSecret(
|
||||||
|
import.meta.env.PUBLIC_ASSET_REPO,
|
||||||
|
)}/${assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH)}/${path}`;
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,14 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
import sitemap from '@astrojs/sitemap';
|
||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig } from 'astro/config';
|
||||||
|
|
||||||
import react from '@astrojs/react';
|
import react from '@astrojs/react';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
integrations: [react()],
|
integrations: [react(), sitemap()],
|
||||||
devToolbar: { enabled: false },
|
devToolbar: { enabled: false },
|
||||||
|
outDir: '../../dist/website',
|
||||||
|
|
||||||
|
prefetch: true,
|
||||||
site: 'https://blitzkit.app',
|
site: 'https://blitzkit.app',
|
||||||
});
|
});
|
||||||
@@ -5,7 +5,8 @@
|
|||||||
"dev": "astro dev",
|
"dev": "astro dev",
|
||||||
"build": "astro build",
|
"build": "astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"astro": "astro"
|
"astro": "astro",
|
||||||
|
"lint": "astro check"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/partytown": "^2.1.4",
|
"@astrojs/partytown": "^2.1.4",
|
||||||
@@ -23,6 +24,7 @@
|
|||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/react": "^19.1.5",
|
"@types/react": "^19.1.5",
|
||||||
"@types/react-dom": "^19.1.5",
|
"@types/react-dom": "^19.1.5",
|
||||||
|
"@types/semver": "^7.7.0",
|
||||||
"@types/three": "^0.160.0",
|
"@types/three": "^0.160.0",
|
||||||
"astro": "^5.8.0",
|
"astro": "^5.8.0",
|
||||||
"immer": "^10.1.1",
|
"immer": "^10.1.1",
|
||||||
@@ -31,6 +33,7 @@
|
|||||||
"minimatch": "^10.0.1",
|
"minimatch": "^10.0.1",
|
||||||
"react": "^19.1.0",
|
"react": "^19.1.0",
|
||||||
"react-dom": "^19.1.0",
|
"react-dom": "^19.1.0",
|
||||||
|
"semver": "^7.7.2",
|
||||||
"three": "^0.169.0",
|
"three": "^0.169.0",
|
||||||
"zustand": "^4.5.5"
|
"zustand": "^4.5.5"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export function Checks({ localeData }: LocaleAcceptorProps) {
|
|||||||
* Wargaming: 14 (refresh: 7)
|
* Wargaming: 14 (refresh: 7)
|
||||||
*/
|
*/
|
||||||
function Content() {
|
function Content() {
|
||||||
const localeData = useLocale();
|
const { locale } = useLocale();
|
||||||
const logins = App.use((state) => state.logins);
|
const logins = App.use((state) => state.logins);
|
||||||
const mutateApp = App.useMutation();
|
const mutateApp = App.useMutation();
|
||||||
const appStore = App.useStore();
|
const appStore = App.useStore();
|
||||||
@@ -128,17 +128,11 @@ function Content() {
|
|||||||
<Text>
|
<Text>
|
||||||
This website utilizes cookies to perform analytics and personalize
|
This website utilizes cookies to perform analytics and personalize
|
||||||
your experience. You can learn more through{' '}
|
your experience. You can learn more through{' '}
|
||||||
<LinkI18n
|
<LinkI18n locale={locale} href="/docs/legal/privacy-policy">
|
||||||
localeData={localeData}
|
|
||||||
href="/docs/legal/privacy-policy"
|
|
||||||
>
|
|
||||||
our privacy policy
|
our privacy policy
|
||||||
</LinkI18n>
|
</LinkI18n>
|
||||||
. By using BlitzKit, you also agree to our{' '}
|
. By using BlitzKit, you also agree to our{' '}
|
||||||
<LinkI18n
|
<LinkI18n locale={locale} href="/docs/legal/terms-of-service">
|
||||||
localeData={localeData}
|
|
||||||
href="/docs/legal/terms-of-service"
|
|
||||||
>
|
|
||||||
terms of service
|
terms of service
|
||||||
</LinkI18n>
|
</LinkI18n>
|
||||||
.
|
.
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
---
|
---
|
||||||
import { assertSecret, fetchGameDefinitions } from '@blitzkit/core';
|
|
||||||
import { Box, Code, Flex, Heading, Link, Text } from '@radix-ui/themes';
|
import { Box, Code, Flex, Heading, Link, Text } from '@radix-ui/themes';
|
||||||
import packageJson from '../../../../package.json';
|
import packageJson from '../../../../package.json';
|
||||||
import { getStrings } from '../core/i18n/getStrings';
|
import { getStrings } from '../core/i18n/getStrings';
|
||||||
@@ -10,8 +9,6 @@ interface Props {
|
|||||||
locale: string;
|
locale: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const gameDefinitions = await fetchGameDefinitions();
|
|
||||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
|
||||||
const { locale } = Astro.props;
|
const { locale } = Astro.props;
|
||||||
const localeData = { locale };
|
const localeData = { locale };
|
||||||
const strings = await getStrings(locale);
|
const strings = await getStrings(locale);
|
||||||
@@ -83,7 +80,7 @@ const strings = await getStrings(locale);
|
|||||||
sm: 'start',
|
sm: 'start',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<LinkI18n {localeData} href="/docs/about/credits" color="gray">
|
<LinkI18n {locale} href="/docs/about/credits" color="gray">
|
||||||
{strings.website.footer.about.credits}
|
{strings.website.footer.about.credits}
|
||||||
</LinkI18n>
|
</LinkI18n>
|
||||||
<Link
|
<Link
|
||||||
@@ -100,7 +97,7 @@ const strings = await getStrings(locale);
|
|||||||
>
|
>
|
||||||
{strings.website.footer.about.github}
|
{strings.website.footer.about.github}
|
||||||
</Link>
|
</Link>
|
||||||
<LinkI18n {localeData} href="/docs/patches" color="gray">
|
<LinkI18n {locale} href="/docs/patches" color="gray">
|
||||||
{strings.website.footer.about.patches}
|
{strings.website.footer.about.patches}
|
||||||
</LinkI18n>
|
</LinkI18n>
|
||||||
</Flex>
|
</Flex>
|
||||||
@@ -120,14 +117,10 @@ const strings = await getStrings(locale);
|
|||||||
>
|
>
|
||||||
<Heading size="3">{strings.website.footer.legal.title}</Heading>
|
<Heading size="3">{strings.website.footer.legal.title}</Heading>
|
||||||
<Flex direction="column">
|
<Flex direction="column">
|
||||||
<LinkI18n {localeData} href="/docs/legal/privacy-policy" color="gray">
|
<LinkI18n {locale} href="/docs/legal/privacy-policy" color="gray">
|
||||||
{strings.website.footer.legal.privacy}
|
{strings.website.footer.legal.privacy}
|
||||||
</LinkI18n>
|
</LinkI18n>
|
||||||
<LinkI18n
|
<LinkI18n {locale} href="/docs/legal/terms-of-service" color="gray">
|
||||||
{localeData}
|
|
||||||
href="/docs/legal/terms-of-service"
|
|
||||||
color="gray"
|
|
||||||
>
|
|
||||||
{strings.website.footer.legal.terms}
|
{strings.website.footer.legal.terms}
|
||||||
</LinkI18n>
|
</LinkI18n>
|
||||||
</Flex>
|
</Flex>
|
||||||
@@ -138,30 +131,12 @@ const strings = await getStrings(locale);
|
|||||||
<Flex gap="5" display={{ initial: 'flex', sm: 'none' }}>
|
<Flex gap="5" display={{ initial: 'flex', sm: 'none' }}>
|
||||||
<Flex direction="column" justify="between" align="end">
|
<Flex direction="column" justify="between" align="end">
|
||||||
<Text size="2" color="gray">BlitzKit</Text>
|
<Text size="2" color="gray">BlitzKit</Text>
|
||||||
{
|
|
||||||
PUBLIC_ASSET_BRANCH !== 'preview' && (
|
|
||||||
<Text size="2" color="gray">
|
|
||||||
WoTB
|
|
||||||
</Text>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
<Text size="2" color="gray">CDN</Text>
|
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex direction="column" justify="between" align="start">
|
<Flex direction="column" justify="between" align="start">
|
||||||
<Code size="2" color="gray">
|
<Code size="2" color="gray">
|
||||||
{packageJson.version}
|
{packageJson.version}
|
||||||
</Code>
|
</Code>
|
||||||
{
|
|
||||||
PUBLIC_ASSET_BRANCH !== 'preview' && (
|
|
||||||
<Code size="2" color="gray">
|
|
||||||
{gameDefinitions.version}
|
|
||||||
</Code>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
<Code size="2" color="gray">
|
|
||||||
{PUBLIC_ASSET_BRANCH}
|
|
||||||
</Code>
|
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
@@ -170,23 +145,5 @@ const strings = await getStrings(locale);
|
|||||||
<Code size="2" color="gray">
|
<Code size="2" color="gray">
|
||||||
{packageJson.version}
|
{packageJson.version}
|
||||||
</Code>
|
</Code>
|
||||||
|
|
||||||
{
|
|
||||||
PUBLIC_ASSET_BRANCH !== 'preview' && (
|
|
||||||
<>
|
|
||||||
<Text size="2" color="gray">
|
|
||||||
WoTB
|
|
||||||
</Text>
|
|
||||||
<Code size="2" color="gray">
|
|
||||||
{gameDefinitions.version}
|
|
||||||
</Code>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
<Text size="2" color="gray">CDN</Text>
|
|
||||||
<Code size="2" color="gray">
|
|
||||||
{PUBLIC_ASSET_BRANCH}
|
|
||||||
</Code>
|
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
@@ -1,14 +1,12 @@
|
|||||||
import locales from '@blitzkit/i18n/locales.json' with { type: 'json' };
|
import locales from '@blitzkit/i18n/locales.json' with { type: 'json' };
|
||||||
import { Link, type LinkProps } from '@radix-ui/themes';
|
import { Link, type LinkProps } from '@radix-ui/themes';
|
||||||
import type { LocaleAcceptorProps } from '../hooks/useLocale';
|
|
||||||
|
|
||||||
export function LinkI18n({
|
export function LinkI18n({
|
||||||
localeData,
|
locale,
|
||||||
href,
|
href,
|
||||||
...props
|
...props
|
||||||
}: LinkProps & LocaleAcceptorProps) {
|
}: LinkProps & { locale: string }) {
|
||||||
const prefix =
|
const prefix = locale === locales.default ? '' : `/${locale}`;
|
||||||
localeData.locale === locales.default ? '' : `/${localeData.locale}`;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link href={href?.startsWith('/') ? `${prefix}${href}` : href} {...props} />
|
<Link href={href?.startsWith('/') ? `${prefix}${href}` : href} {...props} />
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ export interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { integrated, locale } = Astro.props;
|
const { integrated, locale } = Astro.props;
|
||||||
const localeData = { locale };
|
|
||||||
const toolsFiltered = tools.filter((tool) => tool.enabled);
|
const toolsFiltered = tools.filter((tool) => tool.enabled);
|
||||||
const branchName = resolveBranchName();
|
const branchName = resolveBranchName();
|
||||||
const isBranchNamed = branchName !== undefined;
|
const isBranchNamed = branchName !== undefined;
|
||||||
@@ -107,7 +106,7 @@ const strings = await getStrings(locale);
|
|||||||
<Flex gap="4" direction="column" maxWidth="80rem" width="100%">
|
<Flex gap="4" direction="column" maxWidth="80rem" width="100%">
|
||||||
<Flex align="center">
|
<Flex align="center">
|
||||||
<LinkI18n
|
<LinkI18n
|
||||||
{localeData}
|
{locale}
|
||||||
color="gray"
|
color="gray"
|
||||||
highContrast
|
highContrast
|
||||||
href="/"
|
href="/"
|
||||||
@@ -146,7 +145,7 @@ const strings = await getStrings(locale);
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<LinkI18n
|
<LinkI18n
|
||||||
{localeData}
|
{locale}
|
||||||
weight={selected ? 'medium' : 'regular'}
|
weight={selected ? 'medium' : 'regular'}
|
||||||
color="gray"
|
color="gray"
|
||||||
highContrast={selected}
|
highContrast={selected}
|
||||||
@@ -175,7 +174,7 @@ const strings = await getStrings(locale);
|
|||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<LinkI18n
|
<LinkI18n
|
||||||
{localeData}
|
{locale}
|
||||||
style={{ display: 'flex', alignContent: 'center' }}
|
style={{ display: 'flex', alignContent: 'center' }}
|
||||||
color="gray"
|
color="gray"
|
||||||
href="/settings"
|
href="/settings"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
import { assertSecret } from '@blitzkit/core';
|
|
||||||
import { CaretRightIcon } from '@radix-ui/react-icons';
|
import { CaretRightIcon } from '@radix-ui/react-icons';
|
||||||
import { Box, Button, Code, Flex, Heading, Text } from '@radix-ui/themes';
|
import { Box, Button, Flex, Heading, Text } from '@radix-ui/themes';
|
||||||
import type { Tool } from '../constants/tools';
|
import type { Tool } from '../constants/tools';
|
||||||
import { getStrings } from '../core/i18n/getStrings';
|
import { getStrings } from '../core/i18n/getStrings';
|
||||||
import { LinkI18n } from './LinkI18n';
|
import { LinkI18n } from './LinkI18n';
|
||||||
@@ -102,16 +101,7 @@ const toolStrings =
|
|||||||
size={{ initial: '3', sm: tool.significant ? '4' : '3' }}
|
size={{ initial: '3', sm: tool.significant ? '4' : '3' }}
|
||||||
color="gray"
|
color="gray"
|
||||||
>
|
>
|
||||||
{
|
{toolStrings.description}
|
||||||
disabled ? (
|
|
||||||
<>
|
|
||||||
Unavailable on{' '}
|
|
||||||
<Code>{assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH)}</Code>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
toolStrings.description
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</Text>
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import { assertSecret } from 'packages/core/src';
|
import { prerelease } from 'semver';
|
||||||
|
import packageJSON from '../../../../../package.json';
|
||||||
|
|
||||||
export function resolveBranchName() {
|
export function resolveBranchName() {
|
||||||
if (assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH) === 'main') {
|
const components = prerelease(packageJSON.version);
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
return import.meta.env.PUBLIC_ASSET_BRANCH;
|
if (components === null) return undefined;
|
||||||
|
|
||||||
|
return components[0];
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,6 @@ import { PageWrapper } from '../components/PageWrapper';
|
|||||||
import BaseLayout from '../layouts/BaseLayout.astro';
|
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||||
|
|
||||||
const locale = locales.default;
|
const locale = locales.default;
|
||||||
const localeData = { locale };
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout {locale}>
|
<BaseLayout {locale}>
|
||||||
@@ -16,7 +15,7 @@ const localeData = { locale };
|
|||||||
<Text color="gray">Where would you like to go?</Text>
|
<Text color="gray">Where would you like to go?</Text>
|
||||||
|
|
||||||
<Flex mt="4" gap="2">
|
<Flex mt="4" gap="2">
|
||||||
<LinkI18n {localeData} href="/">
|
<LinkI18n {locale} href="/">
|
||||||
<Button>
|
<Button>
|
||||||
<HomeIcon /> Home
|
<HomeIcon /> Home
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export function Page({ localeData }: LocaleAcceptorProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Content() {
|
function Content() {
|
||||||
const { gameStrings, strings } = useLocale();
|
const { gameStrings } = useLocale();
|
||||||
const groups = useMemo(() => {
|
const groups = useMemo(() => {
|
||||||
const avatars = allAvatars
|
const avatars = allAvatars
|
||||||
.map((id) => {
|
.map((id) => {
|
||||||
|
|||||||
Reference in new issue
Block a user