3 comments

  • Panos16071 hour ago
    Managing monorepos can get messy quickly. I've used Changesets mostly in pure JS/TS environments and it's been a lifesaver for versioning. Interesting read on how you're handling the polyglot aspect to keep things unified.
  • moltar1 hour ago
    Would love to see more of the Docker step.
  • sshine1 hour ago
    I handle polyglot monorepos using Nix.<p>Because Nix is a package manager not tied to one programming language ecosystem, I can install all the tools for every language I need, and have the tooling consistent and modular, even between monorepos.<p>For formatting I usee treefmt-nix, which quickly format all syntaxes in my repo (.nix, .rs, .md, etc.) by calling individual formatters (installed via Nix), such as rustfmt, mdformat, nixfmt, etc.<p>For git hooks I use lefthook-nix, which automatically installs my git hooks using lefthook. husky, cargo-husky, etc. are great, but they assume you&#x27;re mainly using one tech stack. lefthook is like pre-commit, but with significantly better dependency chain. (I tried one time to bust the Nix cache and had to download and compile both the .NET runtime <i>and</i> the Swift runtime... it reminded me my dependency footprint could be smaller.)<p>For Cargo workspaces in Rust I use workspace-level linter rules, so all new crates can inherit the same rules.<p>As the author, I also love `just` and I have the CI steps as `just fmt`, etc.<p>This means the same commands I type work in CI, so there&#x27;s not a parallel environment I have to maintain.<p>I have a `just ci` for running all the steps at once locally, but in GitHub&#x2F;Forgejo Actions, I like to split them into separate Actions steps for better rendering on web. But `just ci: fmt lint ...` is just an alias, so very little repetition here.<p>Here&#x27;s a lefthook-nix + treefmt-nix guide: <a href="https:&#x2F;&#x2F;simonshine.dk&#x2F;articles&#x2F;lefthook-treefmt-direnv-nix&#x2F;" rel="nofollow">https:&#x2F;&#x2F;simonshine.dk&#x2F;articles&#x2F;lefthook-treefmt-direnv-nix&#x2F;</a><p>Here&#x27;s a GitHub Actions + Nix guide: <a href="https:&#x2F;&#x2F;simonshine.dk&#x2F;articles&#x2F;speeding-up-ci-with-nix&#x2F;" rel="nofollow">https:&#x2F;&#x2F;simonshine.dk&#x2F;articles&#x2F;speeding-up-ci-with-nix&#x2F;</a><p>Here&#x27;s an example project that uses it: <a href="https:&#x2F;&#x2F;github.com&#x2F;sshine&#x2F;walltime-rs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sshine&#x2F;walltime-rs</a><p>Here&#x27;s a &quot;how much Nix should I swallow at once?&quot; guide: <a href="https:&#x2F;&#x2F;simonshine.dk&#x2F;articles&#x2F;three-levels-of-nix&#x2F;" rel="nofollow">https:&#x2F;&#x2F;simonshine.dk&#x2F;articles&#x2F;three-levels-of-nix&#x2F;</a><p>Here&#x27;s a Forgejo Actions runner that builds and pushes an OCI image to a registry without Docker: <a href="https:&#x2F;&#x2F;git.shine.town&#x2F;infra&#x2F;runners&#x2F;src&#x2F;branch&#x2F;main&#x2F;.forgejo&#x2F;workflows&#x2F;build-runners.yaml" rel="nofollow">https:&#x2F;&#x2F;git.shine.town&#x2F;infra&#x2F;runners&#x2F;src&#x2F;branch&#x2F;main&#x2F;.forgej...</a>