mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +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 {
|
||||
// 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,
|
||||
);
|
||||
if (index === -1) {
|
||||
if (crewKey === "#text") return;
|
||||
if (crewKey === "#text") continue;
|
||||
entry = {
|
||||
type: this.blitzCrewTypeToBlitzkit[crewKey as BlitzCrewType],
|
||||
count: 0,
|
||||
@@ -866,7 +866,7 @@ export class ServerBlitzKitAPI extends BlitzKitAPI {
|
||||
}
|
||||
|
||||
for (const unlocks of totalUnlocks) {
|
||||
if (unlocks === undefined) return;
|
||||
if (unlocks === undefined) continue;
|
||||
|
||||
for (const key in unlocks) {
|
||||
const value = unlocks[key as keyof BlitzModuleType];
|
||||
@@ -1082,7 +1082,8 @@ export class ServerBlitzKitAPI extends BlitzKitAPI {
|
||||
({ type }) => this.blitzkitCrewTypeToBlitz[type] === crewKey,
|
||||
);
|
||||
if (index === -1) {
|
||||
if (crewKey === "#text") return;
|
||||
if (crewKey === "#text") continue;
|
||||
|
||||
entry = {
|
||||
type: this.blitzCrewTypeToBlitzkit[crewKey as BlitzCrewType],
|
||||
count: 0,
|
||||
|
||||
@@ -12,7 +12,7 @@ import { tools } from "./src/constants/tools";
|
||||
|
||||
const POSSIBLE_TARGETS = ["app", "web"];
|
||||
|
||||
const target = process.env.PUBLIC_TARGET ;
|
||||
const target = process.env.PUBLIC_TARGET;
|
||||
|
||||
if (!target || !POSSIBLE_TARGETS.includes(target)) {
|
||||
throw new Error("Invalid target");
|
||||
@@ -21,7 +21,11 @@ if (!target || !POSSIBLE_TARGETS.includes(target)) {
|
||||
export default defineConfig({
|
||||
devToolbar: { enabled: false },
|
||||
|
||||
vite: { server: { allowedHosts: [] } },
|
||||
vite: {
|
||||
server: { allowedHosts: [] },
|
||||
esbuild: { target: "es2022" },
|
||||
},
|
||||
|
||||
output: target === "web" ? "static" : "server",
|
||||
site: "https://blitzkit.app",
|
||||
outDir: "../../dist/website",
|
||||
@@ -50,15 +54,15 @@ export default defineConfig({
|
||||
return {
|
||||
name: strings.website.tools[stringId].name,
|
||||
name_localized: wrapper(
|
||||
(strings) => strings.website.tools[stringId].name
|
||||
(strings) => strings.website.tools[stringId].name,
|
||||
),
|
||||
description: strings.website.tools[stringId].description,
|
||||
description_localized: wrapper(
|
||||
(strings) => strings.website.tools[stringId].description
|
||||
(strings) => strings.website.tools[stringId].description,
|
||||
),
|
||||
short_name: strings.website.tools[stringId].name,
|
||||
short_name_localized: wrapper(
|
||||
(strings) => strings.website.tools[stringId].name
|
||||
(strings) => strings.website.tools[stringId].name,
|
||||
),
|
||||
url: `/${tool.id}`,
|
||||
icon: `public/assets/images/tools/${tool.id}.webp`,
|
||||
@@ -68,7 +72,7 @@ export default defineConfig({
|
||||
manifest: {
|
||||
description: strings.website.home.seo_description,
|
||||
description_localized: wrapper(
|
||||
(strings) => strings.website.home.seo_description
|
||||
(strings) => strings.website.home.seo_description,
|
||||
),
|
||||
|
||||
dir: "ltr",
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface Props {
|
||||
locale: string;
|
||||
}
|
||||
|
||||
const gameDefinitions = await api.game();
|
||||
const gameDefinitions = await api.gameDefinitions();
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||
const { locale } = Astro.props;
|
||||
const strings = getStrings(locale);
|
||||
|
||||
Reference in new issue
Block a user