Date post: | 02-Dec-2014 |
Category: |
Documents |
Upload: | jaroslav-kubicek |
View: | 558 times |
Download: | 4 times |
Bowera package manager by Twitter
Bower - introduction
● why another tool?● common commands● installing packages● bower.json● building custom scripts● sources
Developing frontend now
Common workflow:1. Go to jquery.com2. Download jQuery3. Find fancy plugin4. Donwload it5. Link scripts to page6. Hoping for a miracle
... but I broke something, WTF?
Common problems
● changing jQuery version to newer one, but old code doesn't work with it - jQuery do not change mayor version when bc breaks occur.
● Plugin may require specific version, but they don't write that in docs or I didn't read it.
Standard view
My view
It is not about language, it is about programmers.
Bower
● by Twitter● dependency manager for frontend● installing via npm● version control
Bower - basic commands
> bower help
bower installbower updatebower searchbower uninstallbower list
Bower - package installing
> bower install jquery
> bower install modernizr#2.6.1
> bower install jquery/jquery-ui
> bower install ~/myCustomLib
> bower install http://example.com/lib.zip
Bower - common sources
● github
● http://sindresorhus.com/bower-components/
bower.json{
"name": "my-project",
"version": "1.0.0",
"main": "path/to/main.css",
"ignore": [
"**/*.txt"
],
"dependencies": { ... }
}
Bower - saving dependencies
> bower install jquery/jquery#1.9.1 --save
{ "name": "js_lab", "version": "0.0.0", "dependencies": { "jquery": "1.9.1" }}
Bower - .bowerrc{
"directory": "bower_components",
"endpoint": "https://bower.mycompany.com",
"json": "bower.json",
"searchpath": [
"https://bower.herokuapp.com"
],
"shorthand_resolver": "git://example.com/{{{
organization }}}/{{{ package }}}.git"
}
Bower - sources
● http://bower.io/● https://github.com/bower/bower