Fork me on GitHub
#cljsjs
<
2016-09-13
>
michael.heuberger05:09:47

i do not see these files after a boot package - am i doing something wrong?

flyboarder05:09:03

@michael.heuberger Can you post the full boot file plz you url might be incorrect, "“ +lib-version+ ".zip is what I think you want

flyboarder06:09:07

you also want decompress true on the download task and remember to boot package install to put it into local maven

michael.heuberger21:09:57

@flyboarder thanks for that. i thought it doesn’t have to be always zip and you can download the raw files. that’s not mentioned in https://github.com/cljsjs/packages/wiki/Creating-Packages

juhoteperi22:09:13

It doesn't have to be always zip and raw files can be downloaded

michael.heuberger22:09:36

oh, then that should be mentioned too with an example

juhoteperi22:09:23

Though for example https://github.com/dropbox/zxcvbn/tree/4.3.0/dist is a HTML file so downloading that doesn't make any sense

michael.heuberger22:09:33

thanks good to know - here an example what i have now with zip

michael.heuberger22:09:35

(deftask package []
  (task-options! push {:ensure-branch nil})
  (comp
    (download
      :url (str "" +lib-version+ ".zip")
      :unzip true)

    (sift :move {#"^dist/zxcvbn.js"     "cljsjs/zxcvbn/development/zxcvbn.js"
                 #"^dist/zxcvbn.js.map" "cljsjs/zxcvbn/development/zxcvbn.map.js"})

    (sift :move {#"^dist/zxcvbn.js"     "cljsjs/zxcvbn/production/zxcvbn.js"
                 #"^dist/zxcvbn.js.map" "cljsjs/zxcvbn/production/zxcvbn.map.js"})

    (sift :include #{#"^cljsjs"})
    (pom)

michael.heuberger22:09:53

but then, the boot download task gives me a null pointer 😕

michael.heuberger22:09:36

~/C/c/zxcvbn ❯❯❯ boot download                                                                                                                    feature/SCL-1580 ✱
    clojure.lang.ExceptionInfo:
    data: {:file
           "/var/folders/m7/r54_bcwj2ms2w5rpgdmvr6hh0000gn/T/boot.user7776919171751829255.clj",
           :line 19}
java.lang.NullPointerException:

flyboarder22:09:53

@michael.heuberger: boot package what does that currently give you?

michael.heuberger22:09:11

~/C/c/zxcvbn ❯❯❯ boot package                                                                                                                     feature/SCL-1580 ✱
Downloading 4.3.0.zip
Extracting 36 files
Sifting output files...
Sifting output files...
Sifting output files...
Writing pom.xml and pom.properties...
Writing zxcvbn-4.3.0-0.jar…

juhoteperi22:09:27

you can't call boot download without parameters directly

michael.heuberger22:09:06

and where can i see the contents boot package is generating? it’s not in my current directory

juhoteperi22:09:10

boot package doesn't currently print checksum error because you aren't using :checksum parameter with download task

juhoteperi22:09:25

-> everything is valid

juhoteperi22:09:41

to check the checksum, add for example empty checksum property :checksum ""

juhoteperi22:09:49

it is not strictly necessary to check checksum

juhoteperi22:09:33

> After running the package task in any CLJSJS package, the fileset contents should be as follows. You can check these by using show --fileset task or by writing fileset contents to a directory using target task.

michael.heuberger22:09:38

ah, that :checksum “” tip is gold

juhoteperi22:09:09

I have tried to explain in on the wiki: > If the :checksum option is empty string or incorrect, and error containing the real MD5 checksum is displayed and you can use this to fix the value.

michael.heuberger22:09:10

now, boot show —fileset still doesnt show me the new files

michael.heuberger22:09:14

~/C/c/zxcvbn ❯❯❯ boot package                                                                                                                   ⏎ feature/SCL-1580 ✱
Downloading 4.3.0.zip
Extracting 36 files
Sifting output files...
Sifting output files...
Sifting output files...
Writing pom.xml and pom.properties...
Writing zxcvbn-4.3.0-0.jar...
~/C/c/zxcvbn ❯❯❯ boot show --fileset                                                                                                              feature/SCL-1580 ✱

└── cljsjs
    └── zxcvbn
        └── common
            └── zxcvbn.ext.js

juhoteperi22:09:03

the archive file probably has all files prefixed under some directory, like zccvn-123/ so the regexes don't match any files

michael.heuberger22:09:28

can i see this somewhere?

juhoteperi22:09:02

you could for example add (sift :fileset true) task after download task

juhoteperi22:09:21

oh and running boot show --fileset doesn't make sense

juhoteperi22:09:43

each boot invocation/process is separate from another

michael.heuberger22:09:59

sift: unknown option(s): :fileset

juhoteperi22:09:19

sorry, (show :fileset true)

juhoteperi22:09:59

for show --fileset to work, you'd need to run it as part of the same pipeline as package: boot package show --fileset

michael.heuberger22:09:15

ah, that worked … now i can fix my regexes

michael.heuberger22:09:21

does sift also support :copy instead of :move?

juhoteperi22:09:02

Nope. (You can check the options with boot sift --help)

michael.heuberger22:09:07

(sift :copy {#"zxcvbn-4.3.0/dist/zxcvbn.js"     "cljsjs/zxcvbn/development/zxcvbn.js"
                 #"zxcvbn-4.3.0/dist/zxcvbn.js.map" "cljsjs/zxcvbn/development/zxcvbn.map.js"})

    (sift :move {#"zxcvbn-4.3.0/dist/zxcvbn.js"     "cljsjs/zxcvbn/production/zxcvbn.js"
                 #"zxcvbn-4.3.0.dist/zxcvbn.js.map" "cljsjs/zxcvbn/production/zxcvbn.map.js”})

michael.heuberger22:09:12

how can i achieve something like this?

juhoteperi22:09:51

no need to have the the same file duplicated

juhoteperi22:09:03

production file is supposed to be the minifed file, but if you don't have one you can just skip it

michael.heuberger22:09:33

will boot default to development folder if there is no production folder?

michael.heuberger22:09:31

zxcvbn.js is already minified - a special case here

juhoteperi22:09:40

deps-cljs will use any *.inc.js file

juhoteperi22:09:14

I think in this case it would be okay to copy the file (minified) to development folder under .inc.js extension

juhoteperi22:09:59

Also, I fear Cljs doesn't support source-maps for foreign-libs, so that .map.js is probably unncessary

michael.heuberger22:09:14

ok, will use .inc.js make it work then?

juhoteperi22:09:21

(If no \.min.inc.js file exists, .inc.js is used always)

flyboarder22:09:34

(sift :move {#"zxcvbn-4.3.0/dist/zxcvbn.js" "cljsjs/zxcvbn/production/zxcvbn.inc.js”)

flyboarder22:09:59

but you will want to fix the regex to use the lib-version string instead of the hardcoded url

juhoteperi22:09:03

and production folder is probably good call

michael.heuberger22:09:13

yup, thanks guys, your support is awesome

michael.heuberger22:09:22

probably some of the above should be documented for others?

juhoteperi22:09:46

Yeah, improved documentation wouldn't hurt

juhoteperi22:09:53

the wiki is open for everyone to edit

flyboarder22:09:18

@juhoteperi a side note, it was noticed the other day that nothing points to the package readme's

juhoteperi22:09:53

Would be quite easy to add links from the website

flyboarder22:09:13

yeah the current links for the package name goes to clojars

flyboarder22:09:48

and the home link the original project, kinda skips over the instructions for using the cljsjs version in a project

flyboarder22:09:16

maybe we just need a document icon next to the home link

juhoteperi22:09:02

hmh, the hard part is to choose the icon

michael.heuberger22:09:55

btw, is there a trick how to test extern files best?

michael.heuberger22:09:06

possible to add a unit test or so in the same directory?

flyboarder22:09:08

@juhoteperi I would say book, but they are both pretty 😛

juhoteperi22:09:45

There is hope this will be fixed soon... by making extern files completely unncessary

michael.heuberger22:09:52

okay, thanks again guys

michael.heuberger22:09:43

uh, one more thing. zxcvbn.inc.js is already compiled with closure compiler. can you confirm that, in this case, no extern is needed and already has its own definitions?

juhoteperi22:09:57

doesn't look like it is Closure library

michael.heuberger22:09:15

what makes you say that?

juhoteperi22:09:58

package.json in the project says it is compiled using browserify

juhoteperi22:09:12

and it is written in coffeescript and uses commonjs modules

michael.heuberger23:09:01

hello again. tell me, is this line (task-options! push {:ensure-branch nil}) really necessary? and what exactly does it?

juhoteperi23:09:06

It disables check that certain branch is checked out

juhoteperi23:09:11

It is probably anyway disabled

juhoteperi23:09:26

It maybe used to be enabled by bootlaces library, but that is no longer used

juhoteperi23:09:47

And CI is the only places where deploy is ran

juhoteperi23:09:53

-> should be unncessary

michael.heuberger23:09:43

thx, good to know