forked from pagefaultgames/pokerogue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into implement-taunt
- Loading branch information
Showing
1,239 changed files
with
250,940 additions
and
12,287 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: "[BUG]" | ||
labels: Bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
<!-- A clear and concise description of what the bug is. --> | ||
|
||
**To Reproduce** | ||
<!-- Steps to reproduce the behavior: --> | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
<!-- A clear and concise description of what you expected to happen. If it is an existing move or ability --> | ||
|
||
**Screenshots / Videos** | ||
<!-- If applicable, add screenshots or videos to help explain your problem. --> | ||
|
||
**Device** | ||
<!-- What browser are you playing in, are you on a PC/Mac or Phone? --> | ||
|
||
**Additional context** | ||
<!-- Add any other context about the problem here. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: "[Feature]" | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] --> | ||
|
||
**Describe the Feature** | ||
<!-- A clear and concise description of what you want to happen. --> | ||
<!-- Add a link to the feature if it is an existing move/ability/etc --> | ||
|
||
**Additional context** | ||
<!-- Add any other context or screenshots about the feature request here. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!-- Make sure the title includes categorization (i.e. [Bug], [QoL], [Localization]) --> | ||
<!-- Make sure that this PR is not overlapping with someone else's work --> | ||
<!-- Please try to keep the PR self-contained (and small) --> | ||
|
||
## What are the changes? | ||
<!-- Summarize what are the changes from a user perspective on the application --> | ||
|
||
## Why am I doing these changes? | ||
<!-- Explain why you decided to introduce these changes --> | ||
<!-- Does it come from an issue or another PR? Please link it --> | ||
<!-- Explain why you believe this can enhance user experience --> | ||
|
||
## What did change? | ||
<!-- Explicitly state what are the changes introduced by the PR --> | ||
<!-- You can make use of a comparison between what was the state before and after your PR changes --> | ||
|
||
### Screenshots/Videos | ||
<!-- If your change is changing anything on the user experience, please provide visual proofs of it --> | ||
<!-- Please take screenshots/videos before and after your changes, to show what is brought by this PR --> | ||
|
||
## How to test the changes? | ||
<!-- How can a reviewer test your changes once they check out on your branch? --> | ||
<!-- Did you just make use of the `src/overrides.ts` file? --> | ||
<!-- Did you introduce any automated tests? --> | ||
<!-- Do the reviewer need to do something special in order to test your change? --> | ||
|
||
## Checklist | ||
- [ ] There is no overlap with another PR? | ||
- [ ] The PR is self-contained and cannot be split into smaller PRs? | ||
- [ ] Have I provided a clear explanation of the changes? | ||
- [ ] Have I tested the changes (manually)? | ||
- [ ] Are all unit tests still passing? (`npm run test`) | ||
- [ ] Are the changes visual? | ||
- [ ] Have I provided screenshots/videos of the changes? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: "Github Pages" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
pages: | ||
name: Github Pages | ||
if: github.repository == 'pagefaultgames/pokerogue' | ||
runs-on: ubuntu-latest | ||
env: | ||
api-dir: ./ | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout repository for Typedoc | ||
uses: actions/checkout@v3 | ||
with: | ||
path: pokerogue_docs | ||
|
||
- name: Install OS package | ||
run: | | ||
sudo apt update | ||
sudo apt install -y git openssh-client | ||
- name: Setup Node 20.13.1 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Checkout repository for Github Pages | ||
if: github.event_name == 'push' | ||
uses: actions/checkout@v3 | ||
with: | ||
path: pokerogue_gh | ||
ref: gh-pages | ||
|
||
- name: Install Node.js dependencies | ||
working-directory: ${{env.api-dir}} | ||
run: | | ||
cd pokerogue_docs | ||
npm ci | ||
npm install typedoc --save-dev | ||
- name: Generate Typedoc docs | ||
working-directory: ${{env.api-dir}} | ||
run: | | ||
cd pokerogue_docs | ||
npx typedoc --out /tmp/docs --githubPages false --entryPoints ./src/ | ||
- name: Commit & Push docs | ||
if: github.event_name == 'push' | ||
run: | | ||
cd pokerogue_gh | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git config user.name "github-actions[bot]" | ||
mkdir -p $GITHUB_REF_NAME | ||
rm -rf $GITHUB_REF_NAME/* | ||
cp -r /tmp/docs/. $GITHUB_REF_NAME | ||
git add $GITHUB_REF_NAME | ||
git commit --allow-empty -m "[skip ci] Deploy docs" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
## How do I comment my code? | ||
|
||
### While we're not enforcing a strict standard, there are some things to keep in mind: | ||
- Make comments meaningful | ||
- Comments should be explaining why a line or block of code exists and what the reason behind it is | ||
- Comments should not be repeating chunks of code or explaining what 'true' and 'false' means in typescript | ||
- Make sure comments exist on Functions, Classes, Methods, and Properties | ||
- This may be the most important things to comment. When someone goes to use a function/class/method/etc., having a comment reduces the need to flip back and forth between files to figure out how something works. Peek Definition is great until you're three nested functions deep. | ||
- The best example of this is JSDoc-style comments as seen below: | ||
- When formatted this way, the comment gets shown by intellisense in VS Code or similar IDEs just by hovering over the text! | ||
- Functions also show each the comment for parameter as you type them, making keeping track of what each one does in lengthy functions much more clear | ||
```js | ||
/** | ||
* Changes the type-based weather modifier if this move's power would be reduced by it | ||
* @param user {@linkcode Pokemon} using this move | ||
* @param target {@linkcode Pokemon} target of this move | ||
* @param move {@linkcode Move} being used | ||
* @param args [0] {@linkcode Utils.NumberHolder} for arenaAttackTypeMultiplier | ||
* @returns true if the function succeeds | ||
*/ | ||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { | ||
} | ||
|
||
/** Set to true when experimental animated sprites from Gen6+ are used */ | ||
public experimentalSprites: boolean = false; | ||
|
||
/** | ||
* Cures the user's party of non-volatile status conditions, ie. Heal Bell, Aromatherapy | ||
* @extends MoveAttr | ||
* @see {@linkcode apply} | ||
*/ | ||
export class DontHealThePartyPlsAttr extends MoveAttr { | ||
} | ||
``` | ||
You'll notice this contains an `{@linkcode Object}` tag for each parameter. This provides an easy type denomination and hyperlink to that type using VS Code's Intellisense. `@linkcode` is used instead of `@link` so that the text appears in monospace which is more obviously a `type` rather than a random hyperlink. | ||
|
||
If you're interested in going more in depth, you can find a reference guide for how comments like these work [here](https://jsdoc.app) | ||
|
||
### What not to do: | ||
- Don't leave comments for code you don't understand | ||
- Incorrect information is worse than no information. If you aren't sure how something works, don't make something up to explain it. Ask for help instead. | ||
- Don't over-comment | ||
- Not everything needs an explanation. Try to summarize blocks of code instead of singular lines where possible. Single line comments should call out specific oddities. | ||
|
||
## How do Abilities and Moves differ from other classes? | ||
While other classes should be fully documented, Abilities and Moves heavily incoperate inheritance (i.e. the `extends` keyword). Because of this, much of the functionality in these classes is duplicated or only slightly changed between classes. | ||
### With this in mind, there's a few more things to keep in mind for these: | ||
- Do not document any parameters if the function mirrors the one they extend. | ||
- Keep this in mind for functions that are not the `apply` function as they are usually sparce and mostly reused | ||
- The class itself must be documented | ||
- This must include the `@extends BaseClass` and `@see {@linkcode apply}` tags | ||
- Class member variables must be documented | ||
- You can use a single line documentation comment for these `/** i.e. a comment like this */` | ||
- `args` parameters must be documented if used | ||
- This should look something like this when there are multiple: | ||
```ts | ||
/** | ||
... | ||
* @param args [0] {@linkcode Utils.NumberHolder} of arenaAttackTypeMultiplier | ||
* [1] {@linkcode Utils.BooleanHolder} of cancelled | ||
* [2] {@linkcode Utils.BooleanHolder} of rWeDoneYet | ||
... | ||
*/ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import tseslint from '@typescript-eslint/eslint-plugin'; | ||
import parser from '@typescript-eslint/parser'; | ||
import imports from 'eslint-plugin-import'; | ||
|
||
export default [ | ||
{ | ||
files: ["src/**/*.{ts,tsx,js,jsx}"], | ||
ignores: ["dist/*", "build/*", "coverage/*", "public/*", ".github/*", "node_modules/*", ".vscode/*"], | ||
languageOptions: { | ||
parser: parser | ||
}, | ||
plugins: { | ||
imports: imports.configs.recommended, | ||
'@typescript-eslint': tseslint | ||
}, | ||
rules: { | ||
"eqeqeq": ["error", "always"], // Enforces the use of === and !== instead of == and != | ||
"indent": ["error", 2], // Enforces a 2-space indentation | ||
"quotes": ["error", "double"], // Enforces the use of double quotes for strings | ||
"no-var": "error", // Disallows the use of var, enforcing let or const instead | ||
"prefer-const": "error", // Prefers the use of const for variables that are never reassigned | ||
"no-undef": "off", // Disables the rule that disallows the use of undeclared variables (TypeScript handles this) | ||
"@typescript-eslint/no-unused-vars": [ "error", { | ||
"args": "none", // Allows unused function parameters. Useful for functions with specific signatures where not all parameters are always used. | ||
"ignoreRestSiblings": true // Allows unused variables that are part of a rest property in object destructuring. Useful for excluding certain properties from an object while using the rest. | ||
}], | ||
"eol-last": ["error", "always"], // Enforces at least one newline at the end of files | ||
"@typescript-eslint/semi": ["error", "always"], // Requires semicolons for TypeScript-specific syntax | ||
"semi": "off", // Disables the general semi rule for TypeScript files | ||
"no-extra-semi": ["error"], // Disallows unnecessary semicolons for TypeScript-specific syntax | ||
"brace-style": "off", // Note: you must disable the base rule as it can report incorrect errors | ||
"curly": ["error", "all"], // Enforces the use of curly braces for all control statements | ||
"@typescript-eslint/brace-style": ["error", "1tbs"], | ||
"no-trailing-spaces": ["error", { // Disallows trailing whitespace at the end of lines | ||
"skipBlankLines": false, // Enforces the rule even on blank lines | ||
"ignoreComments": false // Enforces the rule on lines containing comments | ||
}], | ||
"space-before-blocks": ["error", "always"], // Enforces a space before blocks | ||
"keyword-spacing": ["error", { "before": true, "after": true }] // Enforces spacing before and after keywords | ||
} | ||
} | ||
] |
Oops, something went wrong.