Bowers .bower.json file version property - bower

bower.json has a property named version. Bower uses tags to manage versions. I'm wondering what is this property uses for then? Does it have to match the committed tag? If not can it cause issues? Is this another way of managing versions? does bower follow this in any way?

Bower currently ignores version from bower.json.
If the version in bower.json doesn't match git tag, you get a warning, and the version entry in generated .bower.json is fixed (version in bower.json stays the same).
Among others that's why bower plugins should consume.bower.json instead bower.json.
You can safely remove version from your bower.json. Bower only respects git tags.
Most probably it won't be used even in the future.

You're correct that bower simply uses the git tags available at the git endpoint submitted during bower register. Most of the info in bower.json is currently mainly used for the package's own record keeping, and isn't kept by the bower registry.
The bower team plans to take advantage of the valuable info in bower.json in the future (discussed here).

Related

How to install a cordova plugin from a GitHub pull request?

iOS does not display a decimal point on the numeric keyboard in cordova apps. The workaround is to install the cordova-plugin-decimal-keyboard plugin. Trouble is, this plugin does not work with the improved UI engine WKWebView.
EricD kindly contributed a fix but the pull request has not yet been merged. So, is it possible to install the plugin from the pull request and if so, what is the command?
The easiest way, as the creator of the PR did his work on his fork master branch is to install the plugin from the fork using the github url
cordova plugin add https://github.com/ericdesa/cordova-plugin-decimal-keyboard
Although #jcesarmobile's answer is correct, that particular plugin could not be installed this way because it was missing a package.json
I therefore forked the project, tweaked the docs and published the renamed package to npm cordova-plugin-decimal-keyboard-wkwebview

Unregister Bower Package that uses BitBucket

So I registered a package with Bower, sugar-mixins and I was using BitBucket as my repo. It seems that was a bad idea. When I run bower unregister sugar-mixins it cannot remove it from the Bower registry since its not a GitHub hosted library.
Any thoughts on how I can remove this?
Opening an issue on https://github.com/bower/registry allows for packages to be removed.

How to author a bower package?

We have created successfully a bower package and it is working great with Subversion and private-bower.
The issue I am facing now, is that we need also the generated files to be commited into (Subversion or Git) to work properly for
bower install
or
bower update
Now every build creates a conflict in the local copy of the repository.
My question is, can I tell bower to do a post install or post update command to execute a build?
In my case it should run a grunt task to build the files locally.
Just wondering if bower is not capable of doing such steps to avoid conflicts on the git/svn repository?
Or what is the suggested way to avoid merge conflicts?
There are postinstall hooks in bower https://github.com/bower/bower/blob/master/HOOKS.md but you can't rely on it as a package provider (they're designed to be used by the developpers who install your package)
For your situation, teams that provide bower packages that require a build step have two main workflows:
The repo tied to the bower registry is the source repo. Sources & build files are in it (like bootstrap). So when you bower install, you retrieve the whole repo with all the sources, build routines, etc ... which can be quite big. That's your case currently.
The repo tied to the bower registry and the repo holding the sources are two different repos (like angular):
Your build directory is in fact the repo tied to bower
Each time you make a new release, you build and then commit from that repo.
If you're having versionning problems, maybe you should switch to the second workflow (which will also let you clean all the unecessary files like build routines).

How to list all older versions of Grails plugins?

The Grails Plugins site only seems to list the latest versions of all the Grails plugins. But what if I wanted to see a list of other available (older) versions for each plugin? Is there a Grails SDK command/target I can issue to see old plugins?
I ask because I'm using a plugin whose current latest release is broke and its version is "2.0-RC2". Since it's a release candidate, I'd like to know what the last stable (non-RC) version is.
You can see the plugins at the main repo site here. The site is referenced via grailsCentral() in the BuildConfig.groovy file which in turn references the repo site in the org.codehaus.groovy.grails.resolve.maven.aether.config.RepositoriesConfiguration.groovy file
There is no such command to see old plugins.
If you are referring to Spring Security Core plugin then corresponding github repository has two branches:
master referring to 2.0-RC2 and 1.x referring to the last stable release 1.2.7.3.
On a side note, if you want to see all installed plugins with their versions then below command can be issued:
grails list-plugins --installed

Can I manage bower versioning via git tags only?

I can specify version in bower.json, but it's quite daunting and I often forget to update it in my packages and need to do a 2nd commit.
Is it possible for Bower to read git tags and read versions purely from that? (much like Composer does for PHP). I couldn't find any information whether the version property in bower.json is required or not.
The version property is not required and Bower will happily read your git tags if they're valid semver.

Resources