Bower - Get only files needed (not entire Repo) - bower

I am trying to use Bower to install jquery.
The frustrating problem I have been running into is that bower downloads the entire repro. I was hoping to tell bower to install a certain version of jquery and have only those files downloaded.
I did try the suggestion here with no luck. The entire repo is still downloaded even after clearing the bower cache
I would rather have something else manage which files to download than me manually specifying the file names in bower.json
bower.json in the repo : https://github.com/jquery/jquery/blob/master/bower.json
Thank you

I think you didn't unterstand the meening of bower:
Bower is handling you dependencys, so if you do a:
bower install jquery
it should download all files.
Now to you question:
you have following options:
declare wich file you want to download:
bower install http://code.jquery.com/jquery-2.1.0.min.js
but remember:
this file cant be updated easily
search for a js only package:
expample with bootstrap:
bower install bootstrap-css-only
but remember:
these packages sometimes are not up to date
use bower-installer (recommended):
install the bower-installer:
npm install bower-installer --global
and now follow the tutorial:
bower-installer github
sorry for my bad english :-)

Related

Bower - Change directory name when package is installed

When I install the following package from this git url, it creates a directory /flyLabel.js
bower install https://github.com/space150/flyLabel.js.git
The fact the directory has a dot in its name is causing issues elsewhere when I am trying to include it.
Question
Is there a way to change the name of the directory Bower is going to create when it installs the package?

How to make JSPM install Bower dependencies

For a while now, my client has been using some Node and Bower components to build projects. Whenever a new developer comes in, it's easy for that person to simply run
npm install
bower install
And then be ready to work.
We are working on a new project and this time we want to use JSPM instead of Bower. However, we want to leverage our existing private libraries (20+ of them) and we don't want to spend stupid amounts of time rewriting them. Plus they still need to work as regular Bower components for other projects.
So far, this worked. We used jspm-git to set the registry. However, JSPM fails in one regards: it does not install the Bower dependencies of those libraries it installed.
How would we go about that? I would love the other devs in the team to be able to check out the project and run
npm install
jspm install
And be on their way. It doesn't seem possible so far. Any set up we have forgotten? Any guidance will be greatly appreciated.
You need the jspm bower endpoint:
npm install jspm-bower-endpoint --save-dev
Then you need to register the bower endpoint with jspm:
jspm registry create bower jspm-bower-endpoint
Then you can install bower packages:
jspm install bower:angular-bootstrap-multiselect
Hope this helps :)
Just installed it successfully with jspm install npm:bootswatch, then required it in code with <require from="bootswatch/slate/bootstrap.min.css"></require>
Also posted this info on the bootswatch-dist project on github here: https://github.com/dbtek/bootswatch-dist/issues/32

Why does bower install github/repo not clone my bower.json?

When I install a library from a git repo via:
bower install git#github.com:fabiantheblind/p5.js.git --save
the component gets cloned into my bower_components but there is no bower.json in the folder. Just a .bower.json.
Why is that so and how can I fix this?
I also get the output:
bower invalid-meta p5.js is missing "main" entry in bower.json
bower invalid-meta p5.js is missing "ignore" entry in bower.json
But the entries are there.
(The final aim is to use grunt-wiredep to install dependencies automagically. See my open issue here )
Okay. After fiddeling a bit more I got the answer:
My clone of the repo had the bower.json but I did not create a tag for it. So bower was still looking at the latest tag 0.3.6 where no bower.json was present.
By creating the tag 0.3.7 the problem is solved.

Is ReactJs on bower?

I'm very interested in some of the concepts in ReactJs and would like to play around with it. I'm trying to start a project to play around with it but I've been looking all over and I can't seem to find it on bower. But then again bower search kind of sucks...
Is it on there and I'm just not seeing it? If is there something about it that makes it not a good fit for the bower model? I would expect that both projects are popular enough they would work together.
I'm not sure on the particulars of bower, but we have this repository:
https://github.com/reactjs/react-bower
which should be available as bower install react.
$ bower lookup react
react git://github.com/facebook/react-bower.git
$
To bower installation, you need to install to Git Shell, using command promt of it, your project have got a bower file. When you installed them, you should be follow the command below:
> cd d:/yourappfolder/
> bower install

How can I tell bower where to install packages?

I'm figuring out how to install packages using bower.
When I 'bower install packagename', packages are installed in /app/components/.
However, I'd like to dictate the structure of my projects myself.
Is there a way to configure bower to install packages in particular places?
Bower can be configured using JSON in a .bowerrc file.
The directory setting is the path in which installed components should be saved.
If not specified it will be install in the default path.
So for example :
{
"directory" : "package/components",
"json" : "bower.json"
}
Here we tell bower to install packages in the subfolder package/components, and use a file named bower.json to store its data.

Resources