Development Setup
Learn how to set up the Magnitude codebase
Prerequisites
Bun
While not explicitly required, it’s recommended to use Bun as your node runtime since that’s what our team uses.
To install bun:
bun
in commands - but you can replace with npm
if preferredMonorepo Setup
Since the initial install will fail due to the missing (unbuilt) dependency magnitude-core
, do this:
The monorepo now has dependencies installed and is built.
Building Packages
Whenever you make a change to magnitude-core
that you want to be reflected in magnitude-test
during testing, make sure to rebuild with bun run build
.
Local Testing
When you make changes to magnitude-test
that you want to test in your project or elsewhere, you need a way to refer to your local package.
To do this, you can use yalc.
Install yalc:
In your other project:
This will add the yalc (local) version of magnitude-test instead of the one published on npm
Then back in the monorepo:
This will update your other project with your modified version of Magnitude