duct

Asier 2021-10-27T07:43:39.002900Z

I added the above in here: https://github.com/duct-framework/duct/wiki/Modules

richiardiandrea 2021-10-27T15:39:49.004300Z

Hi folks, I have a module at the top level of my config.edn and using profiles. For some reason the init-key does not get called (I have put printlns in there). Am I missing something w.r.t. to when modules are called?

2021-10-27T16:05:19.004400Z

Not sure if it matters, but does it derive from :duct/module ?

richiardiandrea 2021-10-27T17:14:10.004600Z

Yeah this is what I have in resources/duct_hierarchy.edn

{:duct.profile/web [:duct.profile/base]
 :duct.profile/core [:duct.profile/base]
 :duct.profile/infra [:duct.profile/base]
 :duct.profile/routes [:duct.profile/base]
 :duct.module/reloadable-routes [:duct/module]}

richiardiandrea 2021-10-27T17:35:23.004900Z

Is there a way to debug if the module indeed derives that key sorry a bit rusty on these things

richiardiandrea 2021-10-27T17:36:19.005100Z

Oh found, sorry for the laziness, will test this at the repl -> https://clojuredocs.org/clojure.core/derive

iarenaza 2021-10-29T10:53:20.005300Z

Is that module implemented in a separate library, or is it part of the same code base? Duct needs to load and eval the namespace where the module Integrant multi-method for that key. And by default uses the key name to derive the namespace. If they don't match, then you need to tell Duct/Integrant how to find it, or load and eval the namespace yourself.

richiardiandrea 2021-10-29T15:52:05.005500Z

it is in the code base but I think I require the namespaces, I will double check but this is is a very good point