tamble / jquery-ui-daterangepicker

A JQuery UI based date range picker.
MIT License
184 stars 108 forks source link

Add bower.json to increase ease of installation #27

Closed holtkamp closed 7 years ago

holtkamp commented 9 years ago

To stimulate adoption and increase ease of installation during development, a bower.json file would be useful.

I would send a PR but I am confused about what name you would prefer for the package:

ghola commented 9 years ago

It would be great if you could add bower support. While our naming scheme is a little complicated (needlessly so), in order to be able to more easily associate the bower package with the github repo we would prefer tamble/jquery-ui-daterangepicker.

holtkamp commented 9 years ago

Mm, bower search jquery-ui-daterangepicker returns two forks:

This seems to complicate the registration caused by a naming conflict:

➜  bower register jquery-ui-daterangepicker git://github.com/tamble/jquery-ui-daterangepicker.git
bower jquery-ui-daterangepicker#*          resolve git://github.com/tamble/jquery-ui-daterangepicker.git#*
bower jquery-ui-daterangepicker#*         download https://github.com/tamble/jquery-ui-daterangepicker/archive/0.4.3.tar.gz
bower jquery-ui-daterangepicker#*          extract archive.tar.gz
bower jquery-ui-daterangepicker#*     invalid-meta jquery-ui-daterangepicker is missing "main" entry in bower.json
bower jquery-ui-daterangepicker#*     invalid-meta jquery-ui-daterangepicker is missing "ignore" entry in bower.json
bower jquery-ui-daterangepicker#*         resolved git://github.com/tamble/jquery-ui-daterangepicker.git#0.4.3
? Registering a package will make it installable via the registry (https://bower.herokuapp.com), continue? Yes
bower jquery-ui-daterangepicker           register git://github.com/tamble/jquery-ui-daterangepicker.git
bower                                   EDUPLICATE Duplicate package

@pbojinov can you unregister your fork of jquery-ui-daterangepicker since it conflicts with the original one.

pbojinov commented 9 years ago

@holtkamp done, I removed it. The only reason I had registered it originally was because this package didn't have bower support.

holtkamp commented 9 years ago

Thanks @pbojinov for the swift response!

Just completed the registration, all systems go:

➜  ~  bower register jquery-ui-daterangepicker git://github.com/tamble/jquery-ui-daterangepicker.git
bower resolve       git://github.com/tamble/jquery-ui-daterangepicker.git#*
bower download      https://github.com/tamble/jquery-ui-daterangepicker/archive/0.4.3.tar.gz
bower extract       jquery-ui-daterangepicker#* archive.tar.gz
bower invalid-meta  jquery-ui-daterangepicker is missing "main" entry in bower.json
bower invalid-meta  jquery-ui-daterangepicker is missing "ignore" entry in bower.json
bower resolved      git://github.com/tamble/jquery-ui-daterangepicker.git#0.4.3
? Registering a package will make it installable via the registry (https://bower.herokuapp.com), continue? Yesn) Y
bower register      git://github.com/tamble/jquery-ui-daterangepicker.git

Package jquery-ui-daterangepicker registered successfully!
All valid semver tags on git://github.com/tamble/jquery-ui-daterangepicker.git will be available as versions.
To publish a new version, just release a valid semver tag.

Run bower info jquery-ui-daterangepicker to list the available versions.

Closing issue

holtkamp commented 9 years ago

@ghola can you tag a new version so the bower.json is picked up correctly?

ghola commented 9 years ago

I did tag the latest commit of the project with 0.4.3 (after i merged it to master).

holtkamp commented 9 years ago

mm, yeah, but now bower.json seems to be available in the generated release archive due to:

https://github.com/tamble/jquery-ui-daterangepicker/commit/983d3a89b87550433e10fecacaa7c73daf4b9bcc

This archive scanned for a bower.json file.

Another thing I just saq is that we do not refer to the minified javascript in the bower.json file...

ghola commented 9 years ago

bower.json is not present in that archive nor in that commit. In fact all releases are stripped to the js and css files. Do you mean that it needs to be present in the release archives?

holtkamp commented 9 years ago

Indeed, the bower.json should be part of the tagged version. Also see this article and this example

ghola commented 9 years ago

I included bower.json into the 0.4.3 tag (forced pushed it). Let me know if that fixes it.

As for the minified file, it seems that bower does not recommend including it. See here https://github.com/bower/bower.json-spec#main , search for "Do not include minified files.". Looking at other threads about minified files and bower, it seems that the consensus is that minified files should be produced by a build tool like grunt and the like. Bower is not a build tool.

Same approach seems to be used by other popular JS components like https://github.com/select2/select2 .