Commit Graph

18 Commits

Author SHA1 Message Date
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
TheJetOU
4b0be1b5b4 TypeScript RoomGame and RoomBattle (#5692) 2019-08-11 17:03:36 +02:00
Kirk Scheibelhut
a9b26fce72 Typescript server/verifier.js (#5482) 2019-05-07 14:09:01 +09:30
Kirk Scheibelhut
4975f1902b Move simulator harness to sim/tools (#5451) 2019-04-18 04:17:07 +09:30
Kirk Scheibelhut
e689913084
Unify dev-tools runners and convert to Typescript (#5441)
- Refactor dev-tools/harness.js and dev-tools/smokes.js to separate
  out the script/CLI code and implementation code into separate
  files.
- Rename 'smoke' to 'exhaustive' ('multi' mode can also be used
  for "smoke testing") to better describe its behavior.
- Rewrite the runners in Typescript for type safety.
- Refactor common build utilities into dev-tools/build.js and
  introduce the notion of a 'full' build analogous to 'full' tests.
2019-04-15 15:22:37 -07:00
Konrad Borowski
525979c72d
Remove unused rewrite function from build script 2019-03-11 18:32:35 +01:00
Kirk Scheibelhut
27c6739ff7 Make builds replace safer and easier to use (#5277) 2019-03-08 13:51:52 -06:00
Guangcong Luo
83dd5650d7
Exclude devDependencies from build script 2019-03-06 13:37:49 -06:00
Kirk Scheibelhut
427f443bf8 Use async fs APIs in build (#5251) 2019-03-05 14:08:26 -06:00
Kirk Scheibelhut
b33971a3d3 Inline replace into build and remove dependency (#5248) 2019-03-04 19:36:00 -06:00
Kirk Scheibelhut
6e88eab90f Use an absolute path instead of relative path in build (#5247) 2019-03-04 18:54:37 -06:00
Kirk Scheibelhut
7cf501aec6 Use replace recursively in build. (#5245) 2019-03-04 16:28:01 -06:00
Kirk Scheibelhut
3624863551 Fix build script on Windows. (#5241)
On Windows,	`shell` doesn't glob for us and the literal
`.sim-dist/*` is passed to `replace` and it doesn't get expanded
into the list of paths.
2019-03-03 21:00:56 -05:00
Guangcong Luo
f1379b46be Fix dependency check in build script
(This error wasn't caught because it still works without installing
the dependency, but makes the build script far slower because
`npx replace` would reinstall `replace` every time it's used.)
2019-03-03 08:16:29 -06:00
Kirk Scheibelhut
6e122d5d74 Refactor lib/ to be native Typescript (#5217) 2019-03-02 11:12:24 -06:00
Guangcong Luo
5de019ac3d Fix fs.promises warning properly
The modern `__esModule` fallback isn't compatible with Node, and also
entirely unnecessary in practice.

The approach of disabling all the fallback code allows us to once again
`import * as fs`.
2019-02-28 11:49:48 -06:00
Guangcong Luo
f5a8723f1c Fix build/hotpatch process
Hotpatching and running `./pokemon-showdown` now automatically run
`./build`. There should now mostly not be any reason you'd want to
manually run `./build`, except if you're invoking tests directly.

In addition, a lot of redundant code has been removed.

I'm not 100% sure this works on Windows, but I'm sure I'll get reports
if anything breaks.
2019-02-27 01:47:44 -06:00
Kirk Scheibelhut
b09fd63377 Refactor sim/ to be native Typescript (#5210) 2019-02-26 11:03:30 -06:00