Adding Env files for Local Development Ease

pull/34/head
Matthew 2024-04-04 12:34:23 -04:00 committed by Samuel H
parent 62e6f28dc7
commit dc9dc98c71
6 changed files with 21 additions and 8 deletions

2
.env Normal file
View File

@ -0,0 +1,2 @@
VITE_BYPASS_LOGIN=0
VITE_BYPASS_TUTORIAL=0

2
.env.development Normal file
View File

@ -0,0 +1,2 @@
VITE_BYPASS_LOGIN=1
VITE_BYPASS_TUTORIAL=0

View File

@ -11,15 +11,12 @@ node: 18.3.0
1. Clone the repo and in the root directory run `npm install`
- *if you run into any errors, reach out in the **#dev-corner** channel in discord*
2. Run `npm run start` to locally run the project in `localhost:8000`
2. Run `npm run start:dev` to locally run the project in `localhost:8000`
### ❔ FAQ
**How do I test a new ability/move?**
- In the `pokemon.ts` file there are overrides you can set to apply the new move/ability to your active pokemon
**How do I test a specific seed/wave?**
- In the `battle-scene.ts` file there are overrides for seed, starting level, starting wave, starting biome, and starting money
**How do I test a new _______?**
- In the `battle-scene.ts` file there are overrides for most values you'll need to change for testing
## 🪧 To Do

View File

@ -5,6 +5,7 @@
"type": "module",
"scripts": {
"start": "vite",
"start:dev": "vite --mode development",
"build": "vite build",
"preview": "vite preview",
"test": "vitest run",

View File

@ -59,7 +59,7 @@ import { UiTheme } from './enums/ui-theme';
import CacheBustedLoaderPlugin from './plugins/cache-busted-loader-plugin';
import { SceneBase } from './scene-base';
export const bypassLogin = false;
export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1";
export const SEED_OVERRIDE = '';
export const STARTER_SPECIES_OVERRIDE = 0;
@ -115,7 +115,7 @@ export default class BattleScene extends SceneBase {
public gameSpeed: integer = 1;
public damageNumbersMode: integer = 0;
public showLevelUpStats: boolean = true;
public enableTutorials: boolean = true;
public enableTutorials: boolean = import.meta.env.VITE_BYPASS_TUTORIAL === "1";
public uiTheme: UiTheme = UiTheme.DEFAULT;
public windowType: integer = 0;
public experimentalSprites: boolean = false;

11
vite.env.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_BYPASS_LOGIN: string;
readonly VITE_BYPASS_TUTORIAL: string;
readonly VITE_API_BASE_URL: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
}