-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Restrict config properties that are merged into opts from .gulp.* files #92
Comments
@phated Sorry for my thoughtless. Certainly cli flags should be distinguished from config properties. I agree. |
I'd like to change this to use the specification object like var configSpecs = require('lib/shared/configs/')
var checkConfig = require('lib/shared/configs/checkConfig')
...
// The target merged with configs is an empty object.
var config = {};
var configFilePaths = ['home', 'cwd'].map(function(prop) {
return env.configFiles['.gulp'][prop];
});
configFilePaths.filter(isString).forEach(function(filePath) {
// The target object is merged with results of checks with the spec. object.
merge(config, checkConfig(require(filePath), configSpecs));
});
...
// The target is marged with flags in `opts` specified in the spec object.
merge(config, checkConfig(opts, lodash.filter(configSpecs, { cliFlag: true }))); And I think it's good to pass the config object to versioned require(path.join(__dirname, '/lib/versioned/', range, '/'))(opts, env, config); What do you think about this? |
@sttk I think it is fine to continue to merge with |
Yes, we would need something like that. And there are |
It would be easiest to have an array of paths but I wonder if a config object that we merge into is better. |
I've implemented for this issue and sended it to PR #94. |
@sttk I created this issue based on #71 (comment)
I'd like to keep the top-level properties restricted so they don't conflict in the future. e.g. a
--description
flag that does something different than the configurationdescription
property.Do you agree?
The text was updated successfully, but these errors were encountered: