Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a dependency to my Yeoman project when there is no generator

Tags:

yeoman

What steps do I need to do in order to add a new dependency library to my Yeoman project. For example, what if I wanted to add Sammy.js or AngularUI. I don't see a generator for either of those so I would have to manually add them. But what other files do I need to edit so the project builds and runs correctly?

Below are some of the generators I searched for

npm search yeoman-generator | grep sammy
npm search yeoman-generator | grep angular-ui
npm search yeoman-generator | grep angularui
like image 309
BeeZee Avatar asked May 21 '13 15:05

BeeZee


People also ask

How do I download Yeoman generator?

You can install Yeoman generators using the npm command and there are over 3500+ generators now available, many of which have been written by the open-source community. This will start to install the Node packages required for the generator.


1 Answers

You want to install things like Angular UI using Bower which is part of the Yeoman workflow along with Grunt.

Both of those packages do exist in the Bower registry:

$ bower search sammy
Search results:

    sammy git://github.com/quirkey/sammy.git
$ bower search angular-ui
Search results:

    angular-ui git://github.com/angular-ui/angular-ui.git
    angular-ui-bootstrap-bower git://github.com/angular-ui/bootstrap-bower
    angular-ui-bootstrap git://github.com/angular-ui/bootstrap.git
    angular-ui-router git://github.com/angular-ui/ui-router
    angular-ui-utils git://github.com/angular-ui/ui-utils.git
    angular-ui-select2 git://github.com/angular-ui/ui-select2.git
    angular-ui-date git://github.com/angular-ui/ui-date.git
    angular-ui-calendar git://github.com/angular-ui/ui-calendar.git
    angular-ui-codemirror git://github.com/angular-ui/ui-codemirror.git
    angular-ui-ace git://github.com/angular-ui/ui-ace.git
    angular-ui-multi-sortable git://github.com/mostr/angular-ui-multi-sortable.git
    angular-ui-map git://github.com/angular-ui/ui-map.git

There's actually a quick example on the 'Getting Started' page linked above, on using Yeoman, Bower and Grunt to scaffold out an Angular project using AngularUI. Including it here for convenience:

yo angular
bower install angular-ui
# then add <script src="components/angular-ui/build/angular-ui.js"></script>
# and <link rel="stylesheet" href="components/angular-ui/build/angular-ui.css"/>
grunt
like image 153
natchiketa Avatar answered Oct 11 '22 16:10

natchiketa