egoist/maid

Add the ability to sync npm scripts

zephraph opened this issue · 1 comments

Introduce an argument --update-scripts to write all the maid tasks to the package.json file.

So ## clean -> "scripts: { "clean": "maid clean" }

This will allow users to use yarn clean or npm run clean as they may likely already be doing, but having the source of truth be their maid file. I envision that the --update-scripts arg would be used with something like lint-staged to automatically update the scripts when there were changes. It would only update the scripts whose commands start with maid.

One issue with this approach is the pre, post task hooks that maid supports. These would suddenly be ran twice. Will need to figure out a solution for that.

Probably --sync is better? But yea, i'm 👍 on that.