polylith

Andrew Leverette 2025-02-21T21:45:17.943739Z

I have a polylith project that is a cli. Is there a way to run this specific project using clj ? I know that I can add an alias to the top level deps and reference the base, but I wasn't sure if there was a built-in polylith way to do that.

Andrew Leverette 2025-02-21T21:46:26.829419Z

I know I can create a jar file and run it that way, but I was thinking that this would be easier for spot-checking things quickly.

seancorfield 2025-02-21T22:51:05.470669Z

(cd projects/my-cli && clj -M -m ...) perhaps? 🙂

seancorfield 2025-02-21T22:53:01.352009Z

That said, I mostly set up projects to run from the top-level using an alias with :extra-deps {poly/my-cli {:local/root "projects/my-cli"}} and :main-opts for the -m portion.

seancorfield 2025-02-21T22:53:57.809459Z

You want your top-level alias to reference the project, not the base BTW, since the base would not have any dependencies on bricks -- only projects have those.

Andrew Leverette 2025-02-21T23:05:18.497619Z

This is what I came up with.

:migrations {:main-opts ["-m" "polydoc.migrations-cli.core"]
                         :extra-deps {poly/polydoc-migrations {:local/root "projects/polydoc-migrations"}}}}}
Does this seem reasonable?

👍🏻 1
Andrew Leverette 2025-02-21T23:05:38.786429Z

That's the alias for the project in the top level deps file.

seancorfield 2025-02-21T23:06:21.309389Z

Yup. That's pretty much what we do at work.

Andrew Leverette 2025-02-21T23:06:30.639979Z

Cool. I'm learning.

Andrew Leverette 2025-02-21T23:07:29.770099Z

I took your advice by the way. I'm incorporating migratus and building a little cli to handle db migrations.

👍🏻 1