Search Unity

Custom package registry for open source projects

Discussion in 'Package Manager' started by BenMoore, Mar 4, 2019.

  1. BenMoore


    Nov 23, 2014
    Hi there.
    We are working on a public registry of open source packages for Unity
    We will welcome any projects.
    You can suggest any packages you know, or if you are working on one yourself, then contact me here or via the contacts below.

    For maintainers:
    1. Create a pair login:hash on the site
    2. Select the scope in which your packages will be placed. (For example it is com.neuecc or com.cysharp or both)
    3. PM me it and I will add your account
    4. Install npm
    5. Start the terminal and enter `npm set registry`
    6. Enter `npm login`
    7. Go to the root of your package in the terminal and enter `npm publish`

    All dependencies are resolved automatically by the package manager.
    It is necessary to specify the dependencies for additional packages like so
    Code (JavaScript):
    2. {
    3.    "name": "com.modesttree.zenject.reflectionbaking",
    4.    "author": "Modest Tree",
    5.    "displayName": "Zenject.ReflectionBaking",
    6.    "unity": "2018.1",
    7.    "version": "8.0.0",
    8.    "keywords": [
    9.        "IoC",
    10.        "DI",
    11.        "Dependency Injection",
    12.        "Zenject"
    13.    ],
    14.    "dependencies": {
    15.        "com.modesttree.zenject": "8.0.0"
    16.    },
    17.    "repository": {
    18.        "type": "git",
    19.        "url": ""
    20.    }
    21. }
    To add registry support to the project, add the following lines to the `manifest.json`
    Code (JavaScript):
    2. {
    3.   "dependencies": {
    4.   },
    5.   "scopedRegistries": [
    6.     {
    7.       "name": "Unity",
    8.       "url": "",
    9.       "scopes": [
    10.         "com.unity"
    11.       ]
    12.     },
    13.     {
    14.       "name": "XCrew",
    15.       "url": "",
    16.       "scopes": [
    17.         "com"
    18.       ]
    19.     }
    20.   ]
    21. }
    In the editor it looks like this

    My Contacts:

    - Email:
    - Telegram:
    - Skype: benjminmoore

    Regards, Oleg
    mobuni5 and M_R like this.
  2. benoitv_unity


    Unity Technologies

    Aug 3, 2017
    Hi @BenMoore,

    First off, kudos for your initiative. However, we would advise not relegating "" to a scoped registry. Doing so will cause problems in the future when we start integrating Asset store APIs or other Unity specific features. Scoped registries were intended to limit the scope of a registry and not the other way around.

    You should instead document the list of scopes your registry supports and let your users opt into the scopes they're interested in. This will prevent breaking changes in the future and in light of what you have posted, we may not even allow configuring 1-part scopes like "com" :)

  3. BenMoore


    Nov 23, 2014

    Hello benoitv_unity

    Thanks for the answer.
    I think it would be more convenient if in the manifest the attribute "registry" was not a string, but an array of strings, then I would not have to use scopedRegistries.
    There are too many different scopes on my registry to enter them all by hand in the manifest and their number will increase.
    I can of course make them children of the scope "com.xcrew", but this doesn’t really change anything.

    I tried to configure my registry to proxy packages through itself.
    Packages were displayed on the link
    But UPM, unfortunately, does not accept this.
    So I had to use scopedRegistries.

    I really hope that in the future, categorization by scopes will appear in the package manager window and there will be easier ways to use third-party registries.

    mobuni5 and JakHussain like this.