Introducing kmono: A workspace tool for Clojure monorepos. https://github.com/kepler16/kmono Kmono is a suite of tools and API's for working in Clojure deps.edn based (mono)repos. It comes offering the following features. • *Workspace features*: Discovers packages and understands relationships between dependencies • *Aliases*: Allows working with packages aliases defined in deps.edn in a 'Clojure native' way without having to pull all alias definitions into a root deps.edn • *Build Tools*: Exposes a suite of tools and APIs intended to be used from tools.build programs to build and release monorepos • *Command Runner*: Allows executing Clojure and/or external commands in workspace packages • *Local Deps Overrides*: Allow overriding kmono config and deps.edn dependencies during local development. Useful for providing local paths to in-development libs without committing. • *Editor/Clojure-lsp*: Integrates with clojure-lsp to provide better classpath information and improve the developer/editing experience in monorepos. This project has been extensively used behind the scenes at my work for a few years now with the ongoing intent to one day share it with the community. Today felt like the day! Check it out and let us know your thoughts.
would this be filling the space of something like Polylith--sans the architecture framework, or would you see this being used for Polylith itself as well?
(oh and hey, i thought i recognized your name from my nvim days)
I would say this is a more general, less opinionated solution for clojure workspaces/monorepos. It could possibly be incorporated into polylith to replace some of its internals, but I think they are more likely to be tangental to one another.
I'm a bit confused by this bit in the readme:
> Here is a list of some of the functionality I find lacking:
> • Start a repl with some subset of package aliases (such as :test) active (deps included, paths on classpath)
What's wrong with clj -M:alias1:alias2? (None of the aliases should provide :main-opts of course.)
Specifically for :test, I have :test with all the dependencies and :test/run that actually runs the tests. And if I just want the REPL, I use clj -M:test.
Me too! Thanks for open-sourcing a really great tool, guys!
What you are suggesting requires the test aliases for all workspace packages to be combined together and defined in the root deps.edn. Kmono allows defining the workspace package aliases in each package's deps.edn directly.
This also allows dynamically including aliases from subpackages based on certain heuristics:
• Only include :test alias from packages that have changed since and run their tests
• Only start a repl with aliases from module x + y + z
• Run :prepare in these three workspace packages
• etc etc
Clojure has no way to do this natively. It's an all-or-nothing solution that also requires you to not define the package configuration at the package itself, but combined in the root.
Kmono makes subpackage aliases a usable and useful construct
I'll definitely be taking a look at this.
https://clojurians.slack.com/archives/C015AL9QYH1/p1754427915191899