polylith

https://polylith.gitbook.io/ and https://github.com/polyfy/polylith
domparry 2021-04-12T05:07:13.092100Z

@allandaviesza wrote some code to rename all the namespaces. Not sure how portable it is, but he can comment.

wactbprot 2021-04-12T11:10:50.092600Z

Hi, I'm new to both, deps.edn and polylith. I wonder how a component can/should be standalone in terms of a config.edn. I like to use (io/resource "config.edn") whereby "config.edn" is placed in the components resources folder. This folder is attached to the workspace deps.edn :dev extra-path as suggested. However, "config.edn" can not be accessed by the io/resource function. I've seen that all(?) resources folders of the real-world-example are empty. Is it a bad idea to provide separate configuration files for each component as resources? Many thanks in advance.

tengstrand 2021-04-12T13:38:29.093Z

Hi @wactbprot. The RealWorld example app doesn’t show how to use resources, but the Polylith codebase itself does, so let’s use that code as an example. The https://github.com/polyfy/polylith/tree/master/components/creator component in the Polylith project has a logo.png image in its https://github.com/polyfy/polylith/tree/master/components/creator/resources/creator directory, and https://github.com/polyfy/polylith/blob/76936c752fb5b729c216b23d92c8a8d71cfdc92f/components/creator/src/polylith/clj/core/creator/workspace.clj#L78 you can see how it’s used from the workspace namespace within the component. Then the resources directory of this component is included in the development’s deps.edn file https://github.com/polyfy/polylith/blob/76936c752fb5b729c216b23d92c8a8d71cfdc92f/deps.edn#L26, and it’s also included in the deps.edn files for all other projects, like the poly project https://github.com/polyfy/polylith/blob/76936c752fb5b729c216b23d92c8a8d71cfdc92f/projects/poly/deps.edn#L5. Hope this can be of some help.

wactbprot 2021-04-12T14:14:15.093200Z

Jup, works! Thank you @tengstrand and many greetings to the fantastic polylith team from Berlin!

tengstrand 2021-04-12T14:17:42.093400Z

Great! 🙂 And by the way, the members of the Polylith team live in Stockholm, Sweden (or close to it)!

wactbprot 2021-04-12T14:24:12.093600Z

I tried to send greetings to the team from Berlin to Stockholm (seems I am a grammar noob too) 😅

tengstrand 2021-04-12T14:26:04.093800Z

Ahh, cool, thanks for the greetings! 😃