mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-16 14:55:22 +01:00
[Dev] Don't use "production" mode for beta server (#6616)
* [Dev] Don't use "production" mode for beta server * Fix `build` command in `package.json`
This commit is contained in:
parent
f4456f6c7c
commit
f7fd72b08c
2
.github/workflows/deploy-beta.yml
vendored
2
.github/workflows/deploy-beta.yml
vendored
@ -32,8 +32,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build:beta
|
run: pnpm build:beta
|
||||||
env:
|
|
||||||
NODE_ENV: production
|
|
||||||
|
|
||||||
- name: Set up SSH
|
- name: Set up SSH
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
"start:beta": "vite --mode beta",
|
"start:beta": "vite --mode beta",
|
||||||
"start:dev": "vite --mode development",
|
"start:dev": "vite --mode development",
|
||||||
"start:podman": "vite --mode development --host 0.0.0.0 --port $PORT",
|
"start:podman": "vite --mode development --host 0.0.0.0 --port $PORT",
|
||||||
"build": "vite build && node --mode development && node scripts/sync-dist-assets.js",
|
"build": "vite build && node scripts/sync-dist-assets.js",
|
||||||
"build:beta": "vite build --mode beta && node scripts/sync-dist-assets.js",
|
"build:beta": "vite build --mode beta && node scripts/sync-dist-assets.js",
|
||||||
"build:dev": "vite build --mode development && node scripts/sync-dist-assets.js",
|
"build:dev": "vite build --mode development && node scripts/sync-dist-assets.js",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
|
|||||||
@ -32,7 +32,6 @@ import type { EnemyPokemon, Pokemon } from "#field/pokemon";
|
|||||||
import { PokemonMove } from "#moves/pokemon-move";
|
import { PokemonMove } from "#moves/pokemon-move";
|
||||||
import { NumberHolder, randSeedInt } from "#utils/common";
|
import { NumberHolder, randSeedInt } from "#utils/common";
|
||||||
import { willTerastallize } from "#utils/pokemon-utils";
|
import { willTerastallize } from "#utils/pokemon-utils";
|
||||||
import { isBeta } from "#utils/utility-vars";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compute and assign a weight to the level-up moves currently available to the Pokémon
|
* Compute and assign a weight to the level-up moves currently available to the Pokémon
|
||||||
@ -633,7 +632,7 @@ function fillInRemainingMovesetSlots(
|
|||||||
* @param note - Short note to include in the log for context
|
* @param note - Short note to include in the log for context
|
||||||
*/
|
*/
|
||||||
function debugMoveWeights(pokemon: Pokemon, pool: Map<MoveId, number>, note: string): void {
|
function debugMoveWeights(pokemon: Pokemon, pool: Map<MoveId, number>, note: string): void {
|
||||||
if ((isBeta || import.meta.env.DEV) && import.meta.env.NODE_ENV !== "test") {
|
if (import.meta.env.DEV && import.meta.env.NODE_ENV !== "test") {
|
||||||
const moveNameToWeightMap = new Map<string, number>();
|
const moveNameToWeightMap = new Map<string, number>();
|
||||||
const sortedByValue = Array.from(pool.entries()).sort((a, b) => b[1] - a[1]);
|
const sortedByValue = Array.from(pool.entries()).sort((a, b) => b[1] - a[1]);
|
||||||
for (const [moveId, weight] of sortedByValue) {
|
for (const [moveId, weight] of sortedByValue) {
|
||||||
|
|||||||
@ -69,7 +69,8 @@ export abstract class ApiBase {
|
|||||||
"Content-Type": config.headers?.["Content-Type"] ?? "application/json",
|
"Content-Type": config.headers?.["Content-Type"] ?? "application/json",
|
||||||
};
|
};
|
||||||
|
|
||||||
if (import.meta.env.DEV) {
|
// can't import `isLocal` due to circular import issues
|
||||||
|
if (import.meta.env.MODE === "development") {
|
||||||
console.log(`Sending ${config.method ?? "GET"} request to: `, this.base + path, config);
|
console.log(`Sending ${config.method ?? "GET"} request to: `, this.base + path, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -78,7 +78,6 @@ import { executeIf, fixedInt, isLocal, NumberHolder, randInt, randSeedItem } fro
|
|||||||
import { decrypt, encrypt } from "#utils/data";
|
import { decrypt, encrypt } from "#utils/data";
|
||||||
import { getEnumKeys } from "#utils/enums";
|
import { getEnumKeys } from "#utils/enums";
|
||||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||||
import { isBeta } from "#utils/utility-vars";
|
|
||||||
import { AES, enc } from "crypto-js";
|
import { AES, enc } from "crypto-js";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
@ -414,7 +413,7 @@ export class GameData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLocal || isBeta) {
|
if (import.meta.env.DEV) {
|
||||||
try {
|
try {
|
||||||
console.debug(
|
console.debug(
|
||||||
GameData.parseSystemData(
|
GameData.parseSystemData(
|
||||||
@ -955,7 +954,7 @@ export class GameData {
|
|||||||
const { promise, resolve, reject } = Promise.withResolvers<boolean>();
|
const { promise, resolve, reject } = Promise.withResolvers<boolean>();
|
||||||
try {
|
try {
|
||||||
const initSessionFromData = (fromSession: SessionSaveData) => {
|
const initSessionFromData = (fromSession: SessionSaveData) => {
|
||||||
if (isLocal || isBeta) {
|
if (import.meta.env.DEV) {
|
||||||
try {
|
try {
|
||||||
console.debug(
|
console.debug(
|
||||||
this.parseSessionData(
|
this.parseSessionData(
|
||||||
|
|||||||
@ -14,11 +14,10 @@ import { BgmBar } from "#ui/bgm-bar";
|
|||||||
import { MessageUiHandler } from "#ui/message-ui-handler";
|
import { MessageUiHandler } from "#ui/message-ui-handler";
|
||||||
import { addTextObject, getTextStyleOptions } from "#ui/text";
|
import { addTextObject, getTextStyleOptions } from "#ui/text";
|
||||||
import { addWindow, WindowVariant } from "#ui/ui-theme";
|
import { addWindow, WindowVariant } from "#ui/ui-theme";
|
||||||
import { fixedInt, isLocal, sessionIdKey } from "#utils/common";
|
import { fixedInt, sessionIdKey } from "#utils/common";
|
||||||
import { getCookie } from "#utils/cookies";
|
import { getCookie } from "#utils/cookies";
|
||||||
import { getEnumValues } from "#utils/enums";
|
import { getEnumValues } from "#utils/enums";
|
||||||
import { toCamelCase } from "#utils/strings";
|
import { toCamelCase } from "#utils/strings";
|
||||||
import { isBeta } from "#utils/utility-vars";
|
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
enum MenuOptions {
|
enum MenuOptions {
|
||||||
@ -238,7 +237,7 @@ export class MenuUiHandler extends MessageUiHandler {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isLocal || isBeta) {
|
if (import.meta.env.DEV) {
|
||||||
manageDataOptions.push({
|
manageDataOptions.push({
|
||||||
label: i18next.t("menuUiHandler:importSession"),
|
label: i18next.t("menuUiHandler:importSession"),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
@ -292,7 +291,7 @@ export class MenuUiHandler extends MessageUiHandler {
|
|||||||
},
|
},
|
||||||
keepOpen: true,
|
keepOpen: true,
|
||||||
});
|
});
|
||||||
if (isLocal || isBeta) {
|
if (import.meta.env.DEV) {
|
||||||
manageDataOptions.push({
|
manageDataOptions.push({
|
||||||
label: i18next.t("menuUiHandler:importData"),
|
label: i18next.t("menuUiHandler:importData"),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
@ -339,7 +338,7 @@ export class MenuUiHandler extends MessageUiHandler {
|
|||||||
keepOpen: true,
|
keepOpen: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (isLocal || isBeta) {
|
if (import.meta.env.DEV) {
|
||||||
// this should make sure we don't have this option in live
|
// this should make sure we don't have this option in live
|
||||||
manageDataOptions.push({
|
manageDataOptions.push({
|
||||||
label: "Test Dialogue",
|
label: "Test Dialogue",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user