This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-05
Channels
- # bangalore-clj (1)
- # beginners (99)
- # boot (108)
- # cider (15)
- # clara (4)
- # cljs-dev (12)
- # cljsjs (37)
- # cljsrn (4)
- # clojure (110)
- # clojure-italy (2)
- # clojure-spec (12)
- # clojurescript (168)
- # cursive (1)
- # datomic (24)
- # graphql (6)
- # hoplon (5)
- # jobs-discuss (2)
- # keechma (21)
- # mount (5)
- # off-topic (140)
- # om (2)
- # parinfer (37)
- # planck (6)
- # re-frame (4)
- # reagent (9)
- # rum (2)
- # spacemacs (4)
Hi, I’m trying to write a task that downloads an external less-template and move it permanently to my prj folder. That part works, but I’m stuck with trying to rename the downloaded folder. Task below is mostly based on what cljsjs does:
(deftask download-semantic-ui []
(comp
(download
:url (format "" +semantic-ui-version+)
:checksum "98ba3248a2c74882204235cba06fad5e"
:unzip true)
(sift :include #{#"^Semantic-UI-.*/(.*)$"})
(sift :include #{#"\.js", #"\.json"} :invert true)
(target :dir #{"resources/less"})))
this gives me the folder resources/less/Semantic-UI-LESS-{x.y.z}
while I would like to reference in my own less file resources/less/semantic-ui
How can I rename this?
@freakinruben Though I'd just recommend using Semantic UI from webjars and https://github.com/Deraen/less4clj
yeah I did something like that but sift only moves files, not directories.. and it’s quite a nested folder structure inside
I will give that a try. Ok, so if I would like to make the above work I’ll have to use some java file methods
@juhoteperi did you ever manage to use semantic-ui less files through webjars? Question doesn’t really belong in this channel, but in case you did, how did you solve semantic-ui trying to import ../../theme.config
while that file is not present in the jar
You could try adding the file META-INF/resources/webjars/semantic-ui/2.2.10/src/theme.config
under you classpath (i.e. resource-paths) (version number in the path doesn't matter, less4clj ignores that part)
Semantic-ui should work with less4clj/less4j, : https://github.com/SomMeri/less4j/issues/295
wow, that seems too work, adding the file under the path you said.. I tried it before with bower
in the path as well 😄
Great! Looking at the import resolve code, having the file at classpath root might also work (`resources/theme.config`)
Or maybe not. That would work if semantic-ui/src/foo.less
did import ../../theme.config
, but the import is from semantic-ui/src/a/b/something.less
hmm
no, tried every path 😛
resources/theme.config
, ./theme.config
, resources/public/theme.config
etc.
nope, only META-INF/resources/webjars/semantic-ui/2.2.10/src/theme.config
seems to work
that’s fine, I can just import there from my actual folder and forget about that file
> Cannot find module ‘/Users/anmonteiro/.boot/cache/tmp/Users/anmonteiro/Documents/github/lumo/1xed/3lgroc/lumo_test/lumo_test/test_suite.out/goog/bootstrap/nodejs.js’
Also, you can provide :asset-path
to test-cljs :cljs-opts
to override value Boot-cljs-test sets
@juhoteperi hrm I guess we need to set asset-path explicitly now then https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L1494
Boot-cljs had bug previously, it only used the name of .cljs.edn file to set asset-path default
Boot-cljs-test code now only uses the name of .cljs.edn, that is at least wrong, but I'm not sure if that is what causes this
to make this work in Node I had to use these compiler options:
(cljs :compiler-options {:optimizations :none
:main 'lumo.test-runner
:verbose true
:asset-path "/target/main.out"
:compiler-stats true
:target :nodejs})
"require(path.join(path.resolve(\".\"),\"" asset-path "\",\"goog\",\"bootstrap\",\"nodejs.js\"));\n"
:cljs-opts {:parallel-build true
:asset-path "test_suite.out"}
works with boot-cljs-test on LumoI also tried nil
but either ClojureScript default doesn't work, or boot-cljs-repl overwrites nil
value
@anmonteiro Btw. it should be safe to include test
in :source-paths
always, and then you could remove the side-effecting testing
task
I think it’s copy paste from another project where I didn’t want the test folder in the installed JAR?
It does work with default :asset-path
IF you first cd into the target dir and then run node main.js
I think the ClojureScript node output is only meant to work when when running from same dir?
I think you’re overriding warnings and there’s a space missing in e.g. undeclared var warnings