Commit Graph

88 Commits

Author SHA1 Message Date
Annika
4424fbff9b
Make tsc warn about unreachable code (#8122) 2021-03-16 18:29:53 -07:00
Annika
d858bed664
Enable incremental compilation in tsc (#7802)
This makes `npm test` faster.
2020-12-13 23:11:38 -08:00
Adam Tran
c7c5f4253b
Support generating sourceMaps for source debugging (#7797) 2020-12-13 19:42:19 -08:00
Annika
a3b83ba50b
Translations: Convert JSON to TypeScript (#7493) 2020-10-09 12:03:44 -07:00
Guangcong Luo
2bcea34447 Support ./pokemon-showdown simulate-battle -S
simulate-battle now has a new option: --spectate.

As a recap:

-D --debug: simulate in debug mode

-R --replay: output only the omniscient (debug) replay, rather than the
  full stream

-S --spectate: output only the spectator replay, rather than the full
  stream
2020-09-29 15:28:07 -07:00
Guangcong Luo
ea8f52ce97
Move descriptions to data/text/ files (#7036)
This adds some new `data/text/` files, which are the new home for
item/move/ability descriptions, as well as in-game messages, in one
place for ease of translation.
2020-09-06 22:00:11 -07:00
Guangcong Luo
cd5c7991b7 Only check .ts files in server/
Mostly, this prevents TypeScript from complaining about .js
files in config/chat-plugins/private/
2020-06-10 11:23:20 -04:00
Guangcong Luo
377969aab2 Simplify tsconfig
A lot of this complexity was because we were once half-migrated, but
now we're basically fully migrated to TypeScript so there's no more
need.
2020-06-09 13:55:53 -07:00
Kris Johnson
a7948c7c9c
Typescript config/ (#6760) 2020-05-29 19:34:43 -07:00
Kris Johnson
e64e083e6c
Typescript The Cafe (#6379) 2020-02-20 23:01:20 -08:00
Kris Johnson
2ea84725e2
Typescript Daily Spotlight, RoomFAQs, and Wi-Fi (#6373) 2020-02-18 13:26:44 -08:00
Kris Johnson
5550b164c8
Typescript Calculator and Chat Monitor (#6365) 2020-02-13 12:38:12 -08:00
Kris Johnson
9aaab2c57b
Typescript Help Tickets and Modlog and fix warnings (#6352) 2020-02-12 21:48:03 -08:00
Kris Johnson
649ac8ea6b Typescript uno/othermetas/hangman (#6229) 2019-12-31 17:52:26 +09:00
whales
fb6f7cb7dc Typescript mafia (#6145) 2019-12-09 22:17:09 +09:00
Guangcong Luo
23f9bfa1b7
Split up server/chat-commands/ (#5943)
`server/chat-commands.js` is now a directory. It's been split into
`core`, `moderation`, and `admin`. `info` and `roomsettings` from
`chat-plugins` have also moved to `chat-commands`.

Some cleanup:

- Bot commands for inserting HTML into rooms like `/adduhtml` have been
  moved from `info` into `admin`.

- `/a` has been renamed `/addline`, for clarity (and also moved from
  `info` into `admin`).

- Room management commands like `/createroom` and `/roomintro` were
  moved to `room-settings`

- `chat-commands/admin` has been TypeScripted
2019-11-15 11:12:54 +13:00
Kirk Scheibelhut
b9e5fcb387
Introduce set importer logic (#5749)
`node tools/set-import [version]` can be run to create a
`@pokemon-showdown/sets` package containing sets from Smogon, usage
stats and third party sources. Some notes:

- The build is set up so that `tools/set-import/importer.ts` is
  compiled to `tools/set-import/importer.js` - creating a
  `.tools-dist/set-import` directory for the sole artifact was
  deemed to be overkill
- The sets package is generated such that it can be used easily on
  Node or in a browser (where the large set JSON can be loaded
  asynchronously)
- Supported tiers/formats are mostly arbitrary - those popular
  enough to have a signficant playerbase or analyses on Smogon have
  been included, but additional formats can be added based on demand
- Some set information is redundant for ease of use by downstream
  users: certain formes are split out and information that could
  theoretically be inferred like level/ability/HP IVs are included
  to simplify parsing logic and make the sets more immediately
  available. This results in what should mostly be negligible
  size overhead.
- In a similar vein, display versions of effect names instead of IDs
  are used (name -> ID is trivial, ID -> name requires data lookup)
- All sets pass validation, provided certain simple transformations
  are applied (eg. reverting `battleOnly` formes like Megas)

This tool has primarily been tested to run on Linux - running on
other platforms is not guaranteed to result in error-free output.
2019-09-10 21:15:05 -04:00
whales
16551a7c5c Typescript lottery (#5739) 2019-08-30 09:12:49 -05:00
TheJetOU
620fd82376 Add lottery plugin (#5722) 2019-08-26 09:56:01 -07:00
TheJetOU
7fe2e5338c TypeScript Tournaments (#5723) 2019-08-24 03:48:13 -07:00
Guangcong Luo
2093539e06
Update RoomGame API (#5492)
- The big change here is that player.userid can now be empty. You can
  now fit state into RoomGamePlayer subclasses even when there are no
  users associated with them.

- `game.players` has been introduced as the new canonical list of
  players, including userless players. The old `game.players` has been
  renamed `game.playerTable`, for clarity.

- `game.addPlayer` now returns the added player

All existing RoomGames have been updated for the new API, and
RoomBattle is now officially a RoomGame subclass.

Tournaments was also massively refactored to be properly updated for
the old API, since that never happened, and should now be a lot more
readable.
2019-05-12 12:56:32 +09:30
Kirk Scheibelhut
a9b26fce72 Typescript server/verifier.js (#5482) 2019-05-07 14:09:01 +09:30
Kirk Scheibelhut
6fea91ee56 Split dev-tools/globals* into sim and server (#5450) 2019-04-18 04:17:54 +09:30
whales
770d3e6b50 Typescript tours (#5323) 2019-04-06 15:51:32 +08:00
Kirk Scheibelhut
c911ee6fa6 Move sim/battle-stream-example.ts to sim/examples subdir 2019-03-22 02:42:05 -05:00
Kirk Scheibelhut
6e122d5d74 Refactor lib/ to be native Typescript (#5217) 2019-03-02 11:12:24 -06:00
Kirk Scheibelhut
36fb436b09 Include data/mods/gen1/pokedex.js in tsconfig (#5213) 2019-02-26 11:28:16 -06:00
Kirk Scheibelhut
b09fd63377 Refactor sim/ to be native Typescript (#5210) 2019-02-26 11:03:30 -06:00
Kirk Scheibelhut
ddcb15e3b7 Cleanup tsconfig includes further (#5202) 2019-02-24 03:23:40 -06:00
Kirk Scheibelhut
0dd43ea3a9 Remove 'server/process-manager.js' from tsconfig (#5197)
'process-manager.js' now lives under 'lib/' which is already
included.
2019-02-22 15:38:26 -06:00
Guangcong Luo
f3e45fbb72 Move server code to server/
Also move mods/ to data/mods/

This makes PS more monorepo-like. The intent is to further separate
the sim and the server code, but without fully committing to splitting
the repository itself.

We now support `./pokemon-showdown start` in addition to
`./pokemon-showdown`. I'm not clear which I want to be the default
yet.
2019-02-03 16:07:06 -06:00
urkerab
5863284eaa Fix some OMotM crashes (#5132) 2019-02-01 19:48:13 -06:00
urkerab
c9ac10d075 Other Metagames of the Month February 2019 (#5131) 2019-02-01 15:17:57 +04:00
Bär Halberkamp
466f4b3324 Add a /daily plugin (#5052) 2019-01-08 19:04:57 -06:00
Bär Halberkamp
0b3593f9a7 Add a chat plugin for The Café 2018-11-07 20:04:12 +01:00
The Immortal
ede7d8da8c Add Fortemons 2018-11-01 21:50:14 +04:00
Kris Johnson
1a729f65a3 Add OMotM, LCotM, and RoA Spotlight November (#4946) 2018-11-01 15:45:32 +04:00
The Immortal
6ef253379c Add Partners in Crime 2018-10-22 15:47:45 +04:00
Kris Johnson
9b0e99b06f G&F: Fix validation with Mega Evolutions (#4882) 2018-10-03 00:53:46 +04:00
Kris Johnson
3d3526a2a5 OMotM, LCotM, and RoA Spotlight Oct 2018 (#4880) 2018-10-02 12:01:23 +04:00
Bär Halberkamp
e0167ef730 Add a chat monitor plugin (#4755) 2018-09-17 19:18:30 -05:00
Kris Johnson
e5dcb1fa48 TypeScript UNO (#4825) 2018-09-01 14:20:18 -04:00
Kris Johnson
5813add1e2 Add September RoA Spotlight, LCotM, and OMotM (#4838) 2018-09-01 16:02:05 +04:00
Kris Johnson
fcb36884c7 Typescript othermetas.js 2018-08-22 19:50:05 +04:00
CheeseMuffin
d5916e3d54 Typescript the round robin generator (#4511) 2018-07-12 00:42:00 -05:00
Bär Halberkamp
16608e2f8d Add newly typescripted plugins to tsconfig.json 2018-07-10 17:10:37 -05:00
Bär Halberkamp
102e3c183c Wifi: typescript wifi plugin 2018-07-05 15:58:53 -04:00
Kris Johnson
eda6cdc108 Add OMotM and LCotM for July 2018 (#4733) 2018-07-02 01:36:26 +08:00
Kris Johnson
0b299d5168 OMotM and RoA Spotlight June 2018 (#4701) 2018-06-01 19:46:38 +08:00
HoeenHero
63eff7cdad Typescript Mafia Plugin (#4669) 2018-05-22 12:02:47 -05:00