From ad0c8b34314c3d8bfdd99b93896cf690c1ae956c Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 8 Nov 2026 18:38:46 -0600 Subject: [PATCH] open source WOTB_GLOSSARY --- .github/workflows/website.yaml | 5 ----- packages/core/src/blitz/fetchGlossary.ts | 8 ++++---- .../[...chunk_api]/icons/currencies/[id].webp.ts | 11 +++++++++-- packages/website/template.env | 5 ----- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/website.yaml b/.github/workflows/website.yaml index 70dbf2a7a..d8ff5ed3e 100644 --- a/.github/workflows/website.yaml +++ b/.github/workflows/website.yaml @@ -82,11 +82,6 @@ env: PUBLIC_STATIC_ASSET_BASE: https://assets.blitzkit.app PUBLIC_GUIDE_WEBSITE: https://guidesblitz.com - # blitz - WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }} - WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }} - WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }} - # google PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }} diff --git a/packages/core/src/blitz/fetchGlossary.ts b/packages/core/src/blitz/fetchGlossary.ts index 00309ea98..049e2a0d3 100644 --- a/packages/core/src/blitz/fetchGlossary.ts +++ b/packages/core/src/blitz/fetchGlossary.ts @@ -1,11 +1,11 @@ -import { assertSecret } from "../blitzkit"; import type { BlitzGlossary } from "../types"; +export const WOTB_GLOSSARY_DOMAIN = "https://na.wotblitz.com"; +export const WOTB_GLOSSARY_PATH = "api/glossary/stuff"; + 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)}`, + `${WOTB_GLOSSARY_DOMAIN}/${locale}/${WOTB_GLOSSARY_PATH}`, ); return (await response.json()) as BlitzGlossary; } diff --git a/packages/website/src/pages/[...chunk_api]/icons/currencies/[id].webp.ts b/packages/website/src/pages/[...chunk_api]/icons/currencies/[id].webp.ts index f6581c798..525b649fa 100644 --- a/packages/website/src/pages/[...chunk_api]/icons/currencies/[id].webp.ts +++ b/packages/website/src/pages/[...chunk_api]/icons/currencies/[id].webp.ts @@ -1,4 +1,9 @@ -import { assertSecret, type BlitzGlossary } from "@blitzkit/core"; +import { + WOTB_GLOSSARY_DOMAIN, + WOTB_GLOSSARY_PATH, + type BlitzGlossary, +} from "@blitzkit/core"; +import locales from "@blitzkit/i18n/locales.json"; import type { APIContext, GetStaticPathsItem } from "astro"; import sharp from "sharp"; import { mixStaticPaths } from "../../../../core/blitzkit/mixStaticPaths"; @@ -30,7 +35,9 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => { }); } - const glossary = await fetch(assertSecret(import.meta.env.WOTB_GLOSSARY)) + const glossary = await fetch( + `${WOTB_GLOSSARY_DOMAIN}/${locales.default}/${WOTB_GLOSSARY_PATH}`, + ) .then((response) => response.json() as Promise) .then((glossary) => Object.values(glossary) diff --git a/packages/website/template.env b/packages/website/template.env index e2f4d103f..1cc1dd9c3 100644 --- a/packages/website/template.env +++ b/packages/website/template.env @@ -26,10 +26,5 @@ PUBLIC_PROMOTE_OPENTEST=false # Legacy variable; this will be removed soon PUBLIC_STATIC_ASSET_BASE=https://assets.blitzkit.app -# Proprietary Wargaming fields; you shouldn't need these for 99% of the tasks -WOTB_GLOSSARY= -WOTB_GLOSSARY_DOMAIN= -WOTB_GLOSSARY_PATH= - # Generate your own application id: https://developers.wargaming.net PUBLIC_WARGAMING_APPLICATION_ID= \ No newline at end of file