فهرست منبع

增加git包管理工具

tanghai 1 سال پیش
والد
کامیت
61a3dce289
94فایلهای تغییر یافته به همراه3820 افزوده شده و 1 حذف شده
  1. 5 0
      Packages/com.halodi.halodi-unity-package-registry-manager/CHANGELOG.md
  2. 7 0
      Packages/com.halodi.halodi-unity-package-registry-manager/CHANGELOG.md.meta
  3. BIN
      Packages/com.halodi.halodi-unity-package-registry-manager/Documentation~/halodi-unity-package-registry-manager-screenshot.png
  4. 8 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor.meta
  5. 22 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi.PackageRegistryManager.Editor.asmdef
  6. 7 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi.PackageRegistryManager.Editor.asmdef.meta
  7. 8 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi.meta
  8. 8 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry.meta
  9. 8 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core.meta
  10. 146 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/CredentialManager.cs
  11. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/CredentialManager.cs.meta
  12. 152 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/RegistryManager.cs
  13. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/RegistryManager.cs.meta
  14. 74 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/ScopedRegistry.cs
  15. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/ScopedRegistry.cs.meta
  16. 246 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/UpgradePackagesManager.cs
  17. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/UpgradePackagesManager.cs.meta
  18. 8 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM.meta
  19. 92 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/NPMLogin.cs
  20. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/NPMLogin.cs.meta
  21. 80 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/NPMPublish.cs
  22. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/NPMPublish.cs.meta
  23. 14 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/NPMResponse.cs
  24. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/NPMResponse.cs.meta
  25. 87 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/PackageTarball.cs
  26. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/PackageTarball.cs.meta
  27. 205 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/PublicationManifest.cs
  28. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/PublicationManifest.cs.meta
  29. 41 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/WebExceptionParser.cs
  30. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/WebExceptionParser.cs.meta
  31. 8 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI.meta
  32. 107 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/BulkAddPackages.cs
  33. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/BulkAddPackages.cs.meta
  34. 148 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/CredentialEditorView.cs
  35. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/CredentialEditorView.cs.meta
  36. 68 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/CredentialManagerView.cs
  37. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/CredentialManagerView.cs.meta
  38. 148 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/GetTokenView.cs
  39. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/GetTokenView.cs.meta
  40. 19 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/InstallPackageCreator.cs
  41. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/InstallPackageCreator.cs.meta
  42. 88 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/RegistryManagerView.cs
  43. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/RegistryManagerView.cs.meta
  44. 179 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/ScopedRegistryEditorView.cs
  45. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/ScopedRegistryEditorView.cs.meta
  46. 96 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/SettingsProvider.cs
  47. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/SettingsProvider.cs.meta
  48. 209 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/UpgradePackagesView.cs
  49. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/UpgradePackagesView.cs.meta
  50. 8 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty.meta
  51. 23 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/LICENSE.Tomlyn.md
  52. 7 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/LICENSE.Tomlyn.md.meta
  53. 21 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/README.md
  54. 7 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/README.md.meta
  55. BIN
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Tomlyn.dll
  56. 33 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Tomlyn.dll.meta
  57. 8 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer.meta
  58. 13 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/Artees.UnitySemVer.asmdef
  59. 7 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/Artees.UnitySemVer.asmdef.meta
  60. 40 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/CloudBuildManifest.cs
  61. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/CloudBuildManifest.cs.meta
  62. 21 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/LICENSE
  63. 7 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/LICENSE.meta
  64. 37 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/README.md
  65. 7 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/README.md.meta
  66. 238 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVer.cs
  67. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVer.cs.meta
  68. 12 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerAttribute.cs
  69. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerAttribute.cs.meta
  70. 74 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerAutoBuild.cs
  71. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerAutoBuild.cs.meta
  72. 70 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerComparer.cs
  73. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerComparer.cs.meta
  74. 51 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerConverter.cs
  75. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerConverter.cs.meta
  76. 12 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerErrorMessage.cs
  77. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerErrorMessage.cs.meta
  78. 32 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerValidationResult.cs
  79. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerValidationResult.cs.meta
  80. 87 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerValidator.cs
  81. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerValidator.cs.meta
  82. 202 0
      Packages/com.halodi.halodi-unity-package-registry-manager/LICENSE.md
  83. 7 0
      Packages/com.halodi.halodi-unity-package-registry-manager/LICENSE.md.meta
  84. 93 0
      Packages/com.halodi.halodi-unity-package-registry-manager/README.md
  85. 7 0
      Packages/com.halodi.halodi-unity-package-registry-manager/README.md.meta
  86. 8 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Tests.meta
  87. 8 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Tests/Editor.meta
  88. 3 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Tests/Editor/AssemblyInfo.cs
  89. 11 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Tests/Editor/AssemblyInfo.cs.meta
  90. 23 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Tests/Editor/Halodi.PackageRegistryManager.Tests.asmdef
  91. 7 0
      Packages/com.halodi.halodi-unity-package-registry-manager/Tests/Editor/Halodi.PackageRegistryManager.Tests.asmdef.meta
  92. 25 0
      Packages/com.halodi.halodi-unity-package-registry-manager/package.json
  93. 7 0
      Packages/com.halodi.halodi-unity-package-registry-manager/package.json.meta
  94. 8 1
      Packages/manifest.json

+ 5 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/CHANGELOG.md

@@ -0,0 +1,5 @@
+# ChangeLog
+
+
+## 0.0.1 - 2020-05-11
+- Package created

+ 7 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/CHANGELOG.md.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 3e6d9b2004fec8de1adc49c18ba1bdcb
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Packages/com.halodi.halodi-unity-package-registry-manager/Documentation~/halodi-unity-package-registry-manager-screenshot.png


+ 8 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3f77bd7bac843b45d851f83be3888f20
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 22 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi.PackageRegistryManager.Editor.asmdef

@@ -0,0 +1,22 @@
+{
+    "name": "Halodi.PackageRegistryManager.Editor",
+    "rootNamespace": "",
+    "references": [
+        "Artees.SemanticVersioning"
+    ],
+    "includePlatforms": [
+        "Editor"
+    ],
+    "excludePlatforms": [],
+    "allowUnsafeCode": false,
+    "overrideReferences": true,
+    "precompiledReferences": [
+        "Newtonsoft.Json.dll",
+        "Unity.SharpZipLib.dll",
+        "Tomlyn.dll"
+    ],
+    "autoReferenced": false,
+    "defineConstraints": [],
+    "versionDefines": [],
+    "noEngineReferences": false
+}

+ 7 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi.PackageRegistryManager.Editor.asmdef.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 69fe18a9ea685ee439ed87927dfee5c7
+AssemblyDefinitionImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 089bef75d43e1ee5888d3be1e71e7ac4
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e0dc91072aad56afa8bf4204ca72e442
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 4cf3f1318b46e144cbe43e9daf69c5b5
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 146 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/CredentialManager.cs

@@ -0,0 +1,146 @@
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using Tomlyn;
+using Tomlyn.Model;
+using Tomlyn.Syntax;
+using UnityEngine;
+
+namespace Halodi.PackageRegistry.Core
+{
+    public class NPMCredential
+    {
+        public string url;
+        public string token;
+        public bool alwaysAuth;
+    }
+
+    public class CredentialManager
+    {
+        private string upmconfigFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".upmconfig.toml");
+        private List<NPMCredential> credentials = new List<NPMCredential>();
+        
+        public List<NPMCredential> CredentialSet
+        {
+            get
+            {
+                return credentials;
+            }
+        }
+
+        public String[] Registries
+        {
+            get
+            {
+                String[] urls = new String[credentials.Count];
+                int index = 0;
+                foreach (NPMCredential cred in CredentialSet)
+                {
+                    urls[index] = cred.url;
+                    ++index;
+                }
+                return urls;
+            }
+        }
+
+        public CredentialManager()
+        {
+            if (File.Exists(upmconfigFile))
+            {
+                var upmconfig = Toml.Parse(File.ReadAllText(upmconfigFile));
+                if (upmconfig.HasErrors)
+                {
+                    Debug.LogError("Cannot load upmconfig, invalid format");
+                    return;
+                }
+
+                TomlTable table = upmconfig.ToModel();
+
+                if(table != null && table.ContainsKey("npmAuth"))
+                {
+                    TomlTable auth = (TomlTable)table["npmAuth"];
+                    if (auth != null)
+                    {
+                        foreach (var registry in auth)
+                        {
+                            NPMCredential cred = new NPMCredential();
+                            cred.url = registry.Key;
+                            TomlTable value = (TomlTable)registry.Value;
+                            cred.token = (string)value["token"];
+                            cred.alwaysAuth = (bool)value["alwaysAuth"];
+
+                            credentials.Add(cred);
+                        }
+                    }
+                }
+            }
+        }
+
+        public void Write()
+        {
+            var doc = new DocumentSyntax();
+
+            foreach (var credential in credentials)
+            {
+                if (string.IsNullOrEmpty(credential.token))
+                {
+                    credential.token = "";
+                }
+
+                doc.Tables.Add(new TableSyntax(new KeySyntax("npmAuth", credential.url))
+                {
+                    Items =
+                    {
+                        {"token", credential.token},
+                        {"alwaysAuth", credential.alwaysAuth}
+                    }
+                });
+
+            }
+
+
+            File.WriteAllText(upmconfigFile, doc.ToString());
+        }
+
+        public bool HasRegistry(string url)
+        {
+            return credentials.Any(x => x.url.Equals(url, StringComparison.Ordinal));
+        }
+
+        public NPMCredential GetCredential(string url)
+        {
+            return credentials.FirstOrDefault(x => x.url?.Equals(url, StringComparison.Ordinal) ?? false);
+        }
+
+        public void SetCredential(string url, bool alwaysAuth, string token)
+        {
+            if (HasRegistry(url))
+            {
+                var cred = GetCredential(url);
+                cred.url = url;
+                cred.alwaysAuth = alwaysAuth;
+                cred.token = token;
+            }
+            else
+            {
+                NPMCredential newCred = new NPMCredential();
+                newCred.url = url;
+                newCred.alwaysAuth = alwaysAuth;
+                newCred.token = token;
+
+                credentials.Add(newCred);
+            }
+        }
+
+        public void RemoveCredential(string url)
+        {
+            if (HasRegistry(url))
+            {
+                credentials.RemoveAll(x => x.url.Equals(url, StringComparison.Ordinal));
+            }
+        }
+    }
+
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/CredentialManager.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d007b6fca56974d8f856529be2d2130a
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 152 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/RegistryManager.cs

@@ -0,0 +1,152 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using Newtonsoft.Json.Linq;
+using UnityEditor;
+using UnityEngine;
+
+namespace Halodi.PackageRegistry.Core
+{
+    public class RegistryManager
+    {
+        private string manifest = Path.Combine(Application.dataPath, "..", "Packages", "manifest.json");
+
+        public List<ScopedRegistry> registries
+        {
+            get; private set;
+        }
+        
+        public CredentialManager credentialManager
+        {
+            get;
+            private set;
+        }
+
+        public RegistryManager()
+        {
+            this.credentialManager = new CredentialManager();
+            this.registries = new List<ScopedRegistry>();
+
+            JObject manifestJSON = JObject.Parse(File.ReadAllText(manifest));
+
+            JArray Jregistries = (JArray)manifestJSON["scopedRegistries"];
+            if (Jregistries != null)
+            {
+                foreach (var JRegistry in Jregistries)
+                {
+                    registries.Add(LoadRegistry((JObject)JRegistry));
+                }
+            }
+            else
+            {
+                Debug.Log("No scoped registries set");
+            }
+        }
+
+        private ScopedRegistry LoadRegistry(JObject Jregistry)
+        {
+            ScopedRegistry registry = new ScopedRegistry();
+            registry.name = (string)Jregistry["name"];
+            registry.url = (string)Jregistry["url"];
+
+            List<string> scopes = new List<string>();
+            foreach (var scope in (JArray)Jregistry["scopes"])
+            {
+                scopes.Add((string)scope);
+            }
+            registry.scopes = new List<string>(scopes);
+
+            if (credentialManager.HasRegistry(registry.url))
+            {
+                NPMCredential credential = credentialManager.GetCredential(registry.url);
+                registry.auth = credential.alwaysAuth;
+                registry.token = credential.token;
+            }
+
+            return registry;
+        }
+
+        private void UpdateScope(ScopedRegistry registry, JToken registryElement) {
+            JArray scopes = new JArray();
+            foreach (var scope in registry.scopes)
+            {
+                scopes.Add(scope);
+            }
+            registryElement["scopes"] = scopes;
+        }
+
+        private JToken GetOrCreateScopedRegistry(ScopedRegistry registry, JObject manifestJSON)
+        {
+            JArray Jregistries = (JArray)manifestJSON["scopedRegistries"];
+            if (Jregistries == null)
+            {
+                Jregistries = new JArray();
+                manifestJSON["scopedRegistries"] = Jregistries;
+            }
+
+            foreach (var JRegistryElement in Jregistries)
+            {
+                if (JRegistryElement["name"] != null && JRegistryElement["url"] != null &&
+                    String.Equals(JRegistryElement["name"].Value<string>(), registry.name, StringComparison.Ordinal) &&
+                    String.Equals(JRegistryElement["url" ].Value<string>(), registry.url, StringComparison.Ordinal))
+                {
+                    UpdateScope(registry, JRegistryElement);
+                    return JRegistryElement;
+                }
+            }
+
+            JObject JRegistry = new JObject();
+            JRegistry["name"] = registry.name;
+            JRegistry["url"] = registry.url;
+            UpdateScope(registry, JRegistry);
+            Jregistries.Add(JRegistry);
+
+            return JRegistry;
+        }
+
+        public void Remove(ScopedRegistry registry)
+        {
+            JObject manifestJSON = JObject.Parse(File.ReadAllText(manifest));
+            JArray Jregistries = (JArray)manifestJSON["scopedRegistries"];
+
+            foreach (var JRegistryElement in Jregistries)
+            {
+                if (JRegistryElement["name"] != null && JRegistryElement["url"] != null &&
+                JRegistryElement["name"].Value<string>().Equals(registry.name, StringComparison.Ordinal) &&
+                JRegistryElement["url" ].Value<string>().Equals(registry.url, StringComparison.Ordinal))
+                {
+                    JRegistryElement.Remove();
+                    break;
+                }
+            }
+
+            write(manifestJSON);
+        }
+
+        public void Save(ScopedRegistry registry)
+        {
+            JObject manifestJSON = JObject.Parse(File.ReadAllText(manifest));
+
+            JToken manifestRegistry = GetOrCreateScopedRegistry(registry, manifestJSON);
+
+            if(!string.IsNullOrEmpty(registry.token))
+            {
+                credentialManager.SetCredential(registry.url, registry.auth, registry.token);
+            }
+            else
+            {
+                credentialManager.RemoveCredential(registry.url);
+            }
+            
+            write(manifestJSON);
+
+            credentialManager.Write();
+        }
+
+        private void write(JObject manifestJSON)
+        {
+            File.WriteAllText(manifest, manifestJSON.ToString());
+            AssetDatabase.Refresh();
+        }
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/RegistryManager.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ed727f03f93e90392bda8e4663336ae2
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 74 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/ScopedRegistry.cs

@@ -0,0 +1,74 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Halodi.PackageRegistry.Core
+{
+    [System.Serializable]
+    public class ScopedRegistry
+    {
+        public string name;
+        public string url;
+        public List<string> scopes = new List<string>();
+
+        public bool auth;
+
+        public string token;
+
+        public override string ToString()
+        {
+            return JsonUtility.ToJson(this, true);
+        }
+
+        public bool isValidCredential()
+        {
+
+            if( string.IsNullOrEmpty(url) || !Uri.IsWellFormedUriString(url, UriKind.Absolute))
+            {
+                return false;
+            }
+
+
+            if(auth)
+            {
+                if(string.IsNullOrEmpty(token))
+                {
+                    return false;
+                }
+            }
+
+            return true;
+        }
+
+        public bool isValid()
+        {
+            if(string.IsNullOrEmpty(name))
+            {
+                return false;
+            }
+
+            if(scopes.Count < 1)
+            {
+                return false;
+            }
+
+            scopes.RemoveAll(string.IsNullOrEmpty);
+            
+            foreach(string scope in scopes)
+            {
+                if(Uri.CheckHostName(scope) != UriHostNameType.Dns)
+                {
+                    Debug.LogWarning("Invalid scope " + scope);
+                    return false;
+                }
+            }
+
+
+            return isValidCredential();
+
+
+        }
+    }
+
+
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/ScopedRegistry.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: be826e7a3923f2b79b58b8a5d923ba54
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 246 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/UpgradePackagesManager.cs

@@ -0,0 +1,246 @@
+using UnityEngine;
+using UnityEditor;
+using UnityEditor.PackageManager.Requests;
+using UnityEditor.PackageManager;
+using System.Threading;
+using System.Collections.Generic;
+using Artees.UnitySemVer;
+using System;
+
+namespace Halodi.PackageRegistry.Core
+{
+    public class UpgradePackagesManager
+    {
+
+        public class PackageUpgradeState
+        {
+            public PackageUpgradeState(UnityEditor.PackageManager.PackageInfo info)
+            {
+                this.info = info;
+                previewAvailable = false;
+                stableAvailable = false;
+                verifiedAvailable = false;
+                hasVerified = false;
+                stableVersion = SemVer.Parse(info.version);
+                previewVersion = SemVer.Parse(info.version);
+                
+
+
+                try
+                {
+                    current = SemVer.Parse(info.version);
+                }
+                catch
+                {
+                    Debug.LogError("Cannot parse version for package " + info.displayName + ": " + info.version);
+                }
+
+                if (info.source == PackageSource.Git)
+                {
+
+                    previewAvailable = true;
+                    preview = info.packageId;
+
+                    stableAvailable = true;
+                    stable = info.packageId;
+                }
+                else if (info.source == PackageSource.Registry)
+                {
+
+                    string[] compatible = info.versions.compatible;
+
+                    foreach (string ver in compatible)
+                    {
+                        try
+                        {
+                            SemVer version = SemVer.Parse(ver);
+
+                            if (string.IsNullOrWhiteSpace(version.preRelease))
+                            {
+                                if (version > stableVersion)
+                                {
+                                    stableVersion = version;
+                                    stableAvailable = true;
+                                    stable = info.name + "@" + ver;
+                                }
+                            }
+                            else
+                            {
+                                // This is a pre-release
+                                if (version > previewVersion)
+                                {
+                                    previewVersion = version;
+                                    previewAvailable = true;
+                                    preview = info.name + "@" + ver;
+                                }
+
+                            }
+                        }
+                        catch
+                        {
+                            Debug.LogError("Invalid version for package " + info.displayName + ": " + ver);
+                        }
+                    }
+                    
+#if UNITY_2022_2_OR_NEWER
+                    string verified = info.versions.recommended;
+#else
+                    string verified = info.versions.verified;
+#endif
+                    
+                    hasVerified = !String.IsNullOrWhiteSpace(verified);
+                    
+                    if(hasVerified)
+                    {
+                        try
+                        {
+                            verifiedVersion = SemVer.Parse(verified);
+                            if(verifiedVersion > current)
+                            {
+                                verifiedAvailable = verifiedVersion > current;
+                                verified = info.name + "@" + verified;
+                            }
+                            
+                        }
+                        catch
+                        {
+                            Debug.LogError("Cannot parse version for package " + info.displayName + ": " + verified);
+                        }
+                    }
+                }
+            }
+
+            internal string GetCurrentVersion()
+            {
+                return info.packageId;
+            }
+
+            public UnityEditor.PackageManager.PackageInfo info;
+
+            private SemVer current;
+
+            private bool previewAvailable;
+            private SemVer previewVersion;
+
+            private string preview;
+
+            private bool stableAvailable;
+            private SemVer stableVersion;
+
+            private string stable;
+
+            private bool hasVerified;
+            private bool verifiedAvailable;
+            private SemVer verifiedVersion;
+            private string verified;
+
+            public bool HasNewVersion(bool showPreviewVersion, bool useVerified)
+            {
+                if(useVerified && hasVerified)
+                {
+                    return verifiedAvailable;
+                }
+                else if (showPreviewVersion)
+                {
+                    return previewAvailable || stableAvailable;
+
+                }
+                else
+                {
+                    return stableAvailable;
+                }
+            }
+
+            public string GetNewestVersion(bool showPreviewVersion, bool useVerified)
+            {
+                if(useVerified && hasVerified)
+                {
+                    if(verifiedAvailable)
+                    {
+                        return verified;
+                    }
+                }
+                else if (showPreviewVersion)
+                {
+                    if (previewAvailable)
+                    {
+                        if (!stableAvailable || previewVersion > stableVersion)
+                        {
+                            return preview;
+                        }
+                    }
+                }
+                if (stableAvailable)
+                {
+                    if (stableAvailable)
+                    {
+                        return stable;
+                    }
+                }
+
+                return null;
+            }
+        }
+
+        public List<PackageUpgradeState> UpgradeablePackages = new List<PackageUpgradeState>();
+
+        private ListRequest request;
+
+        public bool packagesLoaded = false;
+
+        public UpgradePackagesManager()
+        {
+#if UNITY_2019_1_OR_NEWER
+            request = Client.List(false, false);
+#else
+            request = Client.List();
+#endif
+        }
+
+        public void Update()
+        {
+            if (!packagesLoaded && request.IsCompleted)
+            {
+                if (request.Status == StatusCode.Success)
+                {
+                    PackageCollection collection = request.Result;
+                    foreach (UnityEditor.PackageManager.PackageInfo info in collection)
+                    {
+                        UpgradeablePackages.Add(new PackageUpgradeState(info));
+                    }
+                }
+                else
+                {
+                    Debug.LogError("Cannot query package manager for packages");
+                }
+
+                packagesLoaded = true;
+            }
+        }
+
+
+        public bool UpgradePackage(String packageWithVersion, ref string error)
+        {
+            AddRequest request = UnityEditor.PackageManager.Client.Add(packageWithVersion);
+
+            while (!request.IsCompleted)
+            {
+                Thread.Sleep(100);
+            }
+
+            if (request.Status == StatusCode.Success)
+            {
+                return true;
+            }
+            else
+            {
+                error = request.Error.message;
+                return false;
+            }
+
+
+        }
+
+
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/Core/UpgradePackagesManager.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 62211760241e94052a18720a8ae0a8ff
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2bdc72b5107d76fc9b0eefd914b165d1
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 92 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/NPMLogin.cs

@@ -0,0 +1,92 @@
+
+using System;
+using System.IO;
+using System.Net;
+using System.Text;
+using UnityEngine;
+using Random = System.Random;
+
+namespace Halodi.PackageRegistry.NPM
+{
+    [System.Serializable]
+    internal class NPMLoginRequest
+    {
+        public string name;
+        public string password;
+    }
+
+
+    public class ExpectContinueAware : System.Net.WebClient
+    {
+        protected override System.Net.WebRequest GetWebRequest(Uri address)
+        {
+            System.Net.WebRequest request = base.GetWebRequest(address);
+            if (request is System.Net.HttpWebRequest)
+            {
+                var hwr = request as System.Net.HttpWebRequest;
+                hwr.ServicePoint.Expect100Continue = false;
+                hwr.AllowAutoRedirect = false;
+            }
+            return request;
+        }
+    }
+
+
+    public class NPMLogin
+    {
+        internal static string UrlCombine(string start, string more)
+        {
+            if (string.IsNullOrEmpty(start))
+            {
+                return more;
+            }
+            else if (string.IsNullOrEmpty(more))
+            {
+                return start;
+            }
+
+            return start.TrimEnd('/') + "/" + more.TrimStart('/');
+        }
+
+        public static string GetBintrayToken(string user, string apiKey)
+        {
+            return Convert.ToBase64String(Encoding.ASCII.GetBytes(user + ":" + apiKey));
+        }
+
+        public static NPMResponse GetLoginToken(string url, string user, string password)
+        {
+            using (var client = new WebClient())
+            {
+                string loginUri = UrlCombine(url, "/-/user/org.couchdb.user:" + user);
+                client.Headers.Add(HttpRequestHeader.Accept, "application/json");
+                client.Headers.Add(HttpRequestHeader.ContentType, "application/json");
+                client.Headers.Add(HttpRequestHeader.Authorization, "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(user + ":" + password)));
+
+                NPMLoginRequest request = new NPMLoginRequest();
+                request.name = user;
+                request.password = password;
+
+                string requestString = JsonUtility.ToJson(request);
+
+                try
+                {
+                    string responseString = client.UploadString(loginUri, WebRequestMethods.Http.Put, requestString);
+                    NPMResponse response = JsonUtility.FromJson<NPMResponse>(responseString);
+                    return response;
+                }
+                catch (WebException e)
+                {
+                    NPMResponse response = new NPMResponse();
+                    response.error = WebExceptionParser.ParseWebException(e);
+                    return response;
+
+                }
+            }
+        }
+
+
+
+
+    }
+
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/NPMLogin.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b48148742aea9c373b5a101a0794ff57
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 80 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/NPMPublish.cs

@@ -0,0 +1,80 @@
+using System;
+using System.IO;
+using System.Net;
+using System.Text;
+using Halodi.PackageRegistry.Core;
+using UnityEngine;
+
+namespace Halodi.PackageRegistry.NPM
+{
+public class NPMPublish
+{
+        public static void Publish(string packageFolder, string registry)
+        {
+            CredentialManager manager = new CredentialManager();
+            if (!manager.HasRegistry(registry))
+            {
+                throw new System.IO.IOException("Credentials not set for registry " + registry);
+            }
+
+            string token = manager.GetCredential(registry).token;
+
+            PublicationManifest manifest = new PublicationManifest(packageFolder, registry); ;
+
+
+
+
+            using (var client = new ExpectContinueAware())
+            {
+                string upload = NPMLogin.UrlCombine(registry, manifest.name);
+
+
+                client.Encoding = Encoding.UTF8;
+                client.Headers.Add(HttpRequestHeader.Accept, "application/json");
+                client.Headers.Add(HttpRequestHeader.ContentType, "application/json");
+                client.Headers.Add(HttpRequestHeader.Authorization, "Bearer " + token);
+
+
+                // Headers set by the NPM client, but not by us. Option to try with compatibility issues.
+                
+                // client.Headers.Add("npm-in-ci", "false");
+                // client.Headers.Add("npm-scope", "");
+                // client.Headers.Add(HttpRequestHeader.UserAgent, "npm/6.14.4 node/v12.16.2 linux x64");
+                // var random = new Random();
+                // string a = String.Format("{0:X8}", random.Next(0x10000000, int.MaxValue)).ToLower();
+                // string b = String.Format("{0:X8}", random.Next(0x10000000, int.MaxValue)).ToLower();
+
+                // client.Headers.Add("npm-session", a + b);
+                // client.Headers.Add("referer", "publish");
+
+
+                try
+                {
+                    string responseString = client.UploadString(upload, WebRequestMethods.Http.Put, manifest.Request);
+
+                    try
+                    {
+                        NPMResponse response = JsonUtility.FromJson<NPMResponse>(responseString);
+                        if (!response.success && string.IsNullOrEmpty(response.ok))
+                        {
+                            throw new System.IO.IOException(responseString);
+                        }
+                    }
+                    catch (Exception)
+                    {
+                        throw new System.IO.IOException(responseString);
+                    }
+
+
+                }
+                catch (WebException e)
+                {
+                    throw new System.IO.IOException(WebExceptionParser.ParseWebException(e));
+                }
+            }
+
+        }
+
+
+}
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/NPMPublish.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4c14ed213814c5c26835ad084ee31ef0
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 14 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/NPMResponse.cs

@@ -0,0 +1,14 @@
+namespace Halodi.PackageRegistry.NPM
+{
+    [System.Serializable]
+    public class NPMResponse
+    {
+        public string error;
+        public string ok;
+        public string token;
+
+        public bool success;
+
+        public string reason;
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/NPMResponse.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e1686b71fd1b8d8ad91a35d5a7994008
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 87 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/PackageTarball.cs

@@ -0,0 +1,87 @@
+using Newtonsoft.Json.Linq;
+using System.IO;
+using Unity.SharpZipLib.GZip;
+using Unity.SharpZipLib.Tar;
+
+namespace Halodi.PackageRegistry.NPM
+{
+
+    /// <summary>
+    /// Tool to create tarballs for packages.
+    /// UnityEditor.PackageManager.Client.Pack() creates a broken tarball that gets rejected by bintray.
+    /// </summary>
+    public class PackageTarball
+    {
+        public static string Create(string packageFolder, string outputFolder)
+        {
+            JObject manifest = PublicationManifest.LoadManifest(packageFolder);
+
+            string packageName = manifest["name"] + "-" + manifest["version"] + ".tgz";
+
+            Directory.CreateDirectory(outputFolder);
+
+            string outputFile = Path.Combine(outputFolder, packageName);
+
+
+            Stream outStream = File.Create(outputFile);
+            Stream gzoStream = new GZipOutputStream(outStream);
+            TarArchive tarArchive = TarArchive.CreateOutputTarArchive(gzoStream);
+
+            AddDirectoryFilesToTar(tarArchive, packageFolder, true, "packages/");
+            tarArchive.Close();
+            gzoStream.Close();
+            outStream.Close();
+
+            return outputFile;
+        }
+
+
+
+        private static string AppendDirectorySeparatorChar(string path)
+        {
+            // Append a slash only if the path is a directory and does not have a slash.
+            if (Directory.Exists(path) &&
+                !path.EndsWith(Path.DirectorySeparatorChar.ToString()))
+            {
+                return path + Path.DirectorySeparatorChar;
+            }
+
+            return path;
+        }
+
+
+
+        private static void AddDirectoryFilesToTar(TarArchive tarArchive, string sourceDirectory, bool recurse, string directoryName)
+        {
+            // Optionally, write an entry for the directory itself.
+            // Specify false for recursion here if we will add the directory's files individually.
+            TarEntry tarEntry = TarEntry.CreateEntryFromFile(sourceDirectory);
+            tarEntry.Name = directoryName;
+            tarArchive.WriteEntry(tarEntry, false);
+
+            // Write each file to the tar.
+            string[] filenames = Directory.GetFiles(sourceDirectory);
+            foreach (string filename in filenames)
+            {
+                TarEntry fileEntry = TarEntry.CreateEntryFromFile(filename);
+                fileEntry.Name = directoryName + Path.GetFileName(filename);
+                tarArchive.WriteEntry(fileEntry, true);
+            }
+
+            if (recurse)
+            {
+                string[] directories = Directory.GetDirectories(sourceDirectory);
+                foreach (string directory in directories)
+                {
+                    string dirname = new DirectoryInfo(directory).Name;
+                    if (dirname == ".git")
+                    {
+                        continue;
+                    }
+                    string newDirectory = directoryName + dirname + "/";
+                    AddDirectoryFilesToTar(tarArchive, directory, recurse, newDirectory);
+                }
+            }
+        }
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/PackageTarball.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 65eda3cbab9699e01aee646d705bf241
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 205 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/PublicationManifest.cs

@@ -0,0 +1,205 @@
+using System;
+using System.IO;
+using System.Security.Cryptography;
+using System.Threading;
+using Newtonsoft.Json.Linq;
+using UnityEditor;
+using UnityEditor.PackageManager;
+using UnityEditor.PackageManager.Requests;
+using UnityEngine;
+using System.Linq;
+using Newtonsoft.Json;
+using System.Text.RegularExpressions;
+using Halodi.PackageRegistry.Core;
+
+namespace Halodi.PackageRegistry.NPM
+{
+    /// <summary>
+    /// Helper class to create the JSON data to upload to the package server
+    /// </summary>
+    internal class PublicationManifest
+    {
+        private JObject j = new JObject();
+
+        public string name
+        {
+            get; private set;
+        }
+
+        private string base64Data;
+        private long size;
+        private string sha512;
+        private string sha1;
+
+        public string Request
+        {
+            get
+            {
+                return j.ToString(Formatting.None);
+            }
+        }
+
+        internal static JObject LoadManifest(string packageFolder)
+        {
+            string manifestPath = Path.Combine(packageFolder, "package.json");
+
+            if (!File.Exists(manifestPath))
+            {
+                throw new System.IO.IOException("Invalid package folder. Cannot find package.json in " + packageFolder);
+            }
+
+            JObject manifest = JObject.Parse(File.ReadAllText(manifestPath));
+
+            if (manifest["name"] == null)
+            {
+                throw new System.IO.IOException("Package name not set");
+            }
+
+            if (manifest["version"] == null)
+            {
+                throw new System.IO.IOException("Package version not set");
+            }
+
+            if (manifest["description"] == null)
+            {
+                throw new System.IO.IOException("Package description not set");
+            }
+
+            return manifest;
+        }
+
+
+
+        internal PublicationManifest(string packageFolder, string registry)
+        {
+
+            CreateTarball(packageFolder);
+
+            JObject manifest = LoadManifest(packageFolder);
+
+            name = manifest["name"].ToString();
+            string version = manifest["version"].ToString();
+            string description = manifest["description"].ToString();
+
+            string tarballName = name + "-" + version + ".tgz";
+            string tarballPath = name + "/-/" + tarballName;
+
+
+            string tarballUri = NPMLogin.UrlCombine(registry, tarballPath);
+            tarballUri = Regex.Replace(tarballUri, @"^https:\/\/", "http://");
+
+
+            string readmeFile = GetReadmeFilename(packageFolder);
+            string readme = null;
+            if(readmeFile != null)
+            {
+                readme = GetReadme(readmeFile);
+            }
+
+
+
+
+            j["_id"] = name;
+            j["name"] = name;
+            j["description"] = description;
+
+
+
+            j["dist-tags"] = new JObject();
+            j["dist-tags"]["latest"] = version;
+
+
+            j["versions"] = new JObject();
+            j["versions"][version] = manifest;
+
+            if (!string.IsNullOrEmpty(readmeFile))
+            {
+                j["versions"][version]["readme"] = readme;
+                j["versions"][version]["readmeFilename"] = readmeFile;
+            }
+
+            j["versions"][version]["_id"] = name + "@" + version;
+
+
+            // Extra options set by the NPM client. Will not set here as they do not seem neccessary.
+
+            // j["versions"][version]["_npmUser"] = new JObject();
+            // j["versions"][version]["_npmUser"]["name"] = "";
+            // j["versions"][version]["_npmUser"]["email"] = "";
+            // j["versions"][version]["_npmVersion"] = "6.14.4";
+            // j["versions"][version]["_nodeVersion"] = "12.16.2";
+
+            j["versions"][version]["dist"] = new JObject();
+            j["versions"][version]["dist"]["integrity"] = sha512;
+            j["versions"][version]["dist"]["shasum"] = sha1;
+            j["versions"][version]["dist"]["tarball"] = tarballUri.ToString();
+
+            if (!string.IsNullOrEmpty(readme))
+            {
+                j["readme"] = readme;
+            }
+
+            j["_attachments"] = new JObject();
+            j["_attachments"][tarballName] = new JObject();
+            j["_attachments"][tarballName]["content_type"] = "application/octet-stream";
+            j["_attachments"][tarballName]["length"] = new JValue(size);
+            j["_attachments"][tarballName]["data"] = base64Data;
+
+        }
+
+        private string GetReadmeFilename(string packageFolder)
+        {
+            foreach (var path in Directory.EnumerateFiles(packageFolder))
+            {
+                string file = Path.GetFileName(path);
+                if (file.Equals("readme.md", StringComparison.InvariantCultureIgnoreCase) ||
+                file.Equals("readme.txt", StringComparison.InvariantCultureIgnoreCase) ||
+                file.Equals("readme", StringComparison.InvariantCultureIgnoreCase))
+                {
+                    return path;
+                }
+            }
+            return null;
+        }
+
+        private string GetReadme(string readmeFile)
+        {
+            return File.ReadAllText(readmeFile);
+        }
+
+        private string SHA512(byte[] data)
+        {
+            var sha = new SHA512Managed();
+            byte[] checksum = sha.ComputeHash(data);
+            return "sha512-" + Convert.ToBase64String(checksum);
+        }
+        private string SHA1(byte[] data)
+        {
+            var sha = new SHA1Managed();
+            byte[] checksum = sha.ComputeHash(data);
+            return BitConverter.ToString(checksum).Replace("-", string.Empty).ToLower();
+        }
+
+
+
+        public void CreateTarball(string packageFolder)
+        {
+            string folder = FileUtil.GetUniqueTempPathInProject();
+            string file = PackageTarball.Create(packageFolder, folder);
+
+            Byte[] bytes = File.ReadAllBytes(file);
+            base64Data = Convert.ToBase64String(bytes);
+            size = bytes.Length;
+
+            sha1 = SHA1(bytes);
+            sha512 = SHA512(bytes);
+
+            File.Delete(file);
+            Directory.Delete(folder);
+
+        }
+
+
+    }
+}
+

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/PublicationManifest.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0c6809e15491b0062ad2e9c9aa05a72a
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 41 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/WebExceptionParser.cs

@@ -0,0 +1,41 @@
+using System.Net;
+
+namespace Halodi.PackageRegistry.NPM
+{
+    public class WebExceptionParser
+    {
+        public static string ParseWebException(WebException e)
+        {
+            if (e.Status == WebExceptionStatus.ProtocolError)
+            {
+                HttpWebResponse response = (HttpWebResponse)e.Response;
+
+                switch (response.StatusCode)
+                {
+                    case HttpStatusCode.Unauthorized:
+                        return response.StatusCode + ": Invalid credentials.";
+                    case HttpStatusCode.BadRequest:
+                    case HttpStatusCode.Conflict:
+                        return response.StatusCode + ": Check if version already exists on server.";
+                    default:
+                        return response.StatusCode + ": Unknown error. Try again.";
+
+                }
+
+            }
+            else
+            {
+                if (e.InnerException != null)
+                {
+                    return e.InnerException.Message;
+                }
+                else
+                {
+                    return e.Message;
+                }
+            }
+
+
+        }
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/NPM/WebExceptionParser.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 38840c461d1475a36bb61118358e2b51
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a67360ebdc1e6d247b183859bd4be8a1
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 107 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/BulkAddPackages.cs

@@ -0,0 +1,107 @@
+using System;
+using System.IO;
+using System.Threading;
+using UnityEditor;
+using UnityEditor.PackageManager;
+using UnityEditor.PackageManager.Requests;
+using UnityEngine;
+
+namespace Halodi.PackageRegistry.UI
+{
+    public class BulkAddPackages : EditorWindow
+    {
+        private string PackageList = "";
+
+        [MenuItem("Packages/Add packages (bulk)", false, 22)]
+        internal static void ManageRegistries()
+        {
+            EditorWindow.GetWindow<BulkAddPackages>(true, "Add packages", true);
+        }
+
+        void OnEnable()
+        {
+            PackageList = "";
+            minSize = new Vector2(640, 320);
+        }
+        void OnGUI()
+        {
+            EditorGUILayout.LabelField("Add Packages", EditorStyles.whiteLargeLabel);
+            EditorGUILayout.Separator();
+
+            PackageList = EditorGUILayout.TextArea(PackageList, GUILayout.Height(200));
+
+            EditorGUILayout.LabelField("Add multiple packages. Place each package on a newline.");
+            EditorGUILayout.LabelField("Format:.");
+            EditorGUILayout.LabelField("\tLatest version of package: com.halodi.halodi-unity-package-registry-manager");
+            EditorGUILayout.LabelField("\tSpecific version: com.halodi.halodi-unity-package-registry-manager@0.1.0");
+
+
+
+            EditorGUILayout.BeginHorizontal();
+            if (GUILayout.Button("Add packages"))
+            {
+                AddPackages();
+                CloseWindow();
+            }
+
+            if (GUILayout.Button("Close"))
+            {
+                CloseWindow();
+            }
+
+            EditorGUILayout.EndHorizontal();
+
+        }
+
+        private void AddPackages()
+        {
+            string result = "";
+
+            bool hasPackages = false;
+
+            using (StringReader reader = new StringReader(PackageList))
+            {
+                string line = string.Empty;
+                while ( (line = reader.ReadLine()) != null)
+                {
+                    if(!string.IsNullOrEmpty(line))
+                    {
+                        AddRequest request = UnityEditor.PackageManager.Client.Add(line);  
+                        
+                        while(!request.IsCompleted)
+                        {
+                            Thread.Sleep(100);
+                        }
+
+                        if(request.Status == StatusCode.Success)
+                        {
+                            result +=  "Imported: " + line + Environment.NewLine;
+                        }
+                        else
+                        {
+                            result += "Cannot import " + line + ": " + request.Error.message + Environment.NewLine;
+                        }
+                        hasPackages = true;
+                    }
+                } 
+            }
+
+            if(hasPackages)
+            {
+                EditorUtility.DisplayDialog("Added packages", "Packages added:" + Environment.NewLine + Environment.NewLine + result, "OK");
+            }
+            else
+            {
+                EditorUtility.DisplayDialog("No packages entered", "No packages entered.", "OK");
+            }
+        }
+
+        private void CloseWindow()
+        {
+            Close();
+            GUIUtility.ExitGUI();
+        }
+
+    }
+
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/BulkAddPackages.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 392cfa6b2194898f5a5328604b1e4814
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 148 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/CredentialEditorView.cs

@@ -0,0 +1,148 @@
+
+using System;
+using Halodi.PackageRegistry.Core;
+using UnityEditor;
+using UnityEngine;
+
+namespace Halodi.PackageRegistry.UI
+{
+    class CredentialEditorView : EditorWindow
+    {
+        private bool initialized = false;
+
+        private CredentialManager credentialManager;
+
+        private bool createNew;
+
+        private ScopedRegistry registry;
+
+        private int tokenMethod;
+
+
+        void OnEnable()
+        {
+            tokenMethod = 0;
+            minSize = new Vector2(480, 320);
+        }
+
+        void OnDisable()
+        {
+            initialized = false;
+        }
+
+        public void CreateNew(CredentialManager credentialManager)
+        {
+            this.credentialManager = credentialManager;
+            this.createNew = true;
+            this.registry = new ScopedRegistry();
+            this.initialized = true;
+        }
+
+        public void Edit(NPMCredential credential, CredentialManager credentialManager)
+        {
+            this.credentialManager = credentialManager;
+            this.registry = new ScopedRegistry();
+            this.registry.url = credential.url;
+            this.registry.auth = credential.alwaysAuth;
+            this.registry.token = credential.token;
+
+            this.createNew = false;
+            this.initialized = true;
+        }
+
+        void OnGUI()
+        {
+            if (initialized)
+            {
+                if (createNew)
+                {
+                    EditorGUILayout.LabelField("Add credential", EditorStyles.whiteLargeLabel);
+
+                    registry.url = EditorGUILayout.TextField("Registry URL", registry.url);
+                }
+                else
+                {
+                    EditorGUILayout.LabelField("Edit credential", EditorStyles.whiteLargeLabel);
+                    EditorGUILayout.LabelField("Registry URL: " + registry.url);
+                }
+                
+                if(string.IsNullOrEmpty(registry.url))
+                {
+                    EditorGUILayout.HelpBox("Enter the registry URL you want to add authentication for.", MessageType.Warning);
+                }
+
+                registry.auth = EditorGUILayout.Toggle("Always auth", registry.auth);
+                registry.token = EditorGUILayout.TextField("Token", registry.token);
+
+                EditorGUILayout.Space();
+
+                EditorGUI.BeginDisabledGroup(string.IsNullOrEmpty(registry.url));
+                tokenMethod = GetTokenView.CreateGUI(tokenMethod, registry);
+                
+                if (!string.IsNullOrEmpty(registry.url) && string.IsNullOrEmpty(registry.token))
+                {
+                    EditorGUILayout.HelpBox("Select an authentication method and click on \"Get token\"", MessageType.Warning);
+                }
+                
+                EditorGUI.BeginDisabledGroup(string.IsNullOrEmpty(registry.token));
+                
+                EditorGUILayout.Space();
+                EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(true));
+                EditorGUILayout.EndVertical();
+
+                EditorGUILayout.HelpBox("Restart Unity to reload credentials after saving.", MessageType.Info);
+                EditorGUILayout.BeginHorizontal();
+                if (createNew)
+                {
+                    if (GUILayout.Button("Add"))
+                    {
+                        Save();
+                    }
+                }
+                else
+                {
+                    if (GUILayout.Button("Save"))
+                    {
+                        Save();
+                    }
+                }
+                
+                EditorGUI.EndDisabledGroup();
+                EditorGUI.EndDisabledGroup();
+
+                if (GUILayout.Button("Cancel"))
+                {
+                    Close();
+                    GUIUtility.ExitGUI();
+                }
+                EditorGUILayout.EndHorizontal();
+            }
+        }
+
+        private void Save()
+        {
+            if (registry.isValidCredential() && !string.IsNullOrEmpty(registry.token))
+            {
+                credentialManager.SetCredential(registry.url, registry.auth, registry.token);
+                credentialManager.Write();
+                
+                // TODO figure out in which cases/Editor versions a restart is actually required,
+                // and where a Client.Resolve() call or PackMan reload is sufficient
+                if (EditorUtility.DisplayDialog("Unity Editor restart might be required", "The Unity editor might need to be restarted for this change to take effect.", "Restart Now", "Cancel"))
+                {
+                    EditorApplication.OpenProject(Environment.CurrentDirectory);
+                }
+                
+                Close();
+                GUIUtility.ExitGUI();
+            }
+            else
+            {
+                EditorUtility.DisplayDialog("Invalid", "Invalid settings for credential.", "Ok");
+            }
+        }
+
+
+
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/CredentialEditorView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: aed147722dfd212f18ab415b2ced4be3
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 68 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/CredentialManagerView.cs

@@ -0,0 +1,68 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using Halodi.PackageRegistry.Core;
+using UnityEditor;
+using UnityEditorInternal;
+using UnityEngine;
+
+namespace Halodi.PackageRegistry.UI
+{
+    public class CredentialManagerView : EditorWindow
+    {
+
+        private ReorderableList drawer;
+        
+        void OnEnable()
+        {
+            drawer = GetCredentialList(new CredentialManager());
+            minSize = new Vector2(640, 320);
+        }
+
+        void OnGUI()
+        {
+            drawer.DoLayoutList();
+        }
+
+        internal static ReorderableList GetCredentialList(CredentialManager credentialManager)
+        {
+            ReorderableList credentialList = null;
+            credentialList = new ReorderableList(credentialManager.CredentialSet, typeof(NPMCredential), false, true, true, true)
+            {
+                drawHeaderCallback = rect =>
+                {
+                    GUI.Label(rect, "User Credentials on this computer");
+                },
+                drawElementCallback = (rect, index, active, focused) =>
+                {
+                    var credential = credentialList.list[index] as NPMCredential;
+                    if (credential == null) return;
+                    
+                    rect.width -= 60;
+                    EditorGUI.LabelField(rect, credential.url);
+                    
+                    rect.x += rect.width;
+                    rect.width = 60;
+                    if (GUI.Button(rect, "Edit"))
+                    {
+                        CredentialEditorView credentialEditor = EditorWindow.GetWindow<CredentialEditorView>(true, "Edit credential", true);
+                        credentialEditor.Edit(credential, credentialManager);
+                    }
+                },
+                onAddCallback = reorderableList =>
+                {
+                    CredentialEditorView credentialEditor = EditorWindow.GetWindow<CredentialEditorView>(true, "Add credential", true);
+                    credentialEditor.CreateNew(credentialManager);
+                },
+                onRemoveCallback = reorderableList =>
+                {
+                    var credential = credentialList.list[credentialList.index] as NPMCredential;
+                    
+                    credentialManager.RemoveCredential(credential.url);
+                    credentialManager.Write();
+                }
+            };
+            return credentialList;
+        }
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/CredentialManagerView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6f1896f0b6cdab862b835b3498da53bd
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 148 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/GetTokenView.cs

@@ -0,0 +1,148 @@
+using System;
+using Halodi.PackageRegistry.Core;
+using Halodi.PackageRegistry.NPM;
+using UnityEditor;
+using UnityEngine;
+
+namespace Halodi.PackageRegistry.UI
+{
+    internal class TokenMethod : GUIContent
+    {
+        internal delegate bool GetToken(ScopedRegistry registry, string username, string password);
+        internal string usernameName;
+        internal string passwordName;
+        internal GetToken action;
+
+        public TokenMethod(string name, string usernameName, string passwordName, GetToken action) : base(name)
+        {
+            this.usernameName = usernameName;
+            this.passwordName = passwordName;
+            this.action = action;
+        }
+    }
+
+    internal class GetTokenView : EditorWindow
+    {
+        private static TokenMethod[] methods = {
+                new TokenMethod("npm login", "Registry username", "Registry password", GetNPMLoginToken),
+                new TokenMethod("bintray", "Bintray username", "Bintray API key", GetBintrayToken),
+                // TODO adjust TokenMethod to allow for opening GitHub token URL: https://github.com/settings/tokens/new
+            };
+
+
+        private string username;
+        private string password;
+
+        private bool initialized = false;
+
+        private TokenMethod tokenMethod;
+
+        private ScopedRegistry registry;
+
+
+        void OnEnable()
+        {
+            error = null;
+        }
+
+        void OnDisable()
+        {
+            initialized = false;
+        }
+
+        private void SetRegistry(TokenMethod tokenMethod, ScopedRegistry registry)
+        {
+            this.tokenMethod = tokenMethod;
+            this.registry = registry;
+            this.initialized = true;
+        }
+
+        void OnGUI()
+        {
+            if (initialized)
+            {
+                EditorGUILayout.LabelField(tokenMethod, EditorStyles.whiteLargeLabel);
+                username = EditorGUILayout.TextField(tokenMethod.usernameName, username);
+                password = EditorGUILayout.PasswordField(tokenMethod.passwordName, password);
+
+                if (GUILayout.Button("Login"))
+                {
+                    if(tokenMethod.action(registry, username, password))
+                    {
+                        CloseWindow();
+                    }
+                }
+
+                if (GUILayout.Button("Close"))
+                {
+                    CloseWindow();
+                }
+
+                if (!string.IsNullOrEmpty(error))
+                {
+                    EditorGUILayout.HelpBox(error, MessageType.Error);
+                }
+            }
+        }
+
+        private static void CreateWindow(TokenMethod method, ScopedRegistry registry)
+        {
+            GetTokenView getTokenView = EditorWindow.GetWindow<GetTokenView>(true, "Get token", true);
+            getTokenView.SetRegistry(method, registry);
+        }
+
+        private static string error = null;
+
+        private static bool GetNPMLoginToken(ScopedRegistry registry, string username, string password)
+        {
+            NPMResponse response = NPMLogin.GetLoginToken(registry.url, username, password);
+
+            if (string.IsNullOrEmpty(response.ok))
+            {
+                // EditorUtility.DisplayDialog("Cannot get token", response.error, "Ok");
+                error = "Cannot get token: " + response.error;
+                return false;
+            }
+            else
+            {
+                registry.token = response.token;
+                return true;
+            }
+        }
+
+        private static bool GetBintrayToken(ScopedRegistry registry, string username, string password)
+        {
+            registry.token = NPMLogin.GetBintrayToken(username, password);
+            return !string.IsNullOrEmpty(registry.token);
+        }
+
+
+        private void CloseWindow()
+        {
+            error = null;
+            foreach (var view in Resources.FindObjectsOfTypeAll<CredentialEditorView>())
+            {
+                view.Repaint();
+            }
+            Close();
+            GUIUtility.ExitGUI();
+        }
+
+
+        internal static int CreateGUI(int selectedIndex, ScopedRegistry registry)
+        {
+            EditorGUILayout.LabelField("Generate token", EditorStyles.whiteLargeLabel);
+            EditorGUILayout.BeginHorizontal();
+            selectedIndex = EditorGUILayout.Popup(new GUIContent("Method"), selectedIndex, methods);
+
+            if(GUILayout.Button("Login & get auth token"))
+            {
+                CreateWindow(methods[selectedIndex], registry);
+            }
+
+            EditorGUILayout.EndHorizontal();
+
+            return selectedIndex;
+        }
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/GetTokenView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c114ccf58900f5e5ab2f67306c0f40c2
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 19 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/InstallPackageCreator.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using Halodi.PackageRegistry.Core;
+using UnityEditor;
+using UnityEngine;
+
+namespace Halodi.PackageRegistry.UI
+{
+    internal class InstallPackageCreatorView : EditorWindow
+    {
+        [MenuItem("Packages/Install Halodi Package Creator", false, 41)]
+        internal static void ManageRegistries()
+        {
+            UnityEditor.PackageManager.Client.Add("com.halodi.halodi-unity-package-creator");  
+        }
+        
+
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/InstallPackageCreator.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7c16af11ea1aab931a6cc447c7b7bd7d
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 88 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/RegistryManagerView.cs

@@ -0,0 +1,88 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using Halodi.PackageRegistry.Core;
+using UnityEditor;
+using UnityEditorInternal;
+using UnityEngine;
+
+namespace Halodi.PackageRegistry.UI
+{
+    public class RegistryManagerView : EditorWindow
+    {
+        [MenuItem("Packages/Manage scoped registries", false, 21)]
+        internal static void ManageRegistries()
+        {
+            SettingsService.OpenProjectSettings("Project/Package Manager/Credentials");
+        }
+
+        private ReorderableList drawer;
+
+        void OnEnable()
+        {
+            drawer = GetRegistryList(new RegistryManager());
+            minSize = new Vector2(640, 320);
+        }
+
+        void OnGUI()
+        {
+            EditorGUILayout.LabelField("Scoped registries", EditorStyles.whiteLargeLabel);
+            drawer.DoLayoutList();
+        }
+
+        internal static ReorderableList GetRegistryList(RegistryManager registryManager)
+        {
+            ReorderableList registryList = null;
+            registryList = new ReorderableList(registryManager.registries, typeof(ScopedRegistry), false, true, true, true)
+            {
+                drawHeaderCallback = rect =>
+                {
+                    GUI.Label(rect, "Scoped Registries in this project");
+                },
+                elementHeight = 70,
+                drawElementCallback = (rect, index, active, focused) =>
+                {
+                    var registry = registryList.list[index] as ScopedRegistry;
+                    if (registry == null) return;
+                    bool registryHasAuth = !string.IsNullOrEmpty(registry.token) && registry.isValidCredential();
+
+                    var rect2 = rect;
+                    rect.width -= 60;
+                    rect.height = 20;
+                    GUI.Label(rect, registry.name + " (" + registry.scopes.Count + " scopes)", EditorStyles.boldLabel);
+                    rect.y += 20;
+                    GUI.Label(rect, registry.url);
+                    rect.y += 20;
+                    EditorGUI.BeginDisabledGroup(true);
+                    GUI.Toggle(rect, registryHasAuth, "Has Credentials");
+                    EditorGUI.EndDisabledGroup();
+                    
+                    rect2.x = rect2.xMax - 60;
+                    rect2.height = 20;
+                    rect2.width = 60;
+                    rect2.y += 5;
+                    if (GUI.Button(rect2, "Edit"))
+                    {
+                        ScopedRegistryEditorView registryEditor = EditorWindow.GetWindow<ScopedRegistryEditorView>(true, "Edit registry", true);
+                        registryEditor.Edit(registry, registryManager);
+                    }
+                },
+                onAddCallback = list =>
+                {
+                    ScopedRegistryEditorView registryEditor = EditorWindow.GetWindow<ScopedRegistryEditorView>(true, "Add registry", true);
+                    registryEditor.CreateNew(registryManager);
+                },
+                onRemoveCallback = list =>
+                {
+                    Debug.Log("index to remove: " + list.index);
+                    var entry = list.list[list.index] as ScopedRegistry;
+                    registryManager.Remove(entry);
+                }
+            };
+            return registryList;
+        }
+    }
+
+
+
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/RegistryManagerView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0bb92217c830c75c4baccac1d1455d6a
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 179 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/ScopedRegistryEditorView.cs

@@ -0,0 +1,179 @@
+
+using System;
+using Halodi.PackageRegistry.Core;
+using UnityEditor;
+using UnityEditorInternal;
+using UnityEngine;
+
+namespace Halodi.PackageRegistry.UI
+{
+    class ScopedRegistryEditorView : EditorWindow
+    {
+        private bool initialized = false;
+
+        private RegistryManager controller;
+
+        private bool createNew;
+
+        private ScopedRegistry registry;
+
+        private int tokenMethod;
+        void OnEnable()
+        {
+            tokenMethod = 0;
+
+            minSize = new Vector2(480, 320);
+        }
+
+        void OnDisable()
+        {
+            initialized = false;
+        }
+
+        public void CreateNew(RegistryManager controller)
+        {
+            this.controller = controller;
+            this.createNew = true;
+            this.registry = new ScopedRegistry();
+            this.initialized = true;
+        }
+
+        public void Edit(ScopedRegistry registry, RegistryManager controller)
+        {
+            this.controller = controller;
+            this.registry = registry;
+            this.createNew = false;
+            this.initialized = true;
+        }
+
+
+        private ReorderableList scopeList = null;
+        void OnGUI()
+        {
+            if (initialized)
+            {
+                EditorGUILayout.Space();
+                if (createNew)
+                {
+                    EditorGUILayout.LabelField("Add scoped registry ", EditorStyles.whiteLargeLabel);
+                    registry.name = EditorGUILayout.TextField("Name", registry.name);
+
+                    EditorGUI.BeginChangeCheck();
+                    registry.url = EditorGUILayout.TextField("URL", registry.url);
+                    if (EditorGUI.EndChangeCheck())
+                    {
+                        UpdateCredential();
+                    }
+                }
+                else
+                {
+                    EditorGUILayout.LabelField("Edit scoped registry", EditorStyles.whiteLargeLabel);
+                    EditorGUILayout.LabelField("Name", registry.name);
+                    EditorGUILayout.LabelField("URL", registry.url);
+                }
+
+                if (scopeList == null)
+                {
+                    scopeList = new ReorderableList(registry.scopes, typeof(string), true, false, true, true)
+                    {
+                        drawElementCallback = (rect, index, active, focused) =>
+                        {
+                            registry.scopes[index] = EditorGUI.TextField(rect, registry.scopes[index]);
+                        },
+                        onAddCallback = list =>
+                        {
+                            registry.scopes.Add("");
+                        }
+                    };
+                }
+
+                EditorGUILayout.BeginHorizontal();
+                EditorGUILayout.PrefixLabel("Package Scopes");
+                EditorGUILayout.BeginVertical();
+                scopeList.DoLayoutList();
+                EditorGUILayout.EndVertical();
+                EditorGUILayout.EndHorizontal();
+
+                EditorGUILayout.Space();
+                EditorGUILayout.LabelField("Authentication / Credentials", EditorStyles.whiteLargeLabel);
+                
+                registry.auth = EditorGUILayout.Toggle("Always auth", registry.auth);
+                registry.token = EditorGUILayout.TextField("Token", registry.token);
+
+                EditorGUILayout.Space();
+
+                tokenMethod = GetTokenView.CreateGUI(tokenMethod, registry);
+                
+                EditorGUILayout.Space();
+                EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(true));
+                EditorGUILayout.EndVertical();
+                
+                EditorGUILayout.HelpBox("Restart Unity to reload credentials after saving.", MessageType.Info);
+                EditorGUILayout.BeginHorizontal();
+                if (createNew)
+                {
+                    if (GUILayout.Button("Add"))
+                    {
+                        Add();
+                    }
+                }
+                else
+                {
+                    if (GUILayout.Button("Save"))
+                    {
+                        Save();
+                    }
+                }
+                
+                if (GUILayout.Button("Cancel"))
+                {
+                    Close();
+                    GUIUtility.ExitGUI();
+                }
+                EditorGUILayout.EndHorizontal();
+            }
+        }
+
+        private void Save()
+        {
+            if (registry.isValid())
+            {
+                controller.Save(registry);
+                Close();
+                GUIUtility.ExitGUI();
+            }
+            else
+            {
+                EditorUtility.DisplayDialog("Invalid", "Invalid settings for registry.", "Ok");
+            }
+        }
+
+        private void Add()
+        {
+            if (registry.isValid())
+            {
+                controller.Save(registry);
+                Close();
+                GUIUtility.ExitGUI();
+            }
+            else
+            {
+                EditorUtility.DisplayDialog("Invalid", "Invalid settings for registry.", "Ok");
+            }
+
+        }
+
+        private void UpdateCredential()
+        {
+            if (controller.credentialManager.HasRegistry(registry.url))
+            {
+                NPMCredential cred = controller.credentialManager.GetCredential(registry.url);
+                registry.auth = cred.alwaysAuth;
+                registry.token = cred.token;
+            }
+        }
+
+
+
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/ScopedRegistryEditorView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0fa2f00a8426714b1a94a89df408ce1c
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 96 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/SettingsProvider.cs

@@ -0,0 +1,96 @@
+using System;
+using System.Collections.Generic;
+using Halodi.PackageRegistry.Core;
+using UnityEditor;
+using UnityEditor.PackageManager;
+using UnityEditor.SceneManagement;
+using UnityEditorInternal;
+using UnityEngine;
+
+namespace Halodi.PackageRegistry.UI
+{
+    static class CredentialManagerSettingsProvider
+    {
+        [SettingsProvider]
+        public static SettingsProvider CreateMyCustomSettingsProvider()
+        {
+            RegistryManager registryManager;
+            ReorderableList credentialDrawer = null;
+            ReorderableList registryDrawer = null;
+            
+            var provider = new SettingsProvider("Project/Package Manager/Credentials", SettingsScope.Project)
+            {
+                label = "Credentials",
+                activateHandler = (str, v) =>
+                {
+                    registryManager = new RegistryManager();
+                    registryDrawer = RegistryManagerView.GetRegistryList(registryManager);
+                    credentialDrawer = CredentialManagerView.GetCredentialList(registryManager.credentialManager);
+                },
+                guiHandler = (searchContext) =>
+                {
+                    ThirdPartyInfo();
+
+                    EditorGUILayout.Space();
+                    registryDrawer.DoLayoutList();
+                    
+                    EditorGUILayout.Space();
+                    credentialDrawer.DoLayoutList();
+                },
+                footerBarGuiHandler = () =>
+                {
+                    EditorGUILayout.BeginHorizontal();
+#if UNITY_2020_1_OR_NEWER
+                    if (GUILayout.Button("Reload Packages"))
+                    {
+                        // call internal PackageManagerWindow.ResetPackageDatabase();
+                        var packageManagerWindow = typeof(Client).Assembly.GetType("UnityEditor.PackageManager.UI.PackageManagerWindow");
+                        if (packageManagerWindow != null)
+                            packageManagerWindow.GetMethod("ResetPackageDatabase")?.Invoke(packageManagerWindow, new object[] { });
+
+                        Client.Resolve();
+                    }
+#endif
+                    if (GUILayout.Button("Restart Editor"))
+                    {
+                        if(EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
+                            EditorApplication.OpenProject(Environment.CurrentDirectory);
+                    }
+                    
+                    EditorGUILayout.EndHorizontal();
+                },
+                // Populate the search keywords to enable smart search filtering and label highlighting
+                keywords = new HashSet<string>(new[] { "UPM", "NPM", "Credentials", "Packages", "Authentication", "Scoped Registry" })
+            };
+
+            return provider;
+        }
+        
+        private static class Styles
+        {
+            public static readonly GUIStyle linkLabel;
+
+            static Styles()
+            {
+#if UNITY_2019_2_OR_NEWER
+                linkLabel = new GUIStyle(EditorStyles.linkLabel);
+#else
+                linkLabel = new GUIStyle(EditorStyles.miniLabel);
+#endif
+                linkLabel.fontSize = EditorStyles.miniLabel.fontSize;
+                linkLabel.wordWrap = true;
+            }
+        }
+
+        private static void ThirdPartyInfo()
+        {
+            EditorGUILayout.HelpBox("Packages on scoped registries are provided by third parties.\n", MessageType.Info);
+            var lastRect = GUILayoutUtility.GetLastRect();
+            lastRect.xMin = lastRect.xMax - 60;
+            lastRect.yMin = lastRect.yMax - 20;
+            if (GUI.Button(lastRect, "Read more", Styles.linkLabel))
+                Application.OpenURL("https://docs.unity3d.com/Documentation/Manual/upm-scoped.html");
+            EditorGUIUtility.AddCursorRect(lastRect, MouseCursor.Link);
+        }
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/SettingsProvider.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ef531c9865ba9df44a7b77c821d7bf81
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 209 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/UpgradePackagesView.cs

@@ -0,0 +1,209 @@
+using System;
+using System.Collections.Generic;
+using Halodi.PackageRegistry.Core;
+using UnityEditor;
+using UnityEngine;
+using static Halodi.PackageRegistry.Core.UpgradePackagesManager;
+
+namespace Halodi.PackageRegistry.UI
+{
+    internal class UpgradePackagesView : EditorWindow
+    {
+        [MenuItem("Packages/Upgrade Packages", false, 23)]
+        internal static void ManageRegistries()
+        {
+            EditorWindow.GetWindow<UpgradePackagesView>(true, "Upgrade packages", true);
+        }
+
+        private UpgradePackagesManager manager;
+
+        private bool upgradeAll;
+
+        private bool showPreviewPackages = false;
+
+        private bool useVerified = true;
+        private Dictionary<PackageUpgradeState, bool> upgradeList = new Dictionary<PackageUpgradeState, bool>();
+
+        void OnEnable()
+        {
+            manager = new UpgradePackagesManager();
+
+            minSize = new Vector2(640, 320);
+            upgradeAll = false;
+        }
+
+        void OnDisable()
+        {
+            manager = null;
+        }
+
+        private Vector2 scrollPos;
+
+        private void Package(PackageUpgradeState info)
+        {
+
+            if(info.HasNewVersion(showPreviewPackages, useVerified))
+            {
+
+                GUIStyle boxStyle = new GUIStyle();
+                boxStyle.padding = new RectOffset(10, 10, 0, 0);
+
+                EditorGUILayout.BeginHorizontal(boxStyle);
+
+
+                EditorGUI.BeginChangeCheck();
+
+                bool upgrade = false;
+                if (upgradeList.ContainsKey(info))
+                {
+                    upgrade = upgradeList[info];
+                }
+
+                upgrade = EditorGUILayout.BeginToggleGroup(info.GetCurrentVersion(), upgrade);
+                if (EditorGUI.EndChangeCheck())
+                {
+                    if (!upgrade)
+                    {
+                        upgradeAll = false;
+                    }
+                }
+
+                upgradeList[info] = upgrade;
+
+                EditorGUILayout.EndToggleGroup();
+
+
+                EditorGUILayout.LabelField(info.GetNewestVersion(showPreviewPackages, useVerified));
+
+                EditorGUILayout.EndHorizontal();
+            }
+        }
+
+        void OnGUI()
+        {
+            if (manager != null)
+            {
+                manager.Update();
+
+                EditorGUILayout.LabelField("Upgrade packages", EditorStyles.whiteLargeLabel);
+
+                showPreviewPackages = EditorGUILayout.ToggleLeft("Show Preview Packages", showPreviewPackages);
+
+                useVerified = EditorGUILayout.ToggleLeft("Prefer verified packages", useVerified);
+
+                if (manager.packagesLoaded)
+                {
+
+                    scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
+
+
+
+
+                    foreach (var info in manager.UpgradeablePackages)
+                    {
+                        Package(info);
+                    }
+
+                    EditorGUILayout.EndScrollView();
+
+
+                    EditorGUI.BeginChangeCheck();
+                    upgradeAll = EditorGUILayout.ToggleLeft("Upgrade all packages", upgradeAll);
+                    if (EditorGUI.EndChangeCheck())
+                    {
+                        foreach (var info in manager.UpgradeablePackages)
+                        {
+                            upgradeList[info] = upgradeAll;
+                        }
+                    }
+
+                    EditorGUILayout.BeginHorizontal();
+                    if (GUILayout.Button("Upgrade"))
+                    {
+                        Upgrade();
+                        CloseWindow();
+                    }
+
+                    if (GUILayout.Button("Close"))
+                    {
+                        CloseWindow();
+                    }
+
+                    EditorGUILayout.EndHorizontal();
+                }
+                else
+                {
+                    EditorGUILayout.LabelField("Loading packages...", EditorStyles.whiteLargeLabel);
+                }
+
+
+
+            }
+        }
+
+        private void Upgrade()
+        {
+
+            if (manager != null)
+            {
+
+                EditorUtility.DisplayProgressBar("Upgrading packages", "Starting", 0);
+
+                string output = "";
+                bool failures = false;
+                try
+                {
+                    foreach (var info in manager.UpgradeablePackages)
+                    {
+                        if(upgradeList.ContainsKey(info))
+                        {
+                            if(upgradeList[info])
+                            {
+                                EditorUtility.DisplayProgressBar("Upgrading packages", "Upgrading " + info.info.displayName, 0.5f);
+
+                                string error = "";
+                                if (manager.UpgradePackage(info.GetNewestVersion(showPreviewPackages, useVerified), ref error))
+                                {
+                                    output += "[Success] Upgraded " + info.info.displayName + Environment.NewLine;
+                                }
+                                else
+                                {
+                                    output += "[Error] Failed upgrade of" + info.info.displayName + " with error: " + error + Environment.NewLine;
+                                    failures = true;
+                                }
+                            }
+                        }
+
+                    }
+
+
+                }
+                finally
+                {
+                    EditorUtility.ClearProgressBar();
+                }
+
+
+                string message;
+                if (failures)
+                {
+                    message = "Upgraded with errors." + Environment.NewLine + output;
+                }
+                else
+                {
+                    message = "Upgraded all packages. " + Environment.NewLine + output;
+                }
+                EditorUtility.DisplayDialog("Upgrade finished", message, "OK");
+
+            }
+        }
+
+
+        private void CloseWindow()
+        {
+            Close();
+            GUIUtility.ExitGUI();
+        }
+
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/Halodi/PackageRegistry/UI/UpgradePackagesView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1f38c8e7a61df01009d0a1d9a8cd169e
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ab3ad5cc6e9818cd498b049fe12c0c47
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 23 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/LICENSE.Tomlyn.md

@@ -0,0 +1,23 @@
+Copyright (c) 2019, Alexandre Mutel
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification
+, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 7 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/LICENSE.Tomlyn.md.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 475ab608e6dbf99409204c1b770d6562
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 21 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/README.md

@@ -0,0 +1,21 @@
+# Third party libraries
+
+To avoid conflicts between packages all third party managed DLL's are prefixed with "860BB79D", which is the CRC32 hash of "com.halodi.halodi-unity-package-creator".
+
+Due to the 260 character limit on windows paths, we avoid prefixing the DLL names with "com.halodi.halodi-unity-package-reigstry-manager"
+
+
+## NewtonSoft JSON
+
+https://www.newtonsoft.com/json
+License: MIT (see LICENSE.Newtonsoft.Json) 
+
+## SharpZipLib
+
+https://github.com/icsharpcode/SharpZipLib
+License: MIT 
+
+## Tomlyn
+
+https://github.com/xoofx/Tomlyn
+License: BSD-2-Clause (see LICENSE.Tomlyn)

+ 7 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/README.md.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 0006809df3aab01ef9e2bb535d02ebd9
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Tomlyn.dll


+ 33 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Tomlyn.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: fe280739c6633ac4682879c184af804f
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 1
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 0
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 1
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 701bc2a7cddabf3a4885c944fc034394
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 13 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/Artees.UnitySemVer.asmdef

@@ -0,0 +1,13 @@
+{
+    "name": "Artees.SemanticVersioning",
+    "references": [],
+    "includePlatforms": [],
+    "excludePlatforms": [],
+    "allowUnsafeCode": false,
+    "overrideReferences": true,
+    "precompiledReferences": [],
+    "autoReferenced": true,
+    "defineConstraints": [],
+    "versionDefines": [],
+    "noEngineReferences": false
+}

+ 7 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/Artees.UnitySemVer.asmdef.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 807287499d1ce5fd6a509eb37593f7da
+AssemblyDefinitionImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 40 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/CloudBuildManifest.cs

@@ -0,0 +1,40 @@
+using System;
+using UnityEngine;
+
+namespace Artees.UnitySemVer
+{
+    /// <summary>
+    /// A parsed <a href="https://docs.unity3d.com/Manual/UnityCloudBuildManifest.html">Unity Cloud Build manifest</a>.
+    /// </summary>
+    internal class CloudBuildManifest
+    {
+        private static CloudBuildManifest _instance;
+
+        public static CloudBuildManifest Instance => _instance ?? (_instance = new CloudBuildManifest());
+
+        /// <summary>
+        /// Returns true if the manifest has been successfully loaded.
+        /// </summary>
+        public readonly bool IsLoaded;
+
+        /// <summary>
+        /// The Unity Cloud Build “build number” corresponding to this build.
+        /// </summary>
+        public readonly int BuildNumber;
+
+        private CloudBuildManifest()
+        {
+            var manifestAsset = Resources.Load<TextAsset>("UnityCloudBuildManifest.json");
+            if (manifestAsset == null) return;
+            var manifest = manifestAsset.text;
+            IsLoaded = true;
+            const string key = "\"buildNumber\"";
+            const StringComparison comparison = StringComparison.Ordinal;
+            var keyStart = manifest.IndexOf(key, comparison);
+            var valueStart = manifest.IndexOf("\"", keyStart + key.Length, comparison) + 1;
+            var valueEnd = manifest.IndexOf("\"", valueStart, comparison);
+            var buildNumber = manifest.Substring(valueStart, valueEnd - valueStart);
+            int.TryParse(buildNumber, out BuildNumber);
+        }
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/CloudBuildManifest.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3827c13e6b66fbeaa8fa6d86711b6ab2
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 21 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/LICENSE

@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 Artees
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 7 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/LICENSE.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 3a5b2e83aa2757a0e8adc6834aff5a52
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 37 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/README.md

@@ -0,0 +1,37 @@
+# Unity SemVer
+[![openupm](https://img.shields.io/npm/v/games.artees.semver?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/games.artees.semver/)
+
+A convenient way to edit and compare version numbers according to the [Semantic Versioning 2.0.0](https://semver.org/) specification. Also includes a property drawer for Unity.
+
+![Property drawer](https://github.com/Artees/Unity-SemVer/raw/master/SemVerDrawer.png)
+
+# Installation
+Install the package **games.artees.semver** using [my package registry](https://artees.games/upm).
+Or install via the [OpenUPM registry](https://openupm.com/packages/games.artees.semver/).
+
+# Usage
+Use the `Artees.UnitySemVer.SemVer` class or apply the `Artees.UnitySemVer.SemVerAttribute` attribute to a string field.
+```
+public SemVer version = new SemVer {major = 1, minor = 2, patch = 3};
+[SemVer] public string versionString = "1.2.3";
+```
+
+Parsing:
+```
+var version = SemVer.Parse("2.0.0-rc.1+build.123");
+```
+
+Comparing:
+```
+Debug.Log("2.1.0"  > version);
+```
+
+Validating:
+```
+var result = version.Validate();
+version = result.Corrected;
+foreach (var message in result.Errors)
+{
+    Debug.LogWarning(message);
+}
+```

+ 7 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/README.md.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 21d9cfaa2380b79739f0f756280752f3
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 238 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVer.cs

@@ -0,0 +1,238 @@
+using System;
+using UnityEngine;
+
+namespace Artees.UnitySemVer
+{
+    /// <summary>
+    /// A semantic version based on the <a href="https://semver.org/">Semantic Versioning 2.0.0</a> specification.
+    /// </summary>
+    [Serializable]
+    public class SemVer : IComparable<SemVer>, IEquatable<SemVer>
+    {
+        public const char IdentifiersSeparator = '.';
+        public const char PreReleasePrefix = '-';
+        public const char BuildPrefix = '+';
+
+        public static bool operator ==(SemVer left, SemVer right)
+        {
+            return Equals(left, right);
+        }
+
+        public static bool operator !=(SemVer left, SemVer right)
+        {
+            return !Equals(left, right);
+        }
+
+        public static bool operator >(SemVer left, SemVer right)
+        {
+            return left.CompareTo(right) > 0;
+        }
+
+        public static bool operator <(SemVer left, SemVer right)
+        {
+            return left.CompareTo(right) < 0;
+        }
+
+        public static bool operator >=(SemVer left, SemVer right)
+        {
+            return left.CompareTo(right) >= 0;
+        }
+
+        public static bool operator <=(SemVer left, SemVer right)
+        {
+            return left.CompareTo(right) <= 0;
+        }
+
+        public static implicit operator string(SemVer s)
+        {
+            return s.ToString();
+        }
+
+        public static implicit operator SemVer(string s)
+        {
+            return Parse(s);
+        }
+
+        public static SemVer Parse(string semVer)
+        {
+            return SemVerConverter.FromString(semVer);
+        }
+
+        /// <summary>
+        /// Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced
+        /// to the public API. It MAY include minor and patch level changes. Patch and minor version MUST be reset to 0
+        /// when major version is incremented.
+        /// <seealso cref="IncrementMajor"/>
+        /// </summary>
+        public uint major;
+
+        /// <summary>
+        /// Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is
+        /// introduced to the public API. It MUST be incremented if any public API functionality is marked as
+        /// deprecated. It MAY be incremented if substantial new functionality or improvements are introduced within
+        /// the private code. It MAY include patch level changes. Patch version MUST be reset to 0 when minor version
+        /// is incremented.
+        /// <seealso cref="IncrementMinor"/>
+        /// </summary>
+        public uint minor;
+
+        /// <summary>
+        /// Patch version Z (x.y.Z | x > 0) MUST be incremented if only backwards compatible bug fixes are introduced.
+        /// </summary>
+        public uint patch;
+
+        /// <summary>
+        /// A pre-release version indicates that the version is unstable and might not satisfy the intended
+        /// compatibility requirements as denoted by its associated normal version.
+        /// </summary>
+        /// <example>1.0.0-<b>alpha</b>, 1.0.0-<b>alpha.1</b>, 1.0.0-<b>0.3.7</b>, 1.0.0-<b>x.7.z.92</b></example>
+        public string preRelease;
+
+        /// <summary>
+        /// Set the <see cref="Build">build</see> metadata automatically
+        /// </summary>
+        /// <seealso cref="Build"/>
+        public SemVerAutoBuild.Type autoBuild;
+
+        [SerializeField] private string build = string.Empty;
+
+        /// <summary>
+        /// Build metadata MUST be ignored when determining version precedence. Thus two versions that differ only in
+        /// the build metadata, have the same precedence.
+        /// </summary>
+        /// <example>1.0.0-alpha+<b>001</b>, 1.0.0+<b>20130313144700</b>, 1.0.0-beta+<b>exp.sha.5114f85</b></example>
+        public string Build
+        {
+            get => SemVerAutoBuild.Instances[autoBuild].Get(build);
+            set => build = SemVerAutoBuild.Instances[autoBuild].Set(value);
+        }
+
+        /// <summary>
+        /// The base part of the version number (Major.Minor.Patch).
+        /// </summary>
+        /// <example>1.9.0</example>
+        /// <returns>Major.Minor.Patch</returns>
+        public string Core => $"{major}.{minor}.{patch}";
+
+        /// <summary>
+        /// An internal version number. This number is used only to determine whether one version is more recent than
+        /// another, with higher numbers indicating more recent versions.
+        /// <a href="https://developer.android.com/studio/publish/versioning"/>
+        /// </summary>
+        /// <returns><c>Major * 10000 + Minor * 100 + Patch</c></returns>
+        public int AndroidBundleVersionCode
+        {
+            get
+            {
+                var clampedPatch = ClampAndroidBundleVersionCode(patch, "Patch");
+                var clampedMinor = ClampAndroidBundleVersionCode(minor, "Minor");
+                return (int) (major * 10000 + clampedMinor * 100 + clampedPatch);
+            }
+        }
+
+        private static uint ClampAndroidBundleVersionCode(uint value, string name)
+        {
+            uint clamped;
+            const uint max = 100;
+            if (value >= max)
+            {
+                clamped = max - 1;
+                Debug.LogWarning(name + " should be less than " + max);
+            }
+            else
+            {
+                clamped = value;
+            }
+
+            return clamped;
+        }
+
+        public SemVer()
+        {
+            minor = 1;
+            preRelease = string.Empty;
+            autoBuild = SemVerAutoBuild.Type.Manual;
+        }
+
+        /// <summary>
+        /// Increment the major version, reset the patch and the minor version to 0.
+        /// </summary>
+        public void IncrementMajor()
+        {
+            major++;
+            minor = patch = 0;
+        }
+
+        /// <summary>
+        /// Increment the minor version, reset the patch version to 0.
+        /// </summary>
+        public void IncrementMinor()
+        {
+            minor++;
+            patch = 0;
+        }
+
+        /// <summary>
+        /// Increment the patch version.
+        /// </summary>
+        public void IncrementPatch()
+        {
+            patch++;
+        }
+
+        /// <summary>
+        /// Check if this semantic version meets the <a href="https://semver.org/">Semantic Versioning 2.0.0</a>
+        /// specification.
+        /// </summary>
+        /// <returns>The result of validation and automatically corrected version number.</returns>
+        public SemVerValidationResult Validate()
+        {
+            return new SemVerValidator().Validate(this);
+        }
+
+        /// <summary>
+        /// Creates a copy of this semantic version.
+        /// </summary>
+        public SemVer Clone()
+        {
+            return new SemVer
+            {
+                major = major,
+                minor = minor,
+                patch = patch,
+                preRelease = preRelease,
+                Build = Build,
+                autoBuild = autoBuild,
+            };
+        }
+
+        public int CompareTo(SemVer other)
+        {
+            return new SemVerComparer().Compare(this, other);
+        }
+
+        public bool Equals(SemVer other)
+        {
+            if (ReferenceEquals(null, other)) return false;
+            if (ReferenceEquals(this, other)) return true;
+            return CompareTo(other) == 0;
+        }
+        
+        public override bool Equals(object obj)
+        {
+            if (ReferenceEquals(null, obj)) return false;
+            if (ReferenceEquals(this, obj)) return true;
+            return obj.GetType() == GetType() && Equals((SemVer) obj);
+        }
+
+        public override int GetHashCode()
+        {
+            throw new NotImplementedException();
+        }
+
+        public override string ToString()
+        {
+            return SemVerConverter.ToString(this);
+        }
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVer.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 61d25493bd7efc0be91154722ca4f557
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 12 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerAttribute.cs

@@ -0,0 +1,12 @@
+using UnityEngine;
+
+namespace Artees.UnitySemVer
+{
+    /// <summary>
+    /// Indicates that a string is a semantic version. It looks like <see cref="SemVer"/> in the Unity's Inspector.
+    /// </summary>
+    public class SemVerAttribute : PropertyAttribute
+    {
+        
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerAttribute.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a865e2b2f8f01fe74a15283aac262bdb
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 74 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerAutoBuild.cs

@@ -0,0 +1,74 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Artees.UnitySemVer
+{
+    /// <summary>
+    /// Sets the <see cref="SemVer.Build">build</see> metadata automatically
+    /// </summary>
+    /// <seealso cref="SemVer.Build"/>
+    public abstract class SemVerAutoBuild
+    {
+        /// <summary>
+        /// <see cref="SemVerAutoBuild"/> implementations
+        /// </summary>
+        public enum Type
+        {
+            /// <summary>
+            /// Disables automatic <see cref="SemVer.Build">build</see> metadata
+            /// </summary>
+            Manual,
+
+            /// <summary>
+            /// Sets the <see cref="SemVer.Build">build</see> metadata to the
+            /// <a href="https://docs.unity3d.com/Manual/UnityCloudBuildManifest.html">Unity Cloud Build</a>
+            /// <see cref="Artees.UnitySemVer.CloudBuildManifest.BuildNumber">“build number”</see>
+            /// </summary>
+            /// <seealso cref="Artees.UnitySemVer.CloudBuildManifest"/>
+            CloudBuildNumber
+        }
+
+        public static readonly IReadOnlyDictionary<Type, SemVerAutoBuild> Instances =
+            new Dictionary<Type, SemVerAutoBuild>
+            {
+                {Type.Manual, new ManualBuild()},
+                {Type.CloudBuildNumber, new CloudBuildNumberBuild()}
+            };
+
+        internal abstract string Get(string build);
+
+        internal abstract string Set(string build);
+
+        private class ManualBuild : SemVerAutoBuild
+        {
+            internal override string Get(string build)
+            {
+                return build;
+            }
+
+            internal override string Set(string build)
+            {
+                return build;
+            }
+        }
+
+        private class CloudBuildNumberBuild : ReadOnly
+        {
+            internal override string Get(string build)
+            {
+                return CloudBuildManifest.Instance.IsLoaded
+                    ? CloudBuildManifest.Instance.BuildNumber.ToString()
+                    : string.Empty;
+            }
+        }
+
+        public abstract class ReadOnly : SemVerAutoBuild
+        {
+            internal sealed override string Set(string build)
+            {
+                Debug.LogWarning("The build metadata is read-only");
+                return build;
+            }
+        }
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerAutoBuild.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7da255b3007599433a91930f1a658967
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 70 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerComparer.cs

@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Artees.UnitySemVer
+{
+    internal class SemVerComparer : IComparer<SemVer>
+    {
+        public int Compare(SemVer x, SemVer y)
+        {
+            if (ReferenceEquals(x, y)) return 0;
+            if (ReferenceEquals(null, y)) return 1;
+            if (ReferenceEquals(x, null)) return -1;
+            var majorComparison = x.major.CompareTo(y.major);
+            if (majorComparison != 0) return majorComparison;
+            var minorComparison = x.minor.CompareTo(y.minor);
+            if (minorComparison != 0) return minorComparison;
+            var patchComparison = x.patch.CompareTo(y.patch);
+            return patchComparison != 0 ? patchComparison : ComparePreReleaseVersions(x, y);
+        }
+
+        private static int ComparePreReleaseVersions(SemVer x, SemVer y)
+        {
+            if (IsPreRelease(x))
+            {
+                if (!IsPreRelease(y)) return -1;
+            }
+            else
+            {
+                return IsPreRelease(y) ? 1 : 0;
+            }
+
+            var xIdentifiers = x.preRelease.Split(SemVer.IdentifiersSeparator);
+            var yIdentifiers = y.preRelease.Split(SemVer.IdentifiersSeparator);
+            var length = Mathf.Min(xIdentifiers.Length, yIdentifiers.Length);
+            for (var i = 0; i < length; i++)
+            {
+                var xIdentifier = xIdentifiers[i];
+                var yIdentifier = yIdentifiers[i];
+                if (Equals(xIdentifier, yIdentifier)) continue;
+                return ComparePreReleaseIdentifiers(xIdentifier, yIdentifier);
+            }
+
+            return xIdentifiers.Length.CompareTo(yIdentifiers.Length);
+        }
+
+        private static bool IsPreRelease(SemVer semVer)
+        {
+            return !string.IsNullOrEmpty(semVer.preRelease);
+        }
+
+        private static int ComparePreReleaseIdentifiers(string xIdentifier, string yIdentifier)
+        {
+            var isXNumber = int.TryParse(xIdentifier, out var xNumber);
+            var isYNumber = int.TryParse(yIdentifier, out var yNumber);
+            if (!isXNumber)
+            {
+                const StringComparison comparison = StringComparison.Ordinal;
+                return isYNumber ? 1 : string.Compare(xIdentifier, yIdentifier, comparison);
+            }
+
+            if (isYNumber)
+            {
+                return xNumber.CompareTo(yNumber);
+            }
+
+            return -1;
+        }
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerComparer.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2e4f2656aa63c5aae9f0e95a538481a2
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 51 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerConverter.cs

@@ -0,0 +1,51 @@
+namespace Artees.UnitySemVer
+{
+    internal static class SemVerConverter
+    {
+        public static SemVer FromString(string semVerString)
+        {
+            var strings = semVerString.Split(SemVer.IdentifiersSeparator, SemVer.PreReleasePrefix, SemVer.BuildPrefix);
+            var preReleaseStart = semVerString.IndexOf(SemVer.PreReleasePrefix);
+            var buildIndex = semVerString.IndexOf(SemVer.BuildPrefix);
+            var preReleaseEnd = buildIndex >= 0 ? buildIndex : semVerString.Length;
+            var preRelease = preReleaseStart >= 0
+                ? semVerString.Substring(preReleaseStart + 1, preReleaseEnd - preReleaseStart - 1)
+                : string.Empty;
+            var build = buildIndex >= 0 ? semVerString.Substring(buildIndex + 1) : string.Empty;
+            uint major = 0;
+            if (strings.Length > 0) uint.TryParse(strings[0], out major);
+            uint minor = 1;
+            if (strings.Length > 1) uint.TryParse(strings[1], out minor);
+            uint patch = 0;
+            if (strings.Length > 2) uint.TryParse(strings[2], out patch);
+            var semVer = new SemVer
+            {
+                major = major,
+                minor = minor,
+                patch = patch,
+                preRelease = preRelease,
+                Build = build
+            };
+            return semVer;
+        }
+
+        public static string ToString(SemVer semVer)
+        {
+            var preRelease =
+                string.IsNullOrEmpty(semVer.preRelease)
+                    ? string.Empty
+                    : $"{SemVer.PreReleasePrefix}{semVer.preRelease}";
+            var build =
+                string.IsNullOrEmpty(semVer.Build)
+                    ? string.Empty
+                    : $"{SemVer.BuildPrefix}{semVer.Build}";
+            return string.Format("{1}{0}{2}{0}{3}{4}{5}",
+                SemVer.IdentifiersSeparator,
+                semVer.major,
+                semVer.minor,
+                semVer.patch,
+                preRelease,
+                build);
+        }
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerConverter.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0f9e174e68f0a02129374b3ac91fe3d8
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 12 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerErrorMessage.cs

@@ -0,0 +1,12 @@
+namespace Artees.UnitySemVer
+{
+    public static class SemVerErrorMessage
+    {
+        public const string Empty = "Pre-release and build identifiers must not be empty";
+
+        public const string Invalid = 
+            "Pre-release and build identifiers must comprise only ASCII alphanumerics and hyphen";
+
+        public const string LeadingZero = "Numeric pre-release identifiers must not include leading zeroes";
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerErrorMessage.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2a7bb66e6d2ef54aca93374afae8bbed
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 32 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerValidationResult.cs

@@ -0,0 +1,32 @@
+using System.Collections.ObjectModel;
+
+namespace Artees.UnitySemVer
+{
+    /// <summary>
+    /// Information returned about a checked semantic version.
+    /// <seealso cref="SemVer.Validate"/>
+    /// </summary>
+    public class SemVerValidationResult
+    {
+        /// <summary>
+        /// Error messages. This collection is empty if the version is valid.
+        /// </summary>
+        public readonly ReadOnlyCollection<string> Errors;
+        
+        /// <summary>
+        /// Automatically corrected semantic version.
+        /// </summary>
+        public readonly SemVer Corrected;
+
+        /// <summary>
+        /// Does the version meet the <a href="https://semver.org/">Semantic Versioning 2.0.0</a> specification?
+        /// </summary>
+        public bool IsValid => Errors.Count == 0;
+
+        internal SemVerValidationResult(ReadOnlyCollection<string> errors, SemVer corrected)
+        {
+            Errors = errors;
+            Corrected = corrected;
+        }
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerValidationResult.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 52627243f647c2e3bbda3a99bc93f30c
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 87 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerValidator.cs

@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+
+namespace Artees.UnitySemVer
+{
+    internal class SemVerValidator
+    {
+        private List<string> _errors;
+        private SemVer _corrected;
+
+        public SemVerValidationResult Validate(SemVer semVer)
+        {
+            _errors = new List<string>();
+            _corrected = semVer.Clone();
+            ValidatePreRelease(semVer);
+            ValidateBuild(semVer);
+            return new SemVerValidationResult(_errors.AsReadOnly(), _corrected.Clone());
+        }
+
+        private void ValidatePreRelease(SemVer semVer)
+        {
+            var identifiers = ValidateIdentifiers(semVer.preRelease);
+            identifiers = ValidateLeadingZeroes(identifiers);
+            var joined = JoinIdentifiers(identifiers);
+            _corrected.preRelease = joined;
+        }
+
+        private void ValidateBuild(SemVer semVer)
+        {
+            if (SemVerAutoBuild.Instances[semVer.autoBuild] is SemVerAutoBuild.ReadOnly) return;
+            var identifiers = ValidateIdentifiers(semVer.Build);
+            var joined = JoinIdentifiers(identifiers);
+            _corrected.Build = joined;
+        }
+
+        private string[] ValidateIdentifiers(string identifiers)
+        {
+            if (string.IsNullOrEmpty(identifiers)) return new string[0];
+            var separators = new[] {SemVer.IdentifiersSeparator};
+            var strings = identifiers.Split(separators, StringSplitOptions.RemoveEmptyEntries);
+            if (strings.Length < identifiers.Count(c => c == SemVer.IdentifiersSeparator) + 1)
+            {
+                _errors.Add(SemVerErrorMessage.Empty);
+            }
+
+            for (var i = 0; i < strings.Length; i++)
+            {
+                var raw = strings[i];
+                var corrected = Regex.Replace(raw, "[^0-9A-Za-z-]", "-");
+                if (string.Equals(raw, corrected)) continue;
+                _errors.Add(SemVerErrorMessage.Invalid);
+                strings[i] = corrected;
+            }
+
+            return strings;
+        }
+
+        private string[] ValidateLeadingZeroes(IList<string> identifiers)
+        {
+            var length = identifiers.Count;
+            var corrected = new string[length];
+            for (var i = 0; i < length; i++)
+            {
+                var identifier = identifiers[i];
+                var isNumeric = int.TryParse(identifier, out var numericIdentifier);
+                if (isNumeric && identifier.StartsWith("0") && identifier.Length > 1)
+                {
+                    corrected[i] = numericIdentifier.ToString();
+                    _errors.Add(SemVerErrorMessage.LeadingZero);
+                }
+                else
+                {
+                    corrected[i] = identifier;
+                }
+            }
+
+            return corrected;
+        }
+
+        private static string JoinIdentifiers(string[] identifiers)
+        {
+            return string.Join(SemVer.IdentifiersSeparator.ToString(), identifiers);
+        }
+    }
+}

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Editor/ThirdParty/Unity-SemVer/SemVerValidator.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7e9342dc023a6f090be08b41d4c907d2
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 202 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/LICENSE.md

@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

+ 7 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/LICENSE.md.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 5924639ebe9748b8e86a3e462ddd84fe
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 93 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/README.md

@@ -0,0 +1,93 @@
+# Halodi Unity Package Registry Manager
+
+This package provides a simple UI to edit scoped registries and set credentials.
+
+To manage package creation and publication, take a look at [Halodi Unity Package Creator  ](https://github.com/Halodi/halodi-unity-package-creator).
+
+![Screenshot of main functionality](Documentation~/halodi-unity-package-registry-manager-screenshot.png)
+
+## License
+
+Apache 2.0
+
+## Installation
+
+In Unity, go to Window -> Package Manager.
+
+Add package from git url (press the + in the top left of the Window). Use the repository URL for this package:
+
+```
+https://github.com/Halodi/halodi-unity-package-registry-manager.git
+```
+
+## Usage 
+
+After installation a new menu "Packages" will appear.
+
+### Manage credentials
+
+Under "Manage credential" you can add, edit and remove credentials in ~/.upmconfig.toml. 
+
+Each registry logs in using a token. If your NPM provider provides a token directly, enter it here. If your provider requires a login, select the method and press "Get Token". Enter required information and press "Login". A token will be requested from the registry. The login information will not get saved.
+
+To always authenticate, set "Always auth" to true;
+
+After setting the registry credentials, it is advised to restart Unity to reload the package manager.
+
+#### Notes for specific providers
+
+**Github**: Create a [Personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line), make sure to select "read:packages" for adding packages to a project and "write:packages" if you want to publish packages. Copy the personal access token directly in the "Token" field (ignore Generate Token).
+
+**Bintray**: In Generate Token, select "bintray" as method and press "Get token". Enter your credentials. Note: Your credentials are not checked here, the token is calculated from your credentials.
+
+**Verdaccio**: In Generate Token, select "npm login" as method and press "Get token". Enter your credentials.
+
+### Manage scoped registries
+
+Using "Manage scoped registries" you can add, edit and remove scoped registries from the projects package manifest.json.
+
+In the same dialog, you can set the credentials for scoped registries. If no token is set, the credentials will be removed from the credential database. For more information, see "Manage credentials".
+
+Note: The authentication settings are saved per-computer, not per project. If you have multiple projects with the same scoped registry, the authentication parameters will be shared.
+
+### Add Packages (Bulk)
+
+Utility to add a list of packages. 
+
+Utility could include
+
+- Sharing a list of packages to be bulk imported a project by copy-pasting
+- Adding packages when the registry does not support listing all packages
+
+Note: The Editor will freeze while downloading the packages. This is expected. A popup with the imported packages will appear when done.
+
+
+## Library functions
+
+This library provides basic NPM functionality in [Halodi.PackageRegistry.NPM](Editor/Halodi/PackageRegistry/NPM.cs). The following functions are implemented
+
+
+### NPM.GetLoginToken(string url, string user, string password)
+
+Same as "npm login --registry [url]". Returns a NPMResponse struct. 
+
+If succesfull, NPMResponse.ok will be set and NPMResponse.token will contain the token.
+If a fault happend, NPMREsponse.error will be set to the error.
+
+### NPM.Publish(string packageFolder, string registry)
+
+Same as "npm publish --registry [registry]" executed in "packageFolder".
+
+The publish functionality uses the credentials set in "~/.upmconfig.toml" to publish to the registry. Use "Manage registries" to set the credentials.
+
+The package tarball is created using SharpZipLib, to avoid compatibility issues with PackageManager.Client.Pack() in Unity.
+
+Throws a System.IO.IOException if an error occurs.
+
+## Bugs and feature requests
+
+Please open a ticket on Github. Pull requests are encouraged.
+
+## Maintainer
+
+[Jesper](jesper@halodi.com)

+ 7 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/README.md.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 851de30f36983cf75b87f89edfac329a
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Tests.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: cb4cfc2933fda19ed95027bf0df94ac1
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Tests/Editor.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d26e9d0d897f2ff3cb41c5d4d4c8985e
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 3 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Tests/Editor/AssemblyInfo.cs

@@ -0,0 +1,3 @@
+using System.Reflection;
+
+[assembly: AssemblyTitle("com.halodi.halodi-unity-package-registry-manager.Editor.Tests")]

+ 11 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Tests/Editor/AssemblyInfo.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6e0e426895d792d2ca7bc29a9b7e67f2
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 23 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Tests/Editor/Halodi.PackageRegistryManager.Tests.asmdef

@@ -0,0 +1,23 @@
+{
+    "name": "Halodi.PackageRegistryManager.Tests",
+    "references": [
+        "UnityEngine.TestRunner",
+        "UnityEditor.TestRunner",
+        "Halodi.PackageRegistryManager.Editor"
+    ],
+    "includePlatforms": [
+        "Editor"
+    ],
+    "excludePlatforms": [],
+    "allowUnsafeCode": false,
+    "overrideReferences": true,
+    "precompiledReferences": [
+        "nunit.framework.dll"
+    ],
+    "autoReferenced": false,
+    "defineConstraints": [
+        "UNITY_INCLUDE_TESTS"
+    ],
+    "versionDefines": [],
+    "noEngineReferences": false
+}

+ 7 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/Tests/Editor/Halodi.PackageRegistryManager.Tests.asmdef.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: f56fe7affb0989254a398cff4738a865
+AssemblyDefinitionImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 25 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/package.json

@@ -0,0 +1,25 @@
+{
+  "name": "com.halodi.halodi-unity-package-registry-manager",
+  "version": "1.0.5",
+  "displayName": "Halodi Package Registry Manager",
+  "type": "tool",
+  "samples": [],
+  "description": "Simple tool to manage scoped registries and NPM credentials.",
+  "license": "Apache-2.0",
+  "author": {
+    "name": "Halodi",
+    "email": "jesper@halodi.com",
+    "url": "https://halodi.com"
+  },
+  "dependencies": {
+    "com.unity.nuget.newtonsoft-json": "3.0.2",
+    "com.unity.sharp-zip-lib": "1.3.4-preview"
+  },
+  "publishConfig": {
+    "registry": ""
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/Halodi/halodi-unity-package-registry-manager.git"
+  }
+}

+ 7 - 0
Packages/com.halodi.halodi-unity-package-registry-manager/package.json.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 4480134b80472dc1a847e756ab3917cc
+PackageManifestImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 1
Packages/manifest.json

@@ -44,6 +44,13 @@
       "scopes": [
         "com.tuyoogame.yooasset"
       ]
+    },
+    {
+      "name": "ET-Packages",
+      "url": "https://npm.pkg.github.com/@ET-Packages",
+      "scopes": [
+        "cn.etetet"
+      ]
     }
   ]
-}
+}