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

Consider using rc over env for config #25

Open
olizilla opened this issue May 12, 2019 · 2 comments
Open

Consider using rc over env for config #25

olizilla opened this issue May 12, 2019 · 2 comments
Assignees

Comments

@olizilla
Copy link
Member

The rc module allows the user to store the config for ipfs-deploy either in the current project, as env does, or in standard locations in ~ or /etc as per https://github.com/dominictarr/rc#standards

For things like account credentials, it'd be reasonable to store them in one place for all sites you use ipfs-deploy for, rather than in each project.

@agentofuser
Copy link
Collaborator

@olizilla is there a way to prevent rc from parsing command line arguments? It uses minimist to do that, which would conflict with our use of yargs.

Yargs allows reading configuration from an object with config() (https://yargs.js.org/docs/#api-configobject), so it could be passed the object resulting from rc files.

Yargs would then keep parsing cli arguments and generating the help text.

Yargs also has a feature I find adds familiarity to js devs which is to allow options to be configured within package.json, reducing the amount of dotfiles: https://yargs.js.org/docs/#api-pkgconfkey-cwd

It seems like we can have both by passing the rc object to config() and reading package.json with pkgConf().

Does this make sense?

@agentofuser
Copy link
Collaborator

There is also https://github.com/davidtheclark/cosmiconfig, which prettier uses. Seems nice!

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

No branches or pull requests

2 participants