polylith

telekid 2026-02-24T08:54:35.397559Z

This is a little goofy, but: I have some work that I'd like to keep private, but most that I'd like to open source. I'm wondering what it would be like to create two polylith repos, one for open source work and one for private work, where the latter points to components in the former. Any initial thoughts on how to achieve this, or whether maybe I'm barking up the wrong tree?

imre 2026-02-24T10:16:46.551189Z

As Sean pointed out in a recent thread, Polylith is designed with applications as products in mind, not libraries

imre 2026-02-24T10:18:21.649439Z

It is still possible, however

imre 2026-02-24T10:19:03.259589Z

A few years ago I created https://github.com/imrekoszo/polylith-kaocha where the products are libraries

imre 2026-02-24T10:19:39.161149Z

Namely, the kaocha-wrapper and test-runner projects defined here https://github.com/imrekoszo/polylith-kaocha/tree/master/projects

imre 2026-02-24T10:20:48.291259Z

Referencing multiple libs in the same project from a repository like this might be a little unwieldy due to https://clojure.atlassian.net/browse/TDEPS-132

telekid 2026-02-24T10:55:49.052119Z

Got it, makes sense. Thanks!

telekid 2026-02-24T15:21:00.732839Z

I'd like to use the result of poly deps programatically. Is there a way to output the result as json rather than as a table? Or, barring that, how much work would it be to expose deps as part of the library API?

tengstrand 2026-02-24T15:27:43.661319Z

You have access to the whole https://cljdoc.org/d/polylith/clj-poly/0.3.32/api/polylith.clj.core.api.interface#workspace from the API. So a command like poly ws get:components:info:interface-deps will return:

{:src ["common" "path-finder" "text-table" "util" "validator"], :test ["file"]}
The same information is also available in the workspace structure that the API exposes. Then you need to assembly it to what you need (e.g. something similar to the output from the deps command).

telekid 2026-02-24T15:55:46.542419Z

Awesome. Thanks!

👍 1