This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-13
Channels
- # aws-lambda (7)
- # beginners (80)
- # boot (134)
- # cider (11)
- # cljs-dev (5)
- # cljsjs (3)
- # cljsrn (19)
- # clojure (144)
- # clojure-austin (2)
- # clojure-berlin (3)
- # clojure-greece (6)
- # clojure-italy (3)
- # clojure-russia (95)
- # clojure-spec (57)
- # clojure-uk (120)
- # clojure-za (2)
- # clojurescript (71)
- # component (1)
- # css (1)
- # cursive (22)
- # datascript (2)
- # datomic (101)
- # dirac (9)
- # docker (3)
- # emacs (10)
- # events (2)
- # immutant (3)
- # leiningen (2)
- # om (63)
- # om-next (1)
- # onyx (6)
- # pedestal (55)
- # portland-or (3)
- # protorepl (2)
- # re-frame (30)
- # reagent (10)
- # ring-swagger (1)
- # rum (31)
- # spacemacs (5)
- # specter (9)
- # untangled (90)
- # vim (46)
- # yada (2)
I applied your patch just to be sure and no change
just fixed a small bug π
@richiardiandrea Iβm taking a closer look at #569 - is there a public repo I can clone to reproduce it?
give one minute
@bhagany I am checking as well with my project and boot-figreload
so I might find out the truth soon π
I am actually using your tests as well
@mynomoto ummm, there is one more problem here copying contents of a jar file to our resource folder
tried something like boot -BPd cljsjs/async:2.0.0-rc.4-0 sift -R 'cljsjs/async:development/.*\.inc\.js$' show -f
with the aim to place that file into our resource folder
but this gives me a NoSuchFileException
@michael.heuberger there is a :
in the regex, is this on purpose?
aim is to have a specific JS file in our resources folder
what should i put in after -R ?
yes sorry not a regex but a path
boot -BPd cljsjs/async:2.0.0-rc.4-0 sift -R 'resources/js/' show -f
β¦ but i dont see any files in there
I think this one wants a complete path
-R, --add-resource PATH Conj PATH onto the set of directory paths to add to resources.
you could try also -r, --to-resource MATCH Conj MATCH onto the set of regexes of paths to move to resources.
if using -r
, then it should be a regex. got it. but i dont find it in the resource folder
~/c/app β―β―β― boot -BPd cljsjs/async:2.0.0-rc.4-0 sift -r 'cljsjs/async:development/.*\.inc\.js$' show -f
Sifting output files...
nothing, no output files
ultimately i want to extract a JS file from a jar dependency and place it under /target/js/something.js
but is the regex correct? the /
i think should be excaped right?
umm, lets take a step back and start with
"ultimately i want to extract a JS file from a jar dependency and place it under /target/js/something.js
"
sift is your friend then
your approach looks good to me, I am not sure about the regex only, but I might be wrong of course π
ok, next, which option places a file in the target folder? i only see options related to asset/resource/source but none for target
resource is good
boot has the concept of roles for files
okay, i ll try again with correct paths
@michael.heuberger also, if you want to actually dump to target
you need to append the target
task
umm, still no luck
~/c/app β―β―β― boot -BPd cljsjs/babel-polyfill sift -r 'js/babel-polyfill' show -f
Sifting output files...
~/c/app β―β―β―
i expect the contents to be extracted into our /resources/js/babel-polyfill
ah, -r
expects a regex
boot -BPd cljsjs/babel-polyfill sift -r 'cljsjs/babel-polyfill:development/.*\.inc\.js$' show -f
doesnt work either
hmmm, doesnt show anything
~/c/app β―β―β― boot -BPd cljsjs/babel-polyfill sift -r 'cljsjs/babel-polyfill' show -f
Sifting output files...
~/c/app β―β―β―
true it does not work
i dont want them to be moved into a jar
moves them from a jar to where?
ah, and how can i move that further to the resource folder?
or better to the target folder
ok, let me try
ok, that worked
boot -BPd cljsjs/babel-polyfill sift -j cljsjs/babel-polyfill:"js/babel-polyfill" show -f
tried too yes π
sorry about the derailing @michael.heuberger I thought we did not need -j
thats okay @richiardiandrea π
but when i use boot -BPd cljsjs/babel-polyfill sift -j cljsjs/babel-polyfill:"js/babel-polyfill" show -f
i dont find them in the js folder?
@micha when using target
at the and, can i specify a specific subfolder in it instead?
like target/js
ah, wonderful
i think would be good to add some examples to bootβs README.md like these
i βfunction" better when i see examples π
ok, getting there: boot -BPd cljsjs/babel-polyfill sift -j cljsjs/babel-polyfill target -d target/js/babel-polyfill
is good but it extract all contents of the jar, whereas i only want to pick one single file from the jar
@michael.heuberger see my example you can filter
with -j "name":"regex"
ah, thanks
thanks guys, you rock π
now trying to achieve that in clj code in a boot task
sweet as
@bhagany can I ask you a question on the changed-keys
implementation?
looking at the third param of clojure.data/diff
those are values in both data structures
basically now there is a set/union
with z
, I wonder if that should be there
yes cause you consider that as :changed
right?
but if it is in both it is not really changed
(unless I am misreading the code)
just for reference (set/union (set/intersection x y) (set/intersection (set/union x y) z))
take a look at the example in the ticket: https://github.com/boot-clj/boot/pull/566
you end up with a value in z
in case they are both present
[things-only-in-a things-only-in-b things-in-both]
okay, so far i have this:
(deftask build
[]
(comp
(cljs)
(target)
;; now extract and copy one file from babel-polyfill like this command does:
;; boot -BPd cljsjs/babel-polyfill sift -j cljsjs/babel-polyfill:"polyfill.inc.js" target -d target/js/babel-polyfill
(sift :add-jar {'cljsjs/babel-polyfill #"polyfill\.inc\.js"})
(target :dir #{βtarget/js/babel-polyfill"})))
but it does something weird in the target folder, overwrites target/js/babel-polyfill
over again with everything else
ops sorry @bhagany I am reading it wrong
pffff...
no now it is clear, I though z
was inside the first set/union
still have my problem, but I might be tired for further investigation
I'm hoping someone else can spot what is going on here. Basically I'm looking to remove the .html
from strings that represent a url in my routes. When I do a println it shows but the final output the .html
seems to make it back into the file?
(defn remove-html [in-file out-file]
(println (str/replace (slurp in-file) #".html" "")
(doto out-file
io/make-parents
(spit (str/replace (slurp in-file) #".html" "")))))
(deftask remove-html-task
"Removes the html from routes"
[]
(let [tmp (tmp-dir!)]
(with-pre-wrap [fileset]
(empty-dir! tmp)
(let [in-files (input-files fileset)
file-with-html (by-name ["components.cljc"] in-files)]
(doseq [in file-with-html]
(let [in-file (tmp-file in)
in-path (tmp-path in)
out-path in-path
out-file (io/file tmp out-path)]
(remove-html in-file out-file)))
(-> fileset
(add-resource tmp)
commit!)))))
spotted it. Was in the build boot. I had it after the CLJS compilation and not before. Got confused with the comp function
Looking for a sanity check - I've been trying to work out the testing situation in boot. I've read and mostly understood the code in boot.test
and also in adzerk-oss/boot-test. The former seems to be focused exclusively on testing tasks, while the latter is for clojure.test
tests. Am I correct that there isn't any overlap between these two things?
@bhagany basically boot.test
is supposed to test tasks, and in parallel
it is clojure.test
compliant but not required for "normal" testing in an app
Yeah, I probably should have been clearer. For libs/apps you want boot-test/boot-alt-test
one thing to note is that boot-test
executes tests in a pod, which has been disproved by a couple of people here (myself included) to be necessary/fast
so Juho came up with boot-alt-test
which does not have feature parity but it is where I would put more effort in
(and the missing features are trivial to implement actually π )