Search Unity

Define Custom Package Dependencies

Discussion in 'Package Manager' started by calc1fer, Dec 31, 2019.

  1. calc1fer

    calc1fer

    Joined:
    Oct 5, 2019
    Posts:
    62
    Introduction
    Hi, I am working on several projects.
    I use the Custom Package that exists in the local Packages folder by importing it from another project.

    However, there is a dependency between the modularized packages.
    When I define the dependencies in package.json, I would like to specify a relative or absolute path.

    I know that Unity Packages download packages from pre-specified addresses or copy packages from package cache.
    So I thought, if you have a pre-defined Dictionary, I can do that local environment.

    So I already checked that the package was downloaded automatically when I put it in the package cache with the naming standard. However, I believe this is not a proper solution and is a temporary one. We could use an expedient, for example, symbolic links. I would like to build a custom package in a version control-friendly way and find a way to install it according to its dependencies.

    My Question
    1. Is there a way to automatically download packages via dependency mapping without manually placing them in the Appdata’s Local Folder?
    2. Can I edit the codes of Package Manager?

    What I Want To...
    Share and use packages within an internal network, but find a version control-friendly way.

    Thanks.
     
    Last edited: Dec 31, 2019
  2. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    551
    Hi @CQTD,

    File-based dependencies are not currently supported, but that feature is on our roadmap of improving custom package support. I would advise against altering the package cache since this might not be future-proof, but you already seem to know that.

    Unfortunately the answer to both your questions is no, but we do have support for custom registries, so this may be of help. Since you're trying to share packages within an internal network, have you tried setting up an npm registry like Verdaccio? This would let you publish your packages internally and use them by configuring scoped registries.

    Another option would be to use Git-based dependencies, but this is currently limited to packages stored at the root of their Git repository. (Note: the feature to support packages nested at an arbitrary depth in the Git repository is currently in the works for 2020.1.)
     
    one_one and Sarkahn like this.
  3. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Any news there?
     
  4. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    551
    Hi @one_one,

    I'm sorry, I have nothing new to report yet, but it's still on the roadmap. Unfortunately I cannot say when we get to tackle that exactly, it may not be anytime soon.
     
    one_one likes this.
  5. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    I understand. Thanks for the open communication, that helps us plan ahead!
     
    maximeb_unity likes this.