Fork me on GitHub
#luminus
<
2018-04-25
>
Nikos11:04:12

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? http://www.luminusweb.net/docs/guestbook.html

yogthos20:04:57

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
Nikos15:05:06

I see, thanks for the insight!

gklijs11:04:36

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.

Nikos11:04:03

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.

gklijs11:04:30

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

yogthos20:04:19

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

Nikos12:04:02

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.

Nikos12:04:06

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: https://github.com/luminus-framework/luminus/blob/2fa4c86427808f8ca3c66e3f66b55a0b159916e9/resources/md/guestbook.md https://github.com/luminus-framework/luminus/blob/master/resources/md/guestbook.md

Nikos12:04:10

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

gklijs12:04:44

Seems like I was wrong then

ikitommi13:04:41

@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.