Commit Graph

194 Commits

Author SHA1 Message Date
Marty-D
fcd1dd098d
Update deps to get newest smogon for set-import 2021-01-08 16:42:04 -05:00
Guangcong Luo
7d7676db11 Revert accidental package.json change 2020-12-26 22:04:14 -08:00
Guangcong Luo
3cbf3f8a30 Fix build
Building from a fresh install currently fails since #7797

The problem is that `require('sucrase')` needs to be done _after_
sucrase is installed, which is a lot harder than it sounds.
2020-12-26 10:04:41 -08:00
Annika
b5b91e9d9c Upgrade to the latest SockJS version 2020-12-22 21:42:13 -08:00
Guangcong Luo
baaeb1e23b Release 0.11.4 to npm
This is mostly to publish a version with the Streams issue fixed.

Specifically, this commit: 8b68cdd736
2020-12-12 22:10:24 +00:00
Guangcong Luo
968390a632 Update TypeScript dependency version 2020-11-20 07:53:06 +00:00
Guangcong Luo
e2f4d247e7
Support npm run fix (#7640) 2020-11-05 16:48:49 -08:00
Annika
aa069ce8fd
Support disabling modlogs (#7619)
Co-authored-by: Christopher Monsanto <chris@monsan.to>
2020-11-02 22:59:31 -05:00
Annika
2f130e8762
Modlog: Support logging to a SQLite database (#7513)
* Modlog: Support logging to a SQLite database

Co-authored-by: Christopher Monsanto <chris@monsan.to>
2020-10-30 19:27:25 -04:00
Guangcong Luo
81dc3a7813 Update devDependencies
The newest `@types/node` fixes the `assert.strict.equal` deprecation
issue, so I'm updating more frequently than usual.
2020-10-29 16:17:39 +00:00
Guangcong Luo
2faa3d635d Publish 0.11.3 to npm
PS's sim engine is now available on npm!

sim/README.md describes how to use it:

https://github.com/smogon/pokemon-showdown/blob/master/sim/README.md
2020-10-21 17:24:58 +01:00
Guangcong Luo
c57fcf25c6
Default to type-aware linting (#7538)
In the past, we used non-type-aware linting in our pre-push hook, as
well as in `npm test`. This was for performance reasons.

In practice, though, we use an eslint cache, which makes even
type-aware incremental linting instantaneous. My rule is that you
should be able to make a small change and lint in under 10 seconds, and
`npm test` should take under 30 seconds, and linting with no changes
(for the pre-push hook) should be under 2 seconds. This is still true
for type-aware linting, so there's no actual need for fast linting.

We've also switched to using `--max-warnings 0` to convert warnings to
errors. This seems to allow them to use the same cache file.

A big improvement here is that `npm test` should now be enough for
testing. I think everyone ran `npm run full-test` for a while because
`npm test` didn't have type-aware lint errors, but now that it does,
you'll be able to use it again and have your tests run a lot faster.
2020-10-19 02:52:33 -07:00
Guangcong Luo
264bf83152 Update devDependencies
For some reason, the previous set of devDependencies fail tests for me
in macOS. I'm updating them just to be safe.
2020-10-18 07:48:17 +01:00
Guangcong Luo
1c0c77ff6b
Update to TypeScript 4.0 (#7504) 2020-10-10 14:43:32 -07:00
Guangcong Luo
e40ab96db7 Update Mocha dependency version 2020-10-09 22:33:17 -07:00
Marty-D
f1e4e68e50
Update deps to get newest smogon for set-import 2020-10-01 19:39:54 -04:00
Guangcong Luo
3d68248efa Update to latest eslint
We're skipping two major typescript-eslint versions, so there are a
bunch of changes here, including:

- it's catching a lot of things it didn't catch in the past, for
  reasons unclear to me

- no-unused-vars has to be explicitly disabled in global-types now

- a lot of `ts-ignore`s were never necessary and have been fixed

- Crashlogger can now handle being thrown things that aren't errors.
  This has never been a problem in the past, but to satisfy TypeScript
	we might as well not die in a fire on the off chance someone tries to
	`throw null` or something.
2020-09-29 15:28:08 -07:00
Kirk Scheibelhut
ec84d31d38 Update deps to get newest smogon for set-import 2020-09-01 12:01:35 -07:00
Guangcong Luo
15b7c0ad9f Don't install node-oom-heapdump by default 2020-08-15 17:46:28 -07:00
Annika
b3771214d5
Fix modlog tests on Windows (#7187) 2020-08-10 09:37:08 -07:00
Guangcong Luo
a315c93836 Switch to using import type
We were previously using `type Foo = import('bar').Foo` which works
actually equally well, because sucrase didn't support `import type`,
but now it does!
2020-08-09 08:07:00 -05:00
Kirk Scheibelhut
4e99c2b24e Update deps to get newest smogon for set-import 2020-08-03 22:29:49 -07:00
Kirk Scheibelhut
a470fc48ca Update deps to get newest smogon for set-import 2020-07-03 12:25:04 -07:00
Kirk Scheibelhut
922d292322 Simplify @pokemon-showdown/sets and rename package
@smogon is the preferred namespace for packages (eg. @smogon/calc),
but the fact that this import logic previously contained code from
two non-Smogon sources made such naming awkward. Given the damage
calc didn't end up using these sources (and the Pokémon Showdown
client doesn't either), its simpler to just remove the logic for
third party imports entirely. This allows us to remove ugly 'hidden'
JSON5 dependency, as well as `smogon.com/` namespacing on the
sources.

This commit also tidies up the package.json and type definitions to
be more robust. It makes `--access public` the default when
publishing and cleans up unpkg support.

This is obviously a breaking change, but it's also a package rename
so we get to start the version from zero there :). A corresponding
commit will be added to the client to account for these changes.
2020-06-04 19:43:56 -07:00
Kirk Scheibelhut
4754076efa Update for @pokemon-showdown/sets v0.4.0
- updates smogon package dependency to the latest version
- make sure no old artifacts are left around from previous runs
- revert change from 7aa42b12: for whatever reason we do encounter
instances where `typeof species.battleOnly !== 'string'` and
`throw`-ing means no sets get output.
2020-05-03 13:24:25 -07:00
Kirk Scheibelhut
59bcdab260 Update deps to get newest smogon for set-import 2020-04-01 20:00:36 -07:00
Mia
1628258371
Typescript chat-commands/core (#6484)
Also fix TS line numbers in GitHub Actions
2020-03-23 23:50:35 -07:00
Guangcong Luo
5a26d8685b Remove unused tslint dependency 2020-03-07 15:07:13 -08:00
Guangcong Luo
2f0e83c14b Categorize eslintrc rules
eslintrc rules are now sorted into categories, in theory making them
easier to maintain.
2020-03-06 22:35:45 -08:00
Waleed Hassan
8aa4f053bb
Use optional chaining and linter improvements (#6422)
This is mostly just a follow up to #6342.

`prefer-optional-chaining` was turned on and fixed in every location it
complained in. The transformed function [0] looks expensive from a
glance but from skimming through the replaced sites it doesn't appear
to be ran in any important place, so it should be OK.

The linter improvements are:
- Increase linter performance
	- Make `full-lint` and `lint` write to different caches so we
	  avoid overwriting their caches since they're different configs
	- Change husky's hook to `npm run lint` so as to write to the
	  same cache
	- Remove `@typescript-eslint/eslint-plugin-tslint` which is
	  essentially a wrapper to TSLint because the rules aren't worth
	  running another linter
- Convert `.eslintrc.json` and `.eslintrc-syntax.json` to two spaces
  rather than four tabs to respect PS' `.editorconfig`
- Rename `fulllint` to `full-lint` to ease spelling it

[0] - https://pastie.io/mmtxpf.js (prettified)
2020-03-06 11:44:32 -08:00
Guangcong Luo
b21c9047e2
Migrate to typescript-eslint (#6342) 2020-03-05 08:33:06 -08:00
Kirk Scheibelhut
738fdc9c46 Update deps to get newest smogon for set-import 2020-03-02 16:31:59 -08:00
Kirk Scheibelhut
fdf5679a24 Update set-import stats to use latest stats logic
smogon@0.2.0 now supports the qualified naming transition period
at the end of Gen 6.
2020-02-27 17:00:40 -08:00
Kirk Scheibelhut
37a331a4cb Get tools/set-import to work again
- a scripts.js init() method now calls toID
- Smogon updated the format of moveslots
2020-02-25 14:49:38 -08:00
Guangcong Luo
1d09dd1174 Fix Dragon Darts bugs
- should not stop after one faint
- should not show miss message for first miss
2020-02-20 15:58:36 -08:00
Guangcong Luo
1f8b14cb6c Update dependencies
(The newest sucrase now supports optional chaining.)

(The TSLint crash is fixed.)
2020-02-08 07:44:22 -08:00
not_a_seagull
ae28a960be Convert index.js and team-validator-async.js to typescript (#5987) 2020-01-04 07:11:54 -05:00
Spandan Punwatkar
b6b66de896 Update Repo Links (#6102) 2019-11-28 12:47:38 +04:00
Kirk Scheibelhut
71bc4d5c05 Update tools/set-import for Gen 8 2019-11-25 15:32:12 -08:00
Guangcong Luo
ae8af5a6cf Show full mocha output with fulltest
This is mostly to help debug a weird Travis issue.
2019-11-16 09:33:27 +13:00
Waleed Hassan
92b2c128c2 Upgrade to TypeScript 3.7 (#5935) 2019-11-06 23:02:36 +10:30
Kirk Scheibelhut
e73ac5920b Bump version to remove vunerability message
npm-check-updates was mistakenly listed as a transitive dependency
causing npm audit to complain about one of its dependencies.
2019-10-29 16:21:58 -07:00
Kirk Scheibelhut
e6f3a39f26 Update dependencies, revert premature TS 3.7 2019-10-03 13:58:03 -07:00
Christopher Monsanto
59846c2776 Add optional deps for sqlite, ignore databases/ 2019-10-02 15:31:00 -04:00
HoeenHero
df396ee6a1 Update to Typescript 3.7.0-beta
@Zarel mentioned that he wanted to update to the beta as soon as possible.
2019-10-01 22:12:11 -04:00
TheJetOU
dcbeed3671 Run tsc before mocha in npm run fulltest (#5781) 2019-09-15 10:21:33 -07: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
Kirk Scheibelhut
73aa85fb66 Upgrade to Typescript 3.5 2019-05-29 14:42:50 -07:00
Kirk Scheibelhut
c46a61bb14 Update dependencies to the latest stable versions 2019-05-24 20:11:18 -07:00
Kirk Scheibelhut
1adcd40e48 Windows-friendly Mocha setup
This reverts commit cccc904059.
2019-04-23 07:51:06 -07:00