Search Unity

Folder Structure in Pacakge Manager

Discussion in 'Package Manager' started by Fiedel, Jul 16, 2019.

  1. Fiedel

    Fiedel

    Joined:
    Mar 7, 2017
    Posts:
    4
    Hello everyone,

    Is it currently possible to create a folder structure inside the Package Manager that contains several packages?
    An example would be:
    > Package Manager
    > Company Name
    > Namespace 1
    > Package 1.1
    > Package 1.2
    > Namespace 2
    > Package 2.1

    If this does not exist, I'd like to request that feature.
    For us this feature is essential in order to use the Package Manager for our sub-modules.
     
  2. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    For embed package which placed at Packages folder, Unity will import everything from it. That means it's fine to develop your sub-packages no matter how you layout your sub-folders. The only problem is that Unity Package Manager does not understand your sub-packages, you will see a single package entry in editor UI. But it's not a big deal for development.

    Since UPM is just a derivative from NPM, we can get benefits from NPM solutions. When it comes to publish sub-packages to private registry, consider using Lerna, which is used by Babel, React for managing sub-packages. Lerna will help you publish and manage version across all sub-packages. Your package consumer will see your sub-packages in the registry as normal package.

    I haven't tried this approach myself for UPM, but it sounds worth to try out.
     
    Last edited: Jul 16, 2019