mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
feat: detached cdn branch
This commit is contained in:
1 parent
ed041b78bb
commit
48dcbbc227
43 files changed
+267
-397
No files matched your search
@@ -6,7 +6,7 @@ import { commitAssets } from '../../src/core/blitzkit/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkit/commitMultipleFiles';
|
||||
import { DATA } from './constants';
|
||||
|
||||
export async function boosterIcons(production: boolean) {
|
||||
export async function boosterIcons() {
|
||||
const boosterFiles = (await readdir(`${DATA}/Gfx/Shared/boosters`)).filter(
|
||||
(file) => !file.endsWith('@2x.txt.dvpl') && !file.startsWith('texture0'),
|
||||
);
|
||||
@@ -47,5 +47,5 @@ export async function boosterIcons(production: boolean) {
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('booster icons', changes, production);
|
||||
await commitAssets('booster icons', changes);
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import { commitAssets } from '../../src/core/blitzkit/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkit/commitMultipleFiles';
|
||||
import { DATA } from './constants';
|
||||
|
||||
export async function camouflageIcons(production: boolean) {
|
||||
export async function camouflageIcons() {
|
||||
console.log('Building camouflage icons...');
|
||||
const content = await readDVPLFile(
|
||||
`${DATA}/Gfx/UI/Hangar/IconCamouflage.packed.webp.dvpl`,
|
||||
@@ -16,5 +16,5 @@ export async function camouflageIcons(production: boolean) {
|
||||
},
|
||||
];
|
||||
|
||||
await commitAssets('camo icons', changes, production);
|
||||
await commitAssets('camo icons', changes);
|
||||
}
|
||||
@@ -19,7 +19,7 @@ interface Mappings {
|
||||
|
||||
const listItemsPattern = /<items path="(.+)\.xml"\/>/g;
|
||||
|
||||
export async function consumableProvisionIcons(production: boolean) {
|
||||
export async function consumableProvisionIcons() {
|
||||
console.log('Building consumable and provision icons...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
@@ -188,5 +188,5 @@ export async function consumableProvisionIcons(production: boolean) {
|
||||
);
|
||||
}
|
||||
|
||||
await commitAssets('consumable and provision icons', changes, production);
|
||||
await commitAssets('consumable and provision icons', changes);
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import sharp from 'sharp';
|
||||
import { readDVPLFile } from '../../src/core/blitz/readDVPLFile';
|
||||
import { commitAssets } from '../../src/core/blitzkit/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkit/commitMultipleFiles';
|
||||
import { assertSecrete } from '../../src/core/blitzkit/secrete';
|
||||
import { DATA } from './constants';
|
||||
|
||||
const ICONS = [
|
||||
@@ -21,7 +22,7 @@ type BlitzGlossary = Record<
|
||||
}
|
||||
>;
|
||||
|
||||
export async function currencies(production: boolean) {
|
||||
export async function currencies() {
|
||||
console.log('Building currency icons...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
@@ -44,7 +45,7 @@ export async function currencies(production: boolean) {
|
||||
}),
|
||||
);
|
||||
|
||||
const glossary = await fetch(process.env.WOTB_GLOSSARY!).then(
|
||||
const glossary = await fetch(assertSecrete(process.env.WOTB_GLOSSARY)).then(
|
||||
(response) => response.json() as Promise<BlitzGlossary>,
|
||||
);
|
||||
|
||||
@@ -74,5 +75,5 @@ export async function currencies(production: boolean) {
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('currency icons', changes, production);
|
||||
await commitAssets('currency icons', changes);
|
||||
}
|
||||
@@ -433,7 +433,7 @@ const missingStrings: Record<string, string> = {
|
||||
};
|
||||
export const botPattern = /^.+((tutorial_bot(\d+)?)|(TU(R?)))$/;
|
||||
|
||||
export async function definitions(production: boolean) {
|
||||
export async function definitions() {
|
||||
console.log('Building definitions...');
|
||||
|
||||
const wargamingTankopedia = (await fetch(
|
||||
@@ -1460,55 +1460,51 @@ export async function definitions(production: boolean) {
|
||||
};
|
||||
});
|
||||
|
||||
await commitAssets(
|
||||
'definitions',
|
||||
[
|
||||
{
|
||||
content: superCompress(gameDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/game.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(tankDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/tanks.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(modelDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/models.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(equipmentDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/equipment.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(consumableDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/consumables.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(provisionDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/provisions.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(skillDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/skills.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(mapDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/maps.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(camouflageDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/camouflages.cdon.lz4',
|
||||
},
|
||||
],
|
||||
production,
|
||||
);
|
||||
await commitAssets('definitions', [
|
||||
{
|
||||
content: superCompress(gameDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/game.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(tankDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/tanks.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(modelDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/models.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(equipmentDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/equipment.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(consumableDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/consumables.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(provisionDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/provisions.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(skillDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/skills.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(mapDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/maps.cdon.lz4',
|
||||
},
|
||||
{
|
||||
content: superCompress(camouflageDefinitions),
|
||||
encoding: 'base64',
|
||||
path: 'definitions/camouflages.cdon.lz4',
|
||||
},
|
||||
]);
|
||||
}
|
||||
@@ -17,7 +17,7 @@ interface Mappings {
|
||||
}[];
|
||||
}
|
||||
|
||||
export async function equipmentIcons(production: boolean) {
|
||||
export async function equipmentIcons() {
|
||||
console.log('Building equipment icons...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
@@ -91,5 +91,5 @@ export async function equipmentIcons(production: boolean) {
|
||||
),
|
||||
);
|
||||
|
||||
await commitAssets('equipment icons', changes, production);
|
||||
await commitAssets('equipment icons', changes);
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import { commitAssets } from '../../src/core/blitzkit/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkit/commitMultipleFiles';
|
||||
import { DATA } from './constants';
|
||||
|
||||
export async function flags(production: boolean) {
|
||||
export async function flags() {
|
||||
console.log('Building flags...');
|
||||
|
||||
const changes = [
|
||||
@@ -82,5 +82,5 @@ export async function flags(production: boolean) {
|
||||
)),
|
||||
];
|
||||
|
||||
await commitAssets('flags', changes, production);
|
||||
await commitAssets('flags', changes);
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import { FileChange } from '../../src/core/blitzkit/commitMultipleFiles';
|
||||
import { DATA } from './constants';
|
||||
import { SquadBattleTypeStyles } from './definitions';
|
||||
|
||||
export async function gameModeBanners(production: boolean) {
|
||||
export async function gameModeBanners() {
|
||||
console.log('Building game mode banners...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
@@ -50,5 +50,5 @@ export async function gameModeBanners(production: boolean) {
|
||||
});
|
||||
}
|
||||
|
||||
await commitAssets('game mode banners', changes, production);
|
||||
await commitAssets('game mode banners', changes);
|
||||
}
|
||||
@@ -8,7 +8,6 @@ const targets = argv
|
||||
.find((argument) => argument.startsWith('--target'))
|
||||
?.split('=')[1]
|
||||
.split(',');
|
||||
const production = argv.includes('--production');
|
||||
|
||||
import { boosterIcons } from './boosterIcons';
|
||||
import { camouflageIcons } from './camouflageIcons';
|
||||
@@ -45,5 +44,5 @@ const methods = [
|
||||
];
|
||||
|
||||
for (const method of methods) {
|
||||
if (allTargets || targets?.includes(method.name)) await method(production);
|
||||
if (allTargets || targets?.includes(method.name)) await method();
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import { commitAssets } from '../../src/core/blitzkit/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkit/commitMultipleFiles';
|
||||
import { DATA } from './constants';
|
||||
|
||||
export async function moduleIcons(production: boolean) {
|
||||
export async function moduleIcons() {
|
||||
console.log('Building module icons...');
|
||||
|
||||
const changes = await Promise.all(
|
||||
@@ -33,5 +33,5 @@ export async function moduleIcons(production: boolean) {
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('module icons', changes, production);
|
||||
await commitAssets('module icons', changes);
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import { commitAssets } from '../../src/core/blitzkit/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkit/commitMultipleFiles';
|
||||
import { DATA } from './constants';
|
||||
|
||||
export async function shellIcons(production: boolean) {
|
||||
export async function shellIcons() {
|
||||
console.log('Building shell icons...');
|
||||
|
||||
const image = sharp(
|
||||
@@ -47,5 +47,5 @@ export async function shellIcons(production: boolean) {
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('shell icons', changes, production);
|
||||
await commitAssets('shell icons', changes);
|
||||
}
|
||||
@@ -25,7 +25,7 @@ export interface Avatar {
|
||||
};
|
||||
}
|
||||
|
||||
export async function skillIcons(production: boolean) {
|
||||
export async function skillIcons() {
|
||||
console.log('Building skill icons...');
|
||||
|
||||
const avatar = await readXMLDVPL<{ root: Avatar }>(
|
||||
@@ -47,5 +47,5 @@ export async function skillIcons(production: boolean) {
|
||||
}),
|
||||
);
|
||||
|
||||
commitAssets('skill icons', changes, production);
|
||||
commitAssets('skill icons', changes);
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import { FileChange } from '../../src/core/blitzkit/commitMultipleFiles';
|
||||
import { DATA } from './constants';
|
||||
import { VehicleDefinitionList } from './definitions';
|
||||
|
||||
export async function tankArmors(production: boolean) {
|
||||
export async function tankArmors() {
|
||||
console.log('Building tank armors...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
@@ -42,5 +42,5 @@ export async function tankArmors(production: boolean) {
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('tank armor', changes, production);
|
||||
await commitAssets('tank armor', changes);
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export interface TankParameters {
|
||||
};
|
||||
}
|
||||
|
||||
export async function tankIcons(production: boolean) {
|
||||
export async function tankIcons() {
|
||||
console.log('Building tank icons...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
@@ -97,5 +97,5 @@ export async function tankIcons(production: boolean) {
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('tank icons', changes, production);
|
||||
await commitAssets('tank icons', changes);
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import { DATA } from './constants';
|
||||
import { VehicleDefinitionList } from './definitions';
|
||||
import { TankParameters } from './tankIcons';
|
||||
|
||||
export async function tankModels(production: boolean) {
|
||||
export async function tankModels() {
|
||||
console.log('Building tank models...');
|
||||
|
||||
const nodeIO = new NodeIO();
|
||||
@@ -50,6 +50,6 @@ export async function tankModels(production: boolean) {
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets(`tank models ${nation}`, changes, production);
|
||||
await commitAssets(`tank models ${nation}`, changes);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user