How to register a bower package
3rd February 2014 | by Adam Beres-Deak | bower, javascript
A few weeks ago I posted about my PubSub module. Since then I registered it as a bower package. It was actually my first bower package. I am going to show you how easy it was.
Installing bower is as simple as typing npm install -g bower
. If you don't know bower, here is what the docs say about it:
Bower is a package manager for the web. It offers a generic, unopinionated solution to the problem of front-end package management, while exposing the package dependency model via an API that can be consumed by a more opinionated build stack. There are no system wide dependencies, no dependencies are shared between different apps, and the dependency tree is flat.
Requirements for a bower package:
- The package sources should be hosted in a git repository
- Each package has to have a JSON manifest
- Using semver git tags
Registration steps
- Generate a JSON manifest with
bower init
. During the process we have to answer some questions. - Check the generated
bower.json
file and fill in the missing parts if needed (e.g. dependecies, keywords, author, etc.) - Commit the json file and set a semver tag with
git tag -a v1.0.0 -m 'my version 1.0.0'
- Register your package with calling
bower register packageName git://packageRepository-url
- When everything goes fine, the package should be registered now
At the end of the process everybody should be able to install your package with bower install packageName
. For a more detailed example you can take a look at my PubSub package.
Latest blog posts
Displaying icons with custom elements 14th October 2015
Plain JavaScript event delegation 26th January 2015
After the first year of blogging - what happened on my blog in 2014? 1st January 2015
Better webfont loading with using localStorage and providing WOFF2 support 18th December 2014