Lineman.jsMarch 15th, 2014
Lineman is a thin wrapper around tools like Grunt and Test’em to take away the initial configuration burden from developers and let them focus on what they love most: building great apps.
The difference with Yeoman (a competing tool) is that Lineman is not based on code generation. Where Yeoman generates your initial project with a full Grunt configuration and example code (which you don’t need) and some other stuff, Lineman installs itself as your Grunt configuration. The benefit of this is that you can update your tools without breaking the configuration (or manually updating it).
With Lineman all you need to do to start building a new app is tell it to create one.
That’s it. It provides much like a walking skeleton for your application that you can run and test. Immediately you can enter your regular build cycle of changing code and have it automatically built and tested each time you save a file. If that’s not all, it’s blazingly fast. One of the goals the creators of Lineman set is for each incremental build and test run to take no more than a few hundred millis, independent of the size of the codebase. Now if that doesn’t stimulate TDD I don’t know what will.
To start the build cycle all you need to do is to fire up
lineman run in one shell and
lineman spec in another.
Both of these watch your sources so your app is build and tested whenever you save a change. You need to keep both running because
lineman run compiles your sources and
lineman spec watches the built files for running your specs. It took me a little help to find this out (much thanks to Justin for helping out).
So what about framework support? Lineman creates a vanilla flavored app. This is the walking skeleton, but includes nothing like the framework support you can get from Yeoman.
Personally this is the way I prefer to start an app. Any libraries and frameworks I need I will include myself. Not only gives this full control to what vendor libs I actually use, it also gives me full control to when I want to use them and gives me the opportunity to defer their inclusion if I don’t need them (yet).
If you like to have some popular framework already included that’s okay, Lineman offers that too. All you need to do is to clone one of the Lineman template projects from Github and you’ll get a walking skeleton app with that framework. At the moment templates are provided for Backbone, Ember, and Angular, for building a library or a blog.
At this point I just want to start building things. The lineman website covers a lot of the configuration that’s possible.
Next to build and test configuration one of the first things I need in most apps is to be able to run end-to-end tests. I suspect Lineman can help me out with this too.
I hope I’ll keep enjoying Lineman as much as I do in the first few hours of using it.