clojurescript

meya wudafu 2024-12-09T11:01:45.220019Z

Hello, Someone using jfrog on a ClojureScript project? Some place I can find some examples on how to setup it? Thanks

p-himik 2024-12-09T11:03:10.745939Z

They have at least 8 different products. What exactly do you mean?

meya wudafu 2024-12-09T11:03:39.755279Z

I mean pull maven dependencies from Jfrog

p-himik 2024-12-09T11:04:53.964039Z

In this case, how is it relevant to CLJS? I don't know anything about jfrog, but isn't it just a Maven repo that needs credentials to be accessed?

p-himik 2024-12-09T11:06:02.899349Z

According to their docs, you just configure stuff in ~/.m2/settings.xml. And tools.deps, assuming that's what you're using, respects those settings.

meya wudafu 2024-12-09T11:06:20.607479Z

yes, correct, I trying to setup the :repositories key on shadow-cljs.edn

p-himik 2024-12-09T11:07:08.782759Z

Oof, don't do that. Use :deps true in shadow-cljs.edn and rely on providing the deps via deps.edn. The only downside, as far as I'm aware, is that adding a new dependency would require restarting your CLJS build, that's it.

p-himik 2024-12-09T11:07:56.209109Z

Note also that the :deps key can also mention specific aliases.

meya wudafu 2024-12-09T11:08:19.229759Z

hum, need to move the dependencies from shadow-cljs.edn to deps.edn ?

p-himik 2024-12-09T11:08:49.152699Z

That's what I always do myself, yes.

meya wudafu 2024-12-09T11:08:59.202169Z

I will try, thanks for now!

👍 1
meya wudafu 2024-12-09T11:20:52.243919Z

In this case, I still can use? npx shadow-cljs compile app

meya wudafu 2024-12-09T11:26:27.970269Z

I configured my deps.edn like

{:paths ["src" "test"] 
 :deps {reagent/reagent                  {:mvn/version "1.1.1"}
        re-frame/re-frame                {:mvn/version "1.4.2"}
        day8.re-frame/http-fx            {:mvn/version "0.2.4"}
        metosin/reitit                   {:mvn/version "0.7.2"}
        binaryage/devtools               {:mvn/version "1.0.6"}
        arttuka/reagent-material-ui      {:mvn/version "5.11.12-0"}
        day8.re-frame/test               {:mvn/version "0.1.5"}}
 :aliases
 {:cljs
  {:extra-deps {thheller/shadow-cljs {:mvn/version "2.25.6"}}}}
}

meya wudafu 2024-12-09T11:27:07.510299Z

And try to run: npx shadow-cljs compile app but see: > Execution error (FileNotFoundException) at clojure.main/main (main.java:40). > Could not locate shadow/cljs/devtools/cli__init.class, shadow/cljs/devtools/cli.clj or shadow/cljs/devtools/cli.cljc on classpath.

p-himik 2024-12-09T11:29:50.293479Z

> In this case, I still can use? [...] Yes. > Could not locate shadow/cljs/devtools/cli__init.class [...] As per https://shadow-cljs.github.io/docs/UsersGuide.html#deps-edn: > You must add the thheller/shadow-cljs artifact to your deps.edn manually.

meya wudafu 2024-12-09T14:10:27.046549Z

Kind works, I setup my deps like:

{:paths ["src" "test" "resources"]

 :deps {reagent/reagent                  {:mvn/version "1.1.1"}
        re-frame/re-frame                {:mvn/version "1.4.2"}
        day8.re-frame/http-fx            {:mvn/version "0.2.4"}
        metosin/reitit                   {:mvn/version "0.7.2"}
        binaryage/devtools               {:mvn/version "1.0.6"}
        arttuka/reagent-material-ui      {:mvn/version "5.11.12-0"}
        thheller/shadow-cljs {:mvn/version "2.28.20"}
        day8.re-frame/test               {:mvn/version "0.1.5"}}
 :mvn/repos
 {"jfrog" {:url "artifactory maven url"}}
 :aliases
 {:cljs
  {:extra-deps {thheller/shadow-cljs {:mvn/version "2.28.20"}}}}
 }
and also the ~/.m2/settings.xml But still see the dependencies downloaded from central and clojars Maybe I missing something else?

p-himik 2024-12-09T14:25:38.429939Z

Ah, so you want for everything to be downloaded from jfrog? I don't think that's supported - there's a somewhat similar "ask": https://ask.clojure.org/index.php/14198/ensure-private-coordinate-cannot-shadowed-public-repository?show=14198#q14198 But after a brief look at the impl, maybe you can add "central" and "clojars" keys to :mvn/repos with nil values?

meya wudafu 2024-12-09T17:31:53.614849Z

Yep, everything, but dont looks possible.

p-himik 2024-12-09T17:33:30.703159Z

Did setting "central" to nil not work?

meya wudafu 2024-12-10T11:17:23.897429Z

actually it works, but some packages cannot be find via jfrog, maybe is possible to configure the source per dependency?

p-himik 2024-12-10T11:21:11.219229Z

Not that I'm aware of. If you're fine with configuring the settings via .m2/settings.xml, there you can set a specific order of repositories.

👀 1
meya wudafu 2024-12-10T11:51:14.471379Z

yep, like this it works.

meya wudafu 2024-12-10T11:51:41.506139Z

thanks for the help! Any idea why such settings is no present via deps.end ?

p-himik 2024-12-10T11:53:47.658619Z

Apart from what's written in that "ask" - no clue. If you can describe your use-case in that or a different "ask", that would definitely be helpful.