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

fix: When you try to publish your final plugin a lot of undocumented steps are required #45

Open
rekire opened this issue Feb 23, 2024 · 5 comments
Labels
bug Something isn't working as expected documentation Improvements or additions to documentation product: very_good_flutter_plugin Changes that affect the Very Good Flutter Plugin template. waiting for response Waiting for follow up

Comments

@rekire
Copy link

rekire commented Feb 23, 2024

Description
Currently the generated flutter plugin works so far fine while development (except a couple of possible improvements like #42, #43, #44). However when you try to publish it at least as git dependency (as some kind of preview) you will notice quickly that there are a lot of "path: ../xyz" dependencies which simply won't work. This should be mentioned at least or might be some help how to manage this.

Steps To Reproduce

  1. Create the flutter plugin
  2. Add all the features you want
  3. Try to add your plugin as a dependency in a flutter app

Expected Behavior
The plugin should work

Actual Behavior
The plugin cannot be resolved since the ".." dependencies are unknown.

@rekire rekire added the bug Something isn't working as expected label Feb 23, 2024
@alestiago alestiago added the product: very_good_flutter_plugin Changes that affect the Very Good Flutter Plugin template. label Feb 26, 2024
@alestiago
Copy link
Contributor

Hi @rekire thanks for opening this issue 🙌

I think you are referring to ".." dependencies as those path dependencies.

How are you adding the plugin into your flutter application?

@alestiago alestiago added waiting for response Waiting for follow up documentation Improvements or additions to documentation labels Feb 26, 2024
@rekire
Copy link
Author

rekire commented Mar 20, 2024

Sorry for the late reply, right now I'm adding it as git dependency. But I'm right now on the way to publish it on pub.dev. Since I'm also changing my platform interface before the 1.0.0 I notices that tagging it with a real version makes it also more complicated since you need to keep in mind that the interface it has its own version. Hints for that might be good too

@alestiago
Copy link
Contributor

When publishing to pub.dev it will most likely complain about path dependencies.

I recommend reading the official documentation for publishing, let me know if such documentation helps out.

I think it wouldn't hurt to include a "Publishing your plugin" section in the generated template within a "CONTRIBUTING" file based on the generation. Would you be interested in writing such documentation?

@alestiago alestiago added waiting for response Waiting for follow up and removed waiting for response Waiting for follow up labels Aug 14, 2024
@rekire
Copy link
Author

rekire commented Nov 23, 2024

I'm working on my first update since the initial release. So I can write here down the steps when I fixed my CI issues, which I want to mention in a new issue.

However I don't have the time right now to extend the documentation itself.

@rekire
Copy link
Author

rekire commented Nov 24, 2024

I published now my 1.0.1. When you have fixed everything so that dart pub publish --dry-run has no warnings then you need to run those commands:

cd plugin_name_platform_interface
dart pub publish
cd ../plugin_name_android
dart pub publish
cd ../plugin_name_darwin# (or _ios and _macos if you use multiple packages)
dart pub publish
cd ../plugin_name_linux
dart pub publish
cd ../plugin_name_web
dart pub publish
cd ../plugin_name_windows
dart pub publish
cd ../plugin_name
dart pub publish

Keep in mind that you likely need to publish the platform_interface first since the other packages depend on it. Then publish the platform specific plugins and at the end the package which is used by the users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected documentation Improvements or additions to documentation product: very_good_flutter_plugin Changes that affect the Very Good Flutter Plugin template. waiting for response Waiting for follow up
Projects
Status: Needs Triage
Development

No branches or pull requests

2 participants