-
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
Expose additional properties. #1816
Comments
Great idea @schultek. I've asked some of the pub folks (I'm just an honorary pub folk) about this. I think...if we want to support arbitrary tools reading pubspec, we should namespace things by the package name. So maybe dependencies:
pkg_config:
my_pkg:
my_pkg2: Or similar to avoid conflicts. Kind of like the .dart_tool directory This 147% a brainstorm right now. Let's get into the work week a bit and see what others think... |
I believe the pubspec.yaml is open-ended by design - and people have been putting all kinds of stuff there that is not read by the pub client (eg. flutter). I'm not sure I always agree with this design, as it can make it harder for us not to step on other people's toes. But it has been working out ok until now... I think it would be reasonable for pubspec_parse to expose the raw YamlMap of the pubspec.
We have been discussing something similar here: |
Yes, But also as @sigurdm says That said, I think: Encouraging people to custom keys under In general, I'm not entirely convinced that asking people to put custom keys in With package:extension_discovery we've encouraged people to use That said, I can see that if you want to configure stuff in the root package, that might not be convenient. But if your package is published to pub.dev, using |
Thanks for discussing this. As for my needs, it really doesn't need to be that complex.
Yes just that would be great. Other ways or constraints won't help me anyways, as:
Flutter is doing that for years. I'm just following de-facto standards. |
Disclaimer: I don't have fully formed thoughts here.
Yeah, and In hindsight, maybe it would have been better forbid custom top-level keys, and require that all custom keys are under something like: dependencies:
retry: ^3.0.0
config:
retry:
default_retries: 5 I don't think we can or should attempt to force that now. But we could establish a convention that custom keys in I'm guessing we should formalize such a convention in: https://dart.dev/tools/pub/pubspec And maybe augment it with a section that suggest using package:extension_discovery -- or give up on that idea, and make a |
If |
|
There is no harm from it either, |
This would be helpful to provide temporary support for new features or those that don't already have support, like:
|
It would be very helpful to expose additional properties that are defined in the pubspec as a
Map<String, dynamic>
.Context:
With the Jaspr framework there are additional configuration options developers can set in the puspec under the
jaspr
key. This is similar to how Flutter has some configuration under theflutter
key that is already supported by this package.I'm depending on another package (custom_lint) that uses pubspec_parse to provide the pubspec values, and I have no other way to access these values.
I'm happy to make a PR for this.
@kevmoo
The text was updated successfully, but these errors were encountered: