vrchat-community / package-list-action

Example Action for VPM Package Repo
Other
2 stars 24 forks source link

Pick some packages from other vpm repository #21

Open anatawa12 opened 10 months ago

anatawa12 commented 10 months ago

I think it's better to pick some packages from other vpm listing.

In some vpm listing, this generator is not used (since this is not published in early days) so I think it's better to have way to pick package from other vpm listing instead of adding repository.

momo-the-monster commented 10 months ago

You are welcome to fork and modify these scripts to fit your needs!

anatawa12 commented 10 months ago

@momo-the-monster, Could you answer #11? This repository has no license so I cannot know which license will be applied to new features I'll write.

Spokeek commented 10 months ago

@anatawa12 That was one of the ideas i had for my issue https://github.com/vrchat-community/package-list-action/issues/20 but in the end what i did is integrate the projects as github projects and only handled a specific use case for what i called "deprecated project ids".

Would that help you ?

anatawa12 commented 10 months ago

Many of vpm repository author creates vpm repository without this action so I think it's much better for compatibility to use vpm repository. For example, QvPen, one of the most popular pen for worlds, uses manual update and NDMF, a framework for avatars, uses their own action. I think such a repository author can break compatibility with this action. When I actually need update package.json for vpm for compatibility in the future, I (and I think many of non-this action based repository author) may change vpm.json only not with package zip.

In addition, I think this action is not good for picking third-party because this action increases download count when vpm repository creates. I want to use download count for estimating how much user use my tool so I do not want downstream to register our repository for this action, instead (this is one of the reasons why I still use my own action for vpm repo)

Spokeek commented 10 months ago

So you would definitly need a way to integrate within this action to integrate packages from another vpm repository. As I was planning to do so a while ago but in the end fixed my issue in my own way, i could work on that.

Any idea on how you would describe such thing in the source.json ?

I thought about having an "vpmRepos" entry as following:

{
  "vpmRepos": [
      "https://spokeek.github.io/vpm-repository/index.json",
      {
          "source": "https://vpm.anatawa12.com/vpm.json",
          "ignorePackages":  [
              "com.anatawa12.continuous-avatar-uploader"
          ]
      }
    ]
}

or would you rather do the opposite and list the needed packages ? Tell me so i can get started on that, or maybe you already did ?

anatawa12 commented 10 months ago

I think listing picking packages instead of listing ignored is much better since vpm repository author can add any package any time. I think it's very bad to unexpectedly include third party package. (Removing package from repository is BRAKING change for repository so unexpectedly including package from external repository is bad I think.) So, I think configuration like any of the following is good.

{
  "vpmPackages": {
      "nadena.dev.ndmf": "https://vpm.nadena.dev/vpm.json",
      "com.anatawa12.continuous-avatar-uploader": ["https://vpm.anatawa12.com/vpm.json"],
      "com.anatawa12.avatar-optimizer": {
          "includePrereleases": true,
          "versionRange": ">=1.0.0, <2.0.0"
          "sources": ["https://vpm.anatawa12.com/vpm.json"]
      }
  }
}
{
  "vpmRepos": [
      {
          "source": "https://vpm.anatawa12.com/vpm.json",
          "packages":  [
              "com.anatawa12.continuous-avatar-uploader"
          ]
      }
    ]
}
{
  "vpmRepositories": {
      "https://vpm.anatawa12.com/vpm.json": {
          "packages": ["com.anatawa12.continuous-avatar-uploader"]
      }
  }
}

I think the first is the best format for configuration since

anatawa12 commented 10 months ago

maybe you already did?

No yet. I can do tomorrow but not started yet.

Spokeek commented 10 months ago

It's up to you, If you want to do it, please describe it on that issue or on a PR, i'll look at it and my use it myself (wanted to use _bd vpm repo in that way)

anatawa12 commented 10 months ago

I'll implement this suggestion tomorrow.