Skip to content

Extend a common configuration #1292

@filimon-danopoulos

Description

@filimon-danopoulos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions