Commit Graph

40 Commits

Author SHA1 Message Date
Mia
2ded14125c Fully gitignore logs/ 2024-05-18 03:27:11 -05:00
Christopher Monsanto
328454f695 Add package-lock.json 2023-02-16 19:42:58 -05:00
Mia
b11177d530
Migrate to esbuild for compilation (#9203) 2022-12-22 15:19:29 -06:00
Mia
78b99de196 Gitignore Redis binary dumps 2021-11-30 14:47:43 -06:00
Annika
d858bed664
Enable incremental compilation in tsc (#7802)
This makes `npm test` faster.
2020-12-13 23:11:38 -08:00
Adam Tran
c7c5f4253b
Support generating sourceMaps for source debugging (#7797) 2020-12-13 19:42:19 -08:00
MacChaeger
ebb570e608
Tests: Add a function to save a battle replay (#7692) 2020-11-29 22:08:01 +00: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
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
Annika
f1b4e3d43a
Modlog: Refactor to use ModlogEntry objects (#7403) 2020-09-28 11:06:30 -07:00
Annika
f34ffa9e74
Refactor Modlog into one file (#7127) 2020-08-06 00:39:37 -07:00
Kris Johnson
a7948c7c9c
Typescript config/ (#6760) 2020-05-29 19:34:43 -07:00
Guangcong Luo
09b1c0fa24 Fix gitignore private 2020-03-13 23:57:14 -04: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
asgdf
edebcbc4a9 Support loading plugins from chat-plugins/private/ (#5867) 2019-10-14 11:11:37 +11:00
Christopher Monsanto
59846c2776 Add optional deps for sqlite, ignore databases/ 2019-10-02 15:31:00 -04: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
6e122d5d74 Refactor lib/ to be native Typescript (#5217) 2019-03-02 11:12:24 -06:00
Kirk Scheibelhut
b09fd63377 Refactor sim/ to be native Typescript (#5210) 2019-02-26 11:03:30 -06:00
Guangcong Luo
a13da24f29 Update .gitignore for /server/ 2019-02-18 22:00:09 -05:00
HoeenHero
3e184c0286 Add .vs to .gitignore
Visial Studio Live Share folder
2018-08-03 10:45:21 -04:00
Guangcong Luo
2e85de348f Disable package-lock.json
NPM's official documentation says that package-lock.json should be part
of the repository.

Why? `package-lock.json` is basically a snapshot of the `node_modules/`
directory. You can think of it like `node_modules.zip`, except more
human-readable, and requires an internet connection to unzip.

The main advantage of adding it to Git is that it lets you know exactly
the state of `node_modules/` at the time the programmer commits it. So
if a dependency breaks, it's easier to trace exactly when it broke.

It also makes sure `node_modules/` is exactly the same between
different development environments, so differences don't cause bugs to
appear for some developers but not others.

This comes with a number of disadvantages. The biggest one is that it
causes package-lock changes to appear in random commits, which can
outright lead to merge conflicts. Not to mention making diffs in
general significantly less readable.

And a lot of stated advantages aren't actually true (paraphrased):

> If I install express ^4.15.4, and later express 4.15.5 is released,
> a contributor would run `npm install` and gets 4.15.5, we would
> have different versions.

Like, this is intended behavior. If I didn't want that behavior, I'd
specify the express version as 4.15.4 instead of ^4.15.4. We can still
have the same version if we just re-run `npm install`, which we would
STILL have to do if we were using a package-lock file. The
package-lock file does not improve this situation.

(A Dev poll showed that most devs were in support of this.)
2018-01-12 22:19:05 -06:00
Guangcong Luo
0af79c01c2 Gitignore all chat plugins ending in -private
Closes #4033
2017-10-02 16:54:17 -04:00
Steven Goodman
5efd47a33f Modify .gitignore to track config/formats.js (#3220) 2017-02-11 00:58:11 -06:00
Konrad Borowski
79a5b23f25 Modify data and mods files to follow style rules 2016-01-01 00:18:00 +01: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
Ivo Julca
9a52fe337f Parse all numerical user input as base 10
Also took the chance to commit some style fixes missed in 90973d5 and 04c64c1.
2015-11-07 20:08:01 -05:00
Guangcong Luo
fca06bd11e Support private.js chat plugin
By default, we now support a private.js chat plugin which will be
automatically gitignored, useful for local chat commands.
2015-08-07 09:05:49 -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
716cd0578f Remove bannedwords feature
Username word bans are now implemented in the lobby server
2014-07-16 23:39:51 -04:00
Tyler Stark
949d29be63 Adding Gulp and JSHint 2014-02-09 19:02:06 -06:00
Cathy J. Fitzpatrick
f454177364 Changes to static file serving
- /static/custom.css is now located at /config/custom.css
- /static/avatars/ is now located at /config/avatars/
- The redirect script now redirects all room URIs, not just the root
  path. For example, if you are running a server on localhost port 8000,
  visiting http://localhost:8000/teambuilder will now take you to the
  teambuilder. This works for any room.
2013-04-24 20:41:49 -06:00
Cathy J. Fitzpatrick
5a50366bdb Add a stub static/custom.css file 2013-04-24 16:23:10 -06:00
Cathy J. Fitzpatrick
2864cec3e0 Add /static/avatars/ to .gitignore 2013-04-24 02:47:15 -06:00
Guangcong Luo
7c7a4597f4 .gitignore everything in /config/
(we can still add example config files manually, y'know)
2012-07-28 15:04:02 -07:00
Bill Meltsner
64d210940a Add support for lists of words to be banned from being used in usernames (NOT chat).
& and higher can change the list with /banword and /unbanword (or /bw and /ubw respectively). The words/phrases are turned into IDs (only lowercase alphanumeric characters allowed) and checked against the ID form of a given username.

Keep in mind the list has no sense of context, and so overzealous banning, particularly of short or otherwise common words, should be avoided. Or else user "Cofagrigus" will want to have a word with you.
2012-07-01 21:46:55 -05:00
Guangcong Luo
db37d5abf1 Add usergroups.csv to .gitignore 2012-05-16 21:13:15 -07: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
Guangcong Luo
7170ee9980 Add logs/ and node_modules/v8-profiler/ to .gitignore 2012-02-11 01:51:57 -05:00
Guangcong Luo
4ce2d95037 Everything I did before moving to Git 2011-12-22 23:53:05 -05:00