-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
128 additions
and
609 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,30 +1,14 @@ | ||
# This workflow will do an install of node dependencies, build the source code and run tests across different versions of node | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [14.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: Zarel/setup-node@patch-1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- uses: actions/checkout@v3 | ||
- run: npm install | ||
- run: npm run test | ||
env: | ||
CI: true | ||
- run: npm test | ||
- run: npm run lint |
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 |
---|---|---|
@@ -1,9 +1,27 @@ | ||
node_modules/ | ||
build/ | ||
# Mac | ||
.DS_Store | ||
Thumbs.db | ||
.vscode | ||
|
||
# Zig | ||
zig-cache/ | ||
zig-out/ | ||
build/ | ||
/docgen_tmp/ | ||
|
||
# C | ||
*.o | ||
|
||
# JS | ||
coverage/ | ||
node_modules/ | ||
dist/ | ||
*package-lock.json | ||
*npm-debug.log | ||
.eslintcache | ||
.tsbuildinfo | ||
.vscode | ||
*-debug.log | ||
.parcel-cache/ | ||
|
||
# Project | ||
logs/ | ||
release/ |
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
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 |
---|---|---|
@@ -1,53 +1,25 @@ | ||
{ | ||
"name": "@pkmn/epoke", | ||
"version": "0.0.1", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"description": "Enhanced client representation of a Pokémon battle", | ||
"repository": "github:pkmn/EPOke", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "build/index.js", | ||
"module": "build/index.mjs", | ||
"types": "build/index.d.ts", | ||
"files": ["build"], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@pkmn/client": "^0.6.0", | ||
"@pkmn/data": "^0.7.0", | ||
"@pkmn/protocol": "^0.6.0", | ||
"@pkmn/spreads": "^0.1.0" | ||
"@pkmn/spreads": "file:../spreads" | ||
}, | ||
"scripts": { | ||
"lint": "eslint --cache src --ext ts", | ||
"fix": "eslint --fix src --ext ts", | ||
"compile": "tsc -p .", | ||
"build": "npm run compile && tsup src/index.ts", | ||
"test": "jest", | ||
"prepare": "npm run build", | ||
"pretest": "npm run build", | ||
"posttest": "npm run lint" | ||
}, | ||
"tsup": { | ||
"outDir": "build", | ||
"format": ["cjs", "esm"], | ||
"sourcemap": true, | ||
"dts": true, | ||
"clean": true | ||
}, | ||
"jest": { | ||
"preset": "ts-jest", | ||
"testEnvironment": "node", | ||
"testPathIgnorePatterns": ["node_modules/", "build/"] | ||
"build": "npm run compile", | ||
"test": "vitest src" | ||
}, | ||
"eslintConfig": { | ||
"extends": "@pkmn", | ||
"ignorePatterns": ["node_modules/", "build/"], | ||
"overrides": [{ | ||
"files": ["src/index.ts"], | ||
"rules": { | ||
"@typescript-eslint/no-shadow": "off" | ||
} | ||
}] | ||
"extends": "@pkmn" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +0,0 @@ | ||
import {BoostsTable, ID, StatsTable, StatusName, TypeName} from '@pkmn/data'; | ||
|
||
export type Slot = 1 | 2 | 3 | 4 | 5 | 6; | ||
export type Battle = Gen1.Battle; | ||
export type Side = Gen1.Side; | ||
export type Pokemon = Gen1.Pokemon; | ||
export type MoveSlot = Gen1.MoveSlot; | ||
|
||
export namespace Gen1 { | ||
export interface Battle { | ||
sides: Iterable<Side>; | ||
turn: number; | ||
lastDamage: number; | ||
prng: readonly number[]; | ||
} | ||
|
||
export interface Side { | ||
active: Pokemon | undefined; | ||
pokemon: Iterable<Pokemon>; | ||
lastUsedMove: ID | undefined; | ||
lastSelectedMove: ID | undefined; | ||
lastSelectedIndex: 1 | 2 | 3 | 4 | undefined; | ||
} | ||
|
||
export interface Pokemon { | ||
species: ID; | ||
types: readonly [TypeName, TypeName]; | ||
level: number; | ||
hp: number; | ||
status: StatusName | undefined; | ||
statusData: {sleep: number; self: boolean; toxic: number}; | ||
stats: StatsTable; | ||
boosts: BoostsTable; | ||
moves: Iterable<MoveSlot>; | ||
volatiles: Volatiles; | ||
stored: { | ||
species: ID; | ||
types: readonly [TypeName, TypeName]; | ||
stats: StatsTable; | ||
moves: Iterable<Omit<MoveSlot, 'disabled'>>; | ||
}; | ||
position: Slot; | ||
} | ||
|
||
export interface MoveSlot { | ||
id: ID; | ||
pp: number; | ||
disabled?: number; | ||
} | ||
|
||
export interface Volatiles { | ||
bide?: {duration: number; damage: number}; | ||
thrashing?: {duration: number; accuracy: number}; | ||
multihit?: unknown; | ||
flinch?: unknown; | ||
charging?: unknown; | ||
trapping?: {duration: number}; | ||
invulnerable?: unknown; | ||
confusion?: {duration: number}; | ||
mist?: unknown; | ||
focusenergy?: unknown; | ||
substitute?: {hp: number}; | ||
recharging?: unknown; | ||
rage?: {accuracy: number}; | ||
leechseed?: unknown; | ||
lightscreen?: unknown; | ||
reflect?: unknown; | ||
transform?: {player: 'p1' | 'p2'; slot: number}; | ||
} | ||
} | ||
Oops, something went wrong.