fix: script imports

This commit is contained in:
TrèsAbhi committed 2025-10-13 22:26:11 -05:00
1 parent 2c55455cd7
commit 49b5d4f7dc
6 files changed
+301 -284

No files matched your search

+16 -4
View File
@@ -92,21 +92,25 @@
"@gltf-transform/core": "^4.2.1", "@gltf-transform/core": "^4.2.1",
"@gltf-transform/extensions": "^4.2.1", "@gltf-transform/extensions": "^4.2.1",
"@gltf-transform/functions": "^4.2.1", "@gltf-transform/functions": "^4.2.1",
"@types/bun": "^1.3.0",
"@types/decompress": "^4.2.7",
"@types/lodash-es": "^4.17.12",
"@types/lz4js": "^0.2.1", "@types/lz4js": "^0.2.1",
"@types/progress": "^2.0.7",
"@types/three": "^0.180.0",
"crc": "^4.3.2", "crc": "^4.3.2",
"csv-parse": "^6.1.0", "csv-parse": "^6.1.0",
"decompress": "^4.2.1", "decompress": "^4.2.1",
"dotenv": "^17.2.3",
"esbuild": "^0.25.10", "esbuild": "^0.25.10",
"fast-xml-parser": "^5.2.5", "fast-xml-parser": "^5.2.5",
"lodash-es": "^4.17.21",
"lz4js": "^0.2.0", "lz4js": "^0.2.0",
"progress": "^2.0.3", "progress": "^2.0.3",
"puppeteer": "^24.22.3", "puppeteer": "^24.22.3",
"three": "^0.180.0",
"ts-proto": "^2.7.7", "ts-proto": "^2.7.7",
}, },
"devDependencies": {
"@types/decompress": "^4.2.7",
"@types/progress": "^2.0.7",
},
}, },
"packages/varuna": { "packages/varuna": {
"name": "varuna", "name": "varuna",
@@ -891,6 +895,8 @@
"@types/babel__traverse": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="], "@types/babel__traverse": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="],
"@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.3.0" } }, "sha512-+lAGCYjXjip2qY375xX/scJeVRmZ5cY0wyHYyCYxNcdEXrQ4AOe3gACgd4iQ8ksOslJtW4VNxBJ8llUwc3a6AA=="],
"@types/debug": ["@types/[email protected]", "", { "dependencies": { "@types/ms": "*" } }, "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ=="], "@types/debug": ["@types/[email protected]", "", { "dependencies": { "@types/ms": "*" } }, "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ=="],
"@types/decompress": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-9z+8yjKr5Wn73Pt17/ldnmQToaFHZxK0N1GHysuk/JIPT8RIdQeoInM01wWPgypRcvb6VH1drjuFpQ4zmY437g=="], "@types/decompress": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-9z+8yjKr5Wn73Pt17/ldnmQToaFHZxK0N1GHysuk/JIPT8RIdQeoInM01wWPgypRcvb6VH1drjuFpQ4zmY437g=="],
@@ -1089,6 +1095,8 @@
"buffer-from": ["[email protected]", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="], "buffer-from": ["[email protected]", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="],
"bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-u8X0thhx+yJ0KmkxuEo9HAtdfgCBaM/aI9K90VQcQioAmkVp3SG3FkwWGibUFz3WdXAdcsqOcbU40lK7tbHdkQ=="],
"c12": ["[email protected]", "", { "dependencies": { "chokidar": "^4.0.3", "confbox": "^0.2.2", "defu": "^6.1.4", "dotenv": "^16.6.1", "exsolve": "^1.0.7", "giget": "^2.0.0", "jiti": "^2.4.2", "ohash": "^2.0.11", "pathe": "^2.0.3", "perfect-debounce": "^1.0.0", "pkg-types": "^2.2.0", "rc9": "^2.1.2" }, "peerDependencies": { "magicast": "^0.3.5" }, "optionalPeers": ["magicast"] }, "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw=="], "c12": ["[email protected]", "", { "dependencies": { "chokidar": "^4.0.3", "confbox": "^0.2.2", "defu": "^6.1.4", "dotenv": "^16.6.1", "exsolve": "^1.0.7", "giget": "^2.0.0", "jiti": "^2.4.2", "ohash": "^2.0.11", "pathe": "^2.0.3", "perfect-debounce": "^1.0.0", "pkg-types": "^2.2.0", "rc9": "^2.1.2" }, "peerDependencies": { "magicast": "^0.3.5" }, "optionalPeers": ["magicast"] }, "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw=="],
"call-bind": ["[email protected]", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="], "call-bind": ["[email protected]", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="],
@@ -2451,6 +2459,10 @@
"@babel/preset-env/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], "@babel/preset-env/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
"@blitzkit/core/dotenv": ["[email protected]", "", {}, "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w=="],
"@blitzkit/scripts/dotenv": ["[email protected]", "", {}, "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w=="],
"@blitzkit/website/@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-ukd93VGzaNPMAUPy0gRDSC57UuQbnH9Kussp7HBjM06YFi9uZTFhOvMSO2OKqXm1rSgzOE+pVx1k1PYHGwlc8Q=="], "@blitzkit/website/@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-ukd93VGzaNPMAUPy0gRDSC57UuQbnH9Kussp7HBjM06YFi9uZTFhOvMSO2OKqXm1rSgzOE+pVx1k1PYHGwlc8Q=="],
"@blitzkit/website/react": ["[email protected]", "", {}, "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ=="], "@blitzkit/website/react": ["[email protected]", "", {}, "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ=="],
File diff suppressed because it is too large. Load diff
+27 -23
View File
@@ -1,7 +1,32 @@
{ {
"name": "@blitzkit/scripts", "name": "@blitzkit/scripts",
"dependencies": {
"@blitzkit/closed": "workspace:*",
"@blitzkit/core": "workspace:*",
"@blitzkit/i18n": "workspace:*",
"@gltf-transform/core": "^4.2.1",
"@gltf-transform/extensions": "^4.2.1",
"@gltf-transform/functions": "^4.2.1",
"@types/bun": "^1.3.0",
"@types/decompress": "^4.2.7",
"@types/lodash-es": "^4.17.12",
"@types/lz4js": "^0.2.1",
"@types/progress": "^2.0.7",
"@types/three": "^0.180.0",
"crc": "^4.3.2",
"csv-parse": "^6.1.0",
"decompress": "^4.2.1",
"dotenv": "^17.2.3",
"esbuild": "^0.25.10",
"fast-xml-parser": "^5.2.5",
"lodash-es": "^4.17.21",
"lz4js": "^0.2.0",
"progress": "^2.0.3",
"puppeteer": "^24.22.3",
"three": "^0.180.0",
"ts-proto": "^2.7.7"
},
"private": true, "private": true,
"type": "module",
"scripts": { "scripts": {
"build:assets": "bun src/buildAssets/index.ts", "build:assets": "bun src/buildAssets/index.ts",
"build:averages": "bun src/averages.ts", "build:averages": "bun src/averages.ts",
@@ -15,26 +40,5 @@
"prunestrings": "bun src/pruneStrings.ts", "prunestrings": "bun src/pruneStrings.ts",
"build:protos": "bun src/protos.ts" "build:protos": "bun src/protos.ts"
}, },
"dependencies": { "type": "module"
"@blitzkit/closed": "workspace:*",
"@blitzkit/core": "workspace:*",
"@blitzkit/i18n": "workspace:*",
"@gltf-transform/core": "^4.2.1",
"@gltf-transform/extensions": "^4.2.1",
"@gltf-transform/functions": "^4.2.1",
"@types/lz4js": "^0.2.1",
"crc": "^4.3.2",
"csv-parse": "^6.1.0",
"decompress": "^4.2.1",
"esbuild": "^0.25.10",
"fast-xml-parser": "^5.2.5",
"lz4js": "^0.2.0",
"progress": "^2.0.3",
"puppeteer": "^24.22.3",
"ts-proto": "^2.7.7"
},
"devDependencies": {
"@types/decompress": "^4.2.7",
"@types/progress": "^2.0.7"
}
} }
+23 -24
View File
@@ -1,33 +1,32 @@
import { config } from 'dotenv'; import { config } from "dotenv";
import { argv } from 'process'; import { argv } from "process";
config(); config();
const allTargets = argv.includes('--all-targets'); const allTargets = argv.includes("--all-targets");
const targets = argv const targets = argv
.find((argument) => argument.startsWith('--target')) .find((argument) => argument.startsWith("--target"))
?.split('=')[1] ?.split("=")[1]
.split(','); .split(",");
import { blitzkitTankIcons } from './blitzkitTankIcons'; import { boosterIcons } from "./boosterIcons";
import { boosterIcons } from './boosterIcons'; import { camouflageIcons } from "./camouflageIcons";
import { camouflageIcons } from './camouflageIcons'; import { consumableProvisionIcons } from "./consumableProvisionIcons";
import { consumableProvisionIcons } from './consumableProvisionIcons'; import { currencies } from "./currencies";
import { currencies } from './currencies'; import { definitions } from "./definitions";
import { definitions } from './definitions'; import { equipmentIcons } from "./equipmentIcons";
import { equipmentIcons } from './equipmentIcons'; import { flags } from "./flags";
import { flags } from './flags'; import { gameModeBanners } from "./gameModeBanners";
import { gameModeBanners } from './gameModeBanners'; import { glossary } from "./glossary";
import { glossary } from './glossary'; import { migration } from "./migration";
import { migration } from './migration'; import { moduleIcons } from "./moduleIcons";
import { moduleIcons } from './moduleIcons'; import { shellIcons } from "./shellIcons";
import { shellIcons } from './shellIcons'; import { skillIcons } from "./skillIcons";
import { skillIcons } from './skillIcons'; import { tankArmors } from "./tankArmors";
import { tankArmors } from './tankArmors'; import { tankIcons } from "./tankIcons";
import { tankIcons } from './tankIcons'; import { tankModels } from "./tankModels";
import { tankModels } from './tankModels';
if (!targets && !allTargets) throw new Error('No target(s) specified'); if (!targets && !allTargets) throw new Error("No target(s) specified");
const methods = [ const methods = [
migration, migration,
+21 -21
View File
@@ -10,18 +10,18 @@ import {
Region, Region,
REGIONS, REGIONS,
regionToRegionSubdomain, regionToRegionSubdomain,
} from '@blitzkit/core'; } from "@blitzkit/core";
import { chunk } from 'lodash'; import { chunk } from "lodash-es";
import { argv } from 'process'; import { argv } from "process";
import { commitAssets } from './core/github/commitAssets'; import { commitAssets } from "./core/github/commitAssets";
import { FileChange } from './core/github/commitMultipleFiles'; import { FileChange } from "./core/github/commitMultipleFiles";
const region = argv const region = argv
.find((arg) => arg.startsWith('--region=')) .find((arg) => arg.startsWith("--region="))
?.split('=')[1] as Region | undefined; ?.split("=")[1] as Region | undefined;
if (region === undefined || !REGIONS.includes(region)) { if (region === undefined || !REGIONS.includes(region)) {
throw new Error('No valid region specified'); throw new Error("No valid region specified");
} }
console.log(`Building rating leaderboard for ${region}`); console.log(`Building rating leaderboard for ${region}`);
@@ -29,11 +29,11 @@ console.log(`Building rating leaderboard for ${region}`);
const regionSubdomain = regionToRegionSubdomain(region); const regionSubdomain = regionToRegionSubdomain(region);
const NEIGHBORS = 2 ** 8; const NEIGHBORS = 2 ** 8;
const PLAYERS = await patientFetchJSON<RatingInfo>( const PLAYERS = await patientFetchJSON<RatingInfo>(
`https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/season/`, `https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/season/`
).then((data) => (data.detail === undefined ? data.count : undefined)); ).then((data) => (data.detail === undefined ? data.count : undefined));
if (PLAYERS === undefined) { if (PLAYERS === undefined) {
throw new Error('No current rating season running'); throw new Error("No current rating season running");
} }
const players: Record<number, RatingPlayer> = {}; const players: Record<number, RatingPlayer> = {};
@@ -43,7 +43,7 @@ let registered = 0;
async function branchFromPlayer(id: number) { async function branchFromPlayer(id: number) {
const { neighbors } = await patientFetchJSON<RatingNeighbors>( const { neighbors } = await patientFetchJSON<RatingNeighbors>(
`https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/user/${id}/?neighbors=${NEIGHBORS}`, `https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/user/${id}/?neighbors=${NEIGHBORS}`
); );
const firstPlayer = neighbors[0]; const firstPlayer = neighbors[0];
@@ -66,7 +66,7 @@ async function branchFromPlayer(id: number) {
`Registered ${registered} / ${PLAYERS} (${( `Registered ${registered} / ${PLAYERS} (${(
(registered / PLAYERS!) * (registered / PLAYERS!) *
100 100
).toFixed(2)}%)`, ).toFixed(2)}%)`
); );
await Promise.all(branches); await Promise.all(branches);
@@ -74,7 +74,7 @@ async function branchFromPlayer(id: number) {
async function branchFromLeague(id: number) { async function branchFromLeague(id: number) {
const { result } = await patientFetchJSON<{ result: RatingPlayer[] }>( const { result } = await patientFetchJSON<{ result: RatingPlayer[] }>(
`https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/league/${id}/top/`, `https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/league/${id}/top/`
); );
const firstPlayer = result[0]; const firstPlayer = result[0];
@@ -86,7 +86,7 @@ async function branchFromLeague(id: number) {
]); ]);
} }
console.log('Branching from leagues...'); console.log("Branching from leagues...");
await Promise.all([ await Promise.all([
branchFromLeague(0), branchFromLeague(0),
branchFromLeague(1), branchFromLeague(1),
@@ -95,7 +95,7 @@ await Promise.all([
branchFromLeague(4), branchFromLeague(4),
]); ]);
console.log('Converting to an array...'); console.log("Converting to an array...");
for (let index = 0; index < PLAYERS; index++) { for (let index = 0; index < PLAYERS; index++) {
const listing = players[index + 1]; const listing = players[index + 1];
if (listing) { if (listing) {
@@ -106,18 +106,18 @@ for (let index = 0; index < PLAYERS; index++) {
} }
} }
console.log('Requesting further stats...'); console.log("Requesting further stats...");
const entries: RatingLeaderboardEntryV2[] = []; const entries: RatingLeaderboardEntryV2[] = [];
let chunkIndex = 0; let chunkIndex = 0;
for (const leaderboardChunk of chunk(entriesV1, 100)) { for (const leaderboardChunk of chunk(entriesV1, 100)) {
console.log( console.log(
`Chunk ${chunkIndex + 1} of ${Math.ceil(entriesV1.length / 100)}`, `Chunk ${chunkIndex + 1} of ${Math.ceil(entriesV1.length / 100)}`
); );
const stats = await getAccountInfo( const stats = await getAccountInfo(
region, region,
leaderboardChunk.map(({ id }) => id), leaderboardChunk.map(({ id }) => id),
['statistics.rating'], ["statistics.rating"]
); );
stats.forEach((stat, index) => { stats.forEach((stat, index) => {
@@ -153,12 +153,12 @@ for (const leaderboardChunk of chunk(entriesV1, 100)) {
} }
const info = await patientFetchJSON<RatingInfo & { detail: undefined }>( const info = await patientFetchJSON<RatingInfo & { detail: undefined }>(
`https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/season/`, `https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/season/`
); );
const normalizedServer = regionSubdomain === 'na' ? 'com' : regionSubdomain; const normalizedServer = regionSubdomain === "na" ? "com" : regionSubdomain;
const content = RatingLeaderboard.encode({ const content = RatingLeaderboard.encode({
version: { $case: 'v2', value: { entries } }, version: { $case: "v2", value: { entries } },
}).finish(); }).finish();
const changes: FileChange[] = [ const changes: FileChange[] = [