estroBiologist / pluralchum

PluralKit integration for BetterDiscord
MIT License
42 stars 12 forks source link

Major Refactor #22

Closed ariagivens closed 1 year ago

ariagivens commented 1 year ago

This PR majorly reorganizes the codebase.

It includes all the dev tools for working with code base in package.json. Now the project can be built using npm run build and npm should take care of installing all the required tools. rollup is used as a bundler, so now the project is separated into different files for nicer organization.

The project is rewritten in a more reactive/functional style. Basically regular functions are preferred over methods. One benefit of this no longer having to remember to do .bind(this) when creating callbacks. A wrapper is used for settings and profileMap that automatically saves them to disk when updated.

In general the long and scary looking functions have been decomposed into simpler parts that should hopefully be easier to work with. Some code duplication has been refactored into function calls.

ariagivens commented 1 year ago

As a side note, the use a bundler also means that external dependencies can be used with less hassle. There's 2 features that I thought might want this:

estroBiologist commented 1 year ago

Thanks very much! And apologies again for the delay on recent PR reviews - life's been getting in the way, to say the least. If nothing else, this should make it significantly less of a pain to work on the plugin for those interested.

Considering the extent to which this PR upgrades and reorganizes the codebase, I feel like a considerable version bump may be appropriate here (plus, it presents a good opportunity to actually start upholding SemVer somewhat - no idea what I was thinking with the current versioning scheme, honestly).

Before doing so, I'm open to possibility of merging the other PRs, assuming they can be rebased without too many problems. I might also try to get some additional maintainers on board, so the onus of keeping this plugin up to date doesn't solely fall on my ADHD ass.

Anyway, this mostly looks good to me. I did find a bug which seems pretty trivial - let me try and figure out how GitHub's PR review process works for a change lol