Merge remote-tracking branch 'upstream/beta' into battle-move-flyout

This commit is contained in:
Bertie690 2025-09-10 15:56:14 -04:00
commit ad2faa11d9
2105 changed files with 86846 additions and 95382 deletions

View File

@ -5,9 +5,7 @@ module.exports = {
name: "no-non-type-@type-exports", name: "no-non-type-@type-exports",
severity: "error", severity: "error",
comment: comment:
"Files in @types should not export anything but types and interfaces. " + "Files in @types should not export anything but types and interfaces. The folder is intended to house imports that are removed at runtime, and thus should not contain anything with a bearing on runtime code.",
"The folder is intended to house imports that are removed at runtime, " +
"and thus should not contain anything with a bearing on runtime code.",
from: {}, from: {},
to: { to: {
path: "(^|/)src/@types", path: "(^|/)src/@types",
@ -29,8 +27,7 @@ module.exports = {
name: "no-circular-at-runtime", name: "no-circular-at-runtime",
severity: "error", severity: "error",
comment: comment:
"This dependency is part of a circular relationship. You might want to revise " + "This dependency is part of a circular relationship. You might want to revise your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ",
"your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ",
from: {}, from: {},
to: { to: {
circular: true, circular: true,
@ -42,11 +39,7 @@ module.exports = {
{ {
name: "no-orphans", name: "no-orphans",
comment: comment:
"This is an orphan module - it's likely not used (anymore?). Either use it or " + "This is an orphan module - it's likely not used (anymore?). Either use it or remove it. If it's logical this module is an orphan (i.e. it's a config file), add an exception for it in your dependency-cruiser configuration. By default this rule does not scrutinize dot-files (e.g. .eslintrc.js), TypeScript declaration files (.d.ts), tsconfig.json and some of the babel and webpack configs.",
"remove it. If it's logical this module is an orphan (i.e. it's a config file), " +
"add an exception for it in your dependency-cruiser configuration. By default " +
"this rule does not scrutinize dot-files (e.g. .eslintrc.js), TypeScript declaration " +
"files (.d.ts), tsconfig.json and some of the babel and webpack configs.",
severity: "error", severity: "error",
from: { from: {
orphan: true, orphan: true,
@ -63,8 +56,7 @@ module.exports = {
{ {
name: "no-deprecated-core", name: "no-deprecated-core",
comment: comment:
"A module depends on a node core module that has been deprecated. Find an alternative - these are " + "A module depends on a node core module that has been deprecated. Find an alternative - these are bound to exist - node doesn't deprecate lightly.",
"bound to exist - node doesn't deprecate lightly.",
severity: "error", severity: "error",
from: {}, from: {},
to: { to: {
@ -96,8 +88,7 @@ module.exports = {
{ {
name: "not-to-deprecated", name: "not-to-deprecated",
comment: comment:
"This module uses a (version of an) npm module that has been deprecated. Either upgrade to a later " + "This module uses a (version of an) npm module that has been deprecated. Either upgrade to a later version of that module, or find an alternative. Deprecated modules are a security risk.",
"version of that module, or find an alternative. Deprecated modules are a security risk.",
severity: "error", severity: "error",
from: {}, from: {},
to: { to: {
@ -108,10 +99,7 @@ module.exports = {
name: "no-non-package-json", name: "no-non-package-json",
severity: "error", severity: "error",
comment: comment:
"This module depends on an npm package that isn't in the 'dependencies' section of your package.json. " + "This module depends on an npm package that isn't in the 'dependencies' section of your package.json. That's problematic as the package either (1) won't be available on live (2 - worse) will be available on live with an non-guaranteed version. Fix it by adding the package to the dependencies in your package.json.",
"That's problematic as the package either (1) won't be available on live (2 - worse) will be " +
"available on live with an non-guaranteed version. Fix it by adding the package to the dependencies " +
"in your package.json.",
from: {}, from: {},
to: { to: {
dependencyTypes: ["npm-no-pkg", "npm-unknown"], dependencyTypes: ["npm-no-pkg", "npm-unknown"],
@ -120,8 +108,7 @@ module.exports = {
{ {
name: "not-to-unresolvable", name: "not-to-unresolvable",
comment: comment:
"This module depends on a module that cannot be found ('resolved to disk'). If it's an npm " + "This module depends on a module that cannot be found ('resolved to disk'). If it's an npm module: add it to your package.json. In all other cases you likely already know what to do.",
"module: add it to your package.json. In all other cases you likely already know what to do.",
severity: "error", severity: "error",
from: {}, from: {},
to: { to: {
@ -131,9 +118,7 @@ module.exports = {
{ {
name: "no-duplicate-dep-types", name: "no-duplicate-dep-types",
comment: comment:
"Likely this module depends on an external ('npm') package that occurs more than once " + "Likely this module depends on an external ('npm') package that occurs more than once in your package.json i.e. bot as a devDependencies and in dependencies. This will cause maintenance problems later on.",
"in your package.json i.e. bot as a devDependencies and in dependencies. This will cause " +
"maintenance problems later on.",
severity: "error", severity: "error",
from: {}, from: {},
to: { to: {
@ -150,9 +135,7 @@ module.exports = {
{ {
name: "not-to-spec", name: "not-to-spec",
comment: comment:
"This module depends on a spec (test) file. The sole responsibility of a spec file is to test code. " + "This module depends on a spec (test) file. The sole responsibility of a spec file is to test code. If there's something in a spec that's of use to other modules, it doesn't have that single responsibility anymore. Factor it out into (e.g.) a separate utility/ helper or a mock.",
"If there's something in a spec that's of use to other modules, it doesn't have that single " +
"responsibility anymore. Factor it out into (e.g.) a separate utility/ helper or a mock.",
severity: "error", severity: "error",
from: {}, from: {},
to: { to: {
@ -163,11 +146,7 @@ module.exports = {
name: "not-to-dev-dep", name: "not-to-dev-dep",
severity: "error", severity: "error",
comment: comment:
"This module depends on an npm package from the 'devDependencies' section of your " + "This module depends on an npm package from the 'devDependencies' section of your package.json. It looks like something that ships to production, though. To prevent problems with npm packages that aren't there on production declare it (only!) in the 'dependencies'section of your package.json. If this module is development only - add it to the from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration",
"package.json. It looks like something that ships to production, though. To prevent problems " +
"with npm packages that aren't there on production declare it (only!) in the 'dependencies'" +
"section of your package.json. If this module is development only - add it to the " +
"from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration",
from: { from: {
path: "^(src)", path: "^(src)",
pathNot: ["[.](?:spec|test|setup|script)[.](?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$", "./test"], pathNot: ["[.](?:spec|test|setup|script)[.](?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$", "./test"],
@ -184,10 +163,7 @@ module.exports = {
name: "optional-deps-used", name: "optional-deps-used",
severity: "info", severity: "info",
comment: comment:
"This module depends on an npm package that is declared as an optional dependency " + "This module depends on an npm package that is declared as an optional dependency in your package.json. As this makes sense in limited situations only, it's flagged here. If you're using an optional dependency here by design - add an exception to yourdependency-cruiser configuration.",
"in your package.json. As this makes sense in limited situations only, it's flagged here. " +
"If you're using an optional dependency here by design - add an exception to your" +
"dependency-cruiser configuration.",
from: {}, from: {},
to: { to: {
dependencyTypes: ["npm-optional"], dependencyTypes: ["npm-optional"],
@ -196,10 +172,7 @@ module.exports = {
{ {
name: "peer-deps-used", name: "peer-deps-used",
comment: comment:
"This module depends on an npm package that is declared as a peer dependency " + "This module depends on an npm package that is declared as a peer dependency in your package.json. This makes sense if your package is e.g. a plugin, but in other cases - maybe not so much. If the use of a peer dependency is intentional add an exception to your dependency-cruiser configuration.",
"in your package.json. This makes sense if your package is e.g. a plugin, but in " +
"other cases - maybe not so much. If the use of a peer dependency is intentional " +
"add an exception to your dependency-cruiser configuration.",
severity: "error", severity: "error",
from: {}, from: {},
to: { to: {

View File

@ -0,0 +1,61 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {
"installDirectlyFromGitHubRelease": true,
"version": "latest"
},
"ghcr.io/devcontainers-extra/features/pnpm:2": {
"version": "latest"
}
},
"customizations": {
"vscode": {
"settings": {
// # Formatter configs
"editor.defaultFormatter": "biomejs.biome",
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.codeActionsOnSave": {
"source.addMissingImports.ts": "always",
"source.removeUnusedImports": "always",
"source.fixAll.biome": "always",
"source.organizeImports.biome": "always"
},
"biome.suggestInstallingGlobally": false,
// # JS/TS setting overrides
"javascript.preferences.importModuleSpecifier": "non-relative",
"javascript.preferences.importModuleSpecifierEnding": "index",
"javascript.preferGoToSourceDefinition": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.importModuleSpecifierEnding": "index",
"typescript.preferGoToSourceDefinition": true,
"typescript.updateImportsOnFileMove.enabled": "always",
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
// # Miscellaneous
"npm.packageManager": "pnpm",
"npm.scriptRunner": "pnpm",
"vitest.cliArguments": "--no-isolate"
},
"extensions": [
"biomejs.biome",
"YoavBls.pretty-ts-errors",
"vitest.explorer",
"adpyke.codesnap", // Bind to a hotkey (ctrl+\, etc) for best results
"aaron-bond.better-comments",
"MuTsunTsai.jsdoc-link"
]
}
},
"postCreateCommand": "pnpm install",
"forwardPorts": [8000]
}

7
.dockerignore Normal file
View File

@ -0,0 +1,7 @@
# .dockerignore
node_modules
*.log
*.md
.gitignore
Dockerfile
.env

View File

@ -3,7 +3,7 @@
# top-most EditorConfig file # top-most EditorConfig file
root = true root = true
[src/*.{js,ts}] [**/*.{js,ts,json,jsonc}]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
end_of_line = lf end_of_line = lf

10
.github/CODEOWNERS vendored
View File

@ -3,9 +3,6 @@
# everything (whole code-base) - Junior Devs # everything (whole code-base) - Junior Devs
* @pagefaultgames/junior-dev-team * @pagefaultgames/junior-dev-team
# github actions/templates etc. - Dev Leads
/.github @pagefaultgames/senior-dev-team
# Art Team # Art Team
/public/**/*.png @pagefaultgames/art-team /public/**/*.png @pagefaultgames/art-team
/public/**/*.json @pagefaultgames/art-team /public/**/*.json @pagefaultgames/art-team
@ -20,3 +17,10 @@
# Balance Files; contain actual code logic and must also be owned by dev team # Balance Files; contain actual code logic and must also be owned by dev team
/src/data/balance @pagefaultgames/balance-team @pagefaultgames/junior-dev-team /src/data/balance @pagefaultgames/balance-team @pagefaultgames/junior-dev-team
/src/data/trainers @pagefaultgames/balance-team @pagefaultgames/junior-dev-team
# GitHub actions/templates etc. - Senior Devs
# Should be defined last in the file to make sure these always override all other definitions
/.github @pagefaultgames/senior-dev-team
package.json @pagefaultgames/senior-dev-team
pnpm-lock.yaml @pagefaultgames/senior-dev-team

View File

@ -20,6 +20,7 @@ permissions:
jobs: jobs:
create-release: create-release:
if: github.repository == 'pagefaultgames/pokerogue' && (vars.BETA_DEPLOY_BRANCH == '' || ! startsWith(vars.BETA_DEPLOY_BRANCH, 'release')) if: github.repository == 'pagefaultgames/pokerogue' && (vars.BETA_DEPLOY_BRANCH == '' || ! startsWith(vars.BETA_DEPLOY_BRANCH, 'release'))
timeout-minutes: 10
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for github cli commands GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for github cli commands
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -36,27 +37,40 @@ jobs:
exit 1 exit 1
fi fi
shell: bash shell: bash
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.PAGEFAULT_APP_ID }}
private-key: ${{ secrets.PAGEFAULT_APP_PRIVATE_KEY }}
- name: Check out code - name: Check out code
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
submodules: "recursive" submodules: "recursive"
# Always base off of beta branch, regardless of the branch the workflow was triggered from. # Always base off of beta branch, regardless of the branch the workflow was triggered from.
ref: beta ref: beta
token: ${{ steps.app-token.outputs.token }}
- name: Create release branch - name: Create release branch
run: git checkout -b release run: git checkout -b release
# In order to be able to open a PR into beta, we need the branch to have at least one change.
- name: Overwrite RELEASE file # In order to be able to open a PR into beta, we need the branch to have at least one commit.
# The first commit is _usually_ just bumping the version number, so we can kill 2 birds with 1 stone here
- name: Bump release version
run: | run: |
git config --local user.name "github-actions[bot]" git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
echo "Release v${{ github.event.inputs.versionName }}" > RELEASE pnpm --no-git-tag-version version ${{ github.events.inputs.versionName }}
git add RELEASE git commit -am "Stage release for v${{ github.events.inputs.versionName }}"
git commit -m "Stage release v${{ github.event.inputs.versionName }}"
- name: Push new branch - name: Push new branch
run: git push origin release run: git push origin release
# The repository variable is used by the deploy-beta workflow to determine whether to deploy from beta or release. # The repository variable is used by the deploy-beta workflow to determine whether to deploy from beta or release.
- name: Set repository variable - name: Set repository variable
run: GITHUB_TOKEN="${{ secrets.RW_VARS_PAT }}" gh variable set BETA_DEPLOY_BRANCH --body "release" run: GITHUB_TOKEN="${{ steps.app-token.outputs.token }}" gh variable set BETA_DEPLOY_BRANCH --body "release"
- name: Create pull request to main - name: Create pull request to main
run: | run: |
gh pr create --base main \ gh pr create --base main \
@ -64,6 +78,7 @@ jobs:
--title "Release v${{ github.event.inputs.versionName }} to main" \ --title "Release v${{ github.event.inputs.versionName }} to main" \
--body "This PR is for the release of v${{ github.event.inputs.versionName }}, and was created automatically by the GitHub Actions workflow invoked by ${{ github.actor }}" \ --body "This PR is for the release of v${{ github.event.inputs.versionName }}, and was created automatically by the GitHub Actions workflow invoked by ${{ github.actor }}" \
--draft --draft
- name: Create pull request to beta - name: Create pull request to beta
run: | run: |
gh pr create --base beta \ gh pr create --base beta \

View File

@ -12,6 +12,7 @@ on:
jobs: jobs:
deploy: deploy:
if: github.repository == 'pagefaultgames/pokerogue' && github.ref_name == (vars.BETA_DEPLOY_BRANCH || 'beta') if: github.repository == 'pagefaultgames/pokerogue' && github.ref_name == (vars.BETA_DEPLOY_BRANCH || 'beta')
timeout-minutes: 10
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -21,8 +22,6 @@ jobs:
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:

View File

@ -11,6 +11,7 @@ on:
jobs: jobs:
deploy: deploy:
if: github.repository == 'pagefaultgames/pokerogue' if: github.repository == 'pagefaultgames/pokerogue'
timeout-minutes: 10
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -19,8 +20,6 @@ jobs:
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:

View File

@ -4,10 +4,15 @@ on:
push: push:
branches: branches:
- main - main
- beta
- release
- 'hotfix*'
pull_request: pull_request:
branches: branches:
- main - main
- beta - beta
- release
- 'hotfix*'
merge_group: merge_group:
types: [checks_requested] types: [checks_requested]
@ -15,31 +20,32 @@ jobs:
pages: pages:
name: Github Pages name: Github Pages
if: github.repository == 'pagefaultgames/pokerogue' if: github.repository == 'pagefaultgames/pokerogue'
timeout-minutes: 10
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
api-dir: ./ docs-dir: ./pokerogue_docs
# Only push docs when running on pushes to main/beta
strategy: DRY_RUN: ${{github.event_name != 'push' || (github.ref_name != 'beta' && github.ref_name != 'main')}}
fail-fast: false
steps: steps:
- name: Checkout repository for Typedoc - name: Checkout repository for Typedoc
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
submodules: 'recursive'
path: pokerogue_docs path: pokerogue_docs
sparse-checkout: |
- name: Install OS package /*
run: | !/public/
sudo apt update /public/images/pokemon/variant/_exp_masterlist.json
sudo apt install -y git openssh-client /public/images/pokemon/variant/_masterlist.json
/public/images/logo.png
sparse-checkout-cone-mode: false
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4
with: with:
version: 10 version: 10
- name: Setup Node 22.14.1 - name: Setup Node
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version-file: "pokerogue_docs/.nvmrc" node-version-file: "pokerogue_docs/.nvmrc"
@ -52,26 +58,24 @@ jobs:
ref: gh-pages ref: gh-pages
- name: Install Node.js dependencies - name: Install Node.js dependencies
working-directory: ${{env.api-dir}} working-directory: ${{env.docs-dir}}
run: | run: pnpm i
cd pokerogue_docs
pnpm i
- name: Generate Typedoc docs - name: Generate Typedoc docs
working-directory: ${{env.api-dir}} working-directory: ${{env.docs-dir}}
run: | env:
cd pokerogue_docs REF_NAME: ${{github.ref_name}}
pnpm exec typedoc --out /tmp/docs --githubPages false --entryPoints ./src/ DRY_RUN: ${{env.DRY_RUN}}
run: pnpm typedoc
- name: Commit & Push docs - name: Commit & Push docs
if: github.event_name == 'push' # env vars are stored as strings instead of booleans (hence why an explicit check is required)
if: ${{ env.DRY_RUN == 'false'}}
run: | run: |
cd pokerogue_gh cd pokerogue_gh
git config user.email "github-actions[bot]@users.noreply.github.com" git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
mkdir -p $GITHUB_REF_NAME rsync -rd --delete /tmp/docs/ $GITHUB_REF_NAME
rm -rf $GITHUB_REF_NAME/*
cp -r /tmp/docs/. $GITHUB_REF_NAME
git add $GITHUB_REF_NAME git add $GITHUB_REF_NAME
git commit --allow-empty -m "[skip ci] Deploy docs" git commit -m "[skip ci] Deploy docs"
git push git push

View File

@ -5,43 +5,105 @@ on:
branches: branches:
- main - main
- beta - beta
- release
- 'hotfix*'
pull_request: pull_request:
branches: branches:
- main - main
- beta - beta
- release
- 'hotfix*'
merge_group: merge_group:
types: [checks_requested] types: [checks_requested]
jobs: jobs:
run-linters: run-linters:
name: Run linters name: Run all linters
timeout-minutes: 10
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out Git repository - name: Check out Git repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
submodules: 'recursive' submodules: "recursive"
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4
with:
version: 10
- name: Set up Node.js - name: Set up Node
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version-file: '.nvmrc' node-version-file: ".nvmrc"
cache: 'pnpm' cache: "pnpm"
- name: Install Node.js dependencies - name: Install Node modules
run: pnpm i run: pnpm i
- name: Lint with Biome # Lint files with Biome-Lint - https://biomejs.dev/linter/
- name: Run Biome-Lint
run: pnpm biome-ci run: pnpm biome-ci
id: biome_lint
continue-on-error: true
- name: Check dependencies with depcruise # Validate dependencies with dependency-cruiser - https://github.com/sverweij/dependency-cruiser
- name: Run Dependency-Cruise
run: pnpm depcruise run: pnpm depcruise
id: depcruise
continue-on-error: true
- name: Lint with ls-lint # Validate types with tsc - https://www.typescriptlang.org/docs/handbook/compiler-options.html#using-the-cli
run: pnpm ls-lint - name: Run Typecheck
run: pnpm typecheck
id: typecheck
continue-on-error: true
# The exact same thing
- name: Run Typecheck (scripts)
run: pnpm typecheck:scripts
id: typecheck-scripts
continue-on-error: true
- name: Evaluate for Errors
env:
BIOME_LINT_OUTCOME: ${{ steps.biome_lint.outcome }}
DEPCRUISE_OUTCOME: ${{ steps.depcruise.outcome }}
TYPECHECK_OUTCOME: ${{ steps.typecheck.outcome }}
TYPECHECK_SCRIPTS_OUTCOME: ${{ steps.typecheck-scripts.outcome }}
run: |
# Check for Errors
# Make text red.
red () {
printf "\e[31m%s\e[0m" "$1"
}
# Make text green.
green () {
printf "\e[32m%s\e[0m" "$1"
}
print_result() {
local name=$1
local outcome=$2
if [ "$outcome" == "success" ]; then
printf "$(green "✅ $name: $outcome")\n"
else
printf "$(red "❌ $name: $outcome")\n"
fi
}
print_result "Biome" "$BIOME_LINT_OUTCOME"
print_result "Depcruise" "$DEPCRUISE_OUTCOME"
print_result "Typecheck" "$TYPECHECK_OUTCOME"
print_result "Typecheck scripts" "$TYPECHECK_SCRIPTS_OUTCOME"
if [[ "$BIOME_LINT_OUTCOME" != "success" || \
"$DEPCRUISE_OUTCOME" != "success" || \
"$TYPECHECK_OUTCOME" != "success" || \
"$TYPECHECK_SCRIPTS_OUTCOME" != "success" ]]; then
printf "$(red "❌ One or more checks failed!")\n" >&2
exit 1
fi
printf "$(green "✅ All checks passed!")\n"

View File

@ -6,6 +6,7 @@ jobs:
# Set the BETA_DEPLOY_BRANCH variable to beta when a release branch is deleted # Set the BETA_DEPLOY_BRANCH variable to beta when a release branch is deleted
update-release-var: update-release-var:
if: github.repository == 'pagefaultgames/pokerogue' && github.event.ref_type == 'branch' && github.event.ref == 'release' if: github.repository == 'pagefaultgames/pokerogue' && github.event.ref_type == 'branch' && github.event.ref == 'release'
timeout-minutes: 5
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set BETA_DEPLOY_BRANCH to beta - name: Set BETA_DEPLOY_BRANCH to beta

View File

@ -21,6 +21,7 @@ jobs:
test: test:
# We can't use dynmically named jobs until https://github.com/orgs/community/discussions/13261 is implemented # We can't use dynmically named jobs until https://github.com/orgs/community/discussions/13261 is implemented
name: Shard name: Shard
timeout-minutes: 10
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ !inputs.skip }} if: ${{ !inputs.skip }}
steps: steps:
@ -31,8 +32,6 @@ jobs:
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4
with:
version: 10
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4

View File

@ -5,15 +5,21 @@ on:
branches: branches:
- main - main
- beta - beta
- release
- 'hotfix*'
pull_request: pull_request:
branches: branches:
- main - main
- beta - beta
- release
- 'hotfix*'
merge_group: merge_group:
types: [checks_requested] types: [checks_requested]
workflow_dispatch:
jobs: jobs:
check-path-change-filter: check-path-change-filter:
timeout-minutes: 5
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
pull-requests: read pull-requests: read
@ -22,6 +28,10 @@ jobs:
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
sparse-checkout: |
.github/test-filters.yml
sparse-checkout-cone-mode: false
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: filter id: filter
@ -32,6 +42,8 @@ jobs:
name: Run Tests name: Run Tests
needs: check-path-change-filter needs: check-path-change-filter
strategy: strategy:
# don't stop upon 1 shard failing
fail-fast: false
matrix: matrix:
shard: [1, 2, 3, 4, 5] shard: [1, 2, 3, 4, 5]
uses: ./.github/workflows/test-shard-template.yml uses: ./.github/workflows/test-shard-template.yml

6
.gitignore vendored
View File

@ -11,10 +11,12 @@ node_modules
dist dist
dist-ssr dist-ssr
*.local *.local
build
# Editor directories and files # Editor directories and files (excluding `extensions.json` for devcontainer)
.vscode
*.code-workspace *.code-workspace
.vscode/*
!.vscode/extensions.json
.idea .idea
.DS_Store .DS_Store
*.suo *.suo

View File

@ -11,17 +11,19 @@ _cfg: &cfg
ls: ls:
<<: *cfg <<: *cfg
src: src: &src
<<: *cfg <<: *cfg
.dir: kebab-case | regex:@types .dir: kebab-case | regex:@types
.js: exists:0 .js: exists:0
src/system/version-migration/versions: src/system/version-migration/versions:
.ts: snake_case .ts: snake_case
<<: *cfg <<: *cfg
test: *src
ignore: ignore:
- node_modules - node_modules
- .vscode - .vscode
- .github - .github
- .git - .git
- public - public
- dist
- .devcontainer

13
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,13 @@
{
"recommendations": [
"biomejs.biome",
"YoavBls.pretty-ts-errors",
"vitest.explorer",
// This stuff isn't mandatory - it's just nice to have :)
"adpyke.codesnap", // Bind to a hotkey (ctrl+\, etc) for best results
"aaron-bond.better-comments",
"MuTsunTsai.jsdoc-link"
]
}

View File

@ -18,17 +18,34 @@ We are here to help and the better you understand what you're working on, the ea
PokéRogue is built with [Typescript](https://www.typescriptlang.org/docs/handbook/intro.html), using the [Phaser](https://github.com/phaserjs/phaser) game framework. PokéRogue is built with [Typescript](https://www.typescriptlang.org/docs/handbook/intro.html), using the [Phaser](https://github.com/phaserjs/phaser) game framework.
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. 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.
## 💻 Environment Setup ## 💻 Environment Setup
### Prerequisites ### Codespaces/Devcontainer Environment
- node: >=22.14.0 - [manage with pnpm](https://pnpm.io/cli/env) | [manage with fnm](https://github.com/Schniz/fnm) | [manage with nvm](https://github.com/nvm-sh/nvm) Arguably the easiest way to get started is by using the prepared development environment.
We have a `.devcontainer/devcontainer.json` file, meaning we are compatible with:
- [![Open in GitHub Codespaces][codespaces-badge]][codespaces-link], or
- the [Visual Studio Code Remote - Containers][devcontainer-ext] extension.
This Linux environment comes with all required dependencies needed to start working on the project.
[codespaces-badge]: <https://github.com/codespaces/badge.svg>
[codespaces-link]: <https://github.com/codespaces/new?hide_repo_select=true&repo=620476224&ref=beta>
[devcontainer-ext]: <https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers>
### Local Development
#### Prerequisites
- node: >=22.14.0 - [manage with pnpm](https://pnpm.io/cli/env) | [manage with fnm](https://github.com/Schniz/fnm) | [manage with nvm](https://github.com/nvm-sh/nvm) | [manage with volta.sh](https://volta.sh/)
- pnpm: 10.x - [how to install](https://pnpm.io/installation) (not recommended to install via `npm` on Windows native) | [alternate method - volta.sh](https://volta.sh/) - pnpm: 10.x - [how to install](https://pnpm.io/installation) (not recommended to install via `npm` on Windows native) | [alternate method - volta.sh](https://volta.sh/)
- The repository [forked](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) and [cloned](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) locally on your device - The repository [forked](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) and [cloned](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) locally on your device
### Running Locally #### Running Locally
1. Run `pnpm install` from the repository root 1. Run `pnpm install` from the repository root
- *if you run into any errors, reach out in the **#dev-corner** channel on Discord* - *if you run into any errors, reach out in the **#dev-corner** channel on Discord*
@ -50,7 +67,7 @@ Most issues are bugs and are labeled with their area, such as `Move`, `Ability`,
- `P2`: Minor - Incorrect (but non-crashing) move/ability/interaction - `P2`: Minor - Incorrect (but non-crashing) move/ability/interaction
- `P3`: No gameplay impact - typo, minor graphical error, etc. - `P3`: No gameplay impact - typo, minor graphical error, etc.
Also under issues, you can take a look at the [List of Partial / Unimplemented Moves and Abilities](https://github.com/pagefaultgames/pokerogue/issues/3503) and the [Bug Board](https://github.com/orgs/pagefaultgames/projects/3) (the latter is essentially the same as the issues page but easier to work with). Also under issues, you can take a look at the [List of Partial / Unimplemented Moves and Abilities](https://github.com/pagefaultgames/pokerogue/issues/3503) and the [Bug Board](https://github.com/orgs/pagefaultgames/projects/3). The latter is essentially the same as the issues page, so take your pick.
You are free to comment on any issue so that you may be assigned to it and we can avoid multiple people working on the same thing. You are free to comment on any issue so that you may be assigned to it and we can avoid multiple people working on the same thing.
@ -58,12 +75,13 @@ You are free to comment on any issue so that you may be assigned to it and we ca
You can find the auto-generated documentation [here](https://pagefaultgames.github.io/pokerogue/main/index.html). You can find the auto-generated documentation [here](https://pagefaultgames.github.io/pokerogue/main/index.html).
Additionally, the [docs folder](./docs) contains a variety of in-depth documents and guides useful for aspiring contributors. Additionally, the [docs folder](./docs) contains a variety of in-depth documents and guides useful for aspiring contributors. \
Notable topics include: Notable topics include:
- [Commenting your code](./docs/comments.md) - [Commenting your code](./docs/comments.md)
- [Linting & Formatting](./docs/linting.md) - [Linting & Formatting](./docs/linting.md)
- [Localization](./docs/localization.md) - [Localization](./docs/localization.md)
- [Enemy AI move selection](./docs/enemy-ai.md) - [Enemy AI move selection](./docs/enemy-ai.md)
- [Running with Podman](./docs/podman.md)
Again, if you have unanswered questions please feel free to ask! Again, if you have unanswered questions please feel free to ask!
@ -81,7 +99,7 @@ For example, here is how you could test a scenario where the player Pokemon has
```typescript ```typescript
const overrides = { const overrides = {
ABILITY_OVERRIDE: AbilityId.DROUGHT, ABILITY_OVERRIDE: AbilityId.DROUGHT,
OPP_MOVESET_OVERRIDE: MoveId.WATER_GUN, ENEMY_MOVESET_OVERRIDE: MoveId.WATER_GUN,
} satisfies Partial<InstanceType<typeof DefaultOverrides>>; } satisfies Partial<InstanceType<typeof DefaultOverrides>>;
``` ```

View File

@ -24,9 +24,10 @@
- Pokémon Sword/Shield - Pokémon Sword/Shield
- Pokémon Legends: Arceus - Pokémon Legends: Arceus
- Pokémon Scarlet/Violet - Pokémon Scarlet/Violet
- Firel (Custom Graveyard, Ice Cave, Laboratory, Metropolis, Plains, Power Plant, Seabed, Space, and Volcano biome music) - Firel (Custom Graveyard, Ice Cave, Laboratory, Metropolis, Plains, Power Plant, Seabed, Space, Volcano, and Desert biome music)
- Lmz (Custom Ancient Ruins, Jungle, and Lake biome music) - Lmz (Custom Ancient Ruins, Jungle, and Lake biome music)
- Andr06 (Custom Forest, Slum and Sea biome music) - Andr06 (Custom Forest, Slum, Sea, and Fairy Cave biome music)
- Leavannite (Custom Wasteland biome music)
- _tresnoir - _tresnoir
- unveiler - unveiler

47
Dockerfile Normal file
View File

@ -0,0 +1,47 @@
# syntax=docker/dockerfile:1
ARG NODE_VERSION=22.14
ARG OS=alpine
FROM node:${NODE_VERSION}-${OS}
# Create non-root user
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
# Install git (for potential runtime needs)
RUN apk add --no-cache git
# Set working directory
WORKDIR /app
# Enable and prepare pnpm
RUN corepack enable && corepack prepare pnpm@10.14.0 --activate
COPY . .
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Install all dependencies
RUN --mount=type=cache,target=/home/appuser/.pnpm-store \
pnpm install --frozen-lockfile && \
rm -rf /home/appuser/.pnpm-store/*
# Change ownership
RUN chown -R appuser:appgroup /app
# Switch to non-root user
USER appuser
# Set environment variables
ENV VITE_BYPASS_LOGIN=1 \
VITE_BYPASS_TUTORIAL=0 \
NEXT_TELEMETRY_DISABLED=1 \
PNP_HOME=/home/appuser/.shrc \
NODE_ENV=development \
PORT=8000
# Expose port
EXPOSE $PORT
# Start the app in development mode
CMD ["pnpm", "run", "start:podman"]

View File

@ -1,4 +1,9 @@
<picture><img src="./public/images/logo.png" width="300" alt="PokéRogue"></picture> <div align="center"><picture><img src="./public/images/logo.png" width="300" alt="PokéRogue"></picture>
[![Discord Static Badge](https://img.shields.io/badge/Community_Discord-blurple?style=flat&logo=discord&logoSize=auto&labelColor=white&color=5865F2)](https://discord.gg/pokerogue)
[![Docs Coverage Static Badge](https://pagefaultgames.github.io/pokerogue/beta/coverage.svg)](https://pagefaultgames.github.io/pokerogue/beta)
[![Testing Badge](https://github.com/pagefaultgames/pokerogue/actions/workflows/tests.yml/badge.svg)](https://github.com/pagefaultgames/pokerogue/actions/workflows/tests.yml)
[![License: GNU AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)</div>
PokéRogue is a browser based Pokémon fangame heavily inspired by the roguelite genre. Battle endlessly while gathering stacking items, exploring many different biomes, fighting trainers, bosses, and more! PokéRogue is a browser based Pokémon fangame heavily inspired by the roguelite genre. Battle endlessly while gathering stacking items, exploring many different biomes, fighting trainers, bosses, and more!
@ -7,7 +12,7 @@ PokéRogue is a browser based Pokémon fangame heavily inspired by the roguelite
See [CONTRIBUTING.md](./CONTRIBUTING.md), this includes instructions on how to set up the game locally. See [CONTRIBUTING.md](./CONTRIBUTING.md), this includes instructions on how to set up the game locally.
# 📝 Credits # 📝 Credits
>
> If this project contains assets you have produced and you do not see your name, **please** reach out, either [here on GitHub](https://github.com/pagefaultgames/pokerogue/issues/new) or via [Discord](https://discord.gg/pokerogue). > If this project contains assets you have produced and you do not see your name, **please** reach out, either [here on GitHub](https://github.com/pagefaultgames/pokerogue/issues/new) or via [Discord](https://discord.gg/pokerogue).
Thank you to all the wonderful people that have contributed to the PokéRogue project! You can find the credits [here](./CREDITS.md). Thank you to all the wonderful people that have contributed to the PokéRogue project! You can find the credits [here](./CREDITS.md).

View File

@ -1,7 +1,7 @@
{ {
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json", "$schema": "https://biomejs.dev/schemas/2.2.3/schema.json",
"vcs": { "vcs": {
"enabled": false, "enabled": true,
"clientKind": "git", "clientKind": "git",
"useIgnoreFile": true, "useIgnoreFile": true,
"defaultBranch": "beta" "defaultBranch": "beta"
@ -10,7 +10,7 @@
"enabled": true, "enabled": true,
"useEditorconfig": true, "useEditorconfig": true,
"indentStyle": "space", "indentStyle": "space",
"includes": ["**", "!**/src/enums/**/*", "!**/src/data/balance/**/*"], "includes": ["**", "!**/src/data/balance/**"],
"lineWidth": 120 "lineWidth": 120
}, },
"files": { "files": {
@ -19,15 +19,12 @@
// and having to verify whether each individual file is ignored // and having to verify whether each individual file is ignored
"includes": [ "includes": [
"**", "**",
"!**/*.d.ts", "!**/dist",
"!**/dist/**/*", "!**/coverage",
"!**/build/**/*", "!**/public",
"!**/coverage/**/*", "!**/.github",
"!**/public/**/*", "!**/node_modules",
"!**/.github/**/*", "!**/typedoc",
"!**/node_modules/**/*",
"!**/.vscode/**/*",
"!**/typedoc/**/*",
// TODO: lint css and html? // TODO: lint css and html?
"!**/*.css", "!**/*.css",
"!**/*.html", "!**/*.html",
@ -37,7 +34,6 @@
"!**/src/data/balance/tms.ts" "!**/src/data/balance/tms.ts"
] ]
}, },
"assist": { "assist": {
"actions": { "actions": {
"source": { "source": {
@ -50,28 +46,75 @@
} }
} }
}, },
// TODO: Remove unneeded `options` blocks once biome's JSON schema is fixed to not require them
"linter": { "linter": {
"enabled": true, "enabled": true,
"rules": { "rules": {
"recommended": true, "recommended": true,
"correctness": { "correctness": {
"noUndeclaredVariables": "off", "noUndeclaredVariables": "error",
"noUnusedVariables": "error", "noUnusedVariables": "error",
"noSwitchDeclarations": "error", "noSwitchDeclarations": "error",
"noVoidTypeReturn": "error", "noVoidTypeReturn": "error",
"noUnusedImports": { "noUnusedImports": {
"level": "error", "level": "error",
"fix": "safe" "fix": "safe",
"options": {}
}, },
"noUnusedFunctionParameters": "error", "noUnusedFunctionParameters": "error",
"noUnusedLabels": "error", "noUnusedLabels": "error",
"noPrivateImports": "error" "noPrivateImports": "error",
"useSingleJsDocAsterisk": "error",
"useJsonImportAttributes": "off" // "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. ts(2823)"
}, },
"style": { "style": {
"useEnumInitializers": "off", // large enums like Moves/Species would make this cumbersome "useExplicitLengthCheck": {
"level": "error",
"fix": "safe",
"options": {}
},
"useAtIndex": "error",
"noNegationElse": {
"level": "info", // TODO: Promote to error eventually
"fix": "unsafe", // duplicates else blocks
"options": {}
},
// TODO: Fix all instances of this and promote to `error` - this and enums are the 2 things
// barring us from `esModuleInterop`
"noParameterProperties": "warn",
"useConsistentBuiltinInstantiation": {
"level": "error",
"fix": "safe",
"options": {}
},
"noDefaultExport": "warn", // TODO: Fix `overrides.ts` and enable
"noShoutyConstants": "error",
"useThrowNewError": {
"level": "error",
"fix": "safe",
"options": {}
},
"useThrowOnlyError": "error",
"useTrimStartEnd": "error",
"useReadonlyClassProperties": {
"level": "info", // TODO: Graduate to error eventually
"options": { "checkAllProperties": true }
},
"useConsistentObjectDefinitions": {
"level": "error",
"options": { "syntax": "shorthand" }
},
"useCollapsedIf": "error",
"useCollapsedElseIf": "error",
"noSubstr": "error",
"noYodaExpression": "error",
"useForOf": "error",
"useEnumInitializers": "off", // large enums like MoveId/SpeciesId would make this cumbersome
"useBlockStatements": { "useBlockStatements": {
"level": "error", "level": "error",
"fix": "safe" "fix": "safe",
"options": {}
}, },
"useConst": "error", "useConst": "error",
"useImportType": "error", "useImportType": "error",
@ -82,9 +125,14 @@
// TODO: Fix spots in the codebase where this flag would be triggered // TODO: Fix spots in the codebase where this flag would be triggered
// and then set to "error" and re-enable the fixer // and then set to "error" and re-enable the fixer
"level": "warn", "level": "warn",
"fix": "none" "fix": "none",
"options": {}
},
"useSingleVarDeclarator": {
"level": "error",
"fix": "safe",
"options": {}
}, },
"useSingleVarDeclarator": "off",
"useNodejsImportProtocol": "off", "useNodejsImportProtocol": "off",
"useTemplate": "off", // string concatenation is faster: https://stackoverflow.com/questions/29055518/are-es6-template-literals-faster-than-string-concatenation "useTemplate": "off", // string concatenation is faster: https://stackoverflow.com/questions/29055518/are-es6-template-literals-faster-than-string-concatenation
"useAsConstAssertion": "error", "useAsConstAssertion": "error",
@ -102,58 +150,80 @@
} }
} }
} }
} },
// TODO: Wait until the rule gets options for ignoring doc comments and/or different parameter names,
// and THEN enable it codebase-wide
"useUnifiedTypeSignatures": {
"level": "info",
"fix": "none",
"options": {}
},
"useGroupedAccessorPairs": "error",
"useObjectSpread": "error",
"useNumericSeparators": "off" // TODO: Consider enabling?
}, },
"suspicious": { "suspicious": {
"useErrorMessage": "error",
"noEvolvingTypes": "warn", // TODO: Review and enable ASAP - this is VERY VERY BAD
"useNumberToFixedDigitsArgument": "error",
"useGuardForIn": "warn", // TODO: Review and enable ASAP - this is EVEN FRICKING WORSE
"noDoubleEquals": "error", "noDoubleEquals": "error",
// While this would be a nice rule to enable, the current structure of the codebase makes this infeasible // While this would be a nice rule to enable, the current structure of the codebase makes this infeasible
// due to being used for move/ability `args` params and save data-related code. // due to being used for move/ability `args` params and save data-related code.
// This can likely be enabled for all non-utils files once these are eventually reworked, but until then we leave it off. // This can likely be enabled for all non-utils files once these are eventually reworked, but until then we leave it off.
"noExplicitAny": "off", "noExplicitAny": "off",
"noAssignInExpressions": "off", "noAssignInExpressions": "off",
"noPrototypeBuiltins": "off", "noPrototypeBuiltins": "off", // TODO: enable this
"noFallthroughSwitchClause": "error", // Prevents accidental automatic fallthroughs in switch cases (use disable comment if needed) "noFallthroughSwitchClause": "error", // Prevents accidental automatic fallthroughs in switch cases (use disable comment if needed)
"noImplicitAnyLet": "warn", // TODO: Refactor and make this an error "noImplicitAnyLet": "warn", // TODO: Refactor and make this an error
"noRedeclare": "info", // TODO: Refactor and make this an error "noRedeclare": "info", // TODO: Refactor and make this an error
"noGlobalIsNan": "off", "noGlobalIsNan": "error",
"noAsyncPromiseExecutor": "warn", // TODO: Refactor and make this an error "noAsyncPromiseExecutor": "warn", // TODO: Refactor and make this an error
"noVar": "error", "noVar": "error",
"noDocumentCookie": "off" // Firefox has minimal support for the "Cookie Store API" "noDocumentCookie": "off", // Firefox has minimal support for the "Cookie Store API"
"noConstantBinaryExpressions": "error",
"noTsIgnore": "error",
"useIterableCallbackReturn": "warn" // TODO: Refactor and change to error
}, },
"complexity": { "complexity": {
"useWhile": "error",
"noVoid": "warn", // TODO: Review and enable ASAP - this is also bad
"noUselessStringConcat": "error",
"noExcessiveCognitiveComplexity": "info", // TODO: Refactor and make this an error "noExcessiveCognitiveComplexity": "info", // TODO: Refactor and make this an error
"useLiteralKeys": "off", "useLiteralKeys": "off", // TODO: enable?
"noForEach": "off", // Foreach vs for of is not that simple. "noForEach": "off", // Foreach vs for of is not that simple.
"noUselessSwitchCase": "off", // Explicit > Implicit "noUselessSwitchCase": "off", // Explicit > Implicit
"noUselessConstructor": "error", "noUselessConstructor": "error",
"noBannedTypes": "warn", // TODO: Refactor and make this an error "noBannedTypes": "warn", // TODO: Refactor and make this an error
"noThisInStatic": "error", "noThisInStatic": "error",
"noUselessThisAlias": "error", "noUselessThisAlias": "error",
"noUselessTernary": "error" "noUselessTernary": "error",
"useIndexOf": "error"
}, },
"performance": { "performance": {
"noNamespaceImport": "error", "noNamespaceImport": "error",
"noDelete": "error" "noDelete": "error",
"noBarrelFile": "error"
}, },
"nursery": { "nursery": {
"useAdjacentGetterSetter": "error", "noUselessUndefined": "error",
"noConstantBinaryExpression": "error", "useMaxParams": {
"noTsIgnore": "error", "level": "warn", // TODO: Change to "error"... eventually...
"noAwaitInLoop": "off", "options": { "max": 4 } // A lot of stuff has a few params, but
"useJsonImportAttribute": "off", // "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. ts(2823)" },
"useIndexOf": "error", "noShadow": "warn", // TODO: refactor and make "error"
"useObjectSpread": "error", "noNonNullAssertedOptionalChain": "warn" // TODO: refactor and make "error"
"useNumericSeparators": "off", // TODO: enable?
"useIterableCallbackReturn": "warn", // TODO: refactor and make "error"
"noShadow": "warn" // TODO: refactor and make "error"
} }
} }
}, },
"javascript": { "javascript": {
"formatter": { "formatter": {
"quoteStyle": "double", "quoteStyle": "double",
"arrowParentheses": "asNeeded" "arrowParentheses": "asNeeded",
"operatorLinebreak": "before"
}, },
"globals": ["Phaser"],
"parser": { "parser": {
"jsxEverywhere": false "jsxEverywhere": false
} }
@ -168,7 +238,7 @@
"noNamespaceImport": "off" // this is required for `vi.spyOn` to work in some tests "noNamespaceImport": "off" // this is required for `vi.spyOn` to work in some tests
}, },
"style": { "style": {
"noNonNullAssertion": "off" "noNonNullAssertion": "off" // tedious in some tests
}, },
"nursery": { "nursery": {
"noFloatingPromises": "error" "noFloatingPromises": "error"
@ -177,9 +247,17 @@
} }
}, },
// Overrides to prevent unused import removal inside `overrides.ts` and enums files (for TSDoc linkcodes) // Overrides to prevent unused import removal inside `overrides.ts`, enums & `.d.ts` files (for TSDoc linkcodes),
// as well as inside script boilerplate files.
{ {
"includes": ["**/src/overrides.ts", "**/src/enums/**/*"], // TODO: Rename existing boilerplates in the folder and remove this last alias
"includes": [
"**/src/overrides.ts",
"**/src/enums/**/*",
"**/*.d.ts",
"scripts/**/*.boilerplate.ts",
"**/boilerplates/*.ts"
],
"linter": { "linter": {
"rules": { "rules": {
"correctness": { "correctness": {

View File

@ -1,48 +1,57 @@
# Linting & Formatting # Linting & Formatting
Writing clean, readable code is important, and linters and formatters are an integral part of ensuring code quality and readability. Writing clean, readable code is important, and linters and formatters are an integral part of ensuring code quality and readability. \
It is for this reason we are using [Biome](https://biomejs.dev), an opinionated linter/formatter (akin to Prettier) with a heavy focus on speed and performance. It is for this reason we are using [Biome](https://biomejs.dev), an opinionated linter/formatter (akin to Prettier) with a heavy focus on speed and performance.
### Installation ### Installation
You probably installed Biome already without noticing it - it's included inside `package.json` and should've been downloaded when you ran `pnpm install` after cloning the repo. If you haven't done that yet, go do it. You probably installed Biome already without noticing it - it's included inside `package.json` and should've been downloaded when you ran `pnpm install` after cloning the repo. If you haven't done that yet, go do that first.
# Using Biome # Using Biome
For the most part, Biome attempts to stay "out of your hair", letting you write code while enforcing a consistent formatting standard and only notifying for errors it can't automatically fix.\ For the most part, Biome attempts to stay "out of your hair", letting you write code while enforcing a consistent formatting standard and only notifying for errors it can't automatically fix. \
On the other hand, if Biome complains about a piece of code, **there's probably a good reason why**. Disable comments should be used sparingly or when readabilty demands it - your first instinct should be to fix the code in question, not disable the rule. On the other hand, if Biome complains about a piece of code, **there's probably a good reason why**. Disable comments should be used sparingly or when readabilty demands it - your first instinct should be to fix the code in question, not disable the rule.
## Editor Integration ## Editor Integration
Biome has integration with many popular code editors. See [these](https://biomejs.dev/guides/editors/first-party-extensions/) [pages](https://biomejs.dev/guides/editors/third-party-extensions/) for information about enabling Biome in your editor of choice. Biome has integration with many popular code editors. See [these](https://biomejs.dev/guides/editors/first-party-extensions/) [pages](https://biomejs.dev/guides/editors/third-party-extensions/) for information about enabling Biome in your editor of choice.
## Automated Runs ## Automated Runs
Generally speaking, most users shouldn't need to run Biome directly; in addition to editor integration, [pre-commit hook](../lefthook.yml) will periodically run Biome before each commit. Generally speaking, most users shouldn't need to run Biome directly; in addition to editor integration, a [pre-commit hook](../lefthook.yml) will automatically format and lint all staged files before each commit.
You will **not** be able to push code with `error`-level linting problems - fix them beforehand.
We also have a [Github Action](../.github/workflows/quality.yml) to verify code quality each time a PR is updated, preventing bad code from inadvertently making its way upstream. > ![WARNING]
> You will **not** be able to commit code if any staged files contain `error`-level linting problems. \
> If you, for whatever reason, _absolutely need_ to bypass Lefthook for a given commit,
> pass the `--no-verify` flag to `git commit`.
We also have a [Github Action](../.github/workflows/linting.yml) to verify code quality each time a PR is updated, preventing bad code from inadvertently making its way upstream. \
These are effectively the same commands as run by Lefthook, merely on a project-wide scale.
## Running Biome via CLI ## Running Biome via CLI
If you want Biome to check your files manually, you can run it from the command line like so: To run you Biome on your files manually, you have 2 main options:
1. Run the scripts included in `package.json` (`pnpm biome` and `pnpm biome:all`). \
These have sensible defaults for command-line options, but do not allow altering certain flags (as some cannot be specified twice in the same command)
```sh 2. Execute the Biome executable manually from the command line like so:
pnpm exec biome check --[flags] ```sh
``` pnpm exec biome check --[flags]
```
This allows customizing non-overridable flags like `--diagnostic-level` on a more granular level, but requires slightly more verbosity and specifying more options.
A full list of flags and options can be found on [their website](https://biomejs.dev/reference/cli/), but here's a few useful ones to keep in mind: A full list of flags and options can be found on [their website](https://biomejs.dev/reference/cli/), but here's a few useful ones to keep in mind:
- `--write` will cause Biome to write all "safe" fixes and formatting changes directly to your files (rather than just complaining and doing nothing). - `--write` will cause Biome to write all "safe" fixes and formatting changes directly to your files (rather than just complaining and erroring out).
- `--changed` and `--staged` will only perform checks on all changed or staged files respectively. Biome sources this info from the relevant version control system (in this case Git). - `--changed` and `--staged` will limit checking to all changed or staged files respectively. Biome sources this info from the relevant version control system (in this case `git`).
- `diagnostic-level=XXX` will only show diagnostics with at least the given severity level (`info/warn/error`). Useful to only focus on errors causing a failed workflow run or similar. - `diagnostic-level=XXX` will only show diagnostics with at least the given severity level (`info/warn/error`). Useful to only focus on errors causing a failed workflow run or similar.
## Linting Rules ## Linting Rules
We primarily use Biome's [recommended ruleset](https://biomejs.dev/linter/rules/) for linting JS/TS, with some customizations to better suit our project's needs[^1]. We primarily use Biome's [recommended ruleset](https://biomejs.dev/linter/rules/) for linting JS/TS files, with some customizations to better suit our project's needs[^1].
Some things to consider: Some things to consider:
- We have disabled rules that prioritize style over performance, such as `useTemplate`. - We have disabled rules that prioritize style over performance, such as `useTemplate`.
- Some rules are currently disabled or marked as warnings (`warn`) to allow for gradual refactoring without blocking development. **Do not write new code that triggers these warnings.** - Some rules are currently marked as warnings (`warn`) to allow for gradual refactoring without blocking development. **Do not write new code that triggers these rules!**
- The linter is configured to ignore specific files and folders (such as excessively large files or ones in need of refactoring) to improve performance and focus on actionable areas. - The linter is configured to ignore specific files and folders (such as excessively large files or ones in need of refactoring) to improve performance and focus on actionable areas.
Any questions about linting rules should be brought up in the `#dev-corner` channel in the discord. Any questions about linting rules can be brought up in the `#dev-corner` channel in the community Discord.
[^1]: A complete list of rules can be found in the `biome.jsonc` file in the project root. [^1]: A complete list of rules can be found in the [`biome.jsonc`](../biome.jsonc) file in the project root. Many rules are accompanied by comments explaining the reasons for their inclusion (or lack thereof).

View File

@ -1,6 +1,6 @@
# Localization 101 # Localization 101
PokéRogue's localization team puts immense effort into making the game accessible around the world, supporting over 12 different languages at the time of writing this document. PokéRogue's localization team puts immense effort into making the game accessible around the world, supporting over 12 different languages at the time of writing this document. \
As a developer, it's important to help maintain global accessibility by effectively coordinating with the Translation Team on any new features or enhancements. As a developer, it's important to help maintain global accessibility by effectively coordinating with the Translation Team on any new features or enhancements.
This document aims to cover everything you need to know to help keep the integration process for localization smooth and simple. This document aims to cover everything you need to know to help keep the integration process for localization smooth and simple.
@ -24,6 +24,7 @@ The parent repo (the "superproject") houses a cloned version of the 2nd reposito
>[!TIP] >[!TIP]
> Many popular IDEs have integrated `git` support with special handling around submodules: > Many popular IDEs have integrated `git` support with special handling around submodules:
>
> ![Image showing Visual Studio Code's `git` integration in the File Explorer. A blue "S" in the top right hand corner indicates the `public/locales` folder is a submodule.](https://github.com/user-attachments/assets/bd42d354-c65b-4cbe-8873-23d760dc1714 "What the `public/locales` submodule looks like in VS Code's File Explorer") > ![Image showing Visual Studio Code's `git` integration in the File Explorer. A blue "S" in the top right hand corner indicates the `public/locales` folder is a submodule.](https://github.com/user-attachments/assets/bd42d354-c65b-4cbe-8873-23d760dc1714 "What the `public/locales` submodule looks like in VS Code's File Explorer")
> >
> ![Image showing Visual Studio Code's Source Control tab. A separate dropdown can be seen for each individual submodule.](https://github.com/user-attachments/assets/8b4d3f64-aec1-4474-91df-03dc1252a2fa "Making commits on submodules without even changing directories!") > ![Image showing Visual Studio Code's Source Control tab. A separate dropdown can be seen for each individual submodule.](https://github.com/user-attachments/assets/8b4d3f64-aec1-4474-91df-03dc1252a2fa "Making commits on submodules without even changing directories!")
@ -32,14 +33,14 @@ The parent repo (the "superproject") houses a cloned version of the 2nd reposito
The following command will initialize your branch's locales repository and update its HEAD: The following command will initialize your branch's locales repository and update its HEAD:
```bash ```bash
git submodule update --init --recursive pnpm update-locales
``` ```
> [!TIP] > [!TIP]
> This command is run _automatically_ after cloning, merging or changing branches, so you should rarely have to run it manually. > This command is run _automatically_ after cloning, merging or changing branches, so you should rarely have to run it manually.
> [!IMPORTANT] > [!IMPORTANT]
> If you run into issues with the `locales` submodule, try deleting the `.git/modules/public` and `public/locales` folders before re-running the command. > If you EVER run into issues with the `locales` submodule, try deleting the `.git/modules/public` and `public/locales` folders before re-initializing it again.
## How Are Translations Integrated? ## How Are Translations Integrated?
@ -65,7 +66,7 @@ The basic process for fetching translated text goes roughly as follows:
``` ```
# Submitting Locales Changes # Submitting Locales Changes
If you have a feature or enhancement that requires additions or changes to in-game text, you will need to make a fork of the `pokerogue-locales` repo and submit your text changes as a pull request _in addition_ to your pull request to the main project. If you have a feature or enhancement that requires additions or changes to in-game text, you will need to make a fork of the `pokerogue-locales` repo and submit your text changes as a pull request _in addition_ to your pull request to the main project. \
Since these two PRs aren't _technically_ linked, it's important to coordinate with the Translation Team to ensure that both PRs are integrated safely into the project. Since these two PRs aren't _technically_ linked, it's important to coordinate with the Translation Team to ensure that both PRs are integrated safely into the project.
> [!CAUTION] > [!CAUTION]
@ -73,26 +74,30 @@ Since these two PRs aren't _technically_ linked, it's important to coordinate wi
## Making Changes ## Making Changes
One perk of submodules is you don't actually _need_ to clone the locales repository to start contributing - initializing the submodule already does that for you. One perk of submodules is you don't actually _need_ to clone the locales repository to start contributing - `git` already does that for you on initialization.
Given `pokerogue-locales` is a full-fledged `git` repository _inside_ `pokerogue`, making changes is roughly the same as normal, merely using `public/locales` as your root directory. Given `pokerogue-locales` is a full-fledged `git` repository _inside_ `pokerogue`, making changes is roughly the same as normal, merely using `public/locales` as your root directory.
> [!WARNING] > [!WARNING]
> Make sure to checkout or rebase onto `upstream/HEAD` **BEFORE** creating a PR! > Make sure to checkout or rebase onto `upstream/main` (`pnpm update-locales:remote`) **BEFORE** creating a locales PR!
> The checked-out commit is based on the superproject's SHA-1 by default, so hastily making changes may see you basing your commits on last week's `HEAD`. > The checked-out commit is based on the superproject's SHA-1 by default, so hastily making changes may see you basing your commits on last week's `HEAD`.
## Requirements for Adding Translated Text ## Requirements for Adding Translated Text
When your new feature or enhancement requires adding a new locales key **without changing text in existing keys**, we require the following workflow with regards to localization: When a new feature or enhancement requires adding a new locales key **without changing text in existing keys**, we have the following workflow with regards to localization:
1. You (the developer) make a pull request to the main repository for your new feature. 1. You (the developer) make a pull request to the main repository for your new feature.
If this feature requires new text, the text should be integrated into the code with a new `i18next` key pointing to where you plan to add it into the locales repository. If this feature requires new text, the text should be integrated into the code with a new `i18next` key pointing to where you plan to add it into the locales repository.
2. You then make another pull request — this time to the `pokerogue-locales` repository — adding a new entry with text for each key you added to your main PR. 2. You then make another pull request — this time to the `pokerogue-locales` repository — adding a new entry with text for each key you added to your main PR.
- You must add the corresponding **English keys** while making the PR; the Translation Team can take care of the rest[^2]. - You must add the corresponding **English keys** while making the PR; the Translation Team can take care of the rest[^2].
- For any feature pulled from the mainline Pokémon games (e.g. a Move or Ability implementation), it's best practice to include a source link for any added text. - For any feature pulled from the mainline Pokémon games (e.g. a Move or Ability implementation), it's best practice to include a source link for any added text. \
[Poké Corpus](https://abcboy101.github.io/poke-corpus/) is a great resource for finding text from the mainline games; otherwise, a video/picture showing the text being displayed should suffice. [Poké Corpus](https://abcboy101.github.io/poke-corpus/) is a great resource for finding text from the mainline games; otherwise, a video/picture showing the text being displayed should suffice.
- You should also [notify the current Head of Translation](#notifying-translation) to ensure a fast response. - You should also [notify the current Head of Translation](#notifying-translation) to ensure a fast response.
3. At this point, you may begin [testing locales integration in your main PR](#documenting-locales-changes). 3. Your locales should use the following format:
4. The Translation Team will approve the locale PR (after corrections, if necessary), then merge it into `pokerogue-locales`. - File names should be in `kebab-case`. Example: `trainer-names.json`
5. The Dev Team will approve your main PR for your feature, then merge it into PokéRogue's beta environment. - Key names should be in `camelCase`. Example: `aceTrainer`
- If you make use of i18next's inbuilt [context support](https://www.i18next.com/translation-function/context), you need to use `snake_case` for the context key. Example: `aceTrainer_male`
4. At this point, you may begin [testing locales integration in your main PR](#documenting-locales-changes).
5. The Translation Team will approve the locales PR (after corrections, if necessary), then merge it into `pokerogue-locales`.
6. The Dev Team will approve your main PR for your feature, then merge it into PokéRogue's beta environment.
[^2]: For those wondering, the reason for choosing English specifically is due to it being the master language set in Pontoon (the program used by the Translation Team to perform locale updates). [^2]: For those wondering, the reason for choosing English specifically is due to it being the master language set in Pontoon (the program used by the Translation Team to perform locale updates).
If a key is present in any language _except_ the master language, it won't appear anywhere else in the translation tool, rendering missing English keys quite a hassle. If a key is present in any language _except_ the master language, it won't appear anywhere else in the translation tool, rendering missing English keys quite a hassle.
@ -102,7 +107,7 @@ If a key is present in any language _except_ the master language, it won't appea
PRs that modify existing text have different risks with respect to coordination between development and translation, so their requirements are slightly different: PRs that modify existing text have different risks with respect to coordination between development and translation, so their requirements are slightly different:
- As above, you set up 2 PRs: one for the feature itself in the main repo, and another for the associated locales changes in the locale repo. - As above, you set up 2 PRs: one for the feature itself in the main repo, and another for the associated locales changes in the locale repo.
- Now, however, you need to have your main PR be approved by the Dev Team **before** your corresponding locale changes are merged in. - Now, however, you need to have your main PR be approved by the Dev Team **before** your corresponding locale changes are merged in.
- After your main PR is approved, the Translation Team will merge your locale PR, and you may update the submodule and post video evidence of integration into the **locales PR**. - After your main PR is approved, you may update the submodule and post video evidence of integration into the **locales PR**.
- A Lead or Senior Translator from the Translation Team will then approve your main PR (if all is well), clearing your feature for merging into `beta`. - A Lead or Senior Translator from the Translation Team will then approve your main PR (if all is well), clearing your feature for merging into `beta`.
## Documenting Locales Changes ## Documenting Locales Changes
@ -111,12 +116,12 @@ After making a PR involving any outwards-facing behavior (but _especially_ local
The basic procedure is roughly as follows: The basic procedure is roughly as follows:
1. Update your locales submodule to point to **the branch you used to make the locales PR**. \ 1. Update your locales submodule to point to **the branch you used to make the locales PR**. \
Many IDEs with `git` integration support doing this from the GUI, \ Many IDEs with `git` integration support doing this from the GUI, \
or you can simply do it via command-line: or you can simply do it via command-line:
```bash ```bash
cd public/locales cd public/locales
git checkout your-branch-name-here git checkout your-branch-name-here
``` ```
2. Set some of the [in-game overrides](../CONTRIBUTING.md#1---manual-testing) inside `overrides.ts` to values corresponding to the interactions being tested. 2. Set some of the [in-game overrides](../CONTRIBUTING.md#1---manual-testing) inside `overrides.ts` to values corresponding to the interactions being tested.
3. Start a local dev server (`pnpm start:dev`) and open localhost in your browser. 3. Start a local dev server (`pnpm start:dev`) and open localhost in your browser.
4. Take screenshots or record a video of the locales changes being displayed in-game using the software of your choice[^2]. 4. Take screenshots or record a video of the locales changes being displayed in-game using the software of your choice[^2].

27
docs/podman.md Normal file
View File

@ -0,0 +1,27 @@
# Using Podman
## Requirements
* `podman >=5.x`
## Steps
1. `podman build -t pokerogue -f Dockerfile .`
2. `podman create --name temp-pokerogue localhost/pokerogue`
3. `podman cp temp-pokerogue:/app/node_modules ./`
4. `podman cp temp-pokerogue:/app/public/locales ./public/`
5. `podman rm temp-pokerogue`
6. `podman run --rm -p 8000:8000 -v $(pwd):/app:Z --userns=keep-id -u $(id -u):$(id -g) localhost/pokerogue`
7. Visit `http://localhost:8000/`
Note:
1. Steps 2,3,4 are required because mounting working directory without installed `node_modules/` and assets locally will be empty,
this way we prevent it by copying them from the container itself to local directory
2. `podman run` may take a couple of minutes to mount the working directory
### Running tests inside container
`podman run --rm -p 8000:8000 -v $(pwd):/app:Z --userns=keep-id -u $(id -u):$(id -g) localhost/pokerogue pnpm test:silent
`

21
global.d.ts vendored
View File

@ -1,7 +1,6 @@
import type { AnyFn } from "#types/type-helpers";
import type { SetupServerApi } from "msw/node"; import type { SetupServerApi } from "msw/node";
export {};
declare global { declare global {
/** /**
* Only used in testing. * Only used in testing.
@ -11,4 +10,22 @@ declare global {
* To set up your own server in a test see `game-data.test.ts` * To set up your own server in a test see `game-data.test.ts`
*/ */
var server: SetupServerApi; var server: SetupServerApi;
// Overloads for `Function.apply` and `Function.call` to add type safety on matching argument types
interface Function {
apply<T extends AnyFn>(this: T, thisArg: ThisParameterType<T>, argArray: Parameters<T>): ReturnType<T>;
call<T extends AnyFn>(this: T, thisArg: ThisParameterType<T>, ...argArray: Parameters<T>): ReturnType<T>;
}
}
// Global augments for `typedoc` to prevent TS from erroring when editing the config JS file
declare module "typedoc" {
export interface TypeDocOptionMap {
coverageLabel: string;
coverageColor: string;
coverageOutputPath: string;
coverageOutputType: "svg" | "json" | "all";
coverageSvgWidth: number;
}
} }

View File

@ -4,7 +4,9 @@ pre-commit:
- rebase - rebase
commands: commands:
biome-lint: biome-lint:
run: pnpm exec biome check --write --reporter=summary --staged --no-errors-on-unmatched # Disable colors as certain IDEs don't support it in the output pane.
# Summary mode looks decent in plain ASCII anyhow
run: pnpm exec biome check --write --colors=off --reporter=summary --staged --no-errors-on-unmatched --diagnostic-level=error
stage_fixed: true stage_fixed: true
ls-lint: ls-lint:
run: pnpm exec ls-lint run: pnpm exec ls-lint
@ -12,11 +14,11 @@ pre-commit:
post-merge: post-merge:
commands: commands:
update-submodules: update-submodules:
run: git submodule update --init --recursive run: pnpm update-locales
post-checkout: post-checkout:
commands: commands:
update-submodules: update-submodules:
# cf https://git-scm.com/docs/githooks#_post_checkout: # cf https://git-scm.com/docs/githooks#_post_checkout:
# The 3rd argument is 1 for branch checkouts and 0 for file checkouts. # The 3rd argument is 1 for branch checkouts and 0 for file checkouts.
run: if test {3} -eq "1"; then git submodule update --init --recursive; fi run: if test {3} -eq "1"; then pnpm update-locales; fi

View File

@ -1,11 +1,13 @@
{ {
"name": "pokemon-rogue-battle", "name": "pokemon-rogue-battle",
"private": true, "private": true,
"version": "1.9.6", "version": "1.10.7",
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "vite", "start:prod": "vite --mode production",
"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",
"build": "vite build", "build": "vite build",
"build:beta": "vite build --mode beta", "build:beta": "vite build --mode beta",
"preview": "vite preview", "preview": "vite preview",
@ -14,34 +16,43 @@
"test:watch": "vitest watch --coverage --no-isolate", "test:watch": "vitest watch --coverage --no-isolate",
"test:silent": "vitest run --silent='passed-only' --no-isolate", "test:silent": "vitest run --silent='passed-only' --no-isolate",
"test:create": "node scripts/create-test/create-test.js", "test:create": "node scripts/create-test/create-test.js",
"eggMoves:parse": "node scripts/parse-egg-moves/main.js",
"scrape-trainers": "node scripts/scrape-trainer-names/main.js",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
"eslint": "eslint --fix .", "typecheck:scripts": "tsc -p scripts/jsconfig.json",
"eslint-ci": "eslint .", "biome": "biome check --write --changed --no-errors-on-unmatched --diagnostic-level=error",
"biome": "biome check --write --changed --no-errors-on-unmatched", "biome:all": "biome check --write --no-errors-on-unmatched --diagnostic-level=error",
"biome-ci": "biome ci --diagnostic-level=error --reporter=github --no-errors-on-unmatched", "biome-ci": "biome ci --diagnostic-level=error --reporter=github --no-errors-on-unmatched",
"docs": "typedoc", "typedoc": "typedoc",
"depcruise": "depcruise src test", "depcruise": "depcruise src test",
"postinstall": "lefthook install; git submodule update --init --recursive", "postinstall": "lefthook install; git submodule update --init --recursive",
"update-version:patch": "pnpm version patch --force --no-git-tag-version", "update-version:patch": "pnpm version patch --force --no-git-tag-version",
"update-version:minor": "pnpm version minor --force --no-git-tag-version", "update-version:minor": "pnpm version minor --force --no-git-tag-version",
"update-locales": "git submodule update --progress --init --recursive",
"update-locales:remote": "git submodule update --progress --init --recursive --force --remote" "update-locales:remote": "git submodule update --progress --init --recursive --force --remote"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "2.0.0", "@biomejs/biome": "2.2.3",
"@ls-lint/ls-lint": "2.3.1", "@ls-lint/ls-lint": "2.3.1",
"@types/crypto-js": "^4.2.0",
"@types/jsdom": "^21.1.7", "@types/jsdom": "^21.1.7",
"@types/node": "^22.16.3", "@types/node": "^22.16.5",
"@vitest/coverage-istanbul": "^3.2.4", "@vitest/coverage-istanbul": "^3.2.4",
"@vitest/expect": "^3.2.4",
"@vitest/utils": "^3.2.4",
"chalk": "^5.4.1", "chalk": "^5.4.1",
"dependency-cruiser": "^16.10.4", "dependency-cruiser": "^16.10.4",
"inquirer": "^12.7.0", "inquirer": "^12.8.2",
"jsdom": "^26.1.0", "jsdom": "^26.1.0",
"lefthook": "^1.12.2", "lefthook": "^1.12.2",
"msw": "^2.10.4", "msw": "^2.10.4",
"phaser3spectorjs": "^0.0.8", "phaser3spectorjs": "^0.0.8",
"typedoc": "^0.28.7", "typedoc": "^0.28.12",
"typedoc-github-theme": "^0.3.1",
"typedoc-plugin-coverage": "^4.0.1",
"typedoc-plugin-mdn-links": "^5.0.9",
"typescript": "^5.8.3", "typescript": "^5.8.3",
"vite": "^6.3.5", "vite": "^7.0.6",
"vite-tsconfig-paths": "^5.1.4", "vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.2.4", "vitest": "^3.2.4",
"vitest-canvas-mock": "^0.3.3" "vitest-canvas-mock": "^0.3.3"
@ -61,5 +72,6 @@
}, },
"engines": { "engines": {
"node": ">=22.0.0" "node": ">=22.0.0"
} },
"packageManager": "pnpm@10.14.0"
} }

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1102,6 +1102,112 @@
"volume": 100, "volume": 100,
"pitch": 136, "pitch": 136,
"eventType": "AnimTimedSoundEvent" "eventType": "AnimTimedSoundEvent"
},
{
"frameIndex": 0,
"resourceName": "PRAS- Strong Winds",
"bgX": 0,
"bgY": 0,
"opacity": 0,
"duration": 4,
"eventType": "AnimTimedAddBgEvent"
},
{
"frameIndex": 0,
"resourceName": "",
"bgX": 0,
"bgY": 0,
"opacity": 32,
"duration": 4,
"eventType": "AnimTimedUpdateBgEvent"
}
],
"4": [
{
"frameIndex": 4,
"resourceName": "",
"bgX": 10,
"bgY": 0,
"opacity": 64,
"duration": 4,
"eventType": "AnimTimedUpdateBgEvent"
}
],
"8": [
{
"frameIndex": 8,
"resourceName": "",
"bgX": 20,
"bgY": 0,
"opacity": 128,
"duration": 4,
"eventType": "AnimTimedUpdateBgEvent"
}
],
"12": [
{
"frameIndex": 12,
"resourceName": "",
"bgX": 30,
"bgY": 0,
"opacity": 128,
"duration": 4,
"eventType": "AnimTimedUpdateBgEvent"
}
],
"16": [
{
"frameIndex": 16,
"resourceName": "",
"bgX": 40,
"bgY": 0,
"opacity": 128,
"duration": 4,
"eventType": "AnimTimedUpdateBgEvent"
}
],
"20": [
{
"frameIndex": 20,
"resourceName": "",
"bgX": 50,
"bgY": 0,
"opacity": 128,
"duration": 4,
"eventType": "AnimTimedUpdateBgEvent"
}
],
"24": [
{
"frameIndex": 24,
"resourceName": "",
"bgX": 60,
"bgY": 0,
"opacity": 64,
"duration": 4,
"eventType": "AnimTimedUpdateBgEvent"
}
],
"28": [
{
"frameIndex": 28,
"resourceName": "",
"bgX": 70,
"bgY": 0,
"opacity": 32,
"duration": 4,
"eventType": "AnimTimedUpdateBgEvent"
}
],
"32": [
{
"frameIndex": 32,
"resourceName": "",
"bgX": 80,
"bgY": 0,
"opacity": 0,
"duration": 3,
"eventType": "AnimTimedUpdateBgEvent"
} }
] ]
}, },

View File

@ -333,8 +333,6 @@
"671-yellow", "671-yellow",
"6713", "6713",
"6713", "6713",
"672",
"672",
"6724", "6724",
"6724", "6724",
"673", "673",
@ -377,10 +375,6 @@
"690", "690",
"691", "691",
"691", "691",
"692",
"692",
"693",
"693",
"695", "695",
"695", "695",
"696", "696",
@ -503,10 +497,6 @@
"751", "751",
"752", "752",
"752", "752",
"753",
"753",
"754",
"754",
"755", "755",
"755", "755",
"756", "756",
@ -535,10 +525,6 @@
"767", "767",
"768", "768",
"768", "768",
"769",
"769",
"770",
"770",
"771", "771",
"771", "771",
"772", "772",
@ -761,10 +747,6 @@
"841", "841",
"842", "842",
"842", "842",
"843",
"843",
"844",
"844",
"845-gorging", "845-gorging",
"845-gorging", "845-gorging",
"845-gulping", "845-gulping",
@ -903,10 +885,6 @@
"900", "900",
"901", "901",
"901", "901",
"902-female",
"902-female",
"902",
"902",
"903", "903",
"903", "903",
"904", "904",
@ -1459,8 +1437,6 @@
"671b-yellow", "671b-yellow",
"6713b", "6713b",
"6713b", "6713b",
"672b",
"672b",
"6724b", "6724b",
"6724b", "6724b",
"673b", "673b",
@ -1503,10 +1479,6 @@
"690b", "690b",
"691b", "691b",
"691b", "691b",
"692b",
"692b",
"693b",
"693b",
"695b", "695b",
"695b", "695b",
"696b", "696b",
@ -1629,10 +1601,6 @@
"751b", "751b",
"752b", "752b",
"752b", "752b",
"753b",
"753b",
"754b",
"754b",
"755b", "755b",
"755b", "755b",
"756b", "756b",
@ -1661,10 +1629,6 @@
"767b", "767b",
"768b", "768b",
"768b", "768b",
"769b",
"769b",
"770b",
"770b",
"771b", "771b",
"771b", "771b",
"772b", "772b",
@ -1887,10 +1851,6 @@
"841b", "841b",
"842b", "842b",
"842b", "842b",
"843b",
"843b",
"844b",
"844b",
"845b-gorging", "845b-gorging",
"845b-gorging", "845b-gorging",
"845b-gulping", "845b-gulping",
@ -2029,10 +1989,6 @@
"900b", "900b",
"901b", "901b",
"901b", "901b",
"902b-female",
"902b-female",
"902b",
"902b",
"903b", "903b",
"903b", "903b",
"904b", "904b",
@ -2585,8 +2541,6 @@
"671sb-yellow", "671sb-yellow",
"6713sb", "6713sb",
"6713sb", "6713sb",
"672sb",
"672sb",
"6724sb", "6724sb",
"6724sb", "6724sb",
"673sb", "673sb",
@ -2629,10 +2583,6 @@
"690sb", "690sb",
"691sb", "691sb",
"691sb", "691sb",
"692sb",
"692sb",
"693sb",
"693sb",
"695sb", "695sb",
"695sb", "695sb",
"696sb", "696sb",
@ -2755,10 +2705,6 @@
"751sb", "751sb",
"752sb", "752sb",
"752sb", "752sb",
"753sb",
"753sb",
"754sb",
"754sb",
"755sb", "755sb",
"755sb", "755sb",
"756sb", "756sb",
@ -2787,10 +2733,6 @@
"767sb", "767sb",
"768sb", "768sb",
"768sb", "768sb",
"769sb",
"769sb",
"770sb",
"770sb",
"771sb", "771sb",
"771sb", "771sb",
"772sb", "772sb",
@ -3013,10 +2955,6 @@
"841sb", "841sb",
"842sb", "842sb",
"842sb", "842sb",
"843sb",
"843sb",
"844sb",
"844sb",
"845sb-gorging", "845sb-gorging",
"845sb-gorging", "845sb-gorging",
"845sb-gulping", "845sb-gulping",
@ -3155,10 +3093,6 @@
"900sb", "900sb",
"901sb", "901sb",
"901sb", "901sb",
"902sb-female",
"902sb-female",
"902sb",
"902sb",
"903sb", "903sb",
"903sb", "903sb",
"904sb", "904sb",
@ -3716,8 +3650,6 @@
"671s-yellow", "671s-yellow",
"6713s", "6713s",
"6713s", "6713s",
"672s",
"672s",
"6724s", "6724s",
"6724s", "6724s",
"673s", "673s",
@ -3760,10 +3692,6 @@
"690s", "690s",
"691s", "691s",
"691s", "691s",
"692s",
"692s",
"693s",
"693s",
"695s", "695s",
"695s", "695s",
"696s", "696s",
@ -3886,10 +3814,6 @@
"751s", "751s",
"752s", "752s",
"752s", "752s",
"753s",
"753s",
"754s",
"754s",
"755s", "755s",
"755s", "755s",
"756s", "756s",
@ -3918,10 +3842,6 @@
"767s", "767s",
"768s", "768s",
"768s", "768s",
"769s",
"769s",
"770s",
"770s",
"771s", "771s",
"771s", "771s",
"772s", "772s",
@ -4144,10 +4064,6 @@
"841s", "841s",
"842s", "842s",
"842s", "842s",
"843s",
"843s",
"844s",
"844s",
"845s-gorging", "845s-gorging",
"845s-gorging", "845s-gorging",
"845s-gulping", "845s-gulping",
@ -4286,10 +4202,6 @@
"900s", "900s",
"901s", "901s",
"901s", "901s",
"902s-female",
"902s-female",
"902s",
"902s",
"903s", "903s",
"903s", "903s",
"904s", "904s",
@ -4625,8 +4537,6 @@
"730", "730",
"747", "747",
"748", "748",
"753",
"754",
"755", "755",
"756", "756",
"761", "761",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 645 B

After

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 419 B

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 338 B

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

After

Width:  |  Height:  |  Size: 276 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 938 B

After

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 B

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B

After

Width:  |  Height:  |  Size: 851 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 455 B

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 B

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 165 B

Some files were not shown because too many files have changed in this diff Show More