mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
Compare commits
4
Commits
953570461c
...
5bda754b6e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bda754b6e | ||
|
|
c5bb537bf2 | ||
|
|
c59779bedb | ||
|
|
5059e382b3 |
No files matched your search
@@ -1,55 +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 }}
|
||||
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 }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
- run: bun run setup
|
||||
|
||||
- name: Build averages
|
||||
env:
|
||||
PUBLIC_ASSET_BRANCH: main
|
||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
||||
|
||||
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,38 +0,0 @@
|
||||
name: Reviews
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: 0 0 * * 2
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
DISCORD_TOKEN: ${{ secrets.DISCORD_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:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
- run: bun run setup
|
||||
|
||||
- name: Find reviews
|
||||
run: bun run build:reviews
|
||||
@@ -31,10 +31,8 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
PUBLIC_ENVIRONMENT: ${{ inputs.environment || 'beta' }}
|
||||
|
||||
# blitzkit
|
||||
PUBLIC_BRANCH: main
|
||||
PUBLIC_ENVIRONMENT: ${{ inputs.environment || 'beta' }}
|
||||
PUBLIC_PROMOTE_OPENTEST: false
|
||||
PUBLIC_STATIC_ASSET_BASE: https://assets.blitzkit.app
|
||||
PUBLIC_GUIDE_WEBSITE: https://guidesblitz.com
|
||||
|
||||
@@ -35,7 +35,6 @@ If you intend to contribute to the code, note that you may need to check out sen
|
||||
| `GOOGLE_APPLICATION_CREDENTIALS` | [Google Cloud](https://cloud.google.com/) | | Google Cloud's API key, primarily used for ranking popular tanks and finding relevant tank review videos in Tankopedia. |
|
||||
| `PUBLIC_DISCORD_SERVER_ID` | [BlitzKit Discord Server](https://discord.gg/nDt7AjGJQH) | `734786591205359697` | BlitzKit Discord Server's id. |
|
||||
| `PUBLIC_ASSET_BASE` | [blitzkit/assets](https://github.com/blitzkit/assets) | `https://blitzkit.github.io/assets` | The root domain and path that serves the external assets like tank models and icons. |
|
||||
| `PUBLIC_BRANCH` | | `main` | The branch that the website is operating on. This is completely nominal. |
|
||||
| `PUBLIC_GUIDE_WEBSITE` | [GuidesBlitz](https://guidesblitz.com/) | `https://guidesblitz.com` | The website that serves the encyclopedia-like content in BlitzKit. |
|
||||
| `SERVICING` | | `false` | Wether the website is down for servicing. |
|
||||
| `GH_TOKEN` | [GitHub Fine-Grained Tokens](https://github.com/settings/personal-access-tokens) | | The GitHub API key used for checking out private submodules and pushing content to the asset repository. |
|
||||
|
||||
@@ -43,10 +43,11 @@
|
||||
},
|
||||
|
||||
"branches": {
|
||||
"local": "dev",
|
||||
"dev": "beta",
|
||||
"opentest": "opentest",
|
||||
"preview": "preview"
|
||||
"beta": "Beta",
|
||||
"development": "Development",
|
||||
"opentest": "OpenTest",
|
||||
"preview": "Preview",
|
||||
"production": "Production"
|
||||
},
|
||||
|
||||
"locales": {
|
||||
|
||||
@@ -12,7 +12,7 @@ export interface Props {
|
||||
}
|
||||
|
||||
const gameDefinitions = await api.gameDefinitions();
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||
const environment = assertSecret(import.meta.env.PUBLIC_ENVIRONMENT);
|
||||
const { locale } = Astro.props;
|
||||
const strings = getStrings(locale);
|
||||
---
|
||||
@@ -135,7 +135,7 @@ const strings = getStrings(locale);
|
||||
<Flex direction="column" gap="1" flexGrow="1" flexBasis="0" align="end">
|
||||
<Text size="2" color="gray">BlitzKit</Text>
|
||||
{
|
||||
PUBLIC_ASSET_BRANCH !== "preview" && (
|
||||
environment !== "preview" && (
|
||||
<Text size="2" color="gray">
|
||||
WoTB
|
||||
</Text>
|
||||
@@ -149,14 +149,14 @@ const strings = getStrings(locale);
|
||||
{packageJson.version}
|
||||
</Code>
|
||||
{
|
||||
PUBLIC_ASSET_BRANCH !== "preview" && (
|
||||
environment !== "preview" && (
|
||||
<Code size="2" color="gray">
|
||||
{gameDefinitions.version}
|
||||
</Code>
|
||||
)
|
||||
}
|
||||
<Code size="2" color="gray">
|
||||
{PUBLIC_ASSET_BRANCH}
|
||||
{environment}
|
||||
</Code>
|
||||
</Flex>
|
||||
</Flex>
|
||||
@@ -168,7 +168,7 @@ const strings = getStrings(locale);
|
||||
</Code>
|
||||
|
||||
{
|
||||
PUBLIC_ASSET_BRANCH !== "preview" && (
|
||||
environment !== "preview" && (
|
||||
<>
|
||||
<Text size="2" color="gray">
|
||||
WoTB
|
||||
@@ -182,7 +182,7 @@ const strings = getStrings(locale);
|
||||
|
||||
<Text size="2" color="gray">CDN</Text>
|
||||
<Code size="2" color="gray">
|
||||
{PUBLIC_ASSET_BRANCH}
|
||||
{environment}
|
||||
</Code>
|
||||
</Flex>
|
||||
</Flex>
|
||||
@@ -1,3 +1,4 @@
|
||||
import { alias } from "@blitzkit/core";
|
||||
import { ClockIcon, ReloadIcon } from "@radix-ui/react-icons";
|
||||
import { Flex, Text } from "@radix-ui/themes";
|
||||
import { api } from "../../core/blitzkit/api";
|
||||
@@ -28,7 +29,7 @@ export function ConsumableButton({
|
||||
<GenericTankComponentButton
|
||||
style={{ width: "6rem" }}
|
||||
tooltip={unwrap(consumableDefinitions.consumables[consumable].name!)}
|
||||
icon={`/api/icons/consumables/${consumable}.webp`}
|
||||
icon={alias("api", `/icons/consumables/${consumable}.webp`)}
|
||||
{...props}
|
||||
>
|
||||
{(cooldown || duration) && (
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { alias } from "@blitzkit/core";
|
||||
import { api } from "../../core/blitzkit/api";
|
||||
import { useLocale } from "../../hooks/useLocale";
|
||||
import { GenericTankComponentButton } from "./GenericTankComponentButton";
|
||||
@@ -15,7 +16,7 @@ export function EquipmentButton({ equipment, ...props }: EquipmentButtonProps) {
|
||||
return (
|
||||
<GenericTankComponentButton
|
||||
tooltip={unwrap(equipmentDefinitions.equipments[equipment].name!)}
|
||||
icon={`/api/icons/equipment/${equipment}.webp`}
|
||||
icon={alias("api", `/icons/equipment/${equipment}.webp`)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Button, Code, Flex, Link, Text } from "@radix-ui/themes";
|
||||
export function Plugs() {
|
||||
const promoteOpentest =
|
||||
assertSecret(import.meta.env.PUBLIC_PROMOTE_OPENTEST) === "true" &&
|
||||
assertSecret(import.meta.env.PUBLIC_BRANCH) !== "opentest";
|
||||
assertSecret(import.meta.env.PUBLIC_ENVIRONMENT) !== "opentest";
|
||||
const promotions = [promoteOpentest];
|
||||
|
||||
if (promotions.every((promotion) => !promotion)) return null;
|
||||
|
||||
@@ -1070,8 +1070,10 @@ function GameModeAbilitiesFilter() {
|
||||
: rawPowers;
|
||||
|
||||
const icons = [
|
||||
...abilities.map((ability) => `api/icons/consumables/${ability}.webp`),
|
||||
...powers.map((power) => `api/icons/provisions/${power}.webp`),
|
||||
...abilities.map((ability) =>
|
||||
alias("api", `/icons/consumables/${ability}.webp`),
|
||||
),
|
||||
...powers.map((power) => alias("api", `/icons/provisions/${power}.webp`)),
|
||||
];
|
||||
|
||||
return (
|
||||
|
||||
@@ -15,7 +15,7 @@ const tankDefinitions = await api.tankDefinitions();
|
||||
export function CalloutsSection() {
|
||||
const tank = Duel.use((state) => state.protagonist.tank);
|
||||
const promoteAeson =
|
||||
assertSecret(import.meta.env.PUBLIC_BRANCH) === "preview";
|
||||
assertSecret(import.meta.env.PUBLIC_ENVIRONMENT) === "preview";
|
||||
|
||||
useEffect(() => {
|
||||
TankopediaPersistent.mutate((draft) => {
|
||||
|
||||
@@ -3,19 +3,12 @@ import { STRINGS } from "@blitzkit/i18n";
|
||||
import locales from "@blitzkit/i18n/locales.json";
|
||||
|
||||
export function resolveBranchName(locale: string = locales.default) {
|
||||
if (!(locale in STRINGS)) throw new Error(`Unsupported locale: ${locale}`);
|
||||
|
||||
const strings = STRINGS[locale];
|
||||
const secret = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||
const environment = assertSecret(import.meta.env.PUBLIC_ENVIRONMENT);
|
||||
|
||||
if (
|
||||
assertSecret(import.meta.env.MODE) === "development" &&
|
||||
secret === "dev"
|
||||
) {
|
||||
return strings.common.branches.local;
|
||||
} else {
|
||||
return (strings.common.branches as Record<string, string>)[secret] as
|
||||
| string
|
||||
| undefined;
|
||||
}
|
||||
if (environment === "production") return undefined;
|
||||
|
||||
return strings.common.branches[
|
||||
environment as keyof typeof strings.common.branches
|
||||
];
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
import { alias } from "@blitzkit/core";
|
||||
import { useLoader } from "@react-three/fiber";
|
||||
import { GLTFLoader } from "three-stdlib";
|
||||
import { useDispose } from "./useDispose";
|
||||
|
||||
export function useArmor(id: number) {
|
||||
const path = `/api/tanks/${id}/collision.glb`;
|
||||
const path = alias("api", `/tanks/${id}/collision.glb`);
|
||||
const gltf = useLoader(GLTFLoader, path);
|
||||
|
||||
useDispose(gltf, path);
|
||||
|
||||
@@ -26,6 +26,8 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("Shell paths", paths);
|
||||
|
||||
return paths;
|
||||
});
|
||||
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
---
|
||||
import { DiscordLogoIcon, HomeIcon } from "@radix-ui/react-icons";
|
||||
import { Button, Flex, Heading, Link, Text } from "@radix-ui/themes";
|
||||
import { LinkI18n } from "../components/LinkI18n";
|
||||
import { PageWrapper } from "../components/PageWrapper";
|
||||
import BaseLayout from "../layouts/BaseLayout.astro";
|
||||
import { LinkI18n } from "../../components/LinkI18n";
|
||||
import { PageWrapper } from "../../components/PageWrapper";
|
||||
import BaseLayout from "../../layouts/BaseLayout.astro";
|
||||
|
||||
const { locale } = Astro.props;
|
||||
---
|
||||
@@ -16,7 +16,7 @@ import { getStaticPaths as _getStaticPaths } from "../_index";
|
||||
|
||||
const MAX_TOOLS_PER_ROW = 2;
|
||||
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||
const environment = assertSecret(import.meta.env.PUBLIC_ENVIRONMENT);
|
||||
const { locale } = Astro.props;
|
||||
const strings = getStrings(locale);
|
||||
const rows: Tool[][] = [];
|
||||
@@ -88,7 +88,7 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => {
|
||||
<Plugs client:idle />
|
||||
|
||||
{
|
||||
PUBLIC_ASSET_BRANCH === "preview" && (
|
||||
environment === "preview" && (
|
||||
<Flex justify="center" my="8" px="4">
|
||||
<AesonPlug />
|
||||
</Flex>
|
||||
|
||||
Reference in new issue
Block a user