Skip to content

"flutter packages pub ..." to passthrough to dart pub #10044

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

Merged
merged 1 commit into from
May 12, 2017

Conversation

Hixie
Copy link
Contributor

@Hixie Hixie commented May 12, 2017

@abarth
Copy link
Contributor

abarth commented May 12, 2017

Why not just flutter pub ... ?

@Hixie
Copy link
Contributor Author

Hixie commented May 12, 2017

Fixes #9799

@Hixie
Copy link
Contributor Author

Hixie commented May 12, 2017

flutter pub pub ... will work (pub is an alias to packages). flutter pub on its own would be tricky because we'd be mixing two namespaces, e.g. flutter pub get (which is managed by flutter) and flutter pub foo (which is managed by pub). Consider for example what you should output for flutter pub --help.

@Hixie
Copy link
Contributor Author

Hixie commented May 12, 2017

Fixes #9301

@mit-mit
Copy link
Member

mit-mit commented May 12, 2017

So you would do commands such as flutter packages pub publish? That seems inconsistent with flutter packages get. I'd prefer something like #9799

@Hixie Hixie force-pushed the flutter_packages branch from 68725b8 to e866fec Compare May 12, 2017 17:58
@Hixie
Copy link
Contributor Author

Hixie commented May 12, 2017

@mit-mit I think it'd be fine to also expose explicit commands (the way e.g. I added test or the way we do get), but given the limitations of ArgParser I don't see how to do arbitrary passthrough on commands in that way while still having some curated commands.

I'm also rather dubious of taking on the maintenance burden of having to track pub's command set (which we would have to do if we exposed everything as an explicit command instead of just pass-through).

@mit-mit
Copy link
Member

mit-mit commented May 12, 2017

I don't think we have added any new commands in for quite a while (maybe several years), so not sure I'm too worried about that.

@@ -67,5 +66,105 @@ void main() {
expectExists(projectPath, 'lib/main.dart');
expectExists(projectPath, '.packages');
});
}, skip: true);
Copy link
Contributor

Choose a reason for hiding this comment

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

why skip?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops. I was testing the other one and forgot to remove this. Fixed.

@Hixie Hixie force-pushed the flutter_packages branch from e866fec to 6ed45ae Compare May 12, 2017 19:19
@tvolkert
Copy link
Contributor

pub is an alias to packages

Why not make a dedicated PubCommand that does exactly what your PassthroughCommand does?

@Hixie Hixie force-pushed the flutter_packages branch from 6ed45ae to da85303 Compare May 12, 2017 19:45
@Hixie
Copy link
Contributor Author

Hixie commented May 12, 2017

Changing the behaviour of flutter pub would be a breaking change; the pub=packages alias predates this PR.

@Hixie
Copy link
Contributor Author

Hixie commented May 12, 2017

If we want to change this to flutter pub ... then I think it's important that we first fix dart-lang/core#25 so that this isn't exposed to people right away in the top-level --help. Aside from the output already being really long (e.g. it lists flutter precache and flutter fuchsia_reload which are really esoteric options today), and making it even longer seeming like a bad idea (it's already about 50 lines long), I'm concerned that people will go down into the weeds trying to troubleshoot problems by directly manipulating pub.

@tvolkert
Copy link
Contributor

Discussing with @Hixie, we'll likely to need a dedicated flutter publish anyway to provide our own validation logic around publishing a Flutter plugin. flutter packages pub is intentionally buried so as to avoid giving the user the impression that we support the gamut of subcommands that are supported by pub.

@tvolkert
Copy link
Contributor

LGTM

@Hixie Hixie merged commit 292abf7 into flutter:master May 12, 2017
@Hixie Hixie deleted the flutter_packages branch May 12, 2017 22:40
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants