LogoLogo
  • OnePub
  • Guides
    • Installing
      • Install CLI tools
      • Register
      • Invite a member
      • Accept an Invite
      • CLI integration
        • Manually add publish_to
        • Implicit Integration
      • IDE integration
        • Android Studio
        • Visual Studio Code
      • Pre Dart 2.15
      • Pre Dart 2.12
    • Searching
    • Watching packages
    • Publishing Packages
      • The hard way
    • Private dependencies
      • The hard way
    • CLI Tools
      • login
      • logout
      • doctor
      • export
      • import
      • pub add
      • pub private
      • pub global activate
      • pub global deactivate
    • CI/CD
    • SSH
    • Docker
    • Community Choice Awards
  • Fundamentals
    • Members
    • Teams
    • Roles
    • Naming Packages
  • Workflows
    • Distributing to Customers
      • Purchase a Customer Distribution License
      • Security considerations
      • Publish a package
      • Invite a customer
      • Customer installation instructions
      • Conditions Apply
    • For Support
    • Setting up CI/CD
    • Vendoring Dependencies
    • Switching Organisations
    • Creating a Team Leader
  • FAQ
    • Is GST/VAT/Sales Tax applicable?
    • Does OnePub.dev have access to my personal information?
    • What is your SLA?
    • How do I get support?
    • How do I use OnePub from my CI/CD environment?
    • How to invite team members to join OnePub
    • How to publish a private package
    • 401: Unauthorized
  • Solved by OnePub
  • Data Retention Policy
  • Payments
Powered by GitBook
On this page
  • When don't you need to vendor packages?
  • To vendor a package:

Was this helpful?

  1. Workflows

Vendoring Dependencies

You may sometimes need to Vendor your dependencies if they come from an unstable source.

The concept of Vendoring a dependency is essentially the concept of building from a local copy of a library rather than relying on the third parties source. You essentially become the vendor of the package.

Vendoring may be necessary if the package owner doesn't release frequently or if you need to create a change to the package that the owner won't accept.

OnePub lets you Vendor a package and subsequently share it with your team or simply your other projects.

When don't you need to vendor packages?

Any released version of a package published on pub.dev doesn't need to be vendored providing you fix the version of the package within your pubspec.yaml.

Just because a package is released to pub.dev (or OnePub) doesn't mean you can trust it, but you can trust that a specific version won't change.

If your organisation requires that you audit any packages used in your project then you must pull the source of the package from pub.dev (or OnePub) rather than from git. The reason for this is that you need to ensure you are auditing the actual code that makes up the version, not just some source code that claims to come from the same version.

To vendor a package:

  1. clone the source to your local machine

  2. mark it as a private package

  3. publish it to OnePub

  4. have your colleagues update their dependencies to use the vendored version of the package.

  5. clone the source

git clone <repo>

2. mark the package as private

cd packagedir
onepub pub private enable

3. publish to OnePub

dart pub publish

4. update packages to use the vendored package

cd otherpackage
onepub pub add <vendored package>
PreviousSetting up CI/CDNextSwitching Organisations

Last updated 2 years ago

Was this helpful?