-
Notifications
You must be signed in to change notification settings - Fork 33
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
wip - add-overrides command #325
base: master
Are you sure you want to change the base?
Conversation
|
||
@override | ||
String get description => | ||
'Generates the CI configuration for child packages.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update :)
import '../root_config.dart'; | ||
import 'mono_repo_command.dart'; | ||
|
||
class AddOverridesCommand extends MonoRepoCommand { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably we also want a RemoveOverridesCommand
(for publishing?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely. Or one should just revert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is common to leave overrides in though as well (see the test repo). But then you need to remove them before publishing.
A bit of a tangent but now that I think about it this could also be useful for setting dependency constraints more generally as well? We could support a dependencies
(and dev_dependencies
) section where you could set the versions of all deps that you want to be consistent across packages.
final updateQueue = <String, String>{}; | ||
|
||
for (var package in config) { | ||
print(package.relativePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cruft?
} | ||
|
||
// TODO: if there is already a value at the target and it doesn't equal | ||
// the value we're adding – throw! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe just log? If I change the overrides in my mono_repo.yaml, I want that to overwrite previously written things.
} | ||
|
||
// We're ready to start adding dependency overrides! | ||
for (var newOverride in toOverride) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: pkgToOverride, or just pkg or package?
@@ -4,6 +4,8 @@ | |||
|
|||
import 'package:json_annotation/json_annotation.dart'; | |||
import 'package:path/path.dart' as p; | |||
// ignore: implementation_imports | |||
import 'package:pubspec_parse/src/dependency.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to expose this? We could also do something funky where we create a fake pubspec and parse that to avoid the impl import?
No description provided.