Yeoman generator for Infusion projects

Harnum, Alan aharnum at ocadu.ca
Tue Aug 1 14:15:41 UTC 2017


Hi Tony,

I'm still learning about how Yeoman does things, but I think these two pieces are relevant to your question:

Composability (http://yeoman.io/authoring/composability.html) allows generators to run other generators. So we could conceive of a structure like the following:
- generator-infusion
-generator-infusion-client
-generator-infusion-node
-generator-infusion-kettle

Sub-generators lets you have additional generators under one generator, to let you run commands like "yo infusion:client" and scaffold a client-side component or similar, a la "rails generate". It feels like Yeoman is de-emphasizing these features since its recent rewrite and encouraging a focus on composability / inheritance.

AFAICT a "generator" is simply the Yeoman convention for packaging a set of template files and instructions for rendering them after taking input from the user, along with other actions like running npm install, etc. They don't conflict with each other unless they write files with the same name to the same location or similar, so it's perfectly safe to run multiple generators in the same directory when scaffolding – I believe this is expected usage to enable the generation of boilerplate files based on input (instead of the cruder, slower "code generation" of copying and pasting files / file contents).

I'll have a go at separating the current work into a "core" and a "client" generator to see how that goes, and will be in a better position to discuss composability / inheritance then.

From: Tony Atkins <tony at raisingthefloor.org<mailto:tony at raisingthefloor.org>>
Date: Tuesday, August 1, 2017 at 3:51 AM
To: Alan Harnum <aharnum at ocadu.ca<mailto:aharnum at ocadu.ca>>
Cc: Fluid Work <fluid-work at fluidproject.org<mailto:fluid-work at fluidproject.org>>
Subject: Re: Yeoman generator for Infusion projects

Hi, Alan.

Fantastic effort, thanks for getting this started.  Can you talk for a bit about template inheritance, i.e. whether we can create a "core" template and then overlay a "client" and "node" template on that?  I'm really interested in helping create the "node" template, just want to get a rough idea of how we might do that without duplicating bits of boilerplate unnecessarily.

Cheers,


Tony

On Mon, Jul 31, 2017 at 3:51 PM, Harnum, Alan <aharnum at ocadu.ca<mailto:aharnum at ocadu.ca>> wrote:
Shared for possible interest to the community, an initial stab at an Infusion scaffolding generator for Yeoman (http://yeoman.io/): https://github.com/waharnum/generator-infusion

I rolled this after realizing how many steps I had to get a full proper setup for developing a new project (linter configuration, initial file structure, etc). Right now this is purely front end - if there is community interest I can continue to put occasional development time into this as I have spare cycles.

ALAN HARNUM
SENIOR INCLUSIVE DEVELOPER
INCLUSIVE DESIGN RESEARCH CENTRE, OCAD UNIVERSITY

E aharnum at ocadu.ca<mailto://aharnum@ocadu.ca>

OCAD UNIVERSITY
100 McCaul Street, Toronto, Canada, M5T 1W1
www.ocadu.ca<http://ocadu.ca/>

_______________________________________________________
fluid-work mailing list - fluid-work at lists.idrc.ocad.ca<mailto:fluid-work at lists.idrc.ocad.ca>
To unsubscribe, change settings or access archives,
see http://lists.idrc.ocad.ca/mailman/listinfo/fluid-work

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idrc.ocad.ca/pipermail/fluid-work/attachments/20170801/324bfa4f/attachment.html>


More information about the fluid-work mailing list