I'm making a Bower package like Bootstrap but for my own projects. My Bower package is using some other Bower packages, so, I'd like to know how to register a Bower package using other bower packages ?
Anthony
I guess you should read the bower.json file specification, and express your dependencies there.
Related
While the Visual Studio and Visual Studio Code MVC templates comes with some client packages such as jQuery, jQueryValidation, bootstrap etc. the bower.json and .bowerrc files are completely missing, so when I go into the VS bower package manager I don't see the already installed packages which is quite annoying.
The thing is this started happening to me 2 weeks ago( around the time I tried npm package manager and did a VS Code update), how can I re-enable bower appearing with the MVC template?
This might be related to bower being deprecated. Those libraries in the template are no longer managed by bower thus they don't show in the manager. If you manually add the bower.json and .bowerrrc files you might be able to continue using bower for js library dependency management. First delete the local copies of the js files that were not added by bower, then re-add them using bower.
However, bower recommends using yarn for js library dependency management. For the client packages jquery, jquery-validation, and bootstrap you could use yarn, npm, or local copies. But for large common libraries like jquery you may want to include from Google's CDN https://developers.google.com/speed/libraries/#jquery
Is there a way to install tweenmax using bower?
I've been looking into angular animations and I noticed the egghead tutorial uses tweenmax but it imports it directly into the html. I want to use bower to import so that I can have my imported packages all managed take advantage of the gulp build process to create the minified vendor script.
It seems that they name tweenmax as GSAP. Correct me if I'm mistaken but I believe this is the same thing esp looking at the main section of the bower file (git repo) which points to tweenmax. Thus, I installed using:
bower install gsap --save
Is it possible to get a list of package dependencies (as produced by bower list) before installing the packages?
bower install does not complete successfulfy in my project as some package has a dependency to a non existing package version, therefore I would like to be able to quickly find that package that has this incorrect dependency instead of having to inspect bower.json of every package.
You could try bower-dependency-tree. npm install -g bower-dependency-tree && bower-dependency-tree name_of_the_package_you_are_interested_in should do it.
disclosure: I am the maintainer of the project.
Which bower package should I use for my project polymer or polymer-polymer?
I see that the polymer package is a shim around the polymer-polymer project.
The version lags behind quite heavily for polymer.
Polymer team has not officially registered any packages with Bower registry. Instead, for now, we rely on using GitHub-based package notation.
For Polymer itself, this would be Polymer/polymer, e.g:
bower install Polymer/polymer
Fwiw, if you install any Polymer element via Bower, polymer and platform are installed automatically as well. E.g.
bower install Polymer/core-toolbar
I'd like to use bower in install packages. I'd also like to have the packages in specific places. In particular, I'd like my javascript in '/js'.
You can set a custom directory for where you would like bower to install all the listed dependencies in the bower.json file. Here's a quick from bower's documentation of .bowerrc:
Custom install directory
A custom install location can be set in a .bowerrc file using the
directory property. The .bowerrc file should be a sibling of your
project's bower.json.
{
"directory": "public/bower_components"
}
One of the benefits of Bower is how simple it is. One of the main downfalls of Bower is how simple it is. I do not believe that bower supports setting custom install locations for each dependency. You may have to rely on another tool to do that.
Here's a similar Stack Overflow question about install bower dependencies to different folders. While bower itself is not able to do what you ask, there are a number of tools that add such functionality:
npm bower installer (using npm)
grunt bower task (using
grunt)
grunt bower organizer (using grunt)