Fork me on GitHub
#boot
<
2016-07-18
>
ajchemist04:07:13

How can I use (watch :manual true) properly? any example?

ajchemist05:07:34

wow I noticed that manual watch is really sweet 😆

flyboarder05:07:14

@anmonteiro what are you trying to do?

avabinary07:07:36

is there an easy way to configure cider (installed from elpa) to run with boot instead of lein ??

ajchemist09:07:31

@avabinary: since cider 0.12.0, there is no need additional configuration to jackin boot-clj repl.

ajchemist09:07:35

you just type C-c M-j.

ajchemist09:07:22

I think this is the full guide.

avabinary10:07:08

ok @ajchemist thanks for your input, I'll download the latest cider

avabinary10:07:26

now ran into an issue where melpa won't connect to refresh packages

ajchemist10:07:37

@avabinary: I personally recommend use exact version 0.12.0 of cider, no latest melpa version.

ajchemist10:07:33

and I have little knowledge about melpa, so I can’t comment this.

avabinary10:07:37

ok, I'll work it out and come back afterwards with updates 🙂 hope it goes well

anmonteiro11:07:33

@flyboarder: trying to get my doo tests to find the node_modules folder with boot-cljs-test

flyboarder11:07:05

You probably want to add the path to resources or assets within your test task

flyboarder11:07:15

@anmonteiro: ^

anmonteiro11:07:29

@flyboarder: I did that

anmonteiro11:07:41

the problem is that Boot creates managed temp dirs for each thing

anmonteiro11:07:56

so node_modules ends up in a tmp dir, the result of CLJS compilation in another

anmonteiro11:07:03

so relative paths are not resolved

flyboarder11:07:42

@anmonteiro: ok, almost 6am here will get back to this in a few hrs after sleep

anmonteiro11:07:04

@flyboarder: hah, go ahead, I can wait 🙂

flyboarder11:07:34

Maybe someone else will have some insight in the mean time :)

martinklepsch12:07:26

@anmonteiro: if you add node_modules with the same fileset role as the CLJS compilation results they should end up in the same directory

martinklepsch12:07:04

I guess that's resource instead of asset

anmonteiro12:07:12

@martinklepsch: Oh that might get me somewhere. I didn’t read about roles yet

anmonteiro12:07:40

I suppose boot-cljs-test adds it as source?

martinklepsch12:07:04

dunno, I'd expect resource but you should check

anmonteiro12:07:31

@martinklepsch: so I add it as source

(deftask testing []
  (set-env! :source-paths #(conj % "src/test"))
  identity)

martinklepsch12:07:36

It's relying a bit on internals, really whatever looks for files on the filesystem should look at the classpath instead (doo I guess)

anmonteiro12:07:37

but this is not what I’m looking for, is it?

anmonteiro12:07:00

I want to know what role the CLJS compilation has, right?

martinklepsch12:07:26

yeah, I think the cljs compilation results will get added as resource

martinklepsch12:07:55

just try that and if it doesn't work try source, there are only for options 😄

anmonteiro12:07:16

@martinklepsch: the problem is that boot-cljs-test actually uses the filesystem dir instead of the classpath https://github.com/crisptrutski/boot-cljs-test/blob/master/src/crisptrutski/boot_cljs_test.clj#L87-L93

martinklepsch12:07:19

(alternatively grep for add- in boot-cljs :)

anmonteiro12:07:18

trying that ASAP

martinklepsch12:07:06

The issue is that doo needs a directory because it runs JS which can't use the classpath...

martinklepsch12:07:34

I guess one option could be to create a tmpdir in boot-cljs-test and link the fileset contents there, then using this dir as input for doo

martinklepsch12:07:09

not sure if that would work 🙂

anmonteiro12:07:02

that makes sense. Let’s see if adding this as a resource can solve my issue first

ska12:07:31

Hi! I just recognized in my dev environment that I am still on Clojure 1.7.0 in a boot project and I think, I tracked it down to my ~/.boot/boot.properties which defined the appropriate ENV var. Am I correct in assuming (after reading https://github.com/boot-clj/boot/wiki/Setting-Clojure-version) that I need to define the dependency on 1.8.0 in my build.boot and boot.properties files in my project?

martinklepsch12:07:01

@ska: yes that is correct

ska12:07:49

@martinklepsch: Thanks for the prompt reply! Will that change in the future?

martinklepsch12:07:09

Boot may run multiple versions of Clojure, the one in boot.properties is used as default, the one in build.boot will be added as dependency

martinklepsch12:07:43

@ska: No plans of changing that as far as I'm aware

ska12:07:57

So, boot.properties defined dev environment and REPL whereas build.boot the runtime?

ska12:07:06

s/defined/defines/

ska12:07:17

Leaves room for subtle errors for a forgetful person like me. But I will assume, there are very valid reasons to separate the two, even if I don't see them right now. 😉 Anyhow, thanks again.

martinklepsch12:07:19

@ska: Boot runs a lot of things (including the repl) in pods, which are isolated Clojure runtimes. The version of Clojure that's used for these pods is defined via boot.properties, via build.boot you can also add a dependency on Clojure or load a different version although it's generally recommended to keep these in sync

ska12:07:00

Hm, while we're at it. Do you use cider?

ska12:07:54

Too bad. Cider does not pick up my checked in ./boot in the project but the one on my $PATH. I can still start the REPL from the command line.

martinklepsch12:07:51

All I can help with is https://github.com/boot-clj/boot/wiki/Cider-REPL and that I've head that Cider 0.12 supposedly works out of the box with boot

anmonteiro13:07:17

@martinklepsch: adding the thing as a resource “just works”™

anmonteiro13:07:32

thanks a lot!

martinklepsch13:07:18

@anmonteiro: please open an issue on boot-cljs-test so it's not forgotten 🙂

martinklepsch13:07:27

@anmonteiro: welcome as well 🙂

anmonteiro13:07:11

@martinklepsch: what should the issue contain? I’m not sure I understood what the problem is with boot-cljs-test given that this works

martinklepsch13:07:59

The issue is that this takes only one temp dir and not all of the temp dirs representing the fileset.

martinklepsch13:07:17

The directory passed to doo should at least contain all output-files of the fileset and not just the files that have the same role as out-file in that snippet

anmonteiro13:07:40

@martinklepsch: actually that might exist already

anmonteiro13:07:09

at least it’s a similar thing

anmonteiro13:07:52

actually @juhoteperi even seems to have a WIP branch to fix this issue https://github.com/Deraen/boot-cljs-test/commit/e7493432f6c41224af6757707874de736de15ddb

martinklepsch13:07:21

Yeah just saw this as well

martinklepsch13:07:51

@anmonteiro do you now what npm install does exactly? could re replicate the basics in Clojure? I think a webjars-based approach (as @juhoteperi suggested) won't work because it doesn't mirror npm but does on-demand builds.

martinklepsch13:07:13

If we could replicate it we could essentially just create node_modules inside the fileset

anmonteiro13:07:23

@martinklepsch: I’m not that familiar with npm, no

nha13:07:18

I think the big difference with maven etc. is that npm modules are installed recursively (ie. each submodule has a node_modules directory. So using different modules versions is easy (as long as they don't have to share state), at the cost of duplication (which is ok since js files are small usually).

kenny19:07:29

Is it possible to get the options that are set for a specific task?

kenny19:07:13

Ah figured it out.. For those interested:

(:task-options (meta #'task))

petrus20:07:32

Can I run one boot command to start both a clj and cljs repl that I can connect to separately? Alternatively, could I turn the clj repl into a cljs repl? My one-run dev task looks like this: (comp (watch) (start-app :port port) (reload :ids #{"js/main”}) (cljs-repl :ids #{"js/main”}) (cljs :ids #{"js/main”}) (target) (boot.task.built-in/speak))

anmonteiro20:07:18

@petrus: if you’re using emacs cider, I’ve made a contribution to boot-cljs-repl exactly for this purpose

anmonteiro20:07:32

instead of using the cljs-repl task, use cljs-repl-env

michael.heuberger22:07:47

does anyone know how to configure boot to serve anything regardless of the URL? this for a single page application

michael.heuberger22:07:54

using boot-http here

michael.heuberger22:07:22

treat for example localhost/index and localhost/something/else the same