hello folks
i do not see these files after a boot package
- am i doing something wrong?
@michael.heuberger Can you post the full boot file plz you url might be incorrect, "<https://github.com/dropbox/zxcvbn/archive/>“ +lib-version+ ".zip
is what I think you want
you also want decompress true on the download task and remember to boot package install
to put it into local maven
@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
It doesn't have to be always zip and raw files can be downloaded
oh, then that should be mentioned too with an example
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
But https://raw.githubusercontent.com/dropbox/zxcvbn/4.3.0/dist/zxcvbn.js can be downloaded
thanks good to know - here an example what i have now with zip
(deftask package []
(task-options! push {:ensure-branch nil})
(comp
(download
:url (str "<https://github.com/dropbox/zxcvbn/archive/>" +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)
but then, the boot download
task gives me a null pointer 😕
~/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:
@michael.heuberger: boot package
what does that currently give you?
~/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…
you can't call boot download
without parameters directly
ah
and where can i see the contents boot package
is generating? it’s not in my current directory
boot package
doesn't currently print checksum error because you aren't using :checksum
parameter with download
task
-> everything is valid
to check the checksum, add for example empty checksum property :checksum ""
it is not strictly necessary to check checksum
> 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.
ah, that :checksum “”
tip is gold
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.
yep, my bad
now, boot show —fileset
still doesnt show me the new files
~/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
the archive file probably has all files prefixed under some directory, like zccvn-123/
so the regexes don't match any files
can i see this somewhere?
you could for example add (sift :fileset true)
task after download
task
oh and running boot show --fileset
doesn't make sense
each boot invocation/process is separate from another
sift: unknown option(s): :fileset
sorry, (show :fileset true)
for show --fileset
to work, you'd need to run it as part of the same pipeline as package
: boot package show --fileset
ah, that worked … now i can fix my regexes
does sift also support :copy
instead of :move
?
Nope. (You can check the options with boot sift --help
)
apparently not
(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”})
how can i achieve something like this?
no need to have the the same file duplicated
production file is supposed to be the minifed file, but if you don't have one you can just skip it
will boot default to development folder if there is no production folder?
hmm
zxcvbn.js is already minified - a special case here
deps-cljs
will use any *.inc.js
file
I think in this case it would be okay to copy the file (minified) to development folder under .inc.js
extension
Also, I fear Cljs doesn't support source-maps for foreign-libs, so that .map.js is probably unncessary
ok, will use .inc.js make it work then?
(If no \.min.inc.js file exists, .inc.js is used always)
yes
(sift :move {#"zxcvbn-4.3.0/dist/zxcvbn.js" "cljsjs/zxcvbn/production/zxcvbn.inc.js”)
should work
but you will want to fix the regex to use the lib-version string instead of the hardcoded url
and production folder is probably good call
yup, thanks guys, your support is awesome
probably some of the above should be documented for others?
Yeah, improved documentation wouldn't hurt
the wiki is open for everyone to edit
@juhoteperi a side note, it was noticed the other day that nothing points to the package readme's
Would be quite easy to add links from the website
yeah the current links for the package name goes to clojars
and the home link the original project, kinda skips over the instructions for using the cljsjs version in a project
maybe we just need a document icon next to the home link
hmh, the hard part is to choose the icon
btw, is there a trick how to test extern files best?
possible to add a unit test or so in the same directory?
@juhoteperi I would say book, but they are both pretty 😛
@michael.heuberger Nope 😞
There is hope this will be fixed soon... by making extern files completely unncessary
okay, thanks again guys
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?
doesn't look like it is Closure library
what makes you say that?
package.json in the project says it is compiled using browserify
and it is written in coffeescript and uses commonjs modules
hello again. tell me, is this line (task-options! push {:ensure-branch nil})
really necessary? and what exactly does it?
It disables check that certain branch is checked out
It is probably anyway disabled
It maybe used to be enabled by bootlaces library, but that is no longer used
And CI is the only places where deploy is ran
-> should be unncessary
thx, good to know