ssannandeji / Zenject-2019

Dependency Injection Framework for Unity3D
MIT License
2.53k stars 363 forks source link

Add support for custom package registry #613

Open olegmrzv opened 5 years ago

olegmrzv commented 5 years ago

Hi there. We are working on a public registry of open source packages for Unity https://xcrew.dev/ It would be nice if you could support and update Zenject yourself.

For it you need:

  1. Create a pair login:hash on the site http://www.htaccesstools.com/htpasswd-generator/
  2. Select the scope in which your packages will be placed. (Apparently it is com.modesttree)
  3. PM me it and I will add your account
  4. Install npm
  5. Start the terminal and enter npm set registry http://xcrew.dev
  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

{
    "name": "com.modesttree.zenject.reflectionbaking",
    "author": "Modest Tree",
    "displayName": "Zenject.ReflectionBaking",
    "unity": "2018.1",
    "version": "8.0.0",
    "keywords": [
        "IoC",
        "DI",
        "Dependency Injection",
        "Zenject"
    ],
    "dependencies": {
        "com.modesttree.zenject": "8.0.0"
    },
    "repository": {
        "type": "git",
        "url": "https://github.com/modesttree/Zenject.git"
    }
}

To add registry support to the project, add the following lines to the manifest.json

{
  "dependencies": {
  },
  "scopedRegistries": [
    {
      "name": "Unity",
      "url": "https://packages.unity.com",
      "scopes": [
        "com.unity"
      ]
    },
    {
      "name": "XCrew",
      "url": "http://xcrew.dev",
      "scopes": [
        "com"
      ]
    }
  ]
}

In the editor it looks like this image

My Contacts:

Regards, Oleg

schodemeiss commented 5 years ago

I'd plus one this for sure. Especially given Zenject is a version of 3 behind in the Asset Store most of the time.