Search Unity

Official package layout convention

Discussion in 'Package Manager' started by bdovaz, Apr 16, 2019.

  1. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    Now that version 2019.1.0f2 has been released and it seems that scoped registries are officially supported I'm thinking about migrating the company's code base to packages.

    I am reviewing the documentation and have seen that the official layout is documented and "supposedly" followed by Unity:

    https://docs.unity3d.com/Manual/cus-layout.html

    I have installed many packages through the package manager to check if this is true. I see that there are a few that do not follow this guidelines.

    That's why I'm afraid that it will change at some point and force me to redo a lot of work. We have between 50-100 packages.

    @okcompute_unity @pedro_unity @samuelb_unity
     
  2. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    151
    Hi @N3uRo,

    Perhaps those other packages had specific needs which necessitated a custom layout or perhaps they just haven't followed the standard when maybe they could have! In any case, Package Manager doesn't make assumptions about folder structure and naming. You'll notice in the document you linked, for
    Editor/
    and
    Runtime/
    directories it says
    So we don't have any special folders like a project does (https://docs.unity3d.com/Manual/SpecialFolders.html). The only thing that makes a package special, is it has a
    package.json
    at the root of the directory.

    In summary, it's safe to assume that whichever folder layout you adopt, your packages should keep working with future versions of Package Manager. And if you would like to follow the standard described in the manual, that's a sensible choice!
     
    rduret likes this.