You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Offer a proper flutter packages publish command for publishing a Flutter package #10403
Currently to publish a Flutter package, you need to run flutter pub pub publish. We really should have something more straightforward like flutter packages publish.
Forwarding individual commands requires keeping the flutter tool in sync with the pub tool as to its precise commands (including "secret" commands, any esoteric behaviour when parsing arguments, etc), so that you can do anything the pub tool can do. Simply having a passthrough as a "last ditch" solution allowed me to use all the pub commands without any such concern and no ongoing maintenance.
I'm fine with also having flutter commands that happen to pass through, like flutter packages get, flutter packages upgrade, and flutter packages test. These aren't intended to offer all the features of the underlying tool, just Flutter's opinion of those features.
changed the title [-]Offer a proper command for publishing a Flutter package[/-][+]Offer a proper `flutter packages publish` command for publishing a Flutter package[/+]on Jun 2, 2017
@sethladd : I have to admit I am completely (maybe beyond repair) confused by the relationship of the pub commands and their flutter equivalents (and surprised others may not be, judging by the lack of ability to find answers on stack overflow).
Is there a summary table somewhere that relates those commands (as in, flutter pub command on the left, dart pub command on the right)? - such as in #9799 (which is not implemented if I understand correctly)
But for now, what is the correct command actually publish a flutter package on pub? (I think I published my flutter package incorrectly as a dart package, not sure about the consequences).
@Hixie@mit-mit : Thanks both, I realize this was not the place to ask, but this item and #9799 was the most often linked from searches. This sounds like one can always use flutter packages pub <pub-command> (maybe there should be a questionmark here) and obtain the desired pub results, which is what I was confused about. (I am not sure why one cannot then just use the pub command portion, but will assume the flutter packages does some processing specific for flutter). Thanks
Yeah you have to use flutter packages pub ... instead of pub ... because the flutter tool configures pub to understand that there's a Flutter SDK installed, so that pubspec.yaml files can say sdk: flutter and have it work correctly.
That makes sense, thanks. I wonder if it may be a good thing to highlight this somewhere explicitly - the following site, for example, https://flutter.io/developing-packages/, writes about flutter packages pub publish, but does not provide a motivation (of the difference from pub publish). It does not help that in Idea, the clickable text is Packages get (not flutter packages get or pub get). I was confused by this for quite a while, but maybe it was just me. Thanks for the explanation.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
mit-mit commentedon May 31, 2017
We could also just do my original proposal: #9799
mit-mit commentedon May 31, 2017
@Hixie didn't you add
pub pubrecently? Can you elaborate on why we went that route?Hixie commentedon May 31, 2017
Forwarding individual commands requires keeping the
fluttertool in sync with thepubtool as to its precise commands (including "secret" commands, any esoteric behaviour when parsing arguments, etc), so that you can do anything the pub tool can do. Simply having a passthrough as a "last ditch" solution allowed me to use all the pub commands without any such concern and no ongoing maintenance.I'm fine with also having flutter commands that happen to pass through, like
flutter packages get,flutter packages upgrade, andflutter packages test. These aren't intended to offer all the features of the underlying tool, just Flutter's opinion of those features.mit-mit commentedon Jun 1, 2017
OK. This is a concrete request for
flutter publishthen.sethladd commentedon Jun 1, 2017
You want
flutter publishorflutter packages publish?flutter publishmight be useful for publishing an app. I think qualifyingpublishfor now is safer.mit-mit commentedon Jun 2, 2017
Not a bad point;
flutter packages publishworks.[-]Offer a proper command for publishing a Flutter package[/-][+]Offer a proper `flutter packages publish` command for publishing a Flutter package[/+]mzimmerm commentedon Nov 28, 2017
@sethladd : I have to admit I am completely (maybe beyond repair) confused by the relationship of the pub commands and their flutter equivalents (and surprised others may not be, judging by the lack of ability to find answers on stack overflow).
Is there a summary table somewhere that relates those commands (as in, flutter pub command on the left, dart pub command on the right)? - such as in #9799 (which is not implemented if I understand correctly)
But for now, what is the correct command actually publish a flutter package on pub? (I think I published my flutter package incorrectly as a dart package, not sure about the consequences).
Thanks
Hixie commentedon Nov 28, 2017
@mzimmerm
flutter packages pub ...is equivalent topub .... (Seeflutter packages --help.)mit-mit commentedon Nov 28, 2017
Currently the equivalents are:
Nice short command available
flutter packages get->pub getflutter packages upgrade->pub upgradeNo short command available; long command needed:
flutter packages pub publish->pub publishto support publishing a pluginflutter packages pub version->pub versionto see the pub versionetc.
mzimmerm commentedon Nov 29, 2017
@Hixie @mit-mit : Thanks both, I realize this was not the place to ask, but this item and #9799 was the most often linked from searches. This sounds like one can always use
flutter packages pub <pub-command>(maybe there should be a questionmark here) and obtain the desired pub results, which is what I was confused about. (I am not sure why one cannot then just use the pub command portion, but will assume theflutter packagesdoes some processing specific for flutter). ThanksHixie commentedon Nov 30, 2017
Yeah you have to use
flutter packages pub ...instead ofpub ...because thefluttertool configurespubto understand that there's a Flutter SDK installed, so thatpubspec.yamlfiles can saysdk: flutterand have it work correctly.mzimmerm commentedon Nov 30, 2017
That makes sense, thanks. I wonder if it may be a good thing to highlight this somewhere explicitly - the following site, for example, https://flutter.io/developing-packages/, writes about
flutter packages pub publish, but does not provide a motivation (of the difference frompub publish). It does not help that in Idea, the clickable text isPackages get(notflutter packages getorpub get). I was confused by this for quite a while, but maybe it was just me. Thanks for the explanation.jmagman commentedon Jan 18, 2020
Documentation instructions are:
@mit-mit Was this fixed with #38490 / #33302 ?
mit-mit commentedon Jan 20, 2020
Yes, this was indeed fixed and is in the latest stable build
github-actions commentedon Aug 17, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.