Fork me on GitHub
#boot
<
2017-06-23
>
cjhowe00:06:23

is there a list of boot-new templates somewhere?

seancorfield00:06:07

cjhowe: No. No more than there is a list of lein-new templates, I’m afraid.

seancorfield00:06:59

boot-new has Boot-specific versions of the same built-in templates that lein new has, but beyond that you’ll get whatever the Boot or Leiningen template has.

cjhowe00:06:00

sounds like a good idea for a wiki page

seancorfield00:06:16

This is probably the easiest way to find Boot-specific templates: https://clojars.org/search?q=boot-template — a wiki page would always be out of date.

seancorfield00:06:48

But all of these Leiningen templates should also work with boot-new too: https://clojars.org/search?q=lein-template

richiardiandrea00:06:02

@cjhowe boot-new is compatible with lein template so you can use any of them

cjhowe00:06:44

wouldn't that generate a project.clj? or does it convert it?

richiardiandrea00:06:59

no it will generate whatever is in the template

richiardiandrea00:06:46

but depends from template to template

zilti06:06:49

I have :source-paths #{"src/clj" "src/cljs" "src/cljc"} and :resource-paths #{"resources"} in my build.boot, and apparently that's not okay - I get java.lang.AssertionError: Assert failed: The :source-paths, :resource-paths, and :asset-paths must not overlap. (empty? (set/intersection paths parents)). What's the recommended solution for this?

dm307:06:12

that should be ok, is it possible there’s more stuff added to source/resource-paths later on?

dm307:06:20

e.g. by a task

zilti07:06:50

@dm3 No, I looked through my complete build.boot but there's nothing else.

zilti07:06:55

Unless (cljs) modifies something in the background

zilti07:06:55

@dm3 Also, I have boot-lein, and it writes a project.clj with exactly those four paths.

dm307:06:50

@zilti I’d bet something adds src to the resource/source path

dm308:06:03

are you using bootlaces?

zilti08:06:55

@dm3 yes, I'm using bootlaces! So, that's the evildoer?

dm308:06:16

yep, there’s a dont-modify-source-paths flag or something like that

zilti08:06:38

@dm3, thanks, I'll look into that 🙂

pandeiro17:06:40

Is there something else I need to do to get boot-reload working besides (comp ... (reload :ip "0.0.0.0" :port 9999 :on-jsload 'myapp.core/init) (cljs) ...)?

pandeiro17:06:08

I've got that set up, and the browser is making the WS connection, I see 'Reload socket connected', but when I change CLJS files, nothing happens

pandeiro17:06:04

Hmm, does the reload task need to come after watch?

pandeiro17:06:15

That would make sense 🙂

richiardiandrea17:06:29

@pandeiro the :on-jsload should go in a main.cljs.edn

richiardiandrea17:06:40

and yes after watch

richiardiandrea17:06:02

you can also try boot-figreload if you want 😄

pandeiro17:06:16

Oooh is that the new hotness? 😉

manenko19:06:11

is there any good comprehensive documentation on writing custom boot tasks?

chouser22:06:42

Hi! I'm trying to tweak cljs-repl-web, and I broke it. It's got a 'dev' task that serves up files to the browser. I added a symlink to a directory with more files I want available in the browser, but now I get a stacktrace from boot that I don't comprehend at all. Shall I paste it somewhere?

chouser22:06:48

man, I'm so confused

richiardiandrea22:06:54

@chouser the dev task should serve it without symlinks but does not materialize it

richiardiandrea22:06:14

because boot does not materialize in target by default

richiardiandrea22:06:09

so you can either build it and serve it yourself or use boot dev to have it served on 3000

richiardiandrea22:06:05

well that file should be there 😄

richiardiandrea22:06:14

but it is not super important

chouser22:06:32

But the things you're saying are surely still relevant because although I'm not getting an error, the files under my symlink are still not available over http.

chouser22:06:49

what does "materialize in target" mean?

richiardiandrea22:06:51

yeah because boot-http serves the fileset

richiardiandrea22:06:08

so boot has an abstraction over the filesystem (the fileset)

richiardiandrea22:06:24

all the tasks create and modify that instead of stuff in your project

chouser22:06:31

oh, so putting a file in the right directory is insufficient?

chouser22:06:40

...to have it served?

richiardiandrea22:06:26

no well it should be, the files are added as :source-paths or :resource-paths

richiardiandrea22:06:35

and boot-http should serve them

richiardiandrea22:06:57

not sure about symlinks though (I have never tried)

chouser22:06:27

ok, so perhaps I need to add my symlink path to :resource-paths

richiardiandrea22:06:41

is it a separate folder?

richiardiandrea22:06:35

if it is static asset, it should probably go in resources/public

chouser22:06:53

it looks like resources/public/ is already in :resource-paths, and I put a symlink from resources/public/b to the directory of stuff I want.

richiardiandrea22:06:22

yeah, that is my only doubt, what if you copy?

chouser22:06:29

hm, ok. I'll try that.

chouser22:06:49

huh. that did it.

richiardiandrea22:06:23

yeah, so prolly there is a problem there with symlinks

chouser22:06:57

thank you for your help! That was not high on my list of things to try.

richiardiandrea22:06:25

no problem, it is my baby, let me know if you need further help 😉

chouser22:06:08

the directory in question is a subdir of javascript from a third-party git repo. I was thinking I'd include that project via git submodules and then symlink from resources to just the part I need.

chouser22:06:49

...perhaps the right way would be to have a separate item in :resource-paths that point directly to the subdir I want, instead of trying to graft it into resources/pubilc via cp or link?

richiardiandrea22:06:57

you know, I was assuming that symlink would work

chouser22:06:30

does the symlink get copied somewhere or something? I was using a relative symlink.

richiardiandrea22:06:31

you can add any additional folder in resource-paths but keep in mind that it will be served starting from ./

richiardiandrea22:06:08

I really don't know the details of that...I should dig into it, maybe an issue in boot would be good

chouser22:06:28

I see. Is there a way to add a prefix when I add to resource-paths?

richiardiandrea22:06:45

you mean an additional folder?

chouser22:06:27

The files I want are all in "Babylon.js/dist/preview release/"

richiardiandrea22:06:06

yes I was going to suggest what pandeiro is going to say 😄

chouser22:06:07

Can I add that to resource-paths in some way that will cause "Babylon.js/dist/preview release/foo.js" to be available via http as "/babylon/foo.js"?

pandeiro22:06:12

@chouser In that repo you mention, if you were to add :dir "name-of-dir-with-your-symlink" to the (serve) part...

pandeiro22:06:18

That might work 🙂

richiardiandrea22:06:32

:dir might be a better option here

pandeiro22:06:52

Otherwise, the http server is only serving from the resources from boot's fileset

pandeiro22:06:16

The :dir option will serve static files from any directory

chouser22:06:24

oh, I see. An option to 'serve'

chouser22:06:44

It will do that in addition to everything else it's serving?

chouser22:06:54

...but I only get one such :dir?

pandeiro22:06:04

It will also serve the classpath, yes

chouser22:06:48

This build.boot file I'm tweaking has a bunch of other stuff in it, perhaps for packaging up a standalone something (though I'm not sure about that). If I want this dir of js to be included, (serve ... :dir) won't work, right? I'd want to stick with resource-paths or something instead?

pandeiro22:06:13

What else is in serve?

chouser22:06:20

Ah, alas I've got to run to pick up dinner. Thanks all for your help!

pandeiro22:06:22

If there's a :handler, you are correct

pandeiro22:06:43

Sure, glad to answer any more questions

pandeiro22:06:03

In that example there, (serve :dir "mydir-with-stuff") should just work