You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To make boilerplate even more flexible and powerful, it would be great to support "callbacks" where you can provide arbitrary code to execute at specific times. For example, there could be a start callback that gets called just after Boilerplate gathers all variables but before it starts generating; a file callback called for each file and folder Boilerplate processes; and an end callback called after project generation is finished. The callbacks could be defined as simple shell commands in boilerplate.yml:
variables:
- name: foo
- name: barcallbacks:
start: echo "Boilerplate is generating files to $2 from templates in $1"file: echo "Boilerplate is processing file $1"end: echo "Boilerplate finished generating files in $2 from templates in $1"
The text was updated successfully, but these errors were encountered:
Sure. Let's say you're using boilerplate to generate a skeleton for a react.js project. Actually, here's an example of just such a template: https://github.com/Granze/react-starterify
You could package that template as a boilerplate template and use the callbacks as follows:
start: Look on GitHub and see if there is a newer version of the template available. If there is, prompt the user to download the latest version.
file: when the package.json file is being processed, run the npm update command to fetch the latest version of each Node.js package (this may be a way to solve Add support for "lookup latest release in GitHub" #8, BTW).
end: run npm install to install all those dependencies and npm run watch to immediately put you into live reload development mode as soon as the project is finished generating.
To make
boilerplate
even more flexible and powerful, it would be great to support "callbacks" where you can provide arbitrary code to execute at specific times. For example, there could be astart
callback that gets called just after Boilerplate gathers all variables but before it starts generating; afile
callback called for each file and folder Boilerplate processes; and anend
callback called after project generation is finished. The callbacks could be defined as simple shell commands inboilerplate.yml
:The text was updated successfully, but these errors were encountered: