Prepare release builds

Hello,

I’ve started working on some bigger changes which I plan to upstream completely - as you can see if you look at the pull requests of the Uppy repo right now :wink:

In a perfect world I can wait for all PRs to land without any time limits, but unfortunately I need to ship the feature rather soonish.
I’ve managed to succesfully run yarn run build - but I’m completely lost what I need to do, to make the packages releasable.
The package.json files reference workspace dependencies and cannot be linked from other projects (not from pnpm projects at least)

Can you give me some pointers what I need to do to create externally consumable builds of especially the frontend libraries?

I’m not sure I understand what you are trying to do, are you trying to test your changes? If so, I recommend using the bundle in packages/Uppy/dist, it’s one standalone JS file that you can import in your project.

1 Like

Aaaah, sounds like! I will check! Thanks!

I guess, my point is: the build process generates js files in packages/Uppy/dist but there are no package.json files that work in external projects - cause they reference workspace packages.

Is there a single command that replaces all the workspace references with something that works in external projects?

yarn build && yarn workspace foreach pack is what I was looking for. That gives me tgz files which I can use in external projects

Ah right, that’s indeed a way to do it, but you should have in mind that dependencies on Uppy packages will target npm instead of your local packages; e.g. @uppy/audio depends on @uppy/utils, and yarn pack will replace to a version number in the package.json, but what you’d actually want would be to point to the local tgz file which has your changes, not the version on npm. If you haven’t touch @uppy/utils, that won’t matter though.

Here is how we work around that in our CI: https://github.com/transloadit/uppy/blob/main/.github/workflows/bundlers.yml

Yup, I’m aware - that I can deal with, on consumption in our project I’m back in pnpm land where I know better what I’m doing. I just use pnpm.overrides, more or less what resolutions in yarn land seems to be.

Thanks for your hints!