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

wip - add-overrides command #325

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

wip - add-overrides command #325

wants to merge 1 commit into from

Conversation

kevmoo
Copy link
Collaborator

@kevmoo kevmoo commented May 26, 2021

No description provided.


@override
String get description =>
'Generates the CI configuration for child packages.';
Copy link
Collaborator

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

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?)

Copy link
Collaborator Author

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?

Copy link
Collaborator

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

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

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

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

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?

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