How can I prevent the spread of gitub repo with darts packages?

Suppose I want to create a collection of packages, for example, related to cooking. I will have a main package called cooking, and then I want some cooking packages:

  • cooking mexican
  • cooking indian
  • cooking tai

Each of them will use cooking. And perhaps more general packages will be created in the future. How can I configure this structure in github so that you are not forced to create a separate repo for each, but still allow client projects to pull just the packages they need.

Can a package refer to a path in a github package?

On the pub dependencies page, they show how you can link to git:

dependencies: cooking: git: url: git://github.com/munificent/cooking.git ref: some-branch 

But ideally, I want:

 dependencies: cooking-indian: git: url: git://github.com/munificent/cooking.git ref: some-branch # path relative to cooking.git that has pubspec.yaml path: cooking-indian 

Is there a way to have one github repeater with N packages in which you can select only a subset through pub?

+5
source share
1 answer

You can always have one top-level git repository containing all the packages in subfolders that are published separately. The pub does not require each package to be repo - as long as individual packages adhere to the pub format of the package format .

If you use private repositories, you can set up a private host instead of relying on github to fetch.

However, pub currently does not support fetching directly from the subtrees of the git repository. If you want to invest in the implementation of this function, you can do this using the git function

+2
source

Source: https://habr.com/ru/post/1233916/


All Articles