invertase / melos

🌋 A tool for managing Dart projects with multiple packages. With IntelliJ and Vscode IDE support. Supports automated versioning, changelogs & publishing via Conventional Commits.
https://melos.invertase.dev/~melos-latest
Apache License 2.0
1.11k stars 198 forks source link

Is that possible to reexport package from another package? #595

Open AlexanderFarkas opened 10 months ago

AlexanderFarkas commented 10 months ago

If I reexport package A from package B, autoversioning considers breaking change in A to be just "version upgrade" for B. Is there a way to specify reexports in melos.yaml?

spydon commented 9 months ago

When you change the version of the re-exported package I think you can flag the deps conventional commit as breaking:

deps!: Bump version of A
AlexanderFarkas commented 9 months ago

So, when I do "feat!: break api" in my dart_only_package, I should also manually update constraint in the flutter_package which reexports dart_only_package?

AlexanderFarkas commented 9 months ago

I believe, it's either a bug or a feature request, since reexporting library with a breaking change should be considered a breaking change for reexporter.

spydon commented 9 months ago

So, when I do "feat!: break api" in my dart_only_package, I should also manually update constraint in the flutter_package which reexports dart_only_package?

If you are following semver, you have to do a commit that bumps the version of the dart_only_package inside the flutter_package right? Then you can just as well do that with a ! to indicate that there has been a breaking change? Or how does your flow look like now?

AlexanderFarkas commented 9 months ago

Melos automatically updates constraints on melos version, but breaking change in dart_only_package results in patch update of flutter_package

AlexanderFarkas commented 9 months ago

Example: dart_only_package: v1.0.0 flutter_package: v1.0.0 flutter_package reexports dart_only_package entirely.

  1. Change something in dart_only_package
  2. Commit with feat!: breaking
  3. Run melos version

dart_only_package: v2.0.0 flutter_only_package: v1.0.0+1

Though reexporting should make flutter_only_package v2.0.0 according to semver.

spydon commented 9 months ago

Ah now I understand what you mean, I thought dart_only_package was external and not in the monorepo. I think it will be hard to identify when a package re-exports another one, but I'll keep the issue open as a feature request.

AlexanderFarkas commented 9 months ago

I think heuristics is overkill. It would be nice to directly specify reexport e.g. in melos.yaml.