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.
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.
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.
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.
`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.
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.
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.)
- 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
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 fixeslint/eslint#5679 so we can just
`eslint .` again
- 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.
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.
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.
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.
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.
- 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.
This cache is quite awful (welcome to the world of Node.js, I guess),
but at least it works. It has few flaws, like not being able to GC
unused cache files. Still, has to work for now. Changes syntax test
times from 10 minutes on my very slow laptop to 0.6 seconds.
(I wonder how this will work with Travis...)
Later I will try to figure out why JSHint is so unbelievably slow.
- Remove `gulp-util`: it's not used and its installation is no longer recommended in Gulp's documentation.
- Next minor version for `gulp-jscs`. Next major for `jshint-stylish`.
- Streams are merged to make sure that all errors and warnings are reported.
- Adds dev dependencies: `merge-stream` and `lazypipe`.
- Tracks a fork of `gulp-jshint` to fix https://github.com/spalger/gulp-jshint/issues/88
This introduces a new file cidr.js, which handles matching CIDR IP
blocks. It replaces our dependency on node-ip.
The old proxy IP system is also moved to cidr.js.
After upgrading node-sockjs to v0.3.7 on the live server, there was an
issue where the `close` event was apparently not being fired on some
sockets, causing various problems.
The only version of ndoe-sockjs that we know for sure works is v0.3.5,
which is the version that had previously been in use on the main server
for a long time.
- upgrade sugar version to 1.3.8 (at least 1.3.7 is required for
`Object.select` and we may as well require the latest version)
- change two space indentation to tabs for consistency
- add Cathy J. Fitzpatrick to contributors array
The default configuration of Pokemon Showdown does not use
socket.io, so it is more appropriately marked as an optional
dependency. This change is largely cosmetic because npm install
will still install optionalDependencies.
The 'request' module is currently unused so it doesn't need to
be included in package.json.
In addition, GitHub is now served over SSL (and has been for
a while).