segment-boneyard/khaos

hooks api

Closed this issue · 4 comments

Need hooks exposed from the API.

  • before the destination directory is created
  • after the destination directory is created

What else?

I think I was thinking a while back about stages:

  • after prompting for input, but before rendering the templates
  • after rendering the templates, but before writing to disk
  • after writing to disk

Not sure if the "after writing" is even useful though since it could be argued to be out of scope, and really what could we want to do there that wouldn't be done in the Metalsmith-like part. But maybe for other things like "uploading something to S3" since this has more scope than just Metalsmith-like operations?

For more clarity if those are the ones we get the goals:

  1. Post-prompt: goal is to edit the metadata before using it to render things?
  2. Post-render: goal is to add extra files based on the metadata?
  3. Post-write: goal is to do more project-setupy-build-tasks?

Looking more, I think you're right we only need before/after since the other two don't have any real use cases I can think of that differ

added back as .before() and .after() now!