Publishing Packages
Only Uploaders may publish a package. Each edition of OnePub defines an Uploader differently.
Free/Pro
Team
Enterprise
As all Members are Uploaders any Member can create a new package by running 'dart | flutter pub publish'.
All packages are associated with the Default Team and as such all Members have access to the package.
As all Members are Uploaders any Member can create a new package by running 'dart | flutter pub publish'.
To share a package it must be associated with a Team which only Team Leaders and/or Administrators may do.
As all Members are Uploaders any Member can create a new package by running 'dart | flutter pub publish'.
To share a package it must be associated with a Team which only Team Leaders and/or Administrators may do.
The secret to successfully publishing a package is.... good documentation.
Add a readme.md, take some time to document your public API and throw in some examples.
The largest risk you face is accidentally publishing your package to pub.dev.
If this is your first time publishing a package then you might find our blog article on publishing useful:
To prepare a package for uploading to OnePub you must mark it as a private package.
Run the
onepub pub private
command:onepub login # if you are not already authed
onepub pub private
This has the effect of adding a
publish_to
key to your pubspec.yaml
file. The publish_to
instructs dart to publish you package to OnePub rather than pub.dev.And now publish your package to OnePub:
dart pub publish
Some of your team members may need to publish both private and public packages.
All public packages should be published directly to pub.dev using the standard dart tooling/processes.
Public packages you upload to pub.dev will be cached on onepub.dev within a few minutes of you publishing to pub.dev, so you can easily find these packages on OnePub as well as pub.dev
If your OnePub organisation has multiple teams (you need the Team or Enterprise license) then are some additional steps required when uploading a package.
The core issue is that you need to nominate the team the package belongs to before uploading the package.
A package may be associated with multiple teams.
To associate a package with a Team
- Create a new package
- Enter the package name and description.
- On the Teams tab, select each of the teams the package is associated with.
- Save the new package.
You can now publish your package from the CLI as per the normal process.
Last modified 4mo ago