I’ve recently started playing with AngularJS. Coming from the Rails world I expected a structure enforced by the framework, good default configuration and separation into development, test and production environments.

It seems that the way to start a new project suggested by the creators of AngularJS is to clone angular-seed project. While this seed project worked for me during development and testing, I was a bit lost when it came to deploying to production.

The README is quite vague here and the same can be said about the comment in index.html

Should I change this one line each time I make a deployment, then copy the files to my server and finally undo the change? Next thing – there is nothing said about minification in the README. As a fresh AngularJS developer I was quite disappointed that I wasn’t able to have my app up and running quickly.

Lineman.js enters the stage

And there I stumbled upon Lineman.js. At first I thought – “yet another tool sprung in the complex world of JavaScript”. But then I decided to give it a try.

Lineman.js provides a good structure for your client-side application and is opinionated about how you should run your commands. This means that Lineman.js makes a couple of decisions for me, which I won’t be able to make as a developer learning AngularJS.

Lineman.js takes care about development and testing stages, but does not forget about pushing code to production. It knows that you want your code to be concatenated and minified in production.

You can start with lineman-angular-template, which gives you some nice defaults such as:

grunt-ngmin config, so you can write:

1 2 3 4 angular . module ( 'app' ). controller ( 'ArtistController' , function ( $scope , $routeParams ) { ... });

instead of:

1 2 3 4 angular . module ( 'app' ). controller ( 'ArtistController' , [ '$scope' , '$routeParams' , function ( $scope , $routeParams ) { ... }]);

and your code will still be minified correctly

sourcemaps

template precompilation with grunt-angular-templates so you can avoid making AJAX request for each template

unit tests with Jasmine and testem, re-run after each file change

end-to-end tests with Protractor

effortless deployment to Heroku with custom Heroku Buildpack

Conclusion

Lineman.js is very easy to learn – start from its homepage. You can check my AngularJS toy project – classky which I built with Lineman.js. Everything worked out of the box and I cannot see any negative sides of using this tool. Recommended!