Commit Graph

109 Commits

Author SHA1 Message Date
Guangcong Luo
e6cc393109 Fix unused variable in ProcessManager 2018-01-23 07:45:03 -06:00
Guangcong Luo
e8163824ff Remove validate-conditionals eslint rule
As far as I can tell, `curly, multi-line, consistent` does everything I
want; there's no reason to keep around a validate-conditionals rule.

Which is probably good, since eslint is deprecating the API for this,
anyway. The nice thing about not relying on deprecated APIs is that now
you can lint PS with `eslint` rather than needing to memorize
command-line switches.
2018-01-19 13:25:10 -06:00
Morfent
777ba0fc5f Sockets: implement permessage-deflate support (#4253)
Permessage-deflate is an extensIon that compresses websocket messages with zlib.
SockJS already supports it (indirectly) and the client's load balancer already
inserts the header in the opening handshake when making a WebSocket connection.

Config.wsdeflate makes this optional and allows tweaking the extension's resource
usage.
2017-12-15 15:43:48 -06:00
Guangcong Luo
819ff64d06 Update dependencies 2017-11-17 19:41:32 -06:00
Guangcong Luo
ce8dc52501 Replace ofe with node-oom-heapdump
(ofe is no longer actively maintained)
2017-11-17 19:39:54 -06:00
Guangcong Luo
bfeb75f547 Remove nonDefaultDependencies hack
Modern versions of npm have made it less and less tenable to have
truly optional dependencies, so we'll just bite the bullet and let
people have slightly slower installs in exchange for not having to
deal with npm weirdness.
2017-11-17 19:31:09 -06:00
Guangcong Luo
f5e7133044 Add tsc to npm test 2017-11-08 01:27:46 -06:00
Guangcong Luo
55b18bbc30 Simplify eslint invocation 2017-11-08 01:26:25 -06:00
Guangcong Luo
fa0bc881b5 Update TypeScript version 2017-11-06 21:49:53 -06:00
Guangcong Luo
3b2ada7c43 Update misc dependencies 2017-10-08 03:43:12 -05:00
Guangcong Luo
dcffa2a37d Update Mocha dependency 2017-10-08 03:36:04 -05:00
Guangcong Luo
c4e13fc4fa Update dependencies
Mocha 4 has a weird issue where it doesn't terminate, so we can't use
it for now.
2017-10-07 23:59:52 -05:00
Albert Zhang
2164d08229 Fix breakage with node-static 0.7.9 and mime 2 (#4002)
mime 2 broke node-static 0.7.9, update to 0.7.10 fixes this
2017-09-21 16:19:57 -05:00
Guangcong Luo
b2e989fc76 Fix npm start 2017-08-27 13:59:56 -07:00
Guangcong Luo
6e7aa9c8dd Remove mock-fs-require-fix from dependencies 2017-07-25 03:01:15 -04:00
panpawn
2fc84fa633 v0.11.0 -> v0.11.1 (#3710)
The change from v0.10.x -> v0.11.0 was in November of 2016, and a lot has chanced since then
2017-06-30 15:28:48 +09:00
Guangcong Luo
0143ae28dd Replace fs module (#3686)
The new FS module is an abstraction layer over the built-in fs module.

The main reason it exists is because I need an abstraction layer I can
disable writing from. But that'll be in another commit.

Currently, mine is better because:
 - paths are always relative to PS's base directory
 - Promises (seriously wtf Node Core what are you thinking)
 - PS-style API: FS("foo.txt").write("bar") for easier argument order
 - mkdirp

This also increases the minimum supported Node version from v6.0 to
v7.7, because we now use async/await. Sorry for the inconvenience!

This also drops the mock-fs-require-fix dependency

mock-fs-require-fix was always kind of a huge hack. It's no longer
necessary, with an FS API that does everything it used to.

This removes a lot of other hacks from test/main.js, which is nice.
2017-06-24 13:42:54 -07:00
Guangcong Luo
f87c0e2790 Use Unicode in package.json
`npm install` forces package.json into using the unicode accented-e in
"Pokemon" instead of the escaped format, so committing this prevents the
dirty tree that would otherwise happen every time someone installed
dependencies.
2017-06-23 06:49:58 -04:00
Quinton Lee
ec10d30996 eslint: Lint sim/ directory (#3670) 2017-06-21 20:00:17 -07:00
Bär Halberkamp
961ffc3f9b Upgrade eslint to 4.x (#3657) 2017-06-18 22:37:43 -07:00
Ben Davies
b66e395bf6 Add Config.ofe, refactor optional dependency usage (#3644)
Config.ofe toggles whether or not to write heapdumps if sockets workers
run out of memory, since ofe is an optional dependency but is not
installed by default. nodemailer is now a nonDefaultDependency, and
will complain if it's not installed when Config.crashguardemail is
enabled.
2017-06-17 14:37:11 -07:00
Guangcong Luo
9bd53ab3d7 Update optionalDependencies
Closes #3396

I don't see a need to add another david-dm icon for keeping it
up-to-date, though.
2017-05-18 05:38:14 -05:00
Guangcong Luo
b8df1b365a Remove fuzzur dependency
We no longer use it.

Nondeterministic tests are annoying and fuzzers are only useful for
detecting crashes, memory leaks, etc. You can't use them to detect
behavior correctness because that's what your actual code does.

(In other words, fuzzers are useful, but not as part of a regression
test suite.)
2017-03-17 23:14:52 -05:00
Guangcong Luo
f402bdc8b5 v0.11.0 2016-11-29 17:44:17 -06:00
Ivo Julca
ddfe02efe3 Build: Fix Node v7 support 2016-11-17 14:20:33 -05:00
panpawn
a57e3828f3 Update to newest SockJS (#2795)
This is the latest stable version of SockJS
2016-09-28 22:30:33 -07:00
Ben Davies
d992f1c13f Update package.json and CONTRIBUTING.md to mention Node 6 (#2746) 2016-09-16 00:42:15 -07:00
Guangcong Luo
d3f4e34f97 Update to newest SockJS 2016-08-27 03:12:01 -05:00
Ivo Julca
bfb4cffe30 Update dev dependencies
- Mocha's new major version fixes the persistent
deprecation warnings on usage of every `npm` command.
- MockFS is locked to 3.10.0 due to an issue affecting
its sandbox capabilities.
https://github.com/tschaub/mock-fs/issues/145
2016-08-03 01:24:54 -05:00
Ivo Julca
62a5397083 Lint: Use latest version and features of ESLint 2016-08-03 01:24:36 -05:00
Ivo Julca
e69d9dc803 Test: Dramatically increase coverage of choice parser 2016-06-16 08:25:37 -05:00
Guangcong Luo
08dae5b485 eslint: Manually skip ignored directories
eslint's ignore system first gathers a list of all files, then
decides which ones should be ignored. The "gather a list of all
files" runs out of memory when used on the main server with its
100 million log files, even though the log directory is ignored.

So now we're only passing the files we want linted to eslint.

Hopefully they can fix eslint/eslint#5679 so we can just
`eslint .` again
2016-05-02 22:46:45 -04:00
Ivo Julca
a9098dd565 Update dev dependencies
- Eslint@3 brings some advanced static path analysis to the table.
- Latest version of Mocha doesn`t really bring anything outstanding,
but the caret should cover the next version, which will fix the
current subdep deprecation warnings on `npm install`.
- Mock-FS update brings support for fs.access and fs.accessSync,
which are the Node.js` blessed APIs to replace fs.exists.
2016-04-25 19:41:51 -05:00
Guangcong Luo
52cc7f2e37 Remove Object.values external dependency
An external dependency is kind of overkill when the only
implementation we need is three lines.

This also lets us write a more performant implementation that
omits the parts irrelevant to us.
2016-03-21 10:15:55 -05:00
Guangcong Luo
a125a3ed7b Remove sugar-deprecated 2016-03-16 09:51:23 -05:00
Ivo Julca
0281176fd1 Remove usage of Array|Object methods implemented by Sugar.js
Adds a dependency to shim Object.values until it's natively available.
2016-03-09 16:55:34 -05:00
Ivo Julca
bc1a46eee1 Deps: Deprecate sugar extensions 2016-03-09 16:31:44 -05:00
Guangcong Luo
e624b9d5c7 Merge pull request #2350 from xfix/unify-style
Make code style consistent between files
2015-12-31 23:36:19 +00:00
Konrad Borowski
79a5b23f25 Modify data and mods files to follow style rules 2016-01-01 00:18:00 +01:00
Guangcong Luo
cc6715c677 Add pokemon-showdown binary file
`./pokemon-showdown` should probably eventually replace `node app.js`
as the preferred way to launch PS.

Also update package.json to reflect this.
2015-12-31 16:51:41 -06:00
Ivo Julca
f5b3a3b875 Test: use mock-fs to sandbox the file system 2015-12-20 03:22:02 -05:00
Konrad Borowski
156e193bed Only enable certain ES6 features during ESLint test
Currently, only those features are allowed: let/const, classes, and
octal literals. More can be added when needed, as long main Showdown
server has a supporting Node.js's version.

This also accidentally fixes a bug which caused data files to not
be checked for `let`/`const` keyword existence, which would cause
a problem in a web browser.
2015-12-10 23:07:32 +01:00
Ivo Julca
44adce3f78 Turn on strict mode globally for real 2015-11-08 15:43:47 -05:00
Guangcong Luo
1fc85dce48 Remove es6-shim dependency
We no longer support versions of Node so old they don't have the
level of ES6 support we used es6-shim for.
2015-11-07 22:51:44 -06:00
Ivo Julca
7dddb66253 Migrate build system to ESLint
JSHint's ES6 support is shaky, and its development has stalled as of late.
Since ESLint can do by itself both JSHint and JSCS' jobs, this commit replaces them.
Gulp and its related dependencies are also hereby removed.
2015-11-07 21:36:49 -05:00
Guangcong Luo
bad35b3511 Update Node.js dependency to 4.x
PS now officially supports Node.js 4.x and later.

Unofficially, most versions of iojs are still supported, although
this will probably change as we start using more ES6 features.
2015-11-06 16:36:13 -05:00
Guangcong Luo
68b3754e7d Support new ladder protcol
See 0b3b09e987

This commit doesn't introduce the local ladder yet, it's just some
final changes to support the new protocol.
2015-09-19 15:21:48 -05:00
Irraquated
1fcc947ab4 Update devDependencies to the latest build 2015-09-12 02:58:37 +10:00
Ivo Julca
4d4903d3a7 Update dependency versions and types
- All dependencies are optional except for `sockjs` and `sugar`.
- Fixes global variable leaks in `cloud-env` and `node-static`.
- JSCS: remove (disabled) no longer existent rule: validateJSDoc.
- JSCS: remove `esnext` rule: ES6 is current.
2015-07-28 19:33:38 -05:00
Ivo Julca
3aefdbf7e0 Update formats list protocol to support tournament-only formats 2015-07-24 02:41:29 -05:00