Skip to content

Commit c47d8d9

Browse files
authored
Merge branch 'beta' into flamegraph
2 parents ecaa7eb + 4751206 commit c47d8d9

File tree

667 files changed

+7829
-11293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

667 files changed

+7829
-11293
lines changed

.github/workflows/github-pages.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,14 @@ jobs:
3636
with:
3737
sparse-checkout: |
3838
.nvmrc
39-
sparse-checkout-cone-mode: false
4039
4140
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
4241
id: filter
4342
with:
4443
filters: |
4544
all:
4645
- "src/**/*.ts"
47-
- "test/test-utils/*.ts"
46+
- "test/utils/*.ts"
4847
- "typedoc.config.js"
4948
- "tsdoc.json"
5049
- "tsconfig.json"

.github/workflows/linting.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
with:
4040
sparse-checkout: |
4141
.nvmrc
42-
sparse-checkout-cone-mode: false
4342
4443
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
4544
id: filter
@@ -79,7 +78,7 @@ jobs:
7978

8079
# Lint files with Biome-Lint - https://biomejs.dev/linter/
8180
- name: Lint with Biome
82-
run: pnpm biome-ci
81+
run: pnpm biome:ci
8382
if: ${{ !cancelled() && (needs.linting-path-filter.outputs.all == 'true' || needs.linting-path-filter.outputs.ts-files == 'true' || needs.linting-path-filter.outputs.js-files == 'true') }}
8483

8584
# Validate dependencies with dependency-cruiser - https://github.com/sverweij/dependency-cruiser

.github/workflows/tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
with:
4040
sparse-checkout: |
4141
.github/test-filters.yml
42-
sparse-checkout-cone-mode: false
4342
4443
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
4544
id: filter
@@ -82,7 +81,7 @@ jobs:
8281
sparse-checkout: |
8382
.github/actions/setup-deps/action.yml
8483
test/setup
85-
test/test-utils/reporters/custom-default-reporter.ts
84+
test/reporters/custom-default-reporter.ts
8685
8786
- uses: ./.github/actions/setup-deps
8887

CONTRIBUTING.md

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
<!--
2-
SPDX-FileCopyrightText: 2024-2025 Pagefault Games
2+
SPDX-FileCopyrightText: 2024-2026 Pagefault Games
33
44
SPDX-License-Identifier: CC-BY-NC-SA-4.0
55
-->
66

77
# Contributing to PokéRogue
88

9-
Thank you for taking the time to contribute, every little bit helps. This project is entirely open-source and unmonetized - community contributions are what keep it alive!
9+
Thank you for taking the time to contribute; every little bit helps! This project is entirely open-source and unmonetized - community contributions are what keep it alive!
1010

1111
Please make sure you understand everything relevant to your changes from the [Table of Contents](#-table-of-contents), and absolutely *feel free to reach out in the **#pokerogue-dev** channel on [Discord](https://discord.gg/pokerogue)*.
1212
We are here to help and the better you understand what you're working on, the easier it will be for it to find its way into the game.
1313

14-
Note that, as per GitHub's [terms of service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service#6-contributions-under-repository-license), any contributions made to this repository will be licensed under this repository's terms.
15-
If you use any external code, please make sure to follow its licensing information. Please make use of [SPDX snippets](https://reuse.software/spec-3.3/#in-line-snippet-comments) for the portion of the file that is licensed differently.
14+
> [!NOTE]
15+
> As per GitHub's [terms of service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service#6-contributions-under-repository-license), any contributions made to this repository will be licensed under this repository's terms.
16+
> If you use any external code, please make sure to follow its licensing information. Please make use of [SPDX snippets](https://reuse.software/spec-3.3/#in-line-snippet-comments) for any portion of the file that is licensed differently.
1617
1718

1819
## 📄 Table of Contents
@@ -32,7 +33,6 @@ PokéRogue is built with [TypeScript](https://www.typescriptlang.org/docs/handbo
3233

3334
If you have the motivation and experience with TypeScript/JavaScript (or are willing to learn), you can contribute by forking the repository and making pull requests with contributions.
3435

35-
3636
## 💻 Environment Setup
3737

3838
### Codespaces/Devcontainer Environment
@@ -51,8 +51,8 @@ This Linux environment comes with all required dependencies needed to start work
5151
[devcontainer-ext]: <https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers>
5252

5353
> [!IMPORTANT]
54-
> Due to quirks of devcontainer port forwarding, you must use **`pnpm start:podman`** to start a local dev server from within a devcontainer.
55-
> All other instructions remain the same as local development.
54+
> Due to quirks of devcontainer port forwarding, **you must use `pnpm start:podman`** to start a local dev server from within a devcontainer.
55+
> _All other instructions remain the same as local development_.
5656
5757
### Podman
5858

@@ -95,7 +95,7 @@ You are free to comment on any issue so that you may be assigned to it and we ca
9595

9696
## 📚 Documentation
9797

98-
You can find the auto-generated documentation [here](https://pagefaultgames.github.io/pokerogue/main/index.html).
98+
You can find the auto-generated API documentation [here](https://pagefaultgames.github.io/pokerogue/beta/index.html). It can be incomplete at times (as many methods lack documentation comments), but it's a great way to get a look at the overall structure of the codebase and find particular methods or classes you may be looking for.
9999

100100
Additionally, the [docs folder](./docs) contains a variety of in-depth documents and guides useful for aspiring contributors. \
101101
Notable topics include:
@@ -105,17 +105,19 @@ Notable topics include:
105105
- [Enemy AI move selection](./docs/enemy-ai.md)
106106
- [Running with Podman](./docs/podman.md)
107107

108-
Again, if you have unanswered questions please feel free to ask!
108+
Again, please feel free to ask any questions you may have!
109109

110110
## 🧪 Testing Your Changes
111111

112-
You've just made a change - how can you check if it works? You have two areas to hit:
112+
You've just made a change - how can you check if it works? \
113+
You have two areas to hit:
113114

114115
### 1 - Manual Testing
115116

116117
> This will likely be your first stop. After making a change, you'll want to spin the game up and make sure everything is as you expect. To do this, you will need a way to manipulate the game to produce the situation you're looking to test.
117118
118119
[src/overrides.ts](./src/overrides.ts) contains overrides for most values you'll need to change for testing, controlled through the `overrides` object.
120+
There are a variety of overrides available, ranging from changing movesets and abilities to modifying battle conditions and forcing specific scenarios.
119121
For example, here is how you could test a scenario where the player Pokemon has the ability Drought and the enemy Pokemon has the move Water Gun:
120122

121123
```typescript
@@ -125,12 +127,14 @@ const overrides = {
125127
} satisfies Partial<InstanceType<typeof DefaultOverrides>>;
126128
```
127129

128-
Read through `src/overrides.ts` file to find the override that fits your needs - there are a lot of them!
129-
If the situation you're trying to test can't be created using existing overrides (or with the [Dev Save](#-development-save-file)), reach out in **#pokerogue-dev**.
130-
You can get help testing your specific changes, and you might have found a new override that needs to be created!
130+
> [!NOTE]
131+
> If the situation you're trying to test can't be created using existing overrides (or with the [Dev Save](#-development-save-file)), reach out in **#pokerogue-dev**.
132+
> You can get help testing your specific changes, and you might have found a new override that needs to be created!
131133
132134
### 2 - Automatic Testing
133135

136+
<!-- TODO: Consider moving this to a separate document. There's tons more we could (and should) expand on here, like the `test:create` script, all of the test utils/etc, project conventions, etc etc.-->
137+
134138
PokéRogue uses [Vitest](https://vitest.dev/) for automated testing.
135139
Checking out existing tests in the [test](./test/) folder is a great way to understand how the existing system works, as well as familiarizing yourself with the project as a whole.
136140

@@ -145,11 +149,19 @@ Ensure that new test cases:
145149
- Do not test multiple separate things in the same test case. If you have made two distinct changes, they should be tested in two separate cases.
146150
- Cover as many edge cases as possible. A good strategy is to think of edge cases beforehand and create tests for them using `it.todo`. Once the edge case has been handled, you can remove the `todo` marker.
147151

148-
<!-- TODO: Decide on and suggest a specific placement heiarchy for test cases involving interactions between different moves/abilities/etc. -->
152+
> [!CAUTION]
153+
> Testing UI-related code within the automated test harness is _usually_ a bad idea. \
154+
> While it can be done, such tests tend to be boilerplate-heavy, hard to maintain and prone to randomly breaking/timing out.
155+
> If your change is primarily UI-related, it's usually best to test it manually and only use automated tests for the underlying logic (if applicable).
156+
157+
<!-- TODO: Decide on and suggest a specific placement hierarchy for test cases involving interactions between different moves/abilities/etc., and enforce said placement if feasible -->
158+
159+
> [!NOTE]
160+
> While Vitest does support both Jest and Chai syntax for assertions, our project exclusively uses Jest-style assertions (`...toBe()`, `...toEqual()`, etc.) for internal consistency. (The Chai variants have been blacklisted via TypeScript declaration merging, ensuring they aren't accidentally used by mistake.)
149161
150162
#### Running tests
151-
To make sure your changes didn't break any existing test cases, run `pnpm test:silent` in your terminal to run the full test suite. \
152-
You can provide additional arguments to the command to change its behavior or specify which test files to run;
163+
To make sure your changes didn't break any existing test cases, run `pnpm test:silent <files>` in your terminal to run test files associated with your changes. \
164+
You can provide additional arguments to the command to alter its behavior;
153165
a full list of supported arguments can be found on [Vitest's website](https://vitest.dev/guide/cli.html).
154166

155167
> [!CAUTION]
@@ -158,10 +170,11 @@ a full list of supported arguments can be found on [Vitest's website](https://vi
158170
159171
## 💾 Development Save File
160172
> Some issues may require you to have unlocks on your save file which go beyond normal overrides.
161-
> For this reason, the repository contains a [save file](test/test-utils/saves/everything.psrv) with _everything_ unlocked (it may also contain things that are not legitimately obtainable).
173+
> For this reason, the repository contains a [save file](test/utils/saves/everything.prsv) with _everything_ unlocked (including things not legitimately obtainable, like unreleased variant shinies).
162174
163175
1. Start the game up locally and navigate to `Menu -> Manage Data -> Import Data`
164-
2. Select [everything.prsv](test/test-utils/saves/everything.prsv) (`test/test-utils/saves/everything.prsv`) and confirm.
176+
2. Select [everything.prsv](test/utils/saves/everything.prsv) (`test/utils/saves/everything.prsv`) and hit "Confirm".
177+
3. The page will reload with everything unlocked! You can now test your changes with this save file.
165178

166179
## ✅ Submitting a Pull Request
167180

assets

Submodule assets updated 131 files

biome.jsonc

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: AGPL-3.0-only
55
*/
66
{
7-
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
7+
"$schema": "https://biomejs.dev/schemas/2.4.4/schema.json",
88
"vcs": {
99
"enabled": true,
1010
"clientKind": "git",
@@ -15,7 +15,7 @@
1515
"enabled": true,
1616
"useEditorconfig": true,
1717
"indentStyle": "space",
18-
"includes": ["**", "!src/data/balance/**"], // TODO: enable formatting of balance folder
18+
"includes": ["**", "!src/data/balance/**", "src/data/balance/biomes/**", "src/data/balance/timed-events.ts"], // TODO: enable formatting of balance folder
1919
"lineWidth": 120
2020
},
2121
"files": {
@@ -29,7 +29,7 @@
2929
".github/**/*.mts",
3030
"!!assets",
3131
"!!coverage",
32-
"!!dist",
32+
"!!dist*",
3333
"!!docs",
3434
"!!locales",
3535
"!!typedoc",
@@ -178,12 +178,16 @@
178178
}
179179
}
180180
},
181-
// TODO: Wait until the rule gets options for ignoring doc comments and/or different parameter names,
182-
// and THEN enable it codebase-wide
181+
183182
"useUnifiedTypeSignatures": {
184-
"level": "info",
185-
"fix": "none",
186-
"options": {}
183+
"level": "warn",
184+
"fix": "unsafe",
185+
"options": {
186+
// Disable warnings on functions that differ only by parameter names or JSDoc comments, as these are often intentional
187+
// (e.g. marking one overload as deprecated)
188+
"ignoreDifferentlyNamedParameters": true,
189+
"ignoreDifferentJsDoc": true
190+
}
187191
},
188192
"useGroupedAccessorPairs": "error",
189193
"useObjectSpread": "error",
@@ -236,18 +240,21 @@
236240
"suspicious": {
237241
"noExtraNonNullAssertion": "error",
238242
"useErrorMessage": "error",
239-
"noEvolvingTypes": "warn", // TODO: Review and enable ASAP - this is VERY VERY BAD
243+
"noEvolvingTypes": "error",
244+
"noImplicitAnyLet": "off", // covered by noEvolvingTypes; no need for duplicate warnings
240245
"useNumberToFixedDigitsArgument": "error",
241-
"useGuardForIn": "warn", // TODO: Review and enable ASAP - this is EVEN FRICKING WORSE
246+
"useGuardForIn": "warn", // TODO: Review and enable ASAP
242247
"noDoubleEquals": "error",
243248
// While this would be a nice rule to enable, the current structure of the codebase makes this infeasible
244249
// due to being used for move/ability `args` params and save data-related code.
245250
// This can likely be enabled for all non-utils files once these are eventually reworked, but until then we leave it off.
246251
"noExplicitAny": "off",
247-
"noAssignInExpressions": "off",
248-
"noPrototypeBuiltins": "off", // TODO: enable this
252+
"noAssignInExpressions": "info", // TODO: Increase to "error" once all instances are fixed
253+
"noPrototypeBuiltins": {
254+
"level": "warn", // TODO: Add type guard global augment, fix errors and promote (adding a polyfill if needed)
255+
"fix": "unsafe"
256+
},
249257
"noFallthroughSwitchClause": "error", // Prevents accidental automatic fallthroughs in switch cases (use disable comment if needed)
250-
"noImplicitAnyLet": "warn", // TODO: Refactor and make this an error
251258
"noRedeclare": "info", // TODO: Refactor and make this an error
252259
"noGlobalIsNan": "error",
253260
"noGlobalIsFinite": "error",
@@ -257,7 +264,9 @@
257264
"noConstantBinaryExpressions": "error",
258265
"noTsIgnore": "error",
259266
"useIterableCallbackReturn": "warn", // TODO: Refactor and change to error
260-
"noNonNullAssertedOptionalChain": "warn" // TODO: Refactor and change to error
267+
"noNonNullAssertedOptionalChain": "warn", // TODO: Refactor and change to error
268+
"noDuplicateDependencies": "error",
269+
"noImportCycles": "error"
261270
},
262271
"complexity": {
263272
"useWhile": "error",
@@ -272,7 +281,12 @@
272281
"noThisInStatic": "error",
273282
"noUselessThisAlias": "error",
274283
"noUselessTernary": "error",
275-
"useIndexOf": "error"
284+
"useIndexOf": "error",
285+
"noUselessUndefined": "error",
286+
"useMaxParams": {
287+
"level": "info", // TODO: Change to "error"... eventually...
288+
"options": { "max": 7 }
289+
}
276290
},
277291
"performance": {
278292
"noNamespaceImport": "error",
@@ -286,16 +300,7 @@
286300
"noMultiStr": "error",
287301
"noProto": "error",
288302
"useFind": "error",
289-
"noUselessUndefined": "error",
290-
"useMaxParams": {
291-
"level": "info", // TODO: Change to "error"... eventually...
292-
"options": {
293-
"max": 7
294-
}
295-
},
296303
"noShadow": "warn", // TODO: refactor and make "error"
297-
"noDuplicateDependencies": "error",
298-
"noImportCycles": "error",
299304
// TODO: Change to error once promises are used properly
300305
"noMisusedPromises": "info"
301306
}
@@ -348,6 +353,7 @@
348353
"noNonNullAssertion": "off" // tedious in some tests
349354
},
350355
"nursery": {
356+
// TODO: Enable for normal test folder files as well
351357
"noFloatingPromises": "error"
352358
}
353359
}

0 commit comments

Comments
 (0)