Texas outline

February 2020

Quick Bootstrapping with Yeoman

When I started at my last-but-one job, my very first task was to take a whole bunch of internal coding “best practice” formalisms and find a way to gently enforce them on new projects. For my first pass at this I set up a couple of git repositories: one frontend, one backend. Whenever you started a new project, the rule was that you started off by forking from the relevant “standard” repo. This…worked, but that tedious rename-and-update-everything step never really sat right with me, or the rest of my team.

A couple of years later we came across Yeoman, a general-purpose tool for scaffolding new projects. It made our cumbersome git repos look amazingly cumbersome by comparison — and just a few months after I refactored our standard repositories into Yeoman generators, we were getting serious results. People were experimenting with new projects, structuring code in a sane way instead of cutting corners and just sticking it in some place that already worked. We started moving faster, and — true miracle — we noticed a few months later that we weren’t getting bogged down in anything like as much technical debt as before.

Ever since then, I’ve tried to maintain a similar set of standard generators for myself. At the moment, my preferred tech stack for personal projects is deeply boring: Java+Dropwizard on the backend, and Typescript+React on the frontend. Pretty much any new project I start, or new idea I want to play around with, starts with either:

yo dropwizard-gradle

…for a backend service that’s turnkey-deployable, or:

yo tfountain-webstack

…for a bare-bones single-page web app that’s ready for hacking. If either of those sound like your cup of (instant) tea, you can grab respective Yeoman generators from doches/generator-dropwizard-gradle and doches/generator-tfountain-webstack, or just install ‘em with yarn global add generator-dropwizard-gradle generator-tfountain-webstack.

But what I’d really suggest you do is look at ‘em as meta-templates, and maintain your own personal generator. Just the act of keeping these two up to date has forced me to stay on top of upgrades, changing trends, and new technologies that I might have missed otherwise. And those changes get more-or-less automatically rolled into everything I do over time.

Also, Yeoman’s just a dude.

    |       |    ╭──────────────────────────╮
    |--(o)--|    │        Welcome to        │
   `---------´   │    tfountain-webstack    │
    ( _´U`_ )    ╰──────────────────────────╯
    /___A___\   /
     |  ~  |     
 ´   `  |° ´ Y `