Fork me on GitHub
#polylith
<
2023-09-11
>
jasonjckn02:09:27

i wonder if using the same artifact names is a good idea across profiles, might make reading poly CLI output harder, but otherwise a bit more obvious what-is-going-on ('lib'=component)

jasonjckn03:09:54

I'm really not trying to focus on a triviality here, as its a small detail in the big picture, but i'm trying to escape the nomenclature 'components' , but it's not easy... i thought i managed to pull it off by symlinking everything lib -> components, but no dice.... poly check is still unhappy... bit of background, the project that i'm on already have 3 different distinct usages of the word component, (1) stuart sierra kind with lifecycle functions (2) the distributed system kind, a distributed system of components {microservices/databases/etc} (3) a third definition specific to our project I can't go into here. Also what polylith deems 'component' has traditionally been called 'library' , whether its artifact based or source based (local/root) doesn't change that its a library, its just different coordinates. So i'm not trying to start debate on nomenclature, but i think it would be nice to be able to either (1) be able to disable specific errors and warnings in poly check, and/or (2) make it configurable (the root directory names)

tengstrand04:09:26

Which error or warning number do you get?

jasonjckn04:09:33

Error 107: Missing components in the development project for these interfaces: edn-log I can't promise that is the only error I would want to suppress though.

jasonjckn04:09:59

i symlinked everything

⚡ ls -al etc/polylith
drwxr-xr-x@   - j  9 Sep 11:13  .clj-kondo
drwxr-xr-x@   - j  9 Sep 20:37  .cpcache
drwxr-xr-x    - j 19 Aug 23:27  .lsp
lrwxr-xr-x@  11 j  9 Sep 11:13  bases -> ../../bases
lrwxr-xr-x@   9 j 10 Sep 21:05  components -> ../../lib
lrwxr-xr-x@  10 j  9 Sep 11:13  development -> ../../repl
lrwxr-xr-x@   9 j  9 Sep 11:13  lib -> ../../lib
lrwxr-xr-x@  14 j  9 Sep 11:13  projects -> ../../projects
lrwxr-xr-x@  14 j  9 Sep 11:13  deps.edn -> ../../deps.edn
.rw-r--r--@ 559 j 10 Sep 19:54  workspace.edn

jasonjckn04:09:25

but no dice , it's expecting the local/root's to be "../../components/<libname>", when in fact they're "../../lib/<libname>" , albeit 'components' would still resolve via symlink if it tried to access that in the file system.

jasonjckn04:09:20

i just forked the code, and hardcoded 'lib', as an interim solution, although not planning to stay in this state forever

jasonjckn04:09:05

it looks like a lot of the parts of the polylith code, are generic enough, that it would actually work with the symlink structure I setup

tengstrand05:09:23

Do you have a second workspace.edn file two levels up (`../..`)?

jasonjckn05:09:41

i just wrapped $ poly, in a script which changes directory

tengstrand05:09:02

Okay, so it's only because you want to "rename" the lib directory to components ?

jasonjckn05:09:17

yes that's it

jasonjckn05:09:30

the symlink stuff is a hack

jasonjckn05:09:39

but even my hack won't work

tengstrand05:09:15

And you can't follow the default Polylith naming of directories?

jasonjckn05:09:28

there's nothing physically preventing me , i explained 'why' above, that we have 3 different usages of the word already, i don't want to confuse people

jasonjckn05:09:48

so... yah i mean my request... is probably a bit unreasonable, I totatlly get why this might be a waste of time for you 🙂

seancorfield05:09:11

@U0J3J79FE I have to wonder why you're fighting the conventions so hard? Most of your posts here are about the pain you are causing yourself by trying to color outside the Polylith lines... 🙂

👌 2
seancorfield05:09:46

We use Sierra's Component extensively. No one is confused that we also have components...

jasonjckn05:09:07

for sure... i'll try to make this my last anti-convention post, i don't think there's been too many. fwiw, i yielded in a lot of areas to you guys, this is probably the only non conventional thing left

jasonjckn05:09:40

alright, we'll in the interest of everyones time, i didn't want to make a big deal out of this, for the exact reasons you're bringing up 🙂

jasonjckn05:09:13

components has a ton of different meanings at my work place, everyone wants the semantic real-estate

jasonjckn05:09:22

it's already taken 3 different times , 3 different definitions where I am.

seancorfield05:09:06

One of Polylith's "big problems" is that it can be hard to see why things are the way they are when you first get started. I railed against it too -- go search the archives -- and I was often way less polite than you're being. But eventually I just "gave in" and did things the Polylith way and it's really made a positive difference for us.

❤️ 4
jasonjckn05:09:08

also, these are just 'libraries', i think that maps closely to rich hickeys Spec-ulation talk

seancorfield05:09:30

Words are hard. Libraries are external things in my book. Components are something in our own code.

jasonjckn05:09:54

for sure, i've already come around a bunch last week, so be patient with me

seancorfield05:09:14

A lot of Polylith won't make sense until you've done things the "Polylith Way" (tm) for a while...

jasonjckn05:09:16

i experienced the shift in perspective

jasonjckn05:09:14

irregardless i'm 'all-in' on polylith, we converted the codebase last week

2
seancorfield05:09:56

It took us a while -- see my blog! -- but we're glad we converted. Incremental testing alone has saved us a bunch of money.

seancorfield05:09:22

(and we only build the artifacts that have changed too, which cuts down on CI time and data transfer)

🙌 2
furkan3ayraktar08:09:51

We spent a lot of time, maybe more than necessary :), for the conventions in Polylith, especially the naming conventions. Tens of hours went into discussing the words component and project. I think they are wrongly claimed and used in different parts of the programming world, and their meanings in Polylith are best aligned with the actual word. Also, it is nice that directory structure and naming conventions are not customisable, so people familiar with Polylith can easily understand the codebase they see, and people who need to become more familiar with Polylith can easily follow the documentation and reason about it.

🙏 2
jasonjckn05:09:19

this is intentional (?)... but i thought i could throw a component into :test, guess not, i'll make a :+test profile for this, no sweat

Error 108: Components with an interface that is implemented by more than one component are not allowed for the development project. They should be added to development profiles instead: mulog+test

tengstrand05:09:17

Yes, this is intentional. You can't have two components that implement the same interface on the classpath anyway. Read more about it in the https://polylith.gitbook.io/poly/workflow/profile section.

👍 2