My goal with this project has always been to give developers a full-framework experience for building Discord bots, though I have started splitting things from the megapackage that purplet
is into simpler and smaller chunks like @purplet/gateway
, @purplet/polyfill
, soon coming @purplet/rest
, and in the next weeks we will see a ton more, including a library that replaces the use-case of discord.js
without being the full framework that purplet
is. I guess my new goals have changed to "giving TS developers really good interfaces to interact with the Discord API".
With these packages I also started to support the Bun runtime, as I believe it is the future, though my methods of supporting are only to make my code not depend too tightly onto Node APIs, but rather Web Standards. We then add missing web APIs like fetch
, WebSocket
, and FormData
via the @purplet/polyfill
package. When it comes time to making the purplet
, the framework itself work, that may involve a different approach as we have the opportunity to bun-accelerate compliation using Bun.Transpiler
, and so on. For now, I'm holding off on making the framework cli work in Bun and will probably wait for upstream to implement vite support and use that. In the future, we might go bun-only, but node needs to be completely replacable which it is not and will not be for at least a few years.
So back to that package that replaces discord.js
. It's going to wrap the gateway, rest, and structures packages we already have; being a library exporting an object similar to Discord.Client
, opens a gateway connection and emits structure classes for gateway events. I think a fun name to call that package is buncord
- it was something @Hycord mentioned somewhere on Discord as a hypothetical. It definitely beats @purplet/<any string>
for sure. I'm unsure if that package will be depended on by purplet
, probably not as the interface given might be too strict to cover gateway + endpoint uses across that package. However, the important thing about these two packages is that code written within a purplet
$interaction
should be identical to a buncord
.on('interactionCreate')
event, due to shared dependencies on @purplet/structures
.
We are now at a weird situation where this project has two top-level packages: purplet
and buncord
. Hycord has wanted to go embrace buncord
as the npm scope we use for publishing, and other branding changes, but I'm not so sure that would be a smart move, as it would include a lot of package movement. But if this is truly the right call, it would be best to make it before we continue. I am holding back publishing our rest client until this is resolved.
My personal opinion is Purplet should be the overarching name of the project, keeping buncord
as one public component of the larger picture. I also don't think it makes sense to rename (again) @purplet/serialize
, since buncord
shouldn't be depending on this at all (similar situation with future packages I am planning on like logger
from #28). We also already have an amount, but not absurdly large amount of branding and a set of users are already aware of this project as a whole to be "Purplet".
Also, the buncord
package, depending how we make it work, might be an extremely minimal implementation, as it will primarily be wrapping our other packages into a more useful tool for people who desire a library as opposed to a framework.
I would like to hear other opinions before I use my position as 'code owner / maintainer' to go forward with Purplet being the core name of all of these Discord API projects. In the end, it's not the name that matters, just the actual code we're making. We've grown to a codebase of over 9300 lines, and we're only at the start of a very promising toolkit.