polylith

https://polylith.gitbook.io/ and https://github.com/polyfy/polylith
seancorfield 2021-06-02T04:32:40.034500Z

Another subproject refactored into a component. Tomorrow will be some of another subproject. The downsides of having subprojects that become “grab bags” of random functionality! 😞

Nikolas Pafitis 2021-06-02T14:38:19.036800Z

I have an issue where if i run poly create component name:be.router.reitit interface:be.router i get the following after running poly info

Nikolas Pafitis 2021-06-02T14:39:19.037100Z

I can go around it by using dashes instead of dots but it doesn't quite look idiomatic.

seancorfield 2021-06-02T15:48:42.038600Z

I was a bit surprised you can create an interface with a dotted name at all, but I see it creates the appropriate nested file structure (`components/be.router.reitit/<prefix>/be/router/interface.clj`). I just expected everything to be at the same depth and for a dotted name to be disallowed. Will be interesting to hear what @tengstrand says about that.

Nikolas Pafitis 2021-06-02T15:50:17.038800Z

I mean it works mostly fine, the namespaces correspond correctly to their path, and it feels like a nice way to group up components

Nikolas Pafitis 2021-06-02T15:58:55.039Z

Although if you create 2 components with the same dotted prefix they won't be grouped together under the same dir as java packages-style

Nikolas Pafitis 2021-06-02T15:59:09.039200Z

Which is not necessarily bad

λustin f(n) 2021-06-02T16:00:23.039400Z

After introducing a :git/url dep, I am now getting the following error message when doin poly test

λustin f(n) 2021-06-02T16:00:47.039800Z

Unknown library type: git

λustin f(n) 2021-06-02T16:03:34.041200Z

Does anyone know how I can get more info than this? Does polylith have any additional log files when it runs tests or something?

seancorfield 2021-06-02T16:10:32.041800Z

@austin021 Which version of poly are you using? That works with the latest git version from the issue-66 branch. Maybe it just isn’t supported in the version you’re using?

seancorfield 2021-06-02T16:11:32.042Z

I wouldn’t expect them to — the component names would be unique and everything is grouped “by component”.

tengstrand 2021-06-02T16:12:03.042200Z

No, this should not work, and I’m really surprised that it does! 🙂

1
😎 1
λustin f(n) 2021-06-02T16:19:17.042700Z

0.1.0-alpha9

λustin f(n) 2021-06-02T16:24:09.042900Z

{polyfy/polylith
             {:git/url   "<https://github.com/polyfy/polylith>"
              :sha       "76936c752fb5b729c216b23d92c8a8d71cfdc92f"
              :deps/root "projects/poly"}}

seancorfield 2021-06-02T16:27:35.043Z

Maybe :git/url just isn’t supported on the master version? I’m on 2de60069edbba960b8ab9e71dc6c2341615a52ec which is the latest issue-66 branch (which has a lot of changes from master — including quite a few breaking changes I believe).

λustin f(n) 2021-06-02T16:36:39.043600Z

Yeah, switching to that branch fixes it. Thanks!

seancorfield 2021-06-02T16:39:06.043800Z

Hmm, I didn’t think issue-66 was compatible with master. I’ll be curious to hear of any problems you run into after making that switch… (I figured I’d start with issue-66’s branch since I’m just getting started with Polylith and I need some of the changes that branch supports)

λustin f(n) 2021-06-02T16:39:10.044Z

Huh. Actually, it only fixed things for my local machine. It just slightly changed the error message for CircleCi java.lang.Exception: Unknown library type: git

seancorfield 2021-06-02T16:39:30.044200Z

Is CI running poly or clojure -M:poly?

λustin f(n) 2021-06-02T16:40:18.044400Z

clojure -M:poly test , which is the same as what I tested with on my local machine.

λustin f(n) 2021-06-02T16:43:16.044600Z

Well nevermind. I am reading through my local logs and it is the same. I wonder what I read that made me think it worked!

λustin f(n) 2021-06-02T16:49:57.045Z

@seancorfield, Since you say it is incompatible, where can I look to change to the new version's config? I am also mostly just starting with polylith as well. What are the things it supports that you need?

λustin f(n) 2021-06-02T16:51:19.045200Z

Ah. Info is at the top of the Readme of the branch. nevermind.

seancorfield 2021-06-02T16:55:09.045400Z

Yeah, the diff is pretty enormous: https://github.com/polyfy/polylith/compare/issue-66

seancorfield 2021-06-02T17:01:08.045600Z

I won’t attempt to summarize it — @tengstrand could do a better job — but I think it’s mostly that components have their own deps.edn files now and there’s a workspace.edn file at the root which contains the poly-specific information (moved from deps.edn) and the workspace-level deps.edn is now about just the :dev/`:test` alias stuff.

seancorfield 2021-06-02T17:02:41.045800Z

This much more closely matched how we were already using the Clojure CLI — we’ve had a monorepo for years and been using deps.edn since some time in 2018 and we’ve reorganized it a few times as the CLI has evolved. We had about 40 subprojects and 113K lines of code before we started to migrate to Polylith.

tengstrand 2021-06-02T18:50:10.046Z

Yes, if I remember right, I only fixed that :git/url problem in the issue-66 branch.