Skip to content

Support one version rule for mono-repos #311

Open
@jonasfj

Description

@jonasfj

It would be useful for mono-repos if mono_repo.yaml could contain an option like force_one_version: true, to support mono-repos following the one version rule.

Features:

  1. Check that dependency constraints on a given package name, is the same in all pubspec.yaml files in the mono-repo.
  2. Resolve all pubspec.yaml to the same versions when running mono_repo pub get.

(2) is probably a bit hard to do, might involve generating a single pubspec.yaml containing all dependency constraints, resolving it, and writing the pubspec.lock to all packages in the mono-repo before running pub get for each package in the mono-repo.

(it's rather easy to generate such a pubspec.yaml, save it in a temporary folder that is deleted after it's used for resolution).

@yjbanov, pointed out that many Flutter mono-repos would benefit from something like this, as they are currently using pinning and various scripts to ensure that they only have one version of each package.

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