-
Notifications
You must be signed in to change notification settings - Fork 230
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
Split out directDependencies and devDependencies in pub deps
#4383
Conversation
lib/src/command/deps.dart
Outdated
if (isRoot) | ||
'dev_dependencies': currentPackage.devDependencies.keys.toList(), |
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.
Should this be devDependencies
? I don't know about the rest of this file, but files like package_config.json
seem to use camel case (for ex. rootUri
)
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.
Good question - in pubspec.yaml we use dev_dependencies
- but json guidelines generally suggest camelCase.
@jonasfj do you have an opinion?
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 don't know, I guess using devDependencies
is the most consistent with other JSON outputs we have.
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.
Done
This seems like a nice solution, it's probably even backwards compatible for people who never expected there to be a |
Except we remove the dev-dependencies from the dependencies property... which might break something... |
Some additional thoughts:
|
No it is not. Perhaps it should be in https://dart.dev/tools/pub/cmd/pub-deps .
Yeah - perhaps this is the right way to do it. I can add a
As it is currently written, then yes - maybe we should add a comment about it. |
Oh - I already found someone we are breaking (flutter tools): |
What if the "devDependencies" listed all "dev_dependencies" and "dependencies" continued to list deps+dev_deps ... that would be backwards compatible, but slightly confusing... |
It will make it easier to know whether
Personally, I think it would be better to make the break and update Flutter.. It's a trivial change and the Flutter versions are tied to pub so there's no compatibility issue there as long as the Flutter change is made before Pub rolls in. However, I am assuming there's probably no other consumers (or if there are, this wouldn't break them too badly) and I consume a lot of consuming APIs so feel like less confusion is always better 😄 |
pub deps
pub deps
We have ended up on having
Reasoning: We chose to let backwards compatibility rule over neatness because
We chose not to have a version field in the output because:
We chose not to have a
PTAL |
This sounds good to me :-)
I don't think it's necessary now, but with the previous version it would've been a good indicator for updated clients to know if If you think this is pretty complete now, let me know and I can try updating Dart-Code to use JSON in this format and see if I hit any issues. Thanks! |
@sigurdm is there a way I can include this in an SDK build locally (or otherwise run this version locally)? I tried updating my Edit: nm, I found it also in DEPs :) This worked:
|
I have changes in Dart-Code working using this PR. I fixed a couple of other bugs in the dependencies tree while working on it, so if it's not likely to change again, I'd like to merge those changes (before the next release at the end of the month). If things might change further, then I'll try to unstitch some of those fixes from this change. |
If @jonasfj is happy, then I think we'll stay with this.
You can use the presence of "directDependencies" to distinguish between new and old. |
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.
Awesome, thanks! :) |
Fixes #4330