This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-30
Channels
- # admin-announcements (42)
- # alda (8)
- # aws (10)
- # beginners (22)
- # boot (165)
- # bristol-clojurians (1)
- # cider (6)
- # clara (21)
- # cljs-dev (23)
- # clojure (74)
- # clojure-dev (8)
- # clojure-russia (41)
- # clojurescript (180)
- # core-async (11)
- # cursive (26)
- # datascript (2)
- # datavis (7)
- # datomic (29)
- # editors (1)
- # hoplon (7)
- # jobs (3)
- # ldnclj (4)
- # lein-figwheel (47)
- # leiningen (2)
- # mount (26)
- # off-topic (3)
- # om (163)
- # onyx (56)
- # proton (4)
- # reagent (6)
- # remote-jobs (1)
- # ring-swagger (4)
- # spacemacs (9)
#C03S1KBA2 #C03S1L9DN #C053K90BR just published the 18th Tutorial of the modern-cljs series. It uses the TDD environment augmented with the REPLs. https://github.com/magomimmo/modern-cljs/blob/master/doc/second-edition/tutorial-18.md
happy new year to you also! enjoy your vacation
hello. I'm trying to get automatic testing going with boot-cljs-test ... I copied the example project, changed js-env to node insetad of phantom, and made the target nodejs. But when it runs tests, it thinks there are 0 tests instead of one. My small repo is at https://github.com/frankhenderson/boot-cljs-test-question Could someone tell me what I'm doing wrong?
The example I started with was boot-cljs-example https://github.com/adzerk-oss/boot-cljs-example
Like, sometimes I just want to do some throw-away work like scraping - would be nice to be able to say... (dep-search enlive)
and have it list lein coordinates like '[enlive "1.6"]
and the library's namespaces like '[enlive.core enlive.html ,,,]
@escherize: You can just run (set-env! :dependencies #(conj % '[some.new/dependency "1.0.5"]))
in the repl and it will download it and make it available.
(I was a bit surprised that worked, but I just tried it)
I don't know of a shortcut to figure out the latest version tho'...
@seancorfield: the boot script doesn't do anything you can't do in the repl
Oh, I misunderstood what you meant there sorry... I get it now....
ah, so merge-env!
would be better than set-env!
with a function and into
or conj
... are there equivalents for source paths, resource-paths and repositories?
yeah merge-env!
is just a convenience function, it does set-env!
with a function internally
But merge-env!
is the only convenience? For :source-paths
and :resource-paths
we need set-env!
and a function?
Same with :repositories
right?
oh, so (merge-env! :dependencies ... :source-paths ... :resource-paths ...)
works?
OK, I'll go clean up our build.boot
file at work then!
I didn't realize it existed... the docs sort of imply you need to use set-env!
with functions... and that's what you'd suggested here too
Oh, it's a big improvement over all the set-env!
calls we had with anonymous functions! So much cleaner!
We have 40+ tasks, most of which modify the environment. This is a big cleanup.
@fappy: took a look boot-cljs-test-question
- the issue is the naming of your test namespace, 0.2.1-SNAPSHOT
is trying out a cheeky heuristic for determining test namespaces
you can change the test
namespace to core-test
and it’ll run
@micha: want to second @seancorfield, love-at-first-sight with merge-env!
boot apropos
?
there are somewhat legit api docs now btw: https://github.com/boot-clj/boot/tree/master/doc
I think i might make my first boot task around searching clojars using: https://github.com/clojars/clojars-web/wiki/Data#json-search-results
so I have a function that takes a clojars search term (here hiccup
) and returns a string like this..
hiccup
A fast library for rendering HTML in Clojure
[hiccup "1.0.5"]
[hiccup "0.2.3"]
[hiccup "1.0.3-SNAPSHOT"]
[hiccup "1.0.2"]
[hiccup "2.0.0-alpha1"]
[hiccup "1.0.3a"]
[hiccup "1.1.1"]
[hiccup "1.0.2"]
[hiccup "1.0.2"]
[hiccup "1.0.0-beta1"]
[hiccup "1.0.1-SNAPSHOT"]
[hiccup "2.0.0-SNAPSHOT"]
hiccup-bridge
Hiccup to html, html to hiccup.
[hiccup-bridge "1.0.1"]
[hiccup-bridge "1.0.0-SNAPSHOT"]
hicv
Hiccup to html, html to hiccup.
[hicv "1.0.0-SNAPSHOT"]
....
I had a look at the wiki: https://github.com/boot-clj/boot/wiki/Task-Writer%27s-Guide but can't figure it out
(print)
? 😛
I have something that looks like: https://github.com/mbuczko/boot-ragtime/blob/master/build.boot
(deftask showme
[s search TERM [str] "The vector of search terms."]
(with-pass-thru [_]
(doseq [s search] (print (searchfn s)))))
i feel like i want it all the time, i do a lot of googleing and web browsing just to solve this issue
and you can then make a stub function in your profile.boot, which will be in the boot.user namespace
that way you don't need to add the library that does the searching as a project dependency or anything
the beginning of my build.boot is like this, btw:
(set-env!
:source-paths #{"."}
:resouce-paths #{"."}
:dependencies '[[http-kit "2.1.18"]
[cheshire "5.5.0"]])
(require '[cheshire.core :as json]
'[org.httpkit.client :as http]
'[clojure.string :as str])
(boot.pod/make-pod (assoc boot.pod/env :dependencies '[[http-kit "..."][cheshire "..."]]))
i used assoc and started with boot.pod/env becuase the user might have for example repository configuration in their env
(boot.pod/with-eval-in the-pod
(require '[cheshire.core :as c])
(c/json-parse "{\"foo\":100}"))
i'm getting a problem with this:
(deftask search-clojars
"Search in clojars for libraries and return leiningen coordinates for them."
[s search TERM str "The vector of search terms."]
(with-pass-thru [_]
(print (search-clojars s))))
which isi.e. your package doesn't introduce transitive dependencies into the project that uses it
notice how the pod is created here: https://github.com/adzerk-oss/boot-template/blob/master/src/adzerk/boot_template.clj