Templates would allow defining a way to generate parameterized tasks. For example, a Svelte template might look like (based on using engines https://github.com/guybedford/chomp/issues/4):
With the template "installed", one could then write a task like:
[[task]]
name = "build:svelte"
template = "svelte"
[task.args]
indir = "src"
outdir = "lib"
dev = true
where the target and dependency configuration would be automatically managed based on the provided template input.
Internally, the template is expanded based on the options provided, with the template generation itself running as an embedded JS engine like QuickJS or similar.
The inner "run" via engines still runs in Node.js though!
This means the template can be very quickly expanded without needing to spawn an external process and internally turned into its expanded task form.
When initializing the template to begin with, the prompt definitions allow for nice standard CLI prompts for setting template options. Possibly even via a visual tool in future.
Templates would allow defining a way to generate parameterized tasks. For example, a Svelte template might look like (based on using engines https://github.com/guybedford/chomp/issues/4):
With the template "installed", one could then write a task like:
where the target and dependency configuration would be automatically managed based on the provided template input.
Internally, the template is expanded based on the options provided, with the template generation itself running as an embedded JS engine like QuickJS or similar.
The inner "run" via engines still runs in Node.js though!
This means the template can be very quickly expanded without needing to spawn an external process and internally turned into its expanded task form.
When initializing the template to begin with, the prompt definitions allow for nice standard CLI prompts for setting template options. Possibly even via a visual tool in future.