diff --git a/.dependency-cruiser.cjs b/.dependency-cruiser.cjs
index b7de80a70de..40a9785aeaf 100644
--- a/.dependency-cruiser.cjs
+++ b/.dependency-cruiser.cjs
@@ -1,6 +1,17 @@
/** @type {import('dependency-cruiser').IConfiguration} */
module.exports = {
forbidden: [
+ {
+ name: "only-type-imports",
+ severity: "error",
+ comment: "Files in enums and @types may only use type imports.",
+ from: {
+ path: ["(^|/)src/@types", "(^|/)src/enums"],
+ },
+ to: {
+ dependencyTypesNot: ["type-only"],
+ },
+ },
{
name: "no-circular-at-runtime",
severity: "warn",
@@ -31,6 +42,8 @@ module.exports = {
"[.]d[.]ts$", // TypeScript declaration files
"(^|/)tsconfig[.]json$", // TypeScript config
"(^|/)(?:babel|webpack)[.]config[.](?:js|cjs|mjs|ts|cts|mts|json)$", // other configs
+ // anything in src/@types
+ "(^|/)src/@types/",
],
},
to: {},
diff --git a/.github/test-filters.yml b/.github/test-filters.yml
new file mode 100644
index 00000000000..fc52e85082c
--- /dev/null
+++ b/.github/test-filters.yml
@@ -0,0 +1,15 @@
+all:
+ # Negations syntax from https://github.com/dorny/paths-filter/issues/184#issuecomment-2786521554
+ - "src/**/!(*.{md,py,sh,gitkeep,gitignore})"
+ - "test/**/!(*.{md,py,sh,gitkeep,gitignore})"
+ - "public/**/!(*.{md,py,sh,gitkeep,gitignore})"
+ # Workflows that can impact tests
+ - ".github/workflows/test*.yml"
+ - ".github/test-filters.yml"
+ # top-level files
+ - "package*.json"
+ - ".nvrmc" # Updates to node version can break tests
+ - "vite*" # vite.config.ts, vite.vitest.config.ts, vitest.workspace.ts
+ - "tsconfig*.json" # tsconfig.json tweaking can impact compilation
+ - "global.d.ts"
+ - ".env*"
\ No newline at end of file
diff --git a/.github/workflows/test-shard-template.yml b/.github/workflows/test-shard-template.yml
index cee452f3a59..98836bd335a 100644
--- a/.github/workflows/test-shard-template.yml
+++ b/.github/workflows/test-shard-template.yml
@@ -12,21 +12,27 @@ on:
totalShards:
required: true
type: number
+ skip:
+ required: true
+ type: boolean
+ default: false
jobs:
test:
- name: Shard ${{ inputs.shard }} of ${{ inputs.totalShards }}
+ # We can't use dynmically named jobs until https://github.com/orgs/community/discussions/13261 is implemented
+ name: Shard
runs-on: ubuntu-latest
+ if: ${{ !inputs.skip }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4.2.2
with:
- submodules: 'recursive'
+ submodules: "recursive"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
- node-version-file: '.nvmrc'
- cache: 'npm'
+ node-version-file: ".nvmrc"
+ cache: "npm"
- name: Install Node.js dependencies
run: npm ci
- name: Run tests
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index d9db8401f8e..c3b9666caa9 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -7,63 +7,37 @@ on:
branches:
- main # Trigger on push events to the main branch
- beta # Trigger on push events to the beta branch
- - release # Trigger on push events to the release branch
- # go upvote https://github.com/actions/runner/issues/1182 and yell at microsoft until they fix this or ditch yml for workflows
- paths:
- # src and test files
- - "src/**"
- - "test/**"
- - "public/**"
- # Workflows that can impact tests
- - ".github/workflows/test*.yml"
- # top-level files
- - "package*.json"
- - ".nvrmc" # Updates to node version can break tests
- - "vite.*.ts" # vite.config.ts, vite.vitest.config.ts, vitest.workspace.ts
- - "tsconfig*.json" # tsconfig.json tweaking can impact compilation
- - "global.d.ts"
- - ".env.*"
- # Blanket negations for files that cannot impact tests
- - "!**/*.py" # No .py files
- - "!**/*.sh" # No .sh files
- - "!**/*.md" # No .md files
- - "!**/.git*" # .gitkeep and family
-
pull_request:
branches:
- main # Trigger on pull request events targeting the main branch
- beta # Trigger on pull request events targeting the beta branch
- - release # Trigger on pull request events targeting the release branch
- paths: # go upvote https://github.com/actions/runner/issues/1182 and yell at microsoft because until then we have to duplicate this
- # src and test files
- - "src/**"
- - "test/**"
- - "public/**"
- # Workflows that can impact tests
- - ".github/workflows/test*.yml"
- # top-level files
- - "package*.json"
- - ".nvrmc" # Updates to node version can break tests
- - "vite*" # vite.config.ts, vite.vitest.config.ts, vitest.workspace.ts
- - "tsconfig*.json" # tsconfig.json tweaking can impact compilation
- - "global.d.ts"
- - ".env.*"
- # Blanket negations for files that cannot impact tests
- - "!**/*.py" # No .py files
- - "!**/*.sh" # No .sh files
- - "!**/*.md" # No .md files
- - "!**/.git*" # .gitkeep and family
merge_group:
types: [checks_requested]
jobs:
+ check-path-change-filter:
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: read
+ outputs:
+ all: ${{ steps.filter.outputs.all }}
+ steps:
+ - name: checkout
+ uses: actions/checkout@v4
+ - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
+ id: filter
+ with:
+ filters: .github/test-filters.yml
+
run-tests:
name: Run Tests
+ needs: check-path-change-filter
strategy:
matrix:
- shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+ shard: [1, 2, 3, 4, 5]
uses: ./.github/workflows/test-shard-template.yml
with:
project: main
shard: ${{ matrix.shard }}
- totalShards: 10
+ totalShards: 5
+ skip: ${{ needs.check-path-change-filter.outputs.all != 'true'}}
diff --git a/biome.jsonc b/biome.jsonc
index 3385614635c..82ce7c308dc 100644
--- a/biome.jsonc
+++ b/biome.jsonc
@@ -31,8 +31,6 @@
"src/overrides.ts",
// TODO: these files are too big and complex, ignore them until their respective refactors
"src/data/moves/move.ts",
- "src/data/abilities/ability.ts",
- "src/field/pokemon.ts",
// this file is just too big:
"src/data/balance/tms.ts"
@@ -43,9 +41,6 @@
// TODO: Remove if we ever get down to 0 circular imports
"organizeImports": { "enabled": false },
"linter": {
- "ignore": [
- "src/phases/move-effect-phase.ts" // TODO: unignore after move-effect-phase refactor
- ],
"enabled": true,
"rules": {
"recommended": true,
@@ -58,7 +53,7 @@
},
"style": {
"noVar": "error",
- "useEnumInitializers": "off", // large enums like Moves/Species would make this cumbersome
+ "useEnumInitializers": "off", // large enums like Moves/Species would make this cumbersome
"useBlockStatements": "error",
"useConst": "error",
"useImportType": "error",
@@ -73,9 +68,9 @@
},
"suspicious": {
"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.
- // 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",
"noAssignInExpressions": "off",
"noPrototypeBuiltins": "off",
@@ -92,6 +87,19 @@
"noUselessSwitchCase": "off", // Explicit > Implicit
"noUselessConstructor": "warn", // TODO: Refactor and make this an error
"noBannedTypes": "warn" // TODO: Refactor and make this an error
+ },
+ "nursery": {
+ "noRestrictedTypes": {
+ "level": "error",
+ "options": {
+ "types": {
+ "integer": {
+ "message": "This is an alias for 'number' that can provide false impressions of what values can actually be contained in this variable. Use 'number' instead.",
+ "use": "number"
+ }
+ }
+ }
+ }
}
}
},
diff --git a/index.html b/index.html
index 111464b5e5c..d503617c13c 100644
--- a/index.html
+++ b/index.html
@@ -145,6 +145,5 @@
-