This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-27
Channels
- # aleph (1)
- # aws (2)
- # beginners (69)
- # boot (79)
- # braid-chat (1)
- # cider (221)
- # clara (13)
- # cljs-dev (9)
- # cljs-edn (1)
- # cljsrn (7)
- # clojure (128)
- # clojure-chicago (1)
- # clojure-russia (196)
- # clojure-sanfrancisco (1)
- # clojure-uk (13)
- # clojurescript (166)
- # community-development (2)
- # css (2)
- # cursive (8)
- # datomic (4)
- # emacs (11)
- # hoplon (54)
- # instaparse (2)
- # jobs (16)
- # jobs-discuss (54)
- # jobs-rus (7)
- # luminus (4)
- # off-topic (33)
- # om (37)
- # onyx (8)
- # proton (10)
- # quil (8)
- # re-frame (29)
- # reagent (7)
- # remote-jobs (2)
- # untangled (140)
- # yada (1)
There are days when I feel like web dev has been all downhill from there /blink
I wanted to make a boot task like lein-run, in the wiki it says this should work but I get a ClassNotFound exception, does anyone use similar task successfuly ?
try this:
(deftask run []
(with-pass-thru _
(require 'scenario-runner.core)
((resolve 'scenario-runner.core/-main))))
alternatively you can (require 'scenario-runner.core)
somewhere above your deftask
A question: has somebody achieved the feat of having two repls, one from the bacnked, on for the frontend, in the same JVM with boot? I might have broken mine...
I think juxt’s edge at least tries to bring frontend + backend into one boot process while keeping them separate using pods. Not sure about REPLs but you should check @richiardiandrea
I'll check... I was thinking I could run the two repl tasks in a future
And in a pod
But I'll look there first
alandipert: thank you it works a little bit better, now I have a nullPointerException I don't get when calling main from repl but it's another story
probably, please do edit
to whatever would have made sense to you
much appreciated :thumbsup:
i was wondering if I could get some help constructing a boot task? I want to run a dosh
, but the temporary fileset paths is making it hard… for example, if my shell command wanted to include extra roots to search: do-something —include ../path/to/include —include ./resources
, I’m not sure how to construct the task. I figure it something like this (str (.getParent in-file) “resources”)
, but then /Users/…/.boot/…/uuid/task/resources
doesn’t exist.
@martinklepsch: it looks like edge
is actually able to launch two repls
but cider does not connect to two at the same time 😄
a question for boot-http
: I see Problem accessing /. Reason: Not Found
but with (show :fileset true)
I see that my index.html is at the root of the fileset
why is it not served?
@richiardiandrea: i don't think indexes are served by default? you may need a middleware/handler to doit
/index.html
should work
basically somewhere on the server it needs to map / => /index.html
so
should work?
@lwhorton: perhaps you want to use the file's absolute path as an argument to the shell cmd?
@richiardiandrea: depends do you have wrap-resources middleware in your handler?
i can't remember if boot-http wraps with that by default, would be worth checking
@alandipert: I think you don't need a handler (you can specify it, but by default I guess it serves from the classpath)
gotcha
i would expect it to work then
me too 😄
in lambdax-web I just put the following -> https://github.com/Lambda-X/lambdax-web/blob/devel/build.boot#L96
weird because if I point to the .js
file I can see it
so maybe you are right I am missing something to serve index.html
so adding (serve -d "target")
and (target)
at the bottom did the trick
but still, I should not probably need it, as per: https://github.com/pandeiro/boot-http#composability
@alandipert: is there an api to get the “not temp path” from a tmp file/dir that you know of?
@lwhorton: you mean like the real file object for a tmp filed? that would be tmp-file
i mean .. if boot reads in :soure and :resources and :assets into a tmp filesysem (essentially), and my task I want to run (css preprocessor) depends entirely on none-of-those temp paths but the real paths … it’s proving quite difficult to get it to run
i see what you mean
considering something like @import ../other/style
won’t work when it’s nested inside …/.boot/tmp/cache/blah/blah
i spent about an hour considering re-writing the references inside the actual file to point to tmp files .. but that got messy very fast
i have a thing that recursively copies files from the fileset into a tmpdir
so that in a tmpdir, all the files are relative to eachother as they are in sources
does that sound like what you want?
hmm.. so I could do a (c/by-ext [“.stly”] fs)
and then copy the results somewhere… does it maintain paths/dirs, or is it flat?
https://github.com/alandipert/boot-trinkets/blob/master/src/alandipert/boot_trinkets.clj#L8-L10
yeah i think you could do (doseq [x (c/by-ext [".stly"] fs)] (copy x some-tmp-dir))
that would copy all the .stly files into some-tmp-dir, preserving paths
is there a way from the boot repl to go and fetch new dependencies from changes to the build.boot file?
@mattly: (load-file "build.boot")
do we have already boot
templates?
I am aware of boot-new
and I am reading in the meantime
For some reason we can’t seem to set the environment for our auto-test task. Any ideas? We’re using
(deftask auto-test-clj []
(comp
(environ :env test-env)
(watch)
(javac)
(test)))
Looks good, maybe the content of test-env
is not what boot-environ
expects?
@richiardiandrea: test-env is a map. Thanks. Perhaps we’re doing something somewhere else that’s causing a problem (maybe?) … when we run our dev repl all is good so I’m rather confused. Anyway, thanks.
I don't know about boot-environ but lein-environ generates a file you can look at..do you have an error or simply no values in your env
?
env spits out a bunch of stuff but all of those things are from my shell’s env, ex of the env when printed from inside of the test: :lang "en_US.UTF-8", :term "xterm-256color”
yes usually that's what you should get together with your test-env
how do I go about adding a file to the fileset during a task? do I need to create a io/file “path/to/file”
? my use case is I want to parse a css preprocessor and take any ”@import ‘path/to/file.css”
that might exist in the css and add that referenced file into the fileset
so it will survive across multiple runs of the task (like with the watch task for example)
@lwhorton: here is an example of the workflow: https://github.com/boot-clj/boot/blob/2.5.5/boot/core/src/boot/task/built_in.clj#L663-L676
the zip task creates a temp dir, then populates it with files and adds it to the fileset
i’ll try to study that repo some more .. my thought proces was 1) get all the .styl files 2) search the contents of styl files for @imports, add those imported to the fileset 3) copy the full fileset to a tmp dir in a way that preserves paths, 4) commit those styls
the tricky part is preserving paths because a .styl might do something like @import ../../src/file.styl
, but when boot executes via dosh
the compiler, those paths dont exist (either excluded ‘cause they weren’t imported, or are flattened). I was hoping copying would solve it.
@lwhorton: you're going to be running some kind of css preprocessor on the files in your task?
@micha: yea that’s the plan. I’m actually making some good headway adding all the included .styl files via @import path/to/file
to the fileset. Now that they’re in the fileset I’m writing another task that compiles them out to .css inside /target/relative/dir
it’s a little tricky to figure out where everything is running … for example - when running stylus, i’m getting failing cannot find @import ‘some/path/index.styl’
despite the file doing the importing being right inside /target
and the some/path/index.styl
being correctly located relative to that path