Reflections on a shotgun wedding
I am a “web guy”. I tend to refer to myself as a “Web developer”, not a programmer, or a software engineer. I like making web apps.
Over the last year this has extended to making cordova apps for touch devices. This has entailed dabbling in some native code for plugin wiring, but essentially I’m still a web guy at heart. Javascript is my bread and butter, and I’m just fine with that.
Exploring Metalsmith
Update - 10th June 14: I’ve extracted the JSON parsing features from the following code into a metalsmith plugin, metalsmith-json, whcih is now available on github and npm
A few weeks ago, I read about Metalsmith, a neat looking static site generator. More recently I was looking at ways of improving an internal static site we maintain as a gateway to download and install mobile artifacts. It seemed like a good opportunity to play with Metalsmith and I’d like to talk through my experience.
Inlining grunt tasks
Grunt config files can easily become very verbose and disparate with related tasks scattered far apart. Without careful organisation and maintenance they can become quite unwieldy. In this post I’ll discuss some of the ways I’ve been experimenting with to make gruntfiles terser and keep related components together. I’ll introduce the grunt-inline-task-sugar plugin which I created to implement some of the ideas discussed.
Anatomy of the alias task The grunt ‘alias’ task type is probably familiar to you:
Adding a directed task graph to grunt
Last year we migrated our build system for a multi platform cordova app to Grunt from ant. It was great. Well, actually it was just quite good. See, whilst I’m really not a fan of ant, the ant task graph is nice. It upsets me that I can’t express branching task dependencies in Grunt.
####The problem
In this case we wanted to do a bunch of common setup once then do n platform specific steps for n platforms.