This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-01
Channels
- # aleph (1)
- # bangalore-clj (5)
- # beginners (24)
- # boot (113)
- # cider (42)
- # cljs-dev (2)
- # cljsjs (2)
- # cljsrn (3)
- # clojure (37)
- # clojure-austin (4)
- # clojure-brasil (3)
- # clojure-france (55)
- # clojure-greece (15)
- # clojure-ireland (4)
- # clojure-italy (13)
- # clojure-russia (37)
- # clojure-spec (50)
- # clojure-uk (31)
- # clojurescript (49)
- # component (12)
- # consulting (1)
- # cursive (6)
- # datascript (9)
- # datomic (27)
- # editors (2)
- # garden (1)
- # hoplon (18)
- # jobs (1)
- # klipse (25)
- # lein-figwheel (1)
- # leiningen (1)
- # luminus (2)
- # om (53)
- # om-next (8)
- # onyx (5)
- # parinfer (4)
- # perun (4)
- # re-frame (13)
- # remote-jobs (1)
- # ring (1)
- # ring-swagger (3)
- # rum (52)
- # spacemacs (36)
- # specter (13)
- # sql (3)
- # untangled (49)
- # vim (11)
- # yada (9)
for this I think you will need to open an issue on the project, probably a PR with some sort of "ignore this dir" option in boot-sass
can solve it (few lines of code)...another workaround would be to position the task that adds node_modules
after sass
uhm...right
gotttammit.... every time I think I’m out… they pull me back. I thought I’m done dealing with javascript-land mess. I guess I’m not
look, open an issue, the PR is simple stuff, I opened the code...it is better though to ask @juhoteperi what is the best course of action, maybe he has some other idea
also, you could use mathias/boot-sassc
which has more control over what is compiled
thanks @richiardiandrea! I have created an issue and I’ll try mathias’s lib in the meantime. Although it’s deprecated
np 😉 hopefully this whole thing will help yourself and others (I'll follow the issue)
Is there anyone out there who could give me some help with my boot config?
@ag quite late to this party, but to give you some reasoning, the _ prefix is a standard in the sass community for indicating it's not an entrypoint.
Anyone know of a nice workflow for running tests via boot ? Maybe with a bit of spec magic show-cased ?
@pseud i’m a fan of running boot watch test
(or boot watch speak test
if you want pass/fail sounds)
so far i’ve been satisfied with clojure.test, which is maybe not the most popular perspective 🙂
@grounded_sage sure what's up?
@pseud another testing option: https://github.com/metosin/boot-alt-test
Hmm, is it possible to wrap existing tasks in a pod (e.g. to add the dependencies that include the wrapped tasks)?
Is there any examples (that you know of) showcasing testing of a library that contains cljs, clj and cljc code ? I’m thinking I would want to exercise the cljc code (the api) in both cljs and clj mode to see if the platform-specific code holds up
@pseud: We're doing that here: https://github.com/workfloapp/macros
@jannis not possible. Somewhere there is a with-env
option that sets the env before and after the task so that pods created by the task see a different env but thats more of a hack than a solution
@pseud: another example: https://github.com/daveyarwood/music-theory/blob/master/build.boot this library is cljc only, but the tests are run via boot-test and boot-cljs test to test both platforms
err, it's a with-env
macro ... 🙂
if I had (deftask foo [d debug bool “”] (comp (another-task debug))
, how do I pass that debug into deftask another-task [d debug bool “”]
?
I can just make another-task
a regular defn, but that disallows me from calling it from the boot cli (without doing it through foo
)
@micha a question, is there a way to add a directory to a fileset and then get it back so that I can write things in it? I know it would make it immutable, but I am trying to get around this while working on figwheel
the only super hack I found working is this horrible thing below:
user-resource-dirs (var-get (resolve 'boot.core/user-resource-dirs))
user-resource-dir (-> (user-resource-dirs) first)
@richiardiandrea not sure what you mean there?
basically I need to tell figwheel where to write, my first idea was to pass a tmp-dir
to the fileset and pass tmp-dir
but the fileset will not include the tmp-dir, only a copy of it from what I see
(unless I am doing something stupid)
mmm I will try again, in theory that was my first idea, but it was not working as I expected
meaning (:directories (boot/get-env))
did not contain my temp dir
by poll you mean use boot/sync-user-dirs!
programmatically ?
yes it is
exactly, I need basically to feed it a dir, then sync manually or use a dir already added to the fileset (this is why I was using boot.core/user-resource-dirs
), moreover, figwheel
only serves using resource-response
my workaround works but feels hackish...I wanted to understand if it is the only way out 😉
yeah that is what I was afraid of
but if I use a tmp-dir
, then I need to find a way to say "hey, I changed the tmp-dir", please update my fileset
because from what I see the tmp-dir
is not used directly but just "copied" in the fileset
(which makes sense given that the fileset is immutable)
hey guys… can someone guide me through writing my own custom task that uses dosh? For example I I want to run something like sassc src/sass/main.sass > target/css/main.css
. I know there are community tasks that handle sass already. I just want to learn how to do this without. So as I understand I need to use with-pre-wrap fileset
and then run dosh in there. But how do I grab result of dosh command and make commit!
, not very clear
basically you have to have sassc or whatever write to a directory you make with tmp-dir!
oh… ok… I’ll try to search for tmp-dir!
in github. maybe find some sample snippets. thanks @micha
hey guys.. dubbing into tmp-dir!
why something like this would report that directory doesn’t exist:
(deftask sassc []
(with-pre-wrap fileset
(let [tmp (tmp-dir!)]
(dosh (str "echo FOO! > " (.getPath tmp) "/foo.txt")))))
I know I need to do add-resource
and commit!
but it fails way before I get to do that@ag that error is usually caused by subdirectories not existing when you try to create a new file
you want to call it with a program (`bash` in this case) and the arguments as separate strings
so… I have a dilemma to solve now… I have some sass files that @import stuff from npm packages . I need two tasks - one manages npm installs, second sass compilation. Independently is simple enough. But how do I make these tasks “talk” to each other? is there an example where fileset being “passed’ from one task to another?
@ag the preferred way is for the task to add a manifest/metadata file of some kind to the fileset, for subsequent tasks to find/consume
@ag I made a task for installing npm things degree9/boot-npm
@flyboarder yeah, as I said npm install by itself a trivial problem. but in my sass file let’s say I have something like @import “./node_modules/font-awesome/scss/font-awesome”
. How do I make two independent tasks that deal with the same fileset?
@alandipert where can I read/find samples about this?
well, let’s say I just do “npm install” and copy whole “node_modules” and commit that… something like:
(deftask add-node-modules []
(with-pre-wrap fileset
(let [nm ( "node_modules")]
(when-not (and (.exists nm) (.isDirectory nm))
(dosh "npm" "install"))
(-> fileset
(add-resource ( ".") :include #{#"^node_modules/"})
commit!))))
so if I have that and this:
(deftask sassc []
(with-pre-wrap fileset
(let [tmp (.getPath (tmp-dir!))]
(let [main-sass (->> fileset input-files (by-name ["main.sass"])
first tmp-file .getPath)
out (str tmp "/css/main.css")]
(.mkdir (java.io.File. (str tmp "/css")))
(dosh "bash" "-c" (str "sassc " main-sass " > " out))
(-> fileset
(add-resource tmp)
commit!)))))
how can I make use of fileset of the first in the second?because if main.sass contains a line that imports something ouf of node_modules
- sassc
task would fail with File to import not found or unreadable:
oh… I think I get it now… if I just (boot (comp (first-task) (second-task))
anything that first task commits into fileset would be available in second-task
❓ what’s idiomatic way of throwing a message that certain task should be always called in composition with another task?
@ag the npm task i use copies the whole folder to the fileset so once everything is installed you can use sift
task to filter out the things you don't want
@micha is there a way for tasks to receive metadata about the pipeline? Like to know if the reload task is being used?
@ag Probably. Also see other fileset filters: https://github.com/boot-clj/boot/blob/master/doc/boot.core.md#filter-sequences-of-tmpfiles
@flyboarder usually you want to avoid directly coupling two tasks