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

feat: remove dependency overrides from pubspec_overrides.yaml in melos clean #290

Merged
merged 2 commits into from
May 9, 2022

Conversation

blaugold
Copy link
Collaborator

@blaugold blaugold commented May 9, 2022

Description

Type of Change

  • ✨ feat -- New feature (non-breaking change which adds functionality)
  • πŸ› οΈ fix -- Bug fix (non-breaking change which fixes an issue)
  • ❌ ! -- Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 refactor -- Code refactor
  • βœ… ci -- Build configuration change
  • πŸ“ docs -- Documentation
  • πŸ—‘οΈ chore -- Chore

@blaugold blaugold changed the title feat: remove dependency overrides pubspec_overrides.yaml in melos clean feat: remove dependency overrides from pubspec_overrides.yaml in melos clean May 9, 2022
final contents = await pubspecOverridesFile.readAsString();
final updatedContents = mergeMelosPubspecOverrides({}, contents);
if (updatedContents != null) {
await pubspecOverridesFile.writeAsString(updatedContents);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure but do we want to delete the file here in an else since it's empty and since it was most likely created by Melos?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mergeMelosPubspecOverrides allows overrides that don't come from melos, so passing in {} does not guarantee that pubspec_overrides.yaml is empty. But we can check for that and if there are no other overrides, then I think it's a good idea to delete the file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@Salakar Salakar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thanks for this :)

@blaugold blaugold merged commit 869b2d6 into invertase:main May 9, 2022
@blaugold blaugold deleted the feat/clean-pubspec_overrides branch May 9, 2022 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants