Publishing the First Open-Source Packages for EarthBucks

2024-05-27 · Ryan X. Charles

Rust and TypeScript Packages

Today I’m happy to announce I have published the first two (alpha) open-source packages for EarthBucks:

I have also published a bonus package for doing Rust-style Option and Result enums in TypeScript, which the EarthBucks project uses extensively:

Meanwhile, the software for all these packages can be found on the EarthBucks mono-repo on GitHub:

All open-source packages are MIT-licensed.

I have published all of these packages because I am using them in some of my proprietary code and found it convenient to publish them. They are alpha projects and the API will change. My goal is to stabilize the API for a 1.0 release at launch, which is targeted for July 2024.

Publishing the Code

The Rust code was very easy to publish. I signed up on crates.io and then published the package. End of story.

The TypeScript code was not so easy. For reasons that would take too long to explain, publishing TypeScript code on NPM is not necessarily easy. Please see jsr, an alternative to NPM, for a better experience. However, in spite of the issues, I have decided to publish to NPM instead of jsr, because NPM is the standard package manager for TypeScript/Node.js and is far larger at this time.

In a nutshell, after many hours of effort, I decided to make two changes to all my TypeScript code to be able to publish on NPM:

  • I am using a .js extension in all imports so that the built javascript code can be imported directly with import syntax.
  • I have switched from the jest testing framework to vitest, which is 100% API-compatible to jest, but works out-of-the-box with TypeScript. It is also compatible with vite, the front-end build tool I am using.

Conclusion

Please feel free to experiment with the new packages, but note that the API will change before the final release.

All current and future open-source code for EarthBucks can be found on GitHub:


Earlier Blog Posts

Mines vs. Miners
2024-05-22 · Ryan X. Charles
Why All UTXOs Expire After 90 Days
2024-05-18 · Ryan X. Charles
Rust Result in TypeScript
2024-05-09 · Ryan X. Charles

Back to Blog

Home · About · Blog · Privacy · Terms
X · Telegram · Discord · reddit · GitHub
Copyright © 2024 Ryan X. Charles LLC