This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-23
Channels
- # beginners (8)
- # boot (87)
- # cider (16)
- # cljs-dev (1)
- # cljsrn (2)
- # clojure (27)
- # clojure-austin (2)
- # clojure-beijing (1)
- # clojure-belgium (1)
- # clojure-russia (66)
- # clojure-uk (17)
- # clojurescript (48)
- # core-typed (1)
- # cursive (3)
- # datomic (8)
- # emacs (7)
- # funcool (3)
- # hoplon (22)
- # instaparse (1)
- # jobs-discuss (4)
- # leiningen (2)
- # om (17)
- # onyx (16)
- # reactive (2)
- # reagent (7)
- # rum (2)
- # specter (1)
- # untangled (3)
hello
started trying out boot for building a nodejs script
haven’t found examples for doing this yet
thinking that executing the script from the target directory could cause problems with finding node_modules
@shaunlebron: hey are you compiling with whitespace/simple? if so maybe quickest solution would be to just move the file into .
?
@shaunlebron: I'm not entirely sure it would yanno.
i’m not sure how to copy that over
out of curiosity, i was wondering if I could run boot script
to compile and run a script on node without ever seeing the compiled js file at root, but it doesn’t really matter
@shaunlebron: You're clear, it keeps searching parents: https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders
@dominicm what do you mean by yanno
lol k
oh, yeah, that clears it up, thanks for the link
sorry, i’m a bit confused about filesets in deftasks
i’d like to run node on the target output and not the fileset, as the last step of my deftask
(deftask site-gen []
(comp
(cljs :compiler-options sitegen-opts)
(target :dirs #{"target"})))
not sure how to add a last step to execute node target/main.js
@shaunlebron: you want to shell out but you're not sure how to correctly handle the fact that tasks need to return a fileset?
I can use sh
, but I believe boot’s version of it runs relative to the fileset temp directory?
(with-pass-thru
(boot.util/sh ["node" "..."]))
boot's sh isn't doing anything special
the only thing it provides ove what cl;ojure.shell does is that it will stream output from the shell command as it's produced
so if the shell command you're running prints output you'll see it as it runs instead of getting the output all at once after the shell command is finished
@shaunlebron: working version of the above:
(deftask x []
(with-pass-thru fs
(boot.util/sh "ls" "-lah")))
thanks for the details @micha
(def sitegen-opts
{:target :nodejs
:optimizations :simple})
(deftask run-site-gen []
(with-pass-thru fs
(sh "node" "target/main.js")))
(deftask site-gen []
(comp
(cljs :compiler-options sitegen-opts)
(target :dir #{"target"})
(run-site-gen)))
i’m not getting any output from sh on whether it ran or not
awesome thanks
i’m getting output from the running node process but with errors
Error: cljs.core/*main-cli-fn* not set
sorry, I set this value inside my sitegen.core
, but I can’t seem to set :main
compiler option to point to sitegen.core
since it is replaced by boot-cljs to something else
I’m confused by the concept of a cljs.edn file per build
$name.cljs.edn
files can be used to specify/configure builds in a composable way (perhaps multiple), details are here: https://github.com/adzerk-oss/boot-cljs/wiki/Usage#multiple-builds
I thought the config is fed into the cljs
task in my boot file
@shaunlebron: right and for some options thats true but for others it's not: https://github.com/adzerk-oss/boot-cljs/wiki/Usage#options
The issue with passing all options to the cljs
task is that you would not be able to create multiple builds with varying configurations
e.g. cljs-repl
and reload
tasks inject things into your build without you needing to touch your code
sorry there’s a lot I don’t understand here
and thanks for your help so far
I created a main.cljs.edn file and put it in my root project directory
I don’t think it’s being picked up by boot-cljs
would either of you like to google hangout / screenshare for a bit
i’d like to meet yall anyway
@shaunlebron: the cljs.edn file needs to be on the classpath. so any of the dirs in :source-paths
or :resource-paths
np if not
it’s saying “writing main.cljs.edn"
I have it in src
and src/
is in :source-paths
I guess?
the "writing main.cljs.edn" is printed if there is none. boot-cljs creates one for you in that case.
all the boot parts seem to working now
I can't do hangout right now btw, but would love to some other time
sure np
@shaunlebron: cool! are you doing static site generation using rum's new server side rendering stuff?
that requires clojure, I’m specifically trying to stay in cljs
just rendering normal hiccups with the runtime hiccups renderer function
there will be some dynamic parts like the api docs sidebar which will use a hiccup function that can be fed to either hiccups.runtime for the static part or to rum during user interaction
haven’t figured it out yet really
not sure if that made sense
not sure I got it either 😄
but it's late here...
i’m not sure I can use the static rum stuff in cljs I mean
yeah, it’s just for clojure
alright boot experts, thanks again for the help
hello folks, I was wondering if boot new
has already generators for, say, create the boilerplate env
dir that is used for instance in the Luminous framework
oh sorry I did not read until the end, basically it is already possible to generate, say, foo.bar.config
in env/prod
and env/dev
thanks to the ns
generator, cool stuff!