Closed guybedford closed 2 years ago
I've also updated this PR to permit auto-install
as an option for all templates individually. I've kept package-manager
as a global option though, but renamed it from pkg-manager
to package-manager
- no need for unnecessary shortening I think,
Can it be [template.options]
(instead of [task.options]
) when within the [[task]]
group?
e.g.
[default-options.npm]
package-manager = 'pnpm'
[[task]]
template = 'svelte'
[template.options]
auto-install = true
Yeah I get that would be intuitive, but the way TOML works, every []
object specifier must be the full path from the root. So it would have to be [task.template-options]
or [task.template.name]
and [task.template.options]
if template
were an object.
Hmm. Maybe we could use the TOML inline object in short sample configs, unless the options are many:
[[task]]
template = 'svelte'
template-options = { auto-install = true }
FWIW I think "task.options" borders on confusing once again, because the question that would come to mind is, "Aren't the other things under [[task]]
options also? How do they differ?"
Sure, I can get behind renaming back to template-options
too.
Reverted back in https://github.com/guybedford/chomp/pull/36.
This renames the
template-opts
option to justoptions
, per discussion in https://github.com/guybedford/chomp/issues/32.It might make it simpler to just think of this as global default options and task options. The fact that they are applying to and keyed by templates is perhaps less important to highlight than ensuring users just appreciate template tasks take options.
Before:
After: