-
Notifications
You must be signed in to change notification settings - Fork 58
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
Envinfo config file #176
base: main
Are you sure you want to change the base?
Envinfo config file #176
Conversation
This is awesome - I'll take a deeper look at it tomorrow, but as of now, my only suggestion is that we use the more conventional naming of webpack and babel both do it this way, and I think that's probably a bandwagon we should jump on. |
src/envinfo.js
Outdated
@@ -83,9 +83,20 @@ function main(props, options) { | |||
}); | |||
} | |||
|
|||
function runMainFromConfigFile(configFile, options) { | |||
return Promise.resolve(configFile()).then(({ options: configOptions, ...config }) => { | |||
return main(config, { ...options, ...configOptions }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you switch the order of options and configOptions, I think we can use command line flags to override whats in the config file, I think this is ideal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also be able to merge command line switches for --system as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tabrindle I switched the order of options
and configOptions
which makes a lot of sense.
For merging command line switches, shouldn't we be able to merge all command line switches (--browsers
, IDEs
, etc)?
@@ -18,6 +18,7 @@ module.exports = { | |||
path: path.join(__dirname, '/dist'), | |||
}, | |||
module: { | |||
noParse: /\/src\/nativeRequire.js$/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, lol
4f16c2a
to
40c1b39
Compare
Are we reasonably confident with the state of this PR? I think it's good to go. We can iterate as we get adoption. |
@tabrindle yah I think so. I've been pretty busy lately but I did change the name of the file to envinfo.config.js. I'd like to land this with some docs which I can get to this week. |
How would the API for libraries look like? It seems to me that this PR would add support for an envinfo.config.js in the user repository. But that wouldn't be helpful since the library wants to control what environment information it needs. I was about to file PRs for testing-library and Material-UI presets since I find this package incredibly helpful. Though I'm not sure if PRs for presets should be preferred or waiting for this feature. |
sorry for the delay here. The goal of this PR is to come up with a way to avoid teams having to submit PRs for presets. Maybe we should support being able to pass a @tabrindle thoughts on this approach? |
@tabrindle thoughts on #176 (comment)? |
Yes, I think this approach would work. Would this need to be a separate feature/PR? I think this one is mostly complete for the original intentions. |
This PR adds support for an
envinfo.js
configuration file. Based on the discussion here #158.Some notes on the design considerations from @tabrindle:
envinfo.js
envinfo.js
file. See the tests added as part of this PR