Add flags as AVA config instead of CLI flags
npm init ava --serial should result in {"ava": {"serial": true}}, not "test": "ava --serial".
@novemberborn ?
I assume you'd use this a lot?
- Which flags would you want to support like this?
- Which package would hold the knowledge of how those flags map to config?
- Would this solely update
package.jsonor can it be used to create anava.config.jsas well? - Would it help if you could provide, say, a Gist URL which is then written to the appropriate config file (based on extension)?
Which flags would you want to support like this?
All simple flags, so either a primitive or an array of primitives. These can easily be converted without needing custom logic for each option.
The idea was to keep it simple. In create-xo, I did it in a few LOC: https://github.com/xojs/create-xo/blob/598d18fbf28ee5a8db4b131f7a38e6a24dd61dba/index.js#L67-L79
Which package would hold the knowledge of how those flags map to config?
This
Would this solely update package.json or can it be used to create an ava.config.js as well?
We could add an option to create an ava.config.js instead of updating package.json, yes.
Would it help if you could provide, say, a Gist URL which is then written to the appropriate config file (based on extension)?
For what purpose? Sharing common config?
Which flags would you want to support like this?
All simple flags, so either a primitive or an array of primitives. These can easily be converted without needing custom logic for each option.
OK. Though IIRC we don't have flags that take arrays anymore.
Which package would hold the knowledge of how those flags map to config?
This
:+1:
Would this solely update package.json or can it be used to create an ava.config.js as well?
We could add an option to create an
ava.config.jsinstead of updating package.json, yes.
Yes, let's.
Would it help if you could provide, say, a Gist URL which is then written to the appropriate config file (based on extension)?
For what purpose? Sharing common config?
Just exploring alternative solutions. But I'm happy with what you're proposing.