Skip to content

feat(config): allow sources to append rather than replace #205

Description

@dominics

Description

In the monorepo I work in, there are a large number of package.json files configured using (yarn, soon pnpm) workspaces, and then some few additional package.json files that don't participate in the monorepo for one reason or another. It'd be nice to have a way to include these additional package.json files in the source configuration, without losing the ability to include automatically discovered package.json files from the workspaces configuration.

In other words, where the documentation says:

package.json files are resolved in this order of precedence:

  1. If --source glob patterns are provided, use those.
  2. If using Yarn Workspaces, read workspaces from ./package.json.
  3. If using Lerna, read packages from ./lerna.json.
  4. If using Pnpm, read packages from ./pnpm-workspace.yaml.
  5. Default to 'package.json' and 'packages/*/package.json'.

I'd like a way to use 2-4, while adding some additional package.json files to the sources.

Suggested Solution

Maybe there could be some pre-defined values that can be provided when using globs (1 in the above list), to also merge in the values from 2, 3, 4? MIght cause conflicts with real directories though... I don't know exactly what configuration format to use here

Thanks for the amazing tool!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions