Extend a common configuration
- Dominant language
- TypeScript
- Stars
- 6.4k
- Forks
- 128
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
In monorepo scenarios it is common to have repeating task. For example running TSC in a design system mono repo. It would be beneficial to be able to extend a common configuration in such scenario.
I would like to suggest an extension API to either extend an entire configuration or single script.
To extend an entire config one could do:
```
{
scripts: {
build: 'wireit'
},
wireit: {
extends: '../config/wireit.json'
}
}
```
To extend individual scripts one would do:
```
{
scripts: {
build: 'wireit'
},
wireit: {
build: {
extends: '../config/wireit.json:build'
}
}
}
```
Note the use of `:build` similar to the syntax in dependencies.
Wireit would add the file as dependency and merge the configuration in such a way that the local config has precedence.
It was noted in Discord that the collision of `extends` at the top level of the wireit config have to be handled. I suggest a very simplistic approach where if extends is a string it is handled as an extension otherwise as a script.
Contributor guide
Assessment
This issue has not been assessed yet.