atomic-server
atomic-server copied to clipboard
Minimize impact of pnpm in build scripts
After merging Atomic Data Browser with AtomicServer, the new monorepo builds the JS assets instead of having them in the commits (which required manual work, yuck).
As a result of this, the build process depends on a JS package manager, in this case pnpm. This leads to pnpm being everywhere:
build.rs(callspnpmfrom terminal if assets are not found)- Most github actions / workflows
dockerfile(causing broken builds)- all
READMEs
I don't like this proliferation. Ideally, I'd make something like pnpm part of the build.rs, as an embedded crate thing. Just a rust crate that can build the js assets.
Sticking to pnpm
- Work right now
- Depends on node, requires extra build step
Add build artefacts in repo
This is what we did before we switched to the monorepo. Having JS artefacts in the commits every time anything changes bloats the repo, adds commits that have no semantic value, and increases dev-time complexity (because I sometimes forget to commit build artefacts!).
However it also means that building no longer requires node / pnpm which is great for everyone building Atomic-Server from source.
Using Bun
- Does not depend on node (yay), so we don't need node + pnpm dependencies in the CI
- It works, but I had some issues when configuring the actions. Don't remember exactly what it was, though.
- Bun has a
buildfunction, so it can serve as a replacement forvite build. However, I don't think as of now it can also replaceviteas a development server. Bun used to have abun devcommand, but it's gone now. Also, I currently usepnpm --recursiveto run thedevcommand in multiple projects at the same time - I want the browser to live-reload if I make changes to any of the libs. Not sure if that's possible with bun? bun testis crazy fast, which is great, but the test runner doesn't support many expect calls yet. (toHaveBeenCalledWith, toHaveBeenCalledTimes)
Turbopack
- Is written in Rust, so perhaps can be embedded in build.rs?
- I don't think it supports all the things that we need yet.
Deno v2
- Supports npm stuff, contrary to Deno v1
- Has its own FMT / lint tool. Less config.
- Written in Rust. Could become useful later?
- Small footprint, easier in CI than node + pnpm
- Fast!
But tried it, and:
deno lintindata-browserseems to be stuck in a loop- Can't see how I can run things recursively / in different folders
- other unknown issues?
EDIT: updated on Nov 12th