Commit Graph

217 Commits

Author SHA1 Message Date
Bär Halberkamp
27977931c0 Wifi: use string instead of String for types 2018-07-05 16:13:46 -04:00
Quinton Lee
1142b47e61
Dependencies: re-add Husky
Accidentally removed in cf50a3d642
2018-05-06 15:03:00 -05:00
Quinton Lee
cf50a3d642 Typescript the rest of mods/ (#4588) 2018-05-05 14:56:45 -05:00
Guangcong Luo
322eb9fbf0 TypeScript: Start work on typing chat commands
Nothing is being checked yet because there's a whole bunch of
complication in there, but this is a start.
2018-05-02 17:45:15 -05:00
Quinton Lee
77136a1bcd
Add npm script to run tsc
This allows you to run tsc with the version specified in package.json if you have a different version installed globally
2018-04-30 19:45:01 -05:00
Sacha Reinert
9e2ccfdb24 Dependencies: Add Husky githook (#4576) 2018-04-15 03:57:50 -05:00
Quinton Lee
b45d595519 Update Typescript to 2.8 (#4532) 2018-04-05 17:33:35 -05:00
Quinton Lee
c799393710 Typescript data/ and config/formats (#4513)
Also removes Battle Factory methods accidentally re-added in d0a4a689a7
2018-03-26 09:50:51 -05:00
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
Guangcong Luo
2a94634e7e Increment version number 2015-07-22 18:16:13 -04:00
Ivo Julca
efad2e157f Update dev dependencies
Notable changes: `gulp-jshint` now tracks a proper release and will no longer timeout.
2015-07-02 03:56:52 -05:00
Ivo Julca
b740197244 Implement JSCS rule to enforce PS conditionals' style 2015-06-12 03:36:36 -05:00
Guangcong Luo
3ac05d3432 Update package.json license 2015-06-05 13:28:11 -04:00
Konrad Borowski
b4f272b9b2 Introduce cache for syntax testing.
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.
2015-03-27 21:28:03 +01:00
Guangcong Luo
5ddfe77e7a Update dependencies 2015-03-15 03:24:21 -04:00
Konrad Borowski
35d76cb121 Disable deprecated engineStrict
In newest version of npm, this makes depreciation warnings.

See npm/npm#7171 for justification of removal of this feature from npm.
2015-03-03 18:09:33 +01:00
Ivo Julca
253c2b951e Update dependencies 2015-02-23 04:14:30 -05:00
Ivo Julca
d6c3058673 Deps: update dev dependencies
- 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`.
2015-02-18 19:51:51 -05:00
Ivo Julca
68aaa48974 Gulpfile: no files are exempt from style checks
- 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
2015-02-18 19:51:15 -05:00
Ivo Julca
88c74abe76 Implement Mocha-based test suite 2015-02-15 13:27:36 -05:00
sirDonovan
6e171cb59c Update gulp-jshint to 1.9.2
The old version caused build errors due to one
of the dependencies (rcloader), which was fixed in this newest
release
2015-02-02 12:05:25 -06:00
sirDonovan
68bca82397 Update gulp-replace to 0.5.1
The old version of gulp-replace began to cause build errors due to one
of the dependencies (istextorbinary), which was fixed in this newest
release
2015-01-15 12:55:20 -06:00
Guangcong Luo
80704c272d Merge pull request #1298 from Slayer95/disabled-maybe
Hide moves disabled by Imprison or NEXT's Telepathy
2014-12-10 03:57:30 -06:00
Guangcong Luo
454c5a6cfb Update gulp-jscs to 1.3.1
The old version of gulp-jscs apparently broke somewhere upstream
and is making npm test fail. The newest version works fine, so
I'm updating it.
2014-11-26 15:47:48 -06:00
Ivo Julca
e16346005a Bump version to 0.9.3
Battle choices will now be parsed in a significatively different way.
2014-11-13 14:45:56 -05:00
ryanj
3c943fb096 Autoconfiguration for cloud hosting environments, OpenShift support 2014-10-24 23:02:07 -07:00
小太
5027be79fb Add jscs as a style checker, and add some extra jshint options 2014-09-29 18:38:01 +10:00
Guangcong Luo
f4f0adb5bd Update node-static version 2014-08-24 02:33:30 -04:00
Guangcong Luo
5c2a6e4f43 Update versions in package.json 2014-08-22 00:25:39 -04:00
Guangcong Luo
354a784370 npm test now exits with code 1 on JSLint fail
This is mostly for Travis CI compatibility
2014-08-16 23:53:13 -05:00
Ivo Julca
52a764fdb0 Update SockJS to 0.3.9 2014-08-12 20:09:12 -05:00
Guangcong Luo
075baf89b5 Add gulp-replace to devDependencies 2014-08-11 05:38:46 -04:00
Guangcong Luo
536c6d0d3f Support npm test
Also made linting synchronous, which makes Gulp's output look
slightly nicer (and time it, which is cool).
2014-08-10 21:16:14 -04:00
Slayer95
9f2beb65bd Add ofe as an opt-in dependency
The ´nonDefaultDependencies´ field in package.json is not used by NPM, but allows us to keep track of them.
2014-05-05 20:56:38 -05:00
小太
4f6a3e9c36 Merge remote-tracking branch 'upstream/master' into tournaments-frontend
Conflicts:
	package.json
2014-03-10 12:15:35 +11:00
Guangcong Luo
58e28f0231 Version 0.9.2
(The new team format is an incompatible change)
2014-03-05 23:32:32 -05:00
Tyler Stark
0ffdd34741 Making JSHint actually look helpful, and explicitly ignoring eqeqeq errors 2014-02-09 20:22:33 -06:00
Tyler Stark
949d29be63 Adding Gulp and JSHint 2014-02-09 19:02:06 -06:00
小太
f9101abbe7 Merge remote-tracking branch 'upstream/master' into tournaments-frontend
Conflicts:
	package.json
2014-02-03 00:24:23 +11:00
Guangcong Luo
5e4db2d512 Update SockJS version 2013-12-18 12:53:37 -08:00
Guangcong Luo
d9688b991a PS no longer supports Node <0.10.x 2013-12-18 12:53:01 -08:00
小太
e01604251f Merge remote-tracking branch 'upstream/master' into tournaments 2013-12-12 18:40:20 +11:00
Guangcong Luo
6a2add8898 ipbans.txt now supports CIDR format
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.
2013-09-21 14:15:11 -07:00
小太
435460387d Merge remote-tracking branch 'upstream/master' into tournaments
Conflicts:
	package.json
2013-09-16 16:04:24 +10:00
小太
3abf381182 Add elimination tournaments 2013-09-16 16:00:56 +10:00
Guangcong Luo
8c757ab17f Update dependancies 2013-09-01 02:37:35 -07:00
Guangcong Luo
933ed177ff Version 0.9.1 2013-07-03 20:39:47 -07:00
Cathy J. Fitzpatrick
3547885a91 Fix version of all dependencies
The versions specified are known to work.
2013-06-11 02:37:23 -06:00
Cathy J. Fitzpatrick
5174e0d939 More sophisticated proxyip feature 2013-06-02 16:10:42 -06:00
Guangcong Luo
ab31f5573a Version 0.9.0 2013-05-23 21:17:36 -07:00
Cathy J. Fitzpatrick
f1926209df v0.3.5 is the only version of node-sockjs known to work
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.
2013-05-16 17:17:03 -06:00
Guangcong Luo
d9d0c176b6 Show package.js version in /version 2013-05-14 23:36:50 -07:00
Cathy J. Fitzpatrick
0b24a25170 Remove socket.io from package.json 2013-05-13 20:50:23 -06:00
Guangcong Luo
28034e9970 Update Zarel's information in package.json 2013-04-25 16:01:55 -07:00
Guangcong Luo
3b24ef347d Update README with new nicer URIs
The message on server start has been updated, too
2013-04-25 16:00:03 -07:00
Cathy J. Fitzpatrick
d8d3d897be Implement email crash logging 2013-04-24 23:20:29 -06:00
Cathy J. Fitzpatrick
2d8b489bc1 Add support for serving static files over HTTP 2013-04-24 01:37:58 -06:00
Cathy J. Fitzpatrick
36b3f173dd Note that node v0.10.0 and v0.10.1 are broken 2013-03-25 22:53:42 -06:00
Cathy J. Fitzpatrick
e8c0b45c12 Revise package.json
- 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
2013-03-24 22:35:47 -06:00
Cathy J. Fitzpatrick
79b1814361 Move socket.io to optionalDependencies
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.
2013-01-23 23:25:07 -07:00
Cathy J. Fitzpatrick
84c00ac31f Remove unused dependency
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).
2013-01-23 17:57:52 -07:00
Bill Meltsner
c31ee2a428 Add SockJS as the default networking library.
You can still use Socket.IO by setting config.protocol in config.js.
2012-07-06 22:56:28 -05:00
Guangcong Luo
41b670ad37 Add a new dependency: sugar
also clean up our includes a bit
2012-05-16 21:56:29 -07:00
Guangcong Luo
58ca54e8af long-stack-traces hasn't been a dependency in ages 2012-05-16 21:56:28 -07:00
小太
33162d2501 Revert "Four spaces -> Single tab"
This reverts commit 8f8d387f56.
2012-04-16 14:09:07 +10:00
小太
8f8d387f56 Four spaces -> Single tab 2012-04-16 12:55:40 +10:00
小太
dfca43114d Move braces to the same line as their control statements 2012-04-16 12:54:03 +10:00
Bill Meltsner
f4a9f0d9fd remove the node_modules folder from the repository and use package.json to define dependencies 2012-02-11 12:59:19 -05:00