plopjs / plop

Consistency Made Simple
http://plopjs.com
MIT License
7.17k stars 280 forks source link

enh: make run() awaitable and bubble exceptions rather than process.exit(1) #429

Open benallfree opened 7 months ago

benallfree commented 7 months ago

@crutchcorn Can you take a look at this please, I think it might be helpful for the community.

This PR does two things:

  1. Make run() awaitable. Previously, run() was fire-and-forget, but this doesn't work well when wrapping Plop. I needed a way to await run().
  2. Along the same lines, run() was not bubbling exceptions. It was calling process.exit, but that is insufficient if the user has setup/teardown that needs to happen after run().
crutchcorn commented 7 months ago

I like this change, but it's technically a breaking change.

Let's merge your other PRs, then we can address this. Sorry for the delays on this all - it's been a busy/rough month

benallfree commented 7 months ago

Do we have a system for tagging open PRs for future releases?

How would you feel about making a next branch so users can do npm i plop@next?