UniRx icon indicating copy to clipboard operation
UniRx copied to clipboard

Add support for custom package registry

Open olegmrzv opened this issue 5 years ago • 3 comments

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 UniRx 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.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 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.neuecc.unirx",
    "author": "Yoshifumi Kawai",
    "displayName": "UniRx",
    "description": "UniRx (Reactive Extensions for Unity) is a reimplementation of the .NET Reactive Extensions. The Official Rx implementation is great but doesn't work on Unity and has issues with iOS IL2CPP compatibility. This library fixes those issues and adds some specific utilities for Unity. Supported platforms are PC/Mac/Android/iOS/WebGL/WindowsStore/etc and the library. \n\nBlog for update info - https://medium.com/@neuecc\n\nSupport thread on the Unity Forums: Ask me any question - http://forum.unity3d.com/threads/248535-UniRx-Reactive-Extensions-for-Unity \n\nUniRx is Core Library (Port of Rx) + Platform Adaptor (MainThreadScheduler/FromCoroutine/etc) + Framework (ObservableTriggers/ReactiveProeperty/etc) + async/await integration(UniRx.Async)",
    "unity": "2018.3",
    "version": "6.2.2",
    "keywords": [
        "rx",
        "unirx"
    ],
    "dependencies": {
        "com.neuecc.unirx.async": "6.2.2"
    },
    "repository": {
        "type": "git",
        "url": "https://github.com/neuecc/UniRx.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

olegmrzv avatar Mar 04 '19 11:03 olegmrzv

@BenjaminMoore How do I use your registry in UPM?

phobos2077 avatar May 02 '19 15:05 phobos2077

@phobos2077 Around some months ago UPM has support a new property scopedRegistries in project manifest file. It let people create their own registry server and let anyone connect to any custom registry outside unity's owned per project. You need add that property to you project's manifest file as the @BenjaminMoore describe

Thaina avatar May 03 '19 10:05 Thaina

If UniRx files could be moved to match Unity's custom package layout, then UniRx could be installed as a project dependency just by adding a git URL to Packages/manifest.json.

Example: "com.neuecc.unirx": "https://github.com/neuecc/UniRx?path=folder/containing/package/layout#v1.2.3"

The git URL does not require a third party scopedRegistry. It would pull the package directly from GitHub.

achimmihca avatar Apr 21 '21 17:04 achimmihca