This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-28
Channels
- # announcements (11)
- # aws (30)
- # beginners (98)
- # calva (11)
- # cider (42)
- # clj-kondo (4)
- # cljdoc (1)
- # cljsrn (5)
- # clojure (132)
- # clojure-europe (4)
- # clojure-ireland (1)
- # clojure-italy (35)
- # clojure-japan (2)
- # clojure-nl (5)
- # clojure-spec (5)
- # clojure-uk (24)
- # clojurescript (71)
- # clojutre (1)
- # core-async (6)
- # cursive (9)
- # data-science (4)
- # datascript (3)
- # datomic (78)
- # duct (16)
- # emacs (14)
- # events (2)
- # fulcro (141)
- # graalvm (5)
- # hoplon (14)
- # hyperfiddle (2)
- # jobs-discuss (14)
- # joker (8)
- # luminus (2)
- # off-topic (7)
- # om (1)
- # pathom (4)
- # pedestal (7)
- # planck (2)
- # quil (1)
- # re-frame (14)
- # reagent (2)
- # reitit (14)
- # robots (1)
- # shadow-cljs (20)
- # spacemacs (25)
- # specter (1)
- # sql (122)
- # tools-deps (63)
- # unrepl (2)
- # yada (34)
@alexmiller I think a shadow-cljs user stumbled into a bug in tools.deps regarding :exclusions
of libs. not sure if intentional.
{:deps
{org.clojure/clojure {:mvn/version "1.10.0"}
thheller/shadow-cljs {:mvn/version "2.8.37"}
io.pedestal/pedestal.service {:mvn/version "0.5.5"}
}}
[ring/ring-core "1.7.1"
:exclusions
;; used by cookie middleware which we don't use
[clj-time]]
pedestal.service
also depends on ring-core
but the exclusion from shadow-cljs is applied to its dep
Do any of the tools-deps tools for generating an uberjar have support for something like lein’s :uberjar-merge-with
?
The thing is, I need to merge edn files
e.g. data_readers.edn
but in particular duct_hierarchy.edn
ok actually avoiding the conflicts and using a classloader would probably work… I guess I can just walk the resources and merge them myself. Which of the uberjar options will use a classloader? I’m guessing capsule?
hmmm… infact I probably don’t need to merge them myself… duct must be doing this already to work at the repl.
indeed it does: https://github.com/duct-framework/core/blob/c5fb68ac3539248942c50cdbba5a2ca63735ee3c/src/duct/core.clj#L42-L44 I’d literally just written those same three lines.
ok I can confirm pack.alpha capsule just works ™️ thanks
also capsule is awesome 😀
Pack currently has a no conflict policy so that you don't have an option to shoot yourself in that respect.
:thumbsup: a good policy to have
what is the purpose of -e
in pack.alpha? Why not just an alias with the extra-paths there? Or is it different somehow?
Is there any extra meaning in > Add directory to classpath for building
@rickmoynihan no extra meaning. That flag will continue to exist so that I can put directories generated with mktemp into the class path.
ahh makes sense thanks
yeah — but that use case makes sense 🙂 the docs could possibly benefit from a clarification as to that purpose… but no biggie 🙂
it is essentially the same as :extra-paths
but more suited for scripting/api usage in wider build processes
@dominicm: incidentally it seems that pack.alpha doesn’t seem to honor :extra-paths
in other aliases you supply during the pack phase. I’m guessing this is a bug? Though I could have my wiring wrong.
ok I’ll open an issue for it — and also check it’s a real problem. Issue filed here: https://github.com/juxt/pack.alpha/issues/36
Reposting noob cli question from #beginners:
Is there a way to create a “default profile” for the clj
cli? Such that whenever I run clj
, certain deps are always merged in?
like a ~/.deps.edn
file or something?
you can include custom (private) aliases in ~/.clojure/deps.edn
but as far as I know you always have to opt in to aliases
tools.deps prefers to be explicit
Dumb question from a non-Java person: what is an “alias”? https://clojure.org/reference/deps_and_cli#_aliases doesn’t really explain that.
Also, -S
seems to be missing from that list of possible aliases.
There are 3 deps.edn. The install one, the one in your home directory. And optionally, your project one. The :deps map gets merged from install to home to project. In case of conflicts, the later ones override the prior ones.
Normally, the classpath, that is, the path to all libraries available to your program is defined by the :deps map, and the :paths vector, and a few others.
But, maybe on occasions, you want to start a program or a repl with more or less libraries included
Now, from the command line, you can choose to include some of those additional sets by adding the alias for it
That’s a very helpful explanation @didibus, thanks. So including aliases merges the options contained in those aliases?
You said it’s possible exclude as well? How would that be accomplished, since it’s a merge?
Pretty much. Now the way things are "merged" can vary depending in the type of alias and config.
Well, you can't exactly exclude. So you'd be better off thinking of them more as inclusions
@d4hines As an example of what you can do with ~/.clojure/deps.edn
, here's mine https://github.com/seancorfield/dot-clojure/blob/master/deps.edn
That has some usage notes as comments as well. Plus the README in that repo explains in more detail...
This is super helpful, thanks!