Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AlexanderFarkas opened this issue Oct 25, 2023 · 8 comments
Open

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

AlexanderFarkas opened this issue Oct 25, 2023 · 8 comments

Comments

@AlexanderFarkas
Copy link

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
Copy link
Collaborator

spydon commented Dec 4, 2023

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
Copy link
Author

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
Copy link
Author

AlexanderFarkas commented Dec 4, 2023

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
Copy link
Collaborator

spydon commented Dec 4, 2023

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
Copy link
Author

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

@AlexanderFarkas
Copy link
Author

AlexanderFarkas commented Dec 4, 2023

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
Copy link
Collaborator

spydon commented Dec 4, 2023

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
Copy link
Author

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

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

No branches or pull requests

2 participants