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
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
I am trying to move from Bower to NPM.
While I was using Bower, it was easy to configure the .bowerrc file and have the downloaded libraries in a directory such as wwwroot/lib
Now, I am developing a ASP.Net Core MVC app and trying to use NPM as my default package manager. By using Command Line in Visual Studio 2017, NPM creates package.json file and download libraries to node_modules folder. Then, what is next? How can I get JS or CSS files like I used to have in wwwroot/lib director?
Ok, so heres' the thing.
NPM: Node JS package manager, helps you to manage all the libraries your software relays on. You would define your needs in a file called package.json and run npm install in the command line... BANG your packages are downloaded and are ready to use. Could be used both for front-end and back-end.
resource: https://www.quora.com/What-are-the-differences-between-NPM-Bower-Grunt-Gulp-Webpack-Browserify-Slush-Yeoman-and-Express
Now, here's where NPM stops and his dear friend Gulp takes over. I can't type all of it, but to have your css and js files in a folder (and do whatever you want with them) you'll have to use an automation tool (I personally use Gulp but there's a bunch of them out there).
It's easy to set up and the documentation is here:
https://gulpjs.com/
Gulp will basically be responsible of how and where your css files get compiled. It will base its requests for packages in the node_modules folder. So you're good to go. Configure gulp and you should be on your way.
There's also webpack. Never used it, but it seems to be the future of automation:
https://webpack.js.org/
I'd suggest using webpack.
I've created an open source javascript plugin. It is located on github public repository. When I want to release new version, I'm doing it with github features. My plugin is also indexed in bower repository. How to inform bower, that I have released new version of plugin?
You can update any bower dependency using the "update" command. See below:
bower update <name>
Where is the name of your bower package/dependency.
However, this is assuming that the semvar range provided in the bower.json configuration file allows the installation of the new (versioned) plugin.
As it is authored by you, I doubt very much it would be an issue.
If the above command doesn't work, you can always un-install it and reinstall it as follows:
bower uninstall <name>
bower install <name> --save-dev //or --save, this depends on how you installed it earlier.
I'm using yeoman and it's a great tool. It uses bower for managing dependencies and it assumes you would have all dependencies listed in bower file and then install it in bower_components folder and link them from the your html. But I didn't find any info about the case when some of project dependencies(js or css) are not under bower (for example, it could be some commercial libraries, purchased by developer and not available in open source). How should I manage this case? Let's assume general yeoman webapp template. Where should I store js and css from the libraries which are not under bower?
If the dependency you want to add to your project is not managed by Bower, then it should be separate from your "bower_components" dir. That directory should only have things that Bower controls: i.e., things installed with this command:
bower install
You should create a "lib" dir that has third party components that you install and update manually.
app/
├--bower_components/
│ └--angular/
└--src/
└--css/
└--js/
└--lib/
├--manual_dependency/
└--other_dependency/
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)