Yalc is a simple local dependency repository which we can use to work with local
versions of our SDKs. This is a good alternative to pnpm link for packages where linking is problematic (e.g.
SvelteKit or Angular).
Here's how to set up and use yalc:
You don't need to install yalc. The yalc:publish scripts run it with pnpm dlx, and you can do the same in your test
projects. If you prefer, install it globally with pnpm add -g yalc and drop the pnpm dlx prefix below.
Whenever you want to make your local changes available to your test projects (e.g. after a local code change), run:
pnpm run yalc:publishIf you run this command in the root of the repo, this will publish all SDK packages to the local yalc repo. If you run
it in a specific SDK package, it will just publish this package. You don't need to call yalc update in your test
project. Already linked test projects will be update automatically.
In your test project, run
pnpm dlx yalc add @sentry/browser #or any other SDK packageto add the local SDK package to your project.
Important: You need to yalc add the dependencies of the SDK package as well (e.g. core, utils, types, etc.).
Did you run pnpm run build && pnpm run yalc:publish after making your changes?
Vite pre-bundles and caches dependencies for dev builds. It
doesn't recognize changes in yalc packages though :( To make these changes
show up anyway, run vite dev --force.