Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): remove support for options editors
Remove support for `OptionEditor` plugin types. Plugins are now expected to read their own config, from whatever source they want, in their own respective lifecycle. `OptionsEditor`s (and `ConfigEditor`s before that) provided a way to edit stryker configuration after it was read from disk, but before mutation testing starts. This sounded good at first, but the very nature if OptionsEditors meant that users cannot disable them. They are also limited, because the configuration that is read from disk also needs to be serializable if you want it to end up in your x.y.z. plugin. It was also not great for maintainability. Stryker's core plugins (`@stryker-mutator/...`) quitely moved away from using the `OptionEditor` API and we are now finally ready to pull the plugin on it once and for all.
- Loading branch information
Showing
14 changed files
with
27 additions
and
265 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
import { deepMerge } from '@stryker-mutator/util/src/deepMerge'; | ||
import { StrykerOptions, PartialStrykerOptions } from '@stryker-mutator/api/core'; | ||
import { Config } from '@stryker-mutator/api/config'; | ||
|
||
/** | ||
* Creates a `Config` object for given options. | ||
* `Config` is the same as `StrykerOptions`, but with a `set` function that can be used as a shorthand to | ||
* override options using a deep merge algorithm. This is mostly deprecated. | ||
* Adds a `set` method to the options object that can be used as a shorthand to | ||
* override options using a deep merge algorithm. This is mostly for backward compatibility purposes. | ||
* @param options The stryker options use | ||
* @deprecated Please use `StrykerOptions` directly instead | ||
*/ | ||
export function createConfig(options: StrykerOptions): Config { | ||
const config = options as Config; | ||
export function createConfig(options: StrykerOptions): StrykerOptions { | ||
options.set = (newConfig: PartialStrykerOptions) => { | ||
deepMerge(options, newConfig); | ||
}; | ||
return config; | ||
return options; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export { OptionsEditorApplier } from './OptionsEditorApplier'; | ||
export * from './readConfig'; | ||
export * from './OptionsValidator'; | ||
export * from './buildSchemaWithPluginContributions'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 0 additions & 58 deletions
58
packages/core/test/unit/config/OptionsEditorApplier.spec.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.