Skip to content

Commit

Permalink
Smogon master (#7)
Browse files Browse the repository at this point in the history
* Gigantamax Melmetal is unreleased

* Unskip passing validator test

* Remove /roomwhitelist from /roomhelp (smogon#7547)

* CommandContext: Make requireRoom support specifying a room (smogon#7549)

* Improve Chat.toDurationString

- Default precision is now 3.

  (Instead of "3 months 25 days 17 hours 46 minutes 40 seconds", it'll
	say "3 months 25 days 17 hours". You can still set the precision to
	`Infinity` if you actually prefer that.)

- Now displays "forever" for Infinity or overflow durations

- No longer skips blank precision levels

  (Shows "3 hours 0 minutes 10 seconds" instead of
	"3 hours  10 seconds")

* Mafia: Use new requireRoom API (smogon#7552)

* Youtube: Persist interval time (smogon#7550)

* Use new requireRoom API in trivia and scavs (smogon#7553)

* 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

* Fix typo in sim/README.md

* Update OM banlists

* Random Battle improvements

* Validator: Reject sets with the Gigantamax flag that cant Gmax

* Gen 7: Random Battle updates

* Fix bug in toDurationString precision

Fixes smogon#7554

* Support replay URLs in /join (smogon#7526)

* Remove Battle of Legends

* Add Pikachu-Alola event

* Add legendaries to 1v1 & 2v2 banlists

* Remove Battle Stadium Series 6

* Consolidate Neutralizing Gas tests; add Gluttony/Slow Start NGas tests

* Clarify Neutralizing Gas + Imposter test

* Moderation: Improve modlog entry for /rangeban

* Validate timeout durations (smogon#7556)

* Add Crown Tundra Pokemon

TODO: Learnsets

* Add VGC 2020 mod

* Add VGC 2021 format

* Update hidden ability legality

* Missed this file in 42e918a

* Add new moves

* Add move descriptions

* Remove Dynamax Ubers Clause from Ubers

* Fix oversights from adding Crown Tundra DLC (smogon#7559)

* Add activation messages for Curious Medicine

credits marty

* Prevent Mega Rayquaza in gen 8

* Formats: Update banlists

* Let Rayquaza Mega Evolve in National Dex formats

* Crown Tundra: Add and Update Learnsets

It was mentioned that theres some lingering issues that existed
before this update with some pokemon not having Steel Beam/Draco Meteor
that should. I'm noting this here so its not forgotten.

* Update National Dex

* Fix typo in ability text

* Fix another typo

* Monotype: Unban Calyrex-Ice and Calyrex-Shadow

* Abilities: Fix Grim Neigh typo (smogon#7561)

* Fix Thunderous Kick

* Crown Tundra Learnsets: Add Missing Moves

My script had a flaw where it would not add entires for moves that
a pokemon did not learn previously (eg: Electric Terrain Tapu Koko,
Mystical Fire Latios, Close Combat Blaziken). This fixes this issue.

* Fix Moltres's stats (smogon#7562)

Apparently they got overwritten with galars counterpart

* National Dex: Ban Calyrex-Ice and Calyrex-Shadow

* Camomons: Ban Power Construct

* Fix Steel Beam error in learnsets

* Update 2v2 Doubles

* Fix As One attribution text

* Learnsets: Add new event data

* Validator: Allow Hidden Ability Entei/Raikou/Suicune in Gen 8 natively (smogon#7563)

* Add new aliases

* 2v2: Unban Kyurem-Black

* Prevent As One from being copied or removed

* Fix Eerie Spell

* Update obtainable items

Haven't seen confirmation of Soul Dew yet.

* Release the berries

* Show Genesect forme in Team Preview

* Implement As One correctly

* Add new Random Battle sets

* STABmons: Ban Lovely Kiss

* CAP: Unban Clefable

https://www.smogon.com/forums/posts/8635680/

* Fix crash in Punishments#autolock

We should be destroying a user's personal rooms _after_ making a modlog entry.

* As One cannot be suppressed, acquired, or removed

* Soul Dew is available

* Add Anything Goes ladder

* Add As One entry message

* Fix Dragon Ascent Rayquaza validation

* Monotype: Ban Calyrex-Shadow

* Update learnsets

Added legendary dynamax events.
Removed multiple level up entries.
Copy corrections to VGC20 mod.

* 1v1: Ban Magearna and Marshadow

* Convert VGC 2020's mod to a pre-DLC2 mod (smogon#7564)

* Add temporary format for DLC 1 metagame

* Add thread for VGC 2021

* Add Regigigas and Poipole events

* Monotype: Ban Zygarde

* Add Tundra Tourney (smogon#7565)

* Move Battlesearch to its own file (smogon#7481)

* DOU: Ban Jirachi, Melmetal, Dark Urshifu, Swagger

https://www.smogon.com/forums/threads/np-ss-dou-stage-5-one-more-time-jirachi-melmetal-urshifu-single-strike-swagger-quickbanned.3672010/post-8636825

* Update metagame threads

* Update Inheritance bans

* Add The Studio chat plugin (smogon#7542)

* Improve sim readme

* Clean up imports

A lot of our code for child processes doesn't really follow our
original standards. This refactors them back to work the way they
were intended to.

* Micle Berry is obtainable

* Add event Porygon

* Prevent Abilities from copying As One as well

* Battlesearch: fix crash in child processes

* Restrict Calyrex-Ice and Calyrex-Shadow correctly

* Fix Crown Tundra Pokedex validation (smogon#7573)

* Update descriptions

* NatDex Monotype: Ban Calyrex formes and Dragapult

* Tools: Modernize modlog entries for blacklists

* Calculate natures with 16-bit truncation (smogon#7540)

Also fixes Let's Go! which wanted to override these but couldn't.

* Fix typo

* Ignore As One boosts when already maxed out (smogon#7574)

* NFE: Ban Sneasel

* Add gift Toxel event data

* The Studio: Fix crash

* The Studio: Allow finding recs by artist/user name (smogon#7578)

* Monotype: Ban Calyrex-Ice and Genesect

* Ban Japanese Gen 1 Events in Int Formats: Part 2 (smogon#7581)


Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>

* Ban Gen 1 Japan-only event moves

Fixes smogon#7516

* Update Lunar Dance to Gen 8 mechanics (smogon#7576)

* Random Doubles Updates (smogon#7569)

* Random Battle updates

* Rulesets: Fix crash in CCAPM2 (smogon#7582)

* Allow Randdubs Power Construct Zydog (smogon#7583)

* Add Overflow Stat Clause

* Camomons: Ban Dragonite & Kartana

* Move server/'s global variables out of index.ts (smogon#7585)

* AAA: Ban Kartana & Pheromosa

* Connections: Track current chat page (smogon#7522)

* Fix behavior of /faq with no arguments

* Studio: Handle Net errors better (smogon#7586)

* 1v1: Ban Dragonite

* Metronome Battle: Update ability banlist (smogon#7587)

* Youtube: Properly check permissions (smogon#7590)

* Chatlog: Use new username html tag (smogon#7519)

* Mix and Mega: Restrict Zygarde-C

* Add client text data

This syncs data/text to exactly match the client's data/text, in
preparation for them to be merged. The server's data/text will be
canonical, moving forward:

Relevant changes:

- A new file `data/text/default` has been added, for battle messages
  not associated with a move/item/ability.

- As One (Glastrier) and As One (Spectrier) should not have a start
  message; only As One itself.

- Hidden Power's `realMove` property does not belong in data/text
  and has been removed (it's still in data/moves where it belongs).

* Random Battle improvements

* /show: Throttle requests (smogon#7589)

* Make Eerie Spell's secondary effect secondary (smogon#7575)

* Youtube: Cache requested video data (smogon#7593)

* Indicate pending promises in /eval (smogon#7592)

* Remove sim/global-variables.d.ts

The sim no longer uses any global variables, so this can and should be
removed.

`server/global-variables` has also been cleaned up, since I'm working
on this.

* National Dex BH: Ban Electrify

https://www.smogon.com/forums/threads/national-dex-bh.3658587/page-10#post-8640772

* ZU: Ban Combusken

https://www.smogon.com/forums/threads/np-zu-stage-2-turn-it-again-combusken-quick-banned-77.3668115/page-4#post-8640782

* Remove last vestiges of tslint

* Fix Custom Rules Error (smogon#6811)

`/challenge [Gen 8] OU @@@ +Reshiram` failed earlier, since the rule wasn't trimmed.

* Improve custom rule validation

Stray spaces are now consistently allowed in `/tour rules` and
`/challenge`, but are not allowed in `formats.ts`.

Improves smogon#6811

* Make /clearstatus log to Staff room (smogon#7557)

`/forcerename` and other global punishments do this

* sendReplyBox: fix interaction with hidelines (smogon#7577)

* Chatfilters: Fix reasons displaying as undefined (smogon#7579)

* CommandContext: Add a method for getting roomgames (smogon#7531)

* Helptickets: Add button for the reporter's modlog (smogon#7560)

As per (this suggestion)[https://www.smogon.com/forums/threads/staff-suggestions-bugs.3514540/page-17#post-8634198].

* Random Doubles: Fix Regieleki

* Hosts: Support displaying shared IPs (smogon#7568)

* Punishments: Make rangelocks persistent (smogon#7545)

This solves the issue with yearlocks disappearing.

* Fix Slow Start's interaction with Neutralizing Gas (smogon#7580)

* Fix G-Max moves not showing up in movesearch (smogon#7555)

Happened because G-Max moves had move.isNonstandard as 'Gigantamax'.

* Support banning users from using groupchats (smogon#7558)

* Move Genesect and Naganadel to Uber

* Genesect formes should also be Uber

* Update National Dex UU threads

* M&M: Update bans and restrictions

* Chatlog: Carry opts over when switching days (smogon#7584)

* Fix G-Max Depletion (smogon#7571)

* Chat plugins: Make viewing source respect /permissions

* Fix Neutralizing Gas interactions

* Include groupchat bans in /punishments

* Improve error for Japan-only event moves

Thanks Plague Von Karma for help with wording!

Refs smogon#7581

* Reorganize README

The README has been split up so guides for PS's different use-cases are
easier to find.

* Chatlog: Allow non-trusted secret room ROs to view logs (smogon#7597)

* Ticketbans: Use the user object (smogon#7596)

* Improve documentation

Fixes smogon#7602

Also adds some other stuff, perhaps most notably why we don't use
package-lock so you don't have to dig for 2e85de3

* Studio: Only request YT video data once (smogon#7595)

* Add Doubles DLC 1 format

* Move natures into their own file (smogon#7601)

* BH: Add Dynamax Clause

* Update devDependencies

The newest `@types/node` fixes the `assert.strict.equal` deprecation
issue, so I'm updating more frequently than usual.

* Validate Natures in tests

(There's no need to validate natures somewhere that has an actual
performance impact.)

* Fix Hold Hands' num (smogon#7603)

* Add Galarica Wreath

* ANOTD: Change tagline to quote

Requested by Anime and Manga staff

* Add missing Trainer avatars

* Trivia: Document /trivia move

* National Dex Monotype: Unban Arena Trap

* Moderation: Actually make groupchatbans hotpatchable

* Moderation: Remove whitespace

* Helptickets: Properly quote and escape button HTML

* Add Berserk to the Berserk sim test

* Monotype: Update bans

https://www.smogon.com/forums/threads/ss-monotype-metagame-discussion-crown-tundra.3672167/page-3#post-8642660

* Fix Overflow Stat Clause and turn it into a mod (smogon#7604)

* Fix Ripen

* Users: Don't merge unregistered names across IPs

Fixes smogon#7594

* Don't report multiple punishments for a single room (smogon#7606)

* Add Pikachu-World event

* Add event Milcery

* National Dex Monotype: New bans and unbans (smogon#7608)

* AAA: Ban Dragapult, Dragonite, and Magearna

* Inheritance: Ban Regieleki and restrict Butterfree

* Remove VGC 2020 ladder

* Fix permission checks for global promotions

* Rename DLC 1 formats

* Modlog: Support logging to a SQLite database (smogon#7513)

* Modlog: Support logging to a SQLite database

Co-authored-by: Christopher Monsanto <chris@monsan.to>

* Modlog: Fix crash in writing global modlog

* Fix API for writing to the global modlog

* Trivia: Prevent stalemates in Infinite mode

* Update OU Sample Teams link

* Display the announcement whith /announcement (smogon#7612)

* Don't allow forcerenamed usernames to be reused (smogon#7609)

* Random Battle: Minor updates

* DOU DLC1: Fix banlist

* Improve and number design standards

* Modlog: Disallow duplicates in ModlogEntry#alts

* DOU: Ban Marshadow, Shadow Tag

https://www.smogon.com/forums/threads/np-ss-dou-stage-5-one-more-time-jirachi-melmetal-urshifu-single-strike-swagger-quickbanned-marshadow-shadow-tag-quickbanned.3672010/post-8644210

* Build: Update dependency check

* Trademarked: Update bans

* Fix Streams bug

It turns out 001f98b was wrong.

When urkerab asked why it `peek` wasn't awaited:

smogon@e91c4c5#commitcomment-41364837

The answer was because clearing the buffer after peeking needed to
happen synchronous: if the buffer is written to after peeking but
before the buffer is cleared, that write is lost forever.

This just goes to show, if you do something subtle enough to require
type assertions, you should probably add a comment about what's going
on.

Fixes smogon#7605

This also removes `BattleStream#start()` which is completely useless
API complication. A better implementation would properly forward
crashes between streams (maybe `pipeTo` should do this) but as it
stands, it's not doing anything.

* Improve "click here" error message

* Add November's OMotM, LCotM and RoA Spotlight (smogon#7615)

* NFE: Ban Haunter and Pawniard

* Update Doubles tiers

* CAP: Fix Mega Crucibelle being allowed

* Fix [Gen 3] Doubles OU

* Scalemons: Add Overflow Stat Mod

* November tier update

* Update NU-legal Pokemon

* Update National Dex tiers

* CODEOWNERS: Add chaos to anything SQLite related

* Config: Move Bot rank below Driver  (smogon#7617)

* Revamp Gen 2 Random Battle (smogon#7610)

* Fix /randbats interaction with Gen 2 sets

* Remove unused definitions

* Modlog: Avoid optional properties in ModlogEntry  (smogon#7613)

* Modlog: Avoid optional properties in ModlogEntry

* Use a type

* Make IP nullable

* Add NOT NULL constrains

* Fix typo

* Better handle races when reading Streams

* Mark other Genesect formes as unreleased in DLC1

* Gen 2 Random: Fix Rest + Sleep Talk

* Add new PU bans

* Gen 2 Random: Fix typo

* NU: Unban Drought

Also updated tier threads.

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
Co-authored-by: Leonard Craft <leonardcraft64@gmail.com>
Co-authored-by: Mia <49593536+mia-pi-git@users.noreply.github.com>
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
Co-authored-by: iscke <frumgerth@gmail.com>
Co-authored-by: The Immortal <the_immortal123@live.com>
Co-authored-by: HoeenHero <HoeenCoder@users.noreply.github.com>
Co-authored-by: Annika <56906084+AnnikaCodes@users.noreply.github.com>
Co-authored-by: Annika <hehe@doesntexist.com>
Co-authored-by: Instruct <66930476+xInstruct@users.noreply.github.com>
Co-authored-by: Marty-D <Marty-D@users.noreply.github.com>
Co-authored-by: Quinton Lee <quivistis@gmail.com>
Co-authored-by: LegoFigure11 <24732684+LegoFigure11@users.noreply.github.com>
Co-authored-by: urkerab <urkerab@users.noreply.github.com>
Co-authored-by: May Evans <36418502+PlagueVonKarma@users.noreply.github.com>
Co-authored-by: ACakeWearingAHat <45981036+ACakeWearingAHat@users.noreply.github.com>
Co-authored-by: VineST <alek.malesevic@yahoo.com>
Co-authored-by: Konrad Borowski <konrad@borowski.pw>
Co-authored-by: PartMan <47669599+PartMan7@users.noreply.github.com>
Co-authored-by: Charlie Kobayashi <sparkychildcharlie@gmail.com>
Co-authored-by: edcrfv <70171487+edcrfv0@users.noreply.github.com>
Co-authored-by: DarkPhoenix911 <64982718+DarkPhoenix911@users.noreply.github.com>
Co-authored-by: Christopher Monsanto <chris@monsan.to>
Co-authored-by: Distrib <theodelhay@orange.fr>
Co-authored-by: Annika <annika0uwu@gmail.com>
  • Loading branch information
1 parent c38b3ea commit 7a529fd
Show file tree
Hide file tree
Showing 127 changed files with 89,886 additions and 11,605 deletions.
5 changes: 2 additions & 3 deletions .eslintrc-no-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"tools/set-import/importer.js",
"tools/set-import/sets",
"tools/modlog/converter.js",
"server/global-variables.d.ts",
"sim/global-variables.d.ts"
"server/global-variables.d.ts"
],
"env": {
"es6": true,
Expand Down Expand Up @@ -187,7 +186,7 @@
{
"files": [
"./config/*.ts", "./data/**/*.ts", "./lib/*.ts", "./server/**/*.ts", "./sim/**/*.ts",
"./tools/set-import/*.ts", "./tools/modlog/*.ts", "./translations/**/*.ts"
"./tools/set-import/*.ts", "./tools/modlog/*.ts", "./translations/**/*.ts"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ npm-debug.log
package-lock.json
/tools/set-import/sets
databases/*.db*

*.o
*.o.dSYM
# Typescript build artifacts
.*-dist/
tools/set-import/importer.js
Expand Down
61 changes: 61 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/test

/config/*
!/config/formats.ts
/logs/*
/test/modlogs
/node_modules
/eslint-cache
/server/chat-plugins/private
/server/chat-plugins/private.js
/server/chat-plugins/*-private.js
npm-debug.log
.eslintcache
.eslintcache-no-types
package-lock.json
/tools/set-import/sets
databases/*.db*

# visual studio live share
.vs

# boilerplate #
###############

.DS_Store

# editor temp files
*~
.idea/

tmp/**/*
*.lock
*.DS_Store
*.swp
*.out
*.pyc
*.pyo
.installed.cfg

downloads
dist

# egg related
develop-eggs
*.egg-info
*.egg
*.EGG
*.EGG-INFO
src/*.egg-info
eggs
fake-eggs

# django
local_settings.py

# SCM
.hg
.bzr
.svn

pip-log.txt
3 changes: 3 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ data/mods/*/random-teams.ts @TheImmortal
data/mods/ssb/ @HoeenCoder
data/random-teams.ts @TheImmortal
data/text/ @Marty-D
databases/ @monsanto
server/chat-plugins/help.ts @mia-pi-git
server/chat-plugins/hosts.ts @AnnikaCodes
server/chat-plugins/mafia.ts @HoeenCoder
Expand All @@ -11,4 +12,6 @@ server/chat-plugins/random-battles.ts @KrisXV @TheImmortal
server/chat-plugins/repeats.ts @AnnikaCodes
server/chat-plugins/rock-paper-scissors.ts @mia-pi-git
server/chat-plugins/scavenger*.ts @xfix @sparkychildcharlie
server/chat-plugins/the-studio.ts @KrisXV
server/chat-plugins/trivia.ts @AnnikaCodes
server/modlog.ts @monsanto
64 changes: 64 additions & 0 deletions COMMANDLINE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Pokémon Showdown command-line tools
===================================

Pokémon Showdown provides a command-line utility `pokemon-showdown`. You can access its help anytime with `pokemon-showdown -h`.


Setup
-----

Install Node.js, clone this repository and run `./build` from inside it. (Windows users should use `node build`, and replace all future mentions of `./` in this document with `node` followed by a space.)

Every time you update the code here (such as with `git pull`), run `./build` again. (If you get errors, try running `./build --force`.)

Afterwards, you can use any of the following commands:


Supported commands
------------------

Note: Commands that ask for a team want the team in [packed team format][packed-teams] or JSON format. Teambuilder export format is not supported.

[packed-teams]: https://github.com/smogon/pokemon-showdown/blob/master/PROTOCOL.md#team-format

`./pokemon-showdown start [--skip-build] [PORT]`

: Starts a PS server on the specified port
: (Defaults to the port setting in config/config.js)
: (The port setting in config/config.js defaults to 8000)

: Using Pokémon Showdown as a server is documented at:
: https://github.com/smogon/pokemon-showdown/blob/master/server/README.md

: (You do not need to use `./build` when using PS as a server; it will
: be run automatically for you unless you use `--skip-build`.)

`./pokemon-showdown generate-team [FORMAT-ID [RANDOM-SEED]]`

: Generates a random team, and writes it to stdout in packed team format
: (Format defaults to "gen7randombattle")

`./pokemon-showdown validate-team [FORMAT-ID]`

: Reads a team from stdin, and validates it
: - If valid: exits with code 0
: - If invalid: writes errors to stderr, exits with code 1

`./pokemon-showdown simulate-battle`

: Simulates a battle, taking input to stdin and writing output to stdout

: Using Pokémon Showdown as a command-line simulator is documented at:
: https://github.com/smogon/pokemon-showdown/blob/master/sim/README.md

`./pokemon-showdown unpack-team`

: Reads a team from stdin, writes the unpacked JSON to stdout

`./pokemon-showdown pack-team`

: Reads a JSON team from stdin, writes the packed team to stdout

`./pokemon-showdown help`

: Displays this reference
36 changes: 30 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,28 @@ We strive to be maximally intuitive and accessible. "That's what they all say",

Some principles we try to design by:

- Less text is better
1. Less text is better
- The fewer words you use, the less likely someone is to gloss over it, and the easier it is to find the important information. Compare "1234 battles" with "There are currently 1234 active battles being played on this server" - more words are usually only clutter that makes it hard to find the information you want.

- Buttons should say what they do
2. Buttons should say what they do
- Buttons and links that say "Click here" or "Look at this" are bad for a number of reasons, but the most important one is probably because it violates the principle that you shouldn't need to read outside the button to know what the button does. The way people use interfaces is by looking for buttons that do what they want, not by reading every word from beginning to end.

- Remove unnecessary clicks
In addition, blind users in particular navigate by link text, so a blind user will have a much harder time figuring out where a link goes if it only says "click here".

3. Remove unnecessary clicks
- Whenever you give a user a button to click, always think "in what situations would a user want to click this? in what situations would a user not want to click this?" Dialogs like "Are you sure?" can often be replaced with just doing the thing with an "Undo" button. Buttons to show more details can often be replaced with simply showing more details by default.

- Remove unnecessary scrolling and mouse movement
4. Remove unnecessary scrolling and mouse movement
- Similar to unnecessary clicks - if a user has a large screen and you show them a lot of text in a tiny scrollable region, that's incredibly user-hostile. Either the user wants to read the text or they don't: the perfect use-case for a "read more" or expand/collapse button.

- Affordances are important
5. Affordances are important
- This is why we depart from flat design: Years of UX research have taught us that it's important for buttons look like buttons. Making clickable things "look 3D and pressable" or underlining them is good practice. We can't always do this (dropdown menus would look pretty ugly if every item was beveled and embossed) but we do what we can.

- Feedback is important
6. Feedback is important
- If a button doesn't react instantly, it should be replaced with a "Loading" screen or some other indication that it's doing something. If something's failed, it should come with an error message so the user knows what's wrong.

There's a famous story of a CEO of a company who clicked the "email everyone" button, but it didn't react, so he clicked it a few more times, accidentally spamming a bunch of users and getting their company marked as spam by a bunch of email services.


Commit standards
------------------------------------------------------------------------
Expand Down Expand Up @@ -222,3 +226,23 @@ TypeScript Features
- **Constant Enums: NEVER** - Not supported by Sucrase, our current choice of transpiler. We prefer constant union types, anyway (like `type Category = 'Physical' | 'Special' | 'Status'`)

- **Default Properties: SOMETIMES** - Bad performance when used with Sucrase. This is fine for objects that are rarely created, but prefer setting properties directly in a constructor, for objects created in inner loops.


`package-lock.json`
------------------------------------------------------------------------

We don't use `package-lock`. This is against NPM's (and most others') official advice that we should.

: First, what's `package-lock` and why is it recommended? `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. It also makes diffs in general significantly less readable. It also [introduces security vulnerabilities](https://snyk.io/blog/why-npm-lockfiles-can-be-a-security-blindspot-for-injecting-malicious-modules/).

The biggest supposed advantage (ensure everyone's on the same version) isn't even an advantage! We'd specify the versions as `4.15.4` instead of `^4.15.4` if we wanted everyone on the same version, rather than the latest version. Writing `^4.15.4` is an explicit choice to opt into automatic updating.

We can still have everyone on the same version if we all 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.

(The last time we polled our developers, most supported not having a `package-lock` file.)
6 changes: 4 additions & 2 deletions PROTOCOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,10 @@ format is implemented in `Dex.packTeam` and `Dex.fastUnpackTeam` in
`sim/dex.js`.

If you're not using JavaScript and don't want to reimplement these conversions,
Pokémon Showdown's command-line client can convert between packed teams and
JSON using standard IO. Run `./pokemon-showdown --help` for details.
[Pokémon Showdown's command-line client][command-line] can convert between packed teams and
JSON using standard IO.

[command-line]: https://github.com/smogon/pokemon-showdown/blob/master/COMMANDLINE.md

If you really want to write your own converter, the format looks something like
this:
Expand Down
Loading

0 comments on commit 7a529fd

Please sign in to comment.