democracy.js icon indicating copy to clipboard operation
democracy.js copied to clipboard

Typescript, CI, start/stop methods, dev script, and new options

Open Nathan-Schwartz opened this issue 3 years ago • 2 comments

Changes:

User facing:

  • Expose TS typings #4
  • Switch to ESM
  • Allow stopping and starting a node #9
  • Add an autoStart option
  • Add an enableStrictWeightMode option to be more aggressive about making the highest-weighted node the leader (may help with https://github.com/mKeRix/room-assistant/issues/860)
  • Change isLeader() implementation such that it isn't reliant on object key iteration order, which could have potentially returned false if the current node was a leader and another node was still reporting themself as a leader. If this occurred, it would mean the runoff elections might not occur when necessary, which could result in multiple leaders existing indefinitely.

Dev facing:

  • Remove the deprecated shortid package and replace it with nanoid
  • Update eslint packages and add a script for linting
  • Introduce Github actions to run linting and type checking on PRs and pushes
  • Mark internal-only methods as private
  • Introduce a dev script to easily run a 3 node cluster that watches for file changes
  • Resolve #17, #16, #15, #13, #11, #8 as well

Nathan-Schwartz avatar Sep 05 '21 05:09 Nathan-Schwartz

Hey @goldfire, I'm sure you're busy but I'd love to get some feedback on this when you get time 🙂

Nathan-Schwartz avatar Sep 22 '21 17:09 Nathan-Schwartz

@goldfire do you have an idea of when you'll get a chance to review this? Thanks!

Nathan-Schwartz avatar Feb 12 '22 19:02 Nathan-Schwartz