Yeoman – Level-up Your Daily Workflow

by Tools

Hey there…

This post is 1895 days old. It was written on 14.09.2012. Please make sure to be careful with the information provided and check a more recent source on this topic.

After Yeoman was announced in the end of June while it was still in private beta developers were looking forward to use it soon. It was introduced as a tool that helps developers building web-apps while not having to care too much about the general boilerplate-coding to build a solid base for every project and to help performing tasks to bring your project into production.

Now that Yeoman is available for everyone as Open Source the question how to use it in daily projects arises. I’ll try to give you a short overview on what you can expect from it and what will be helpful. If you haven’t had a look at it this article might help you.

To check out how you can install Yeoman, please refer to the Yeoman-homepage, you will find detailed information there. You will also find more information on how to use Yeoman’s features. You might want to check out this article on one of the Adobe blogs. Also Nettuts+ has an article with deep information on how to use Yeoman.
By default Yeoman supports Linux and OSX, but you can also find a way of installing it on Windows.


Paul Irish introduces Yeoman at Google I/O 2012.

Reduce Time Doing Repetitive Tasks

On the project’s homepage you can find some features they are praising. Let’s get a short overview on what Yeoman may help you with:

There are some things that steal your time when you work on a project. Yeoman is here to help you reduce the time you spent on these to focus more on the actual process of writing clean and lightweight code.


Addy Osmani explains the main features of Yeoman.

Starting Projects & Maintaining Them

Starting a project and maintaining it requires some time. You need to manage compiling your CoffeeScript and SASS styles if you use it. Yeoman does this for you. When it’s done it reloads your project-page automatically using its LiveReload functionality – you are used to this from LiveReload or CodeKit apps.
It also lints your JavaScript and ensures that you write straightforward code. Writing code like this requires that you have some proper tests that guarantee that your code is working correctly. Yeoman includes Mocha so you can write unit tests by default and runs your tests on the fly in a headless browser so you can be sure everything runs smoothly. (Yeoman let’s you use Jasmine out of the box too, you just need to set a flag while initializing.)

All that sounds good but you need to start your project somehow. For me building a basis means taking init and extending it to my needs – manually. Manually adding libraries, maintaining their versions. Manually adding styles like these of Twitter Bootstrap.
With Yeoman you get an initial process to lay out your projects by your needs. Apart from that you can pull in plugins and scripts by just running a single command.

When dealing with client-side MV*-frameworks such as Backbone.js or Ember.js you need to create a bunch of files such as models or views from time to time. By using Yeoman generating these can be done automatically and reduces the time you spend writing boilerplate code.

While developing Grunt is there for all my needs to lint my JavaScript, compile SASS and provide a node-based server. These tasks can all be done by Yeoman which is based on Grunt too.

The work I have to do over and over again is something I want to avoid. In fact that’s why I created init. But init may not fit the need of another developer. Kahlil for instance has jumpstart which is pretty similar to init but with some other defaults.
Exactly this point is where Google tries to help out with Yeoman.

Roll Out Apps

When putting the project to production you don’t want your live website to be affected by mistakes you made while developing. That’s what you got tests for. You run them just before you roll out a new feature. Save the time while doing this automated with Yeoman.

On the web you read a lot about performance of an app, especially slow connections on for example mobile devices with slower processors require that you serve the smallest amount of scripts and stylesheets, optimized sources and minified code. But do you really want to think about all this every time you want to deploy your project? Yeoman integrates minifying scripts and stylesheets, optimizing your images insanely and putting it all together in a package for you to deploy. Just run a command and you are all good.
Apart from that you don’t need to worry about your app not being available offline: Yeoman generates an application cache manifest for you.

“I Use Other Tools. Yeoman Can’t Help Me!”

The good thing is that you can extend Yeoman to your needs. If you are using LESS instead of SASS just pull it in. As Yeoman builds upon Grunt you are all free to change the tools Yeoman builds uses. With Yeoman Generators it’s easily possible you extend Yeoman’ initialization process with your needs.
Yeoman has some solid defaults but you are not chained to them.

Save Your Time, Automate

All the above mentioned doesn’t keep you from writing the code for your app. But isn’t this the part where you want to focus mostly on?

When working on a team it is essential to have a solid process of checking the maintainability and code standards, if everyone’s code is working and automated unit testing. Yeoman is a great Open Source project by people who know how to deal with the problems that you may run into and tackles exactly these points.
To ensure you are doing it right and save time doing things over and over again, try using Yeoman, it will help.


Matthias Mees

So I don’t usually build web apps but merely, well, web sites. Some of them might be plain old static HTML, some might use a CMS after building a static prototype first. But I don’t use much of all that fancy web app stuff, i.e. Bootstrap, require.js or Backbone.

Basically, what I need in most of my projects is H5BP, Sass/Compass and jQuery plus maybe some jQuery plugins. I am, however, quite used to using a build tool for optimization before deployment, and I’m a bit tired of the ant-based H5BP build script.

Given this setting, would you still recommend using Yeoman or is it “too much” for that?

I guess I could just install it and check it out, I mean, it does install everything via homebrew, so it should be pretty easy to uninstall all the stuff I don’t need if I choose not to use it after all, right?


Jose Santos

Hello, how well does yeoman work with php and CMS like WordPress ? Does it have unit testing for php etc ?


Hans Christian

Yeoman does not support PHP unit-tests, it’s pretty front-end focused. To be fair I haven’t tested in how far it plays well with WordPress themes or something similar but I think due to its usage of Grunt, it should work well.


Per Quested Aronsson

Hello,

Can I use Yeoman for building any Javascript project? I mean JS apps not created with Yeoman, and not containing any standard libraries, such as Backbone, Jquery, Modernizr, etc. Or is Grunt a better choice for that purpose?


Leave a Comment

Remember what your mother told you: Be friendly. Your email address will not be published.
Markdown-Goodies available.