webpack-contrib / webpack-canary

Canary tooling for checking webpack dependencies against specific webpack versions
MIT License
47 stars 11 forks source link

Allow external config file #26

Closed andreicek closed 6 years ago

andreicek commented 6 years ago

Use either JS or JSON, the same style that Webpack has. This would reunite all CLI flags.

Use default one webpack-canary.conf.js (TBD).

DarkoKukovec commented 6 years ago

Things that need to be defined:

Proposed format:

module.exports = {
  versions: {
    'v1.14.0': [{
      dependency: 'https://github.com/webpack/webpack-dev-server/archive/v1.16.3.tar.gz',
      target: 'examples'
    }],
    'v2.2.1': [
      'https://github.com/webpack/webpack-dev-server/archive/v2.3.0.tar.gz'
    ],
    'webpack/webpack#master': [
      'https://github.com/webpack/webpack-dev-server/archive/master.tar.gz'
    ]
  },
  packageManager: 'npm@5', // default is 'npm'
  chromeOptions: {}, // TBD
  progress: true
};
andreicek commented 6 years ago

This looks great. Would it make sense to have the commands mapping for packageManager?

{
  packageManager: {
    exec: 'npm' // or '/usr/local/bin/npm'
    commands: {
      install: 'install',
      // etc.
    }
  }
}
DarkoKukovec commented 6 years ago

If we expose the commands (if we want to support something other than npm and yarn), we would also need to support placeholders (e.g., [webpack], [dependency]). I'm not really sure we need this. For start, I would go with the basic options that cover the vast majority of use cases. Later on, we can convert the property from a string to an object without breaking compatibility.