engine
engine copied to clipboard
Not all .config.js files are feature config files
When starting the engine it picks up every .config.js
file as a feature config file. E.g. when running a feature called project-picker I'm getting the following:
$ engineer start -f project-picker -c project-picker/example --singleFeature
Available Configurations:
http://localhost:3000/main.html?feature=project-picker&config=project-picker/engine
http://localhost:3000/main.html?feature=project-picker&config=project-picker/wcs
http://localhost:3000/main.html?feature=project-picker&config=project-picker/webpack
Because in my project I have engine.config.js
, wcs.config.js
, and webpack.config.js
, which are obviously not feature configs.
Multiple people who used this project (me included) raised an issue that the project is broken, because no matter which config they choose it fails to work.
Possible solutions:
- Use a more specific extension for feature configs, e.g.
.feature.config.ts
- Validate discovered configs and don't show invalid ones.
- Allow to specify a glob pattern for config discovery.
@AdamYahid @omerken
@alisey this should be fixed now, since we locate features not from everywhere, but from a given featureDiscoveryRoot.
Please close or assure this still recreates
It's still an issue. In WCS we have:
module.exports = {
featureDiscoveryRoot: 'dist',
};
If I have any file with .config.js
extension in the dist folder, engineer
shows it as one of possible config options:
http://localhost:3000/main.html?feature=project-picker&config=project-picker/webpack <--- this guy here
http://localhost:3000/main.html?feature=project-picker&config=project-picker/example
http://localhost:3000/main.html?feature=project-picker&config=project-picker/test