mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
fix: script imports
This commit is contained in:
1 parent
2c55455cd7
commit
49b5d4f7dc
6 files changed
+301
-284
No files matched your search
@@ -92,21 +92,25 @@
|
||||
"@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",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/decompress": "^4.2.7",
|
||||
"@types/progress": "^2.0.7",
|
||||
},
|
||||
},
|
||||
"packages/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/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/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=="],
|
||||
|
||||
"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=="],
|
||||
|
||||
"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=="],
|
||||
|
||||
"@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/react": ["[email protected]", "", {}, "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ=="],
|
||||
|
||||
+1
-1
Submodule packages/closed updated: 7b5bc2d935...6c6ab9bee6.
File diff suppressed because it is too large.
Load diff
@@ -1,7 +1,32 @@
|
||||
{
|
||||
"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,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build:assets": "bun src/buildAssets/index.ts",
|
||||
"build:averages": "bun src/averages.ts",
|
||||
@@ -15,26 +40,5 @@
|
||||
"prunestrings": "bun src/pruneStrings.ts",
|
||||
"build:protos": "bun src/protos.ts"
|
||||
},
|
||||
"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/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"
|
||||
}
|
||||
"type": "module"
|
||||
}
|
||||
@@ -1,33 +1,32 @@
|
||||
import { config } from 'dotenv';
|
||||
import { argv } from 'process';
|
||||
import { config } from "dotenv";
|
||||
import { argv } from "process";
|
||||
|
||||
config();
|
||||
|
||||
const allTargets = argv.includes('--all-targets');
|
||||
const allTargets = argv.includes("--all-targets");
|
||||
const targets = argv
|
||||
.find((argument) => argument.startsWith('--target'))
|
||||
?.split('=')[1]
|
||||
.split(',');
|
||||
.find((argument) => argument.startsWith("--target"))
|
||||
?.split("=")[1]
|
||||
.split(",");
|
||||
|
||||
import { blitzkitTankIcons } from './blitzkitTankIcons';
|
||||
import { boosterIcons } from './boosterIcons';
|
||||
import { camouflageIcons } from './camouflageIcons';
|
||||
import { consumableProvisionIcons } from './consumableProvisionIcons';
|
||||
import { currencies } from './currencies';
|
||||
import { definitions } from './definitions';
|
||||
import { equipmentIcons } from './equipmentIcons';
|
||||
import { flags } from './flags';
|
||||
import { gameModeBanners } from './gameModeBanners';
|
||||
import { glossary } from './glossary';
|
||||
import { migration } from './migration';
|
||||
import { moduleIcons } from './moduleIcons';
|
||||
import { shellIcons } from './shellIcons';
|
||||
import { skillIcons } from './skillIcons';
|
||||
import { tankArmors } from './tankArmors';
|
||||
import { tankIcons } from './tankIcons';
|
||||
import { tankModels } from './tankModels';
|
||||
import { boosterIcons } from "./boosterIcons";
|
||||
import { camouflageIcons } from "./camouflageIcons";
|
||||
import { consumableProvisionIcons } from "./consumableProvisionIcons";
|
||||
import { currencies } from "./currencies";
|
||||
import { definitions } from "./definitions";
|
||||
import { equipmentIcons } from "./equipmentIcons";
|
||||
import { flags } from "./flags";
|
||||
import { gameModeBanners } from "./gameModeBanners";
|
||||
import { glossary } from "./glossary";
|
||||
import { migration } from "./migration";
|
||||
import { moduleIcons } from "./moduleIcons";
|
||||
import { shellIcons } from "./shellIcons";
|
||||
import { skillIcons } from "./skillIcons";
|
||||
import { tankArmors } from "./tankArmors";
|
||||
import { tankIcons } from "./tankIcons";
|
||||
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 = [
|
||||
migration,
|
||||
|
||||
@@ -10,18 +10,18 @@ import {
|
||||
Region,
|
||||
REGIONS,
|
||||
regionToRegionSubdomain,
|
||||
} from '@blitzkit/core';
|
||||
import { chunk } from 'lodash';
|
||||
import { argv } from 'process';
|
||||
import { commitAssets } from './core/github/commitAssets';
|
||||
import { FileChange } from './core/github/commitMultipleFiles';
|
||||
} from "@blitzkit/core";
|
||||
import { chunk } from "lodash-es";
|
||||
import { argv } from "process";
|
||||
import { commitAssets } from "./core/github/commitAssets";
|
||||
import { FileChange } from "./core/github/commitMultipleFiles";
|
||||
|
||||
const region = argv
|
||||
.find((arg) => arg.startsWith('--region='))
|
||||
?.split('=')[1] as Region | undefined;
|
||||
.find((arg) => arg.startsWith("--region="))
|
||||
?.split("=")[1] as Region | undefined;
|
||||
|
||||
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}`);
|
||||
@@ -29,11 +29,11 @@ console.log(`Building rating leaderboard for ${region}`);
|
||||
const regionSubdomain = regionToRegionSubdomain(region);
|
||||
const NEIGHBORS = 2 ** 8;
|
||||
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));
|
||||
|
||||
if (PLAYERS === undefined) {
|
||||
throw new Error('No current rating season running');
|
||||
throw new Error("No current rating season running");
|
||||
}
|
||||
|
||||
const players: Record<number, RatingPlayer> = {};
|
||||
@@ -43,7 +43,7 @@ let registered = 0;
|
||||
|
||||
async function branchFromPlayer(id: number) {
|
||||
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];
|
||||
@@ -66,7 +66,7 @@ async function branchFromPlayer(id: number) {
|
||||
`Registered ${registered} / ${PLAYERS} (${(
|
||||
(registered / PLAYERS!) *
|
||||
100
|
||||
).toFixed(2)}%)`,
|
||||
).toFixed(2)}%)`
|
||||
);
|
||||
|
||||
await Promise.all(branches);
|
||||
@@ -74,7 +74,7 @@ async function branchFromPlayer(id: number) {
|
||||
|
||||
async function branchFromLeague(id: number) {
|
||||
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];
|
||||
@@ -86,7 +86,7 @@ async function branchFromLeague(id: number) {
|
||||
]);
|
||||
}
|
||||
|
||||
console.log('Branching from leagues...');
|
||||
console.log("Branching from leagues...");
|
||||
await Promise.all([
|
||||
branchFromLeague(0),
|
||||
branchFromLeague(1),
|
||||
@@ -95,7 +95,7 @@ await Promise.all([
|
||||
branchFromLeague(4),
|
||||
]);
|
||||
|
||||
console.log('Converting to an array...');
|
||||
console.log("Converting to an array...");
|
||||
for (let index = 0; index < PLAYERS; index++) {
|
||||
const listing = players[index + 1];
|
||||
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[] = [];
|
||||
let chunkIndex = 0;
|
||||
for (const leaderboardChunk of chunk(entriesV1, 100)) {
|
||||
console.log(
|
||||
`Chunk ${chunkIndex + 1} of ${Math.ceil(entriesV1.length / 100)}`,
|
||||
`Chunk ${chunkIndex + 1} of ${Math.ceil(entriesV1.length / 100)}`
|
||||
);
|
||||
|
||||
const stats = await getAccountInfo(
|
||||
region,
|
||||
leaderboardChunk.map(({ id }) => id),
|
||||
['statistics.rating'],
|
||||
["statistics.rating"]
|
||||
);
|
||||
|
||||
stats.forEach((stat, index) => {
|
||||
@@ -153,12 +153,12 @@ for (const leaderboardChunk of chunk(entriesV1, 100)) {
|
||||
}
|
||||
|
||||
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({
|
||||
version: { $case: 'v2', value: { entries } },
|
||||
version: { $case: "v2", value: { entries } },
|
||||
}).finish();
|
||||
|
||||
const changes: FileChange[] = [
|
||||
|
||||
Reference in new issue
Block a user