Fork me on GitHub

I think I found a snippet in the Luminus wiki that might be obsolete: "Note that the project sets up composite profiles for :dev and :test. These profiles contain the variables from :project/dev and :project/test profiles, as well as from :profiles/dev and :profiles/test found in the profiles.clj. The latter can be used for additional local configuration that is not meant to be checked into the shared code repository." Yet Luminus no longer generates a profiles.clj file, and :profiles/dev and :profiles/test are in project.clj. Have the .edn files superseded profiles.clj?


Luminus doesn't generate profiles.clj, but it's still setup to work with one. The configuration is kept in dev-config.edn and test-config.edn, but you might still wish to add non-configuration things like REPL middleware, and that would end up in the profiles.clj file

👍 4

I see, thanks for the insight!


It’s not obsolete as long as Luminus uses lein. It could be a little clearer, with lein you can use a profiles.clj in the .lein folder from your home directory. It is usefull for things like test depencies, or plugins you only use runtime, or repositories you use. I have a lein-ancient defined there, so I can use lein ancient on any project.


That's what I was thinking at first, but then I'm not sure the quote above and its context make sense. Also, I had a look at the commit history of Luminus and its documentation, and it seems that at some point it did create a profiles.clj file within the project directory during initialization.


The misleading part is ‘:profiles/dev and :profiles/test found in the profiles.clj’ I think. For someone working with leiningen for a time, and having used the profiles.clj before, it will know it’s the file created in the .lein folder, while for someone new to clojure (which lots of luminus users are) might try to find it in the generated project


note that you still might want to have a profile.clj in the project folder, it's just no longer necessary by default


I see! My qualm is that Luminus did use to generate a profiles.clj file within the project directory, but not anymore, and places :profiles/dev and :profiles/test into project.clj instead of profiles.clj. I don't even have a profiles.clj file in my .lein folder as I haven't needed it yet.


And I was comparing these two commits of the wiki page and noticed that all references of profiles.clj except the one above are replaced in the newer one:


So I was just wondering if that was left there by accident.


Seems like I was wrong then


@plins if you use luminus with compojure-api, updating it to 2.0.0-alpha19 gives you spec validation (and swagger). There is also standalone middleware for spec-validation it in the reitit library. Should work with all routing libs.