Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flags as AVA config instead of CLI flags #13

Open
sindresorhus opened this issue Sep 26, 2019 · 3 comments
Open

Add flags as AVA config instead of CLI flags #13

sindresorhus opened this issue Sep 26, 2019 · 3 comments

Comments

@sindresorhus
Copy link
Member

npm init ava --serial should result in {"ava": {"serial": true}}, not "test": "ava --serial".

@novemberborn ?

@novemberborn
Copy link
Member

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.json or can it be used to create an ava.config.js as well?
  • Would it help if you could provide, say, a Gist URL which is then written to the appropriate config file (based on extension)?

@sindresorhus
Copy link
Member Author

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?

@novemberborn
Copy link
Member

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

👍

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants