Fork me on GitHub
#tools-deps
<
2020-09-16
>
practicalli-johnny11:09:14

https://github.com/practicalli/clojure-deps-edn/tree/qualified-alias-keywords-and-new-flags is a refactor of the project wide aliases in light of the changes coming in Clojure CLI tools (version 1.10.1.681 onwards). This will go live when the Clojure CLI changes go live. The aliases are using the -X flag for executing functions and providing default hash-map arguments (where the library supports this) and using -M flag for clojure-main (replacing -A and -R). Where chained aliases in a command have multiple main namespaces, the alias that should have its main run is added last in the chain. Alias namespaces have been upgraded to be qualified names, further defining their purpose and making them easy to understand without looking at the details (at least that is the intent). https://gist.github.com/jr0cket/ae7dd745eb45870109ace59fe835ce80 contains notes to be added to the Practicalli Clojure book on using the Clojure CLI tools with the recent changes. Any feedback on this is welcome, especially on how clear an accurate this is. Thank you.

Alex Miller (Clojure team)13:09:22

-P can be used with -X too

Alex Miller (Clojure team)13:09:58

re "The order in which repositories are consulted is not guaranteed", recently I changed this to actually guarantee that the first two repos consulted are central and clojars (no guarantee after that). central and clojars are listed in the root deps.edn so do not need to be added to deps.edn or settings.xml unless you add mirrors etc.

👍 3
Alex Miller (Clojure team)13:09:16

"`business-area**" looks like bad markup

Alex Miller (Clojure team)13:09:26

the automatically included "central" and "clojars" repos can be removed from consideration by nil'ing them in deps.edn {:mvn/repos {"central" nil}}

👍 3
seancorfield17:09:08

curl -O 
chmod +x linux-install-1.10.1.681.sh
sudo ./linux-install-1.10.1.561.sh
Version is not correct in that last line.

seancorfield17:09:51

Run project with or without an alias:

`clojure -M:alias -m domain.app-name`
`clojure -M -m domain.app-name
` Looks like you have extra backticks in that code block.

seancorfield17:09:44

:project/outdated-mvn - check for newer dependencies (maven only) The other two lines above this have the alias as code (with backticks) but this third one does not.

seancorfield17:09:11

https://cljdoc.org/d/seancorfield/next.jdbc/1.1.588/doc/getting-started#create--populate-a-database I think it would be better to use CURRENT instead of a specific version there, unless you plan to ensure that you update the README any time you update the next.jdbc version used in any of your aliases?

❤️ 3
seancorfield17:09:59

clojure -M:inspect/portal-cli ClojureScript node.js REPL with Portal dependency That should be :inspect/portal-node

seancorfield17:09:21

Add Reveal as tap> source I thought Reveal did that automatically? I don't recall having to do this manually when I've used Reveal. Depends on how you start it. If you start it with vlaaad.reveal/repl the add-tap is automatic. Perhaps make it clearer that this section only applies if you have started the REPL some other way than via Reveal itself? Or maybe it was just my misreading of what's being discussed at this point in the README?

👍 3
seancorfield17:09:33

"DEPRICATED" => "DEPRECATED"

seancorfield17:09:57

I found several other aliases further down the README that are not highlighted as code with backticks.

seancorfield17:09:38

https://github.com/practicalli/clojure-deps-edn/blob/qualified-alias-keywords-and-new-flags/deps.edn#L444 -- midje-runner is not unqualified in the alias -- but should be midje-runner/midje-runner (since unqualified lib names just double up in the group and artifact slot), otherwise you might cause a clash with any midje-runner lib that actually ends up with the midje group ID.

👍 3
seancorfield17:09:13

https://github.com/practicalli/clojure-deps-edn/blob/qualified-alias-keywords-and-new-flags/deps.edn#L575-L590 -- the documented -X entry points are hf.depstar/jar and hf.depstar/uberjar (the ones you have still exist for backward compatibility but are not documented).

practicalli-johnny18:09:36

Thank you Alex, Sean, most helpful and much appreciated.

lread21:09:27

Very cool @U05254DQM! Not sure if anyone mentioned what looks like a typo:

* deps = `:deps`, `:extra-deps`, `replace-paths`
* path = `:path`, `:extra-paths`, `replace-deps
` Last items seem reversed?

practicalli-johnny21:09:35

Good catch. @UE21H2HHD , I'll fix that copy past error, thanks.

seancorfield23:09:54

Posting here because it there's a larger audience who might have more insight into Maven and its shade plugin behavior: The next version of depstar will preserve license/copyright files coming from dependencies by concatenating them (but omitting exact duplicates). As far as I can tell from inspection of several "uber" JAR files I found in the wild, this is the behavior of Maven with the shade plugin, with the additional license resource transformer (which omits duplicates). I couldn't find anything in Maven's documentation about this behavior, and looking at the source of the shade plugin didn't help much. If anyone here has deep insight into that aspect of Maven and can confirm its actual behavior, that would be very helpful (otherwise I'll just run with the depstar behavior I described).

Alex Miller (Clojure team)23:09:20

I've used the shade stuff several times and I'm not sure it is anything mandated by maven either way, you're in making stuff up territory :)

Alex Miller (Clojure team)23:09:18

I actually have come to think that the "right" way to do this is store things like that in lib-specific sub dirs under META-INF

☝️ 3
Alex Miller (Clojure team)23:09:51

I don't think concatenating is wrong though

seancorfield23:09:04

Yeah, my inspection of various "uber" JAR files seemed to confirm that if maven shade finds META-INF/LICENSE or META-INF/LICENSE.txt in multiple dependencies, it simply concatenates them together in the resulting JAR file. My reading of the Apache license resource transformer seemed to confirm that it attempts to avoid duplicating the text of any license.

seancorfield23:09:42

But this is definitely all "undocumented territory" as far as I can tell.