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

Config file vs source code file for presets #158

Open
ryhinchey opened this issue Mar 26, 2020 · 3 comments
Open

Config file vs source code file for presets #158

ryhinchey opened this issue Mar 26, 2020 · 3 comments

Comments

@ryhinchey
Copy link
Collaborator

Looking at PR #153 made me wonder where the line should be drawn for adding presets.

Would it make more sense to have a file like .envinfo that we could read from to figure out a project’s configuration instead of requiring PRs to the presets file?

I’d be happy to work on a pr adding that if others agree it’d be a good approach to take.

@tabrindle
Copy link
Owner

While I do WANT to drive adoption of my project, I had the same thought after reading that issue. I'm ok with a few core projects staying in (CRA, styled-components, apollo, et al), we definitely have to draw a line eventually, and can only do this once we have an alternative route. I can see even core projects wanting their config inline

I agree a file is a good place to do this. Passing that number of configs inline, while possible is not a terribly good idea.

Considerations for the design of this feature:

  • size. envinfo is frequently used via npx, so I want to preserve small size for speed of download
  • the file having a consistent name and extension. (extensionless dotfiles bother me)
  • ability to use a remote config file (fetched via http, possibly a future feature)
  • the contents of the config file being similar or identical to config passed inline when using the library directly in js
  • somehow declaring compatible versions of config vs versions of envinfo

Feel free to open a PR!

@capaj
Copy link

capaj commented May 16, 2020

please add this. That would make this project able to support usage in any other lib/project in general. Not just for the handful few projects in that have their key in presets.js

@eps1lon
Copy link

eps1lon commented Dec 7, 2020

To be fair, I don't think we actually need presets or config files. We (Material-UI) are just publishing our own package (@material-ui/envinfo) that wraps the programmatic API.

That should be sufficient and is even shorter:

-npx envinfo --preset material-ui
+npx @material-ui/envinfo

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

4 participants