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

Ability to host dependencies inside the package #4412

Open
MohiuddinM opened this issue Oct 18, 2024 · 1 comment
Open

Ability to host dependencies inside the package #4412

MohiuddinM opened this issue Oct 18, 2024 · 1 comment
Labels
type-enhancement A request for a change that isn't a bug

Comments

@MohiuddinM
Copy link

Right now we can not add git or path dependencies inside published packages. This creates a lot of additional effort, as all internal dependencies have to be published separately. This may even require additional tooling etc.

A simpler solution will be to allow hosting dependencies inside the parent package. Let's say we create a packages folder at the same level as the lib folder. Then, any package inside this packages folder can be declared as path dependencies inside the parent package without any problem.

An even better solution will be to allow specifying git and path dependencies as internally hosted in pubspec.yaml of the parent package, and then pub will handle everything internally. It can look like this:

name: parent_package

environment:
  sdk: ^3.0.0

dependencies:
  dep_1:
    path: ../packages/dep_1
    host_internally: true
  dep_2:
    git: <URL of git repo>
    host_internally: true

So, with these solutions implemented we won't have to waste time handling sub-dependencies and integrating additional tooling, and pub would handle everything in the background.

@sigurdm sigurdm added the type-enhancement A request for a change that isn't a bug label Oct 24, 2024
@sigurdm
Copy link
Contributor

sigurdm commented Oct 24, 2024

I think this idea has some merit. But I worry it will risk polluting the package name space.

Check out https://pub.dev/packages/vendor that allows you to do something close to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants