lumo icon indicating copy to clipboard operation
lumo copied to clipboard

[Discuss] a config file for Lumo?

Open tiye opened this issue 7 years ago • 8 comments

standing as shadow-cljs user, every time I run shadow-cljs, it loads the shadow-cljs.edn file and reads dependencies in the file:

{:source-paths ["src"],
 :dependencies [[mvc-works/hsl          "0.1.2"]
                [fipp                   "0.6.12"]
                [cumulo/recollect       "0.4.3"]
                [mvc-works/verbosely    "0.1.1"]
                [cirru/sepal            "0.2.0"]
                [cirru/bisection-key    "0.1.2"]]
 :builds {:app {:target :node-script
                :output-to "target/main.js"
                :main server.main/main!
                :devtools {:after-load server.main/reload!}
                :release {:output-to "dist/main.js"}}}}

In Lumo it's -D for dependencies, but I haven't used that for long. Every time I want to use it, I found I have to put all dependencies in command line, which is so tedious.

Is it possible that Lumo reads :dependencies and :source-path from an EDN file, or even reuse the file from shadow-cljs?

tiye avatar Dec 09 '17 04:12 tiye

To me, an interesting thought is to directly support deps.edn for dependencies.

For now, I have been experimenting with a minor tweak to a copy of /usr/local/bin/clojure just have that toolchain wrap Planck (and the same is feasible with Lumo):

$ diff /usr/local/bin/clojure /usr/local/bin/plk
221c221
<   "$JAVA_CMD" "${java_opts[@]}" -classpath "$cp" clojure.main "$@"
---
>   planck -c "$cp" "$@"

mfikes avatar Dec 09 '17 19:12 mfikes

Agree deps.edn support would be nice, maybe ClojureScript will include it at some point as well? Something that reads .edn configuration would be awesome.

arichiardi avatar Dec 09 '17 19:12 arichiardi

@arichiardi FWIW, with CloureScript, if you clj -m cljs.repl.node, then deps.edn works today.

mfikes avatar Dec 09 '17 19:12 mfikes

Follow up on just using deps.edn for dependency configuration: I've logged https://dev.clojure.org/jira/browse/TDEPS-22 which would facilitate doing

lumo -c `cli -Spath`

mfikes avatar Dec 10 '17 04:12 mfikes

Also nice to have something like deps.den, keys are slightly different than shadow-cljs' :

{:paths ["src"]
 :deps {
   org.clojure/clojure {:mvn/version "1.8.0"}
   org.apache.maven.resolver/maven-resolver-api {:mvn/version "1.1.0"}
   org.apache.maven.resolver/maven-resolver-spi {:mvn/version "1.1.0"}
   org.apache.maven.resolver/maven-resolver-impl {:mvn/version "1.1.0"}
   org.apache.maven.resolver/maven-resolver-connector-basic {:mvn/version "1.1.0"}
   org.apache.maven.resolver/maven-resolver-transport-file {:mvn/version "1.1.0"}
   org.apache.maven.resolver/maven-resolver-transport-http {:mvn/version "1.1.0"}
   org.apache.maven/maven-aether-provider {:mvn/version "3.3.9"}
   org.slf4j/slf4j-nop {:mvn/version "1.6.2"}
   org.clojure/data.xml {:mvn/version "0.2.0-alpha3"}
 }
 :aliases {
   :1.9b1 {:override-deps {org.clojure/clojure {:mvn/version "1.9.0-beta1"}}} 
 }
 :mvn/repos {
   "central" {:url "https://repo1.maven.org/maven2/"}
   "clojars" {:url "https://clojars.org/repo/"}
 }
}

tiye avatar Dec 10 '17 08:12 tiye

Cool. Alex Miller fixed https://dev.clojure.org/jira/browse/TDEPS-22. And since it runs 26 times faster than lein classpath, only taking about 47 ms to build a classpath, using

lumo -c `clj -Spath`

and embracing deps.edn seems like a completely viable option for deps management / configuration.

mfikes avatar Dec 10 '17 23:12 mfikes

Think I will start using the above yes.

arichiardi avatar Dec 10 '17 23:12 arichiardi

Pity that Lumo does not have a docs. We should add that to the docs.

chenyong avatar Dec 11 '17 01:12 chenyong