Fork me on GitHub
#boot
<
2016-03-12
>
onetom15:03:51

@alandipert: im just trying your move-webjars task but it blows up like this:

clojure.lang.ExceptionInfo: java.io.FileNotFoundException: /Users/onetom/.boot/cache/tmp/Users/onetom/p/neat/12lz/-p9hf6h/META-INF/resources/webjars/bourbon/4.2.6/bower.json (No such file or directory)
the /Users/onetom/.boot/cache/tmp/Users/onetom/p/neat/12lz/-p9hf6h/ temp dir is empty afterwards so im not sure why does it complain.

micha15:03:49

something isn't doing before trying to write to a file

onetom15:03:52

If I print the files of the libs within the bower? fn with (dorun (map (comp println :path) (flatten (vals libs)))) I do see

META-INF/resources/webjars/bourbon/4.2.6/bower.json

onetom15:03:09

ok, so that gist was not functional?

micha15:03:57

i'm not sure about the gist specifically, but if you see those errors it's usually becuase youre trying to write to a file when some of the directories the file will be in don't exist

onetom15:03:19

it fails on a slurp though

micha15:03:58

which gist?

onetom15:03:55

im trying to map the line numbers in my error to the line numbers in the gist

micha15:03:58

boot -b will allow you to match line numbers in build.boot

micha15:03:12

like if you do boot foo bar baz and you get an error

onetom15:03:14

it's not in the build boot though. but dont worry, i can debug it

onetom15:03:31

i just thought if alan is around he can update the gist or something

onetom15:03:49

i saw martin also posted something along these lines, so i will try that next if this one fails

pandeiro15:03:55

@micha Can you remind me what is the best practice wrt the org.clojure/clojure dependency in boot libraries? Omission (like boot-test)? :scope "provided" like boot-cljs?

micha15:03:16

the (slurp (tmp-file tmp)) seems strange

micha15:03:42

@pandeiro: i think the best way is to have a regular dependency on clojure

pandeiro15:03:14

ah ok, that's what I have in boot-http. what about a boot.properties file? i notice most libs don't have one

onetom15:03:40

i had the exact same questions in my mind in the past few weeks, just didnt have the capacity to ask

micha15:03:42

the boot.properties file is just for you when you are building or testing

micha15:03:45

or for CI

micha15:03:02

@onetom: it should work though

micha15:03:10

is that just for debugging?

onetom15:03:32

but if u specify clojure 1.8.0 in the boot.properties, then boot.core is using clojure 1.8 and my app itself is also using that transitively, no?

micha15:03:42

ah i think i see

micha15:03:56

the webjars task never calls commit! on the new fileset it builds

onetom15:03:01

but if i only specify 1.8 in set-env :dependencies then i will end up pulling down both versions, no?

onetom15:03:42

micha: how can i see the files with boot webjars show -f then?

onetom15:03:54

ah, ok, nvm, got it

micha15:03:00

because the things are in the fileset, but the actual files are not on the classpath

micha15:03:11

that's what happens when you call commit!

micha15:03:19

that's like git checkout

micha15:03:24

it updates the working set

onetom15:03:21

move-webjars doesnt call commit! either how come?

micha15:03:26

@onetom: yeah the boot.properties should have the same clojure version as what you specify in your build.boot :dependencies

micha15:03:46

it doesn't look like the move-webjars task is complete?

micha15:03:35

i think where it's doing println is where the logic for moving things would go, perhaps?

onetom15:03:31

ok, i haven't read it until then end since it was throwing an error earlier.

micha15:03:40

the move-webjars task doesn't look like it's making a new fileset

micha15:03:47

so it wouldn't need to call commit!

onetom15:03:48

no worries, i don't want to hold up anyone with this

micha15:03:23

i think we named things wrong with the fileset maybe

micha15:03:47

maybe not

micha15:03:49

add-resource etc are sort of like git add

micha15:03:06

and commit! is sort of like git checkout

micha15:03:23

well the analogy isn't perfect lol

alandipert18:03:01

@onetom: sorry, I never finished that task

martinklepsch18:03:29

@onetom:

;; META-INF/resources/webjars/basscss/8.0.1/css/basscss.css
(deftask from-jars
  [i imports IMPORT #{[sym str str]} "Tuples describing imports: [jar-symbol path-in-jar target-path]"]
  (let [add-jar-args (into {} (for [[j p]  imports] [j (re-pattern (str "^" p "$"))]))
        move-args (into {} (for [[_ p t]  imports] [(re-pattern (str "^" p "$")) t]))]
    (util/dbug "Importing from jars: %s\n" (pr-str add-jar-args))
    (util/dbug "Moving into locations: %s\n" (pr-str move-args))
    (util/info "Importing %s files from jars...\n" (count imports))
    (sift :add-jar add-jar-args
          :move move-args)))

(deftask import-css []
  (comp (from-jars :imports #{['org.webjars.npm/basscss "META-INF/resources/webjars/basscss/8.0.1/css/basscss.css" "_bass.scss"]
                              ['org.webjars.npm/normalize.css "META-INF/resources/webjars/normalize.css/3.0.3/normalize.css" "_normalize.scss"]})))

martinklepsch18:03:15

@onetom: maybe this helps if you're trying to pull in webjars

alandipert18:03:37

i was working on a task that handled the "bower' webjars too but then i learned some of the web components ones aren't packaged correctly so i gave up

flyboarder19:03:43

I started working on a Apache-exec task to nicely wrap local bin's, I don't think we can entirely avoid using bower as of yet

onetom20:03:24

@martinklepsch: @alandipert: thanks. just saw your answers though, because i was not paying attention to slack... i've ended up doing the same sifting business, but haven't generalized it yet. I just made PureCSS (more or less) work:

(sift
      :add-jar {'org.webjars.bower/purecss #".+\.css$"}
      :move {#"/src/.+/(.+)\.css$" "/_$1.scss"})
and having an app.scss:
@import "normalize-css/normalize";
@import "purecss/base";
@import "purecss/buttons-core";
@import "purecss/buttons";
@import "purecss/forms";
@import "purecss/forms-r";
@import "purecss/grids-core";
@import "purecss/menus-core";
@import "purecss/menus-horizontal";
@import "purecss/menus-dropdown";
@import "purecss/menus-scrollable";
@import "purecss/menus-skin";
@import "purecss/tables";

onetom20:03:18

i wrote this based on their Gruntfile (https://github.com/yahoo/pure/blob/master/Gruntfile.js) BUT the grid setup or something else is still missing, so the characters pile up on each other

onetom20:03:51

@martinklepsch: im using @juhoteperi boot-sass task (v0.2.1). are you using the same?

martinklepsch20:03:57

@onetom: Using the same yes, regex to import all files is probably saner than importing single files

onetom20:03:18

purecss has test.htmls and similar useless files bundled too, though

onetom20:03:39

but anyway, thanks again for the support! good nite