mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
some returns
This commit is contained in:
1 parent
30522bfda0
commit
2dc23ba09d
4 files changed
+36
-11
No files matched your search
@@ -1,3 +1,23 @@
|
|||||||
|
import {
|
||||||
|
CamouflageDefinitions,
|
||||||
|
ConsumableDefinitions,
|
||||||
|
EquipmentDefinitions,
|
||||||
|
GameDefinitions,
|
||||||
|
MapDefinitions,
|
||||||
|
ModelDefinitions,
|
||||||
|
ProvisionDefinitions,
|
||||||
|
SkillDefinitions,
|
||||||
|
TankDefinitions,
|
||||||
|
} from "@blitzkit/core";
|
||||||
|
|
||||||
export abstract class BlitzKitAPI {
|
export abstract class BlitzKitAPI {
|
||||||
// abstract game(): Promise<GameDefinitions>;
|
abstract skillDefinitions(): Promise<SkillDefinitions>;
|
||||||
|
abstract provisionDefinitions(): Promise<ProvisionDefinitions>;
|
||||||
|
abstract consumableDefinitions(): Promise<ConsumableDefinitions>;
|
||||||
|
abstract equipmentDefinitions(): Promise<EquipmentDefinitions>;
|
||||||
|
abstract mapDefinitions(): Promise<MapDefinitions>;
|
||||||
|
abstract modelDefinitions(): Promise<ModelDefinitions>;
|
||||||
|
abstract camouflageDefinitions(): Promise<CamouflageDefinitions>;
|
||||||
|
abstract tankDefinitions(): Promise<TankDefinitions>;
|
||||||
|
abstract gameDefinitions(): Promise<GameDefinitions>;
|
||||||
}
|
}
|
||||||
@@ -526,7 +526,7 @@ export class ServerBlitzKitAPI extends BlitzKitAPI {
|
|||||||
({ type }) => this.blitzkitCrewTypeToBlitz[type] === crewKey,
|
({ type }) => this.blitzkitCrewTypeToBlitz[type] === crewKey,
|
||||||
);
|
);
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
if (crewKey === "#text") return;
|
if (crewKey === "#text") continue;
|
||||||
entry = {
|
entry = {
|
||||||
type: this.blitzCrewTypeToBlitzkit[crewKey as BlitzCrewType],
|
type: this.blitzCrewTypeToBlitzkit[crewKey as BlitzCrewType],
|
||||||
count: 0,
|
count: 0,
|
||||||
@@ -866,7 +866,7 @@ export class ServerBlitzKitAPI extends BlitzKitAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const unlocks of totalUnlocks) {
|
for (const unlocks of totalUnlocks) {
|
||||||
if (unlocks === undefined) return;
|
if (unlocks === undefined) continue;
|
||||||
|
|
||||||
for (const key in unlocks) {
|
for (const key in unlocks) {
|
||||||
const value = unlocks[key as keyof BlitzModuleType];
|
const value = unlocks[key as keyof BlitzModuleType];
|
||||||
@@ -1082,7 +1082,8 @@ export class ServerBlitzKitAPI extends BlitzKitAPI {
|
|||||||
({ type }) => this.blitzkitCrewTypeToBlitz[type] === crewKey,
|
({ type }) => this.blitzkitCrewTypeToBlitz[type] === crewKey,
|
||||||
);
|
);
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
if (crewKey === "#text") return;
|
if (crewKey === "#text") continue;
|
||||||
|
|
||||||
entry = {
|
entry = {
|
||||||
type: this.blitzCrewTypeToBlitzkit[crewKey as BlitzCrewType],
|
type: this.blitzCrewTypeToBlitzkit[crewKey as BlitzCrewType],
|
||||||
count: 0,
|
count: 0,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { tools } from "./src/constants/tools";
|
|||||||
|
|
||||||
const POSSIBLE_TARGETS = ["app", "web"];
|
const POSSIBLE_TARGETS = ["app", "web"];
|
||||||
|
|
||||||
const target = process.env.PUBLIC_TARGET ;
|
const target = process.env.PUBLIC_TARGET;
|
||||||
|
|
||||||
if (!target || !POSSIBLE_TARGETS.includes(target)) {
|
if (!target || !POSSIBLE_TARGETS.includes(target)) {
|
||||||
throw new Error("Invalid target");
|
throw new Error("Invalid target");
|
||||||
@@ -21,7 +21,11 @@ if (!target || !POSSIBLE_TARGETS.includes(target)) {
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
devToolbar: { enabled: false },
|
devToolbar: { enabled: false },
|
||||||
|
|
||||||
vite: { server: { allowedHosts: [] } },
|
vite: {
|
||||||
|
server: { allowedHosts: [] },
|
||||||
|
esbuild: { target: "es2022" },
|
||||||
|
},
|
||||||
|
|
||||||
output: target === "web" ? "static" : "server",
|
output: target === "web" ? "static" : "server",
|
||||||
site: "https://blitzkit.app",
|
site: "https://blitzkit.app",
|
||||||
outDir: "../../dist/website",
|
outDir: "../../dist/website",
|
||||||
@@ -50,15 +54,15 @@ export default defineConfig({
|
|||||||
return {
|
return {
|
||||||
name: strings.website.tools[stringId].name,
|
name: strings.website.tools[stringId].name,
|
||||||
name_localized: wrapper(
|
name_localized: wrapper(
|
||||||
(strings) => strings.website.tools[stringId].name
|
(strings) => strings.website.tools[stringId].name,
|
||||||
),
|
),
|
||||||
description: strings.website.tools[stringId].description,
|
description: strings.website.tools[stringId].description,
|
||||||
description_localized: wrapper(
|
description_localized: wrapper(
|
||||||
(strings) => strings.website.tools[stringId].description
|
(strings) => strings.website.tools[stringId].description,
|
||||||
),
|
),
|
||||||
short_name: strings.website.tools[stringId].name,
|
short_name: strings.website.tools[stringId].name,
|
||||||
short_name_localized: wrapper(
|
short_name_localized: wrapper(
|
||||||
(strings) => strings.website.tools[stringId].name
|
(strings) => strings.website.tools[stringId].name,
|
||||||
),
|
),
|
||||||
url: `/${tool.id}`,
|
url: `/${tool.id}`,
|
||||||
icon: `public/assets/images/tools/${tool.id}.webp`,
|
icon: `public/assets/images/tools/${tool.id}.webp`,
|
||||||
@@ -68,7 +72,7 @@ export default defineConfig({
|
|||||||
manifest: {
|
manifest: {
|
||||||
description: strings.website.home.seo_description,
|
description: strings.website.home.seo_description,
|
||||||
description_localized: wrapper(
|
description_localized: wrapper(
|
||||||
(strings) => strings.website.home.seo_description
|
(strings) => strings.website.home.seo_description,
|
||||||
),
|
),
|
||||||
|
|
||||||
dir: "ltr",
|
dir: "ltr",
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export interface Props {
|
|||||||
locale: string;
|
locale: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const gameDefinitions = await api.game();
|
const gameDefinitions = await api.gameDefinitions();
|
||||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||||
const { locale } = Astro.props;
|
const { locale } = Astro.props;
|
||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
|
|||||||
Reference in new issue
Block a user