engine icon indicating copy to clipboard operation
engine copied to clipboard

Not all .config.js files are feature config files

Open alisey opened this issue 4 years ago • 3 comments

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:

  1. Use a more specific extension for feature configs, e.g. .feature.config.ts
  2. Validate discovered configs and don't show invalid ones.
  3. Allow to specify a glob pattern for config discovery.

alisey avatar Feb 22 '21 10:02 alisey

@AdamYahid @omerken

alisey avatar Feb 22 '21 10:02 alisey

@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

RomanYarik avatar Nov 15 '21 12:11 RomanYarik

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

alisey avatar Nov 15 '21 12:11 alisey