using System.Collections.Generic; namespace Amanotes { internal static class CommonPackagesRegistry { internal enum InstallType { /// Install by name from Unity Registry (e.g. "3.2.1") UnityRegistry, /// Install via git URL in manifest GitUrl, /// Install by name from a scoped registry (npm, OpenUPM, etc.) ScopedRegistry, } internal struct ScopedRegistryInfo { public string registryName; public string url; public string scope; /// Short label shown as a tag in the UI (e.g. "NPM", "OpenUPM") public string tag; } internal struct Entry { public string name; public string displayName; public InstallType installType; /// /// Git URL (for GitUrl type) or empty/null for registry types. /// public string installRef; /// /// Scoped registry required for ScopedRegistry install type. Null for others. /// public ScopedRegistryInfo? scopedRegistry; /// /// Extra dependencies to inject into manifest alongside this package /// (workaround for packages that don't declare all their deps). /// Each entry is "packageName": "version". /// public string[][] requiredDeps; } // ── Scoped registries ────────────────────────────────────────── private static readonly ScopedRegistryInfo NpmJs = new ScopedRegistryInfo { registryName = "npmjs", url = "https://registry.npmjs.org", tag = "NPM", }; private static readonly ScopedRegistryInfo AmanotesGitLab = new ScopedRegistryInfo { registryName = "Amanotes GitLab", url = "https://gitlab.amanotes.net/api/v4/projects/592/packages/npm/", tag = "GitLab", }; private static readonly ScopedRegistryInfo OpenUPM = new ScopedRegistryInfo { registryName = "OpenUPM", url = "https://package.openupm.com", tag = "OpenUPM", }; // ── Package list ─────────────────────────────────────────────── internal static readonly List Packages = new List { // ── Git URL packages ──────────────────────────────────── new Entry { name = "com.cysharp.unitask", displayName = "UniTask", installType = InstallType.GitUrl, installRef = "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask", }, new Entry { name = "com.coplaydev.unity-mcp", displayName = "MCP for Unity", installType = InstallType.GitUrl, installRef = "https://github.com/CoplayDev/unity-mcp.git?path=/MCPForUnity#main", requiredDeps = new[] { new[] { "com.unity.modules.imageconversion", "1.0.0" } }, }, new Entry { name = "com.boxqkrtm.ide.cursor", displayName = "Cursor IDE", installType = InstallType.GitUrl, installRef = "https://github.com/boxqkrtm/com.unity.ide.cursor.git", }, new Entry { name = "com.annulusgames.lit-motion", displayName = "LitMotion", installType = InstallType.GitUrl, installRef = "https://github.com/annulusgames/LitMotion.git?path=src/LitMotion/Assets/LitMotion", }, // ── OpenUPM packages (scope: com.coffee) ────────────────── new Entry { name = "com.coffee.ui-effect", displayName = "UI Effect", installType = InstallType.ScopedRegistry, scopedRegistry = WithScope(OpenUPM, "com.coffee"), }, new Entry { name = "com.coffee.ui-particle", displayName = "UI Particle", installType = InstallType.ScopedRegistry, scopedRegistry = WithScope(OpenUPM, "com.coffee"), }, new Entry { name = "com.coffee.softmask-for-ugui", displayName = "Soft Mask", installType = InstallType.ScopedRegistry, scopedRegistry = WithScope(OpenUPM, "com.coffee"), }, // ── OpenUPM packages (scope: com.google) ────────────────── new Entry { name = "com.google.external-dependency-manager", displayName = "External Dependency Manager", installType = InstallType.ScopedRegistry, scopedRegistry = WithScope(OpenUPM, "com.google.external-dependency-manager"), }, // ── NPM packages (scope: co.balancy) ────────────────────── new Entry { name = "co.balancy.unity", displayName = "Balancy", installType = InstallType.ScopedRegistry, scopedRegistry = WithScope(NpmJs, "co.balancy"), }, // ── NPM packages (scope: com.amanotes) ──────────────────── new Entry { name = "com.amanotes.gdk", displayName = "Amanotes GDK", installType = InstallType.ScopedRegistry, scopedRegistry = WithScope(NpmJs, "com.amanotes"), requiredDeps = new[] { new[] { "com.unity.modules.unitywebrequest", "1.0.0" }, new[] { "com.unity.modules.ui", "1.0.0" }, new[] { "com.unity.modules.imgui", "1.0.0" }, new[] { "com.unity.modules.androidjni", "1.0.0" }, new[] { "com.unity.modules.audio", "1.0.0" }, new[] { "com.unity.ugui", "1.0.0" }, new[] { "com.cysharp.unitask", "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask" }, }, }, new Entry { name = "com.amanotes.magictilescore", displayName = "Magic Tiles Core", installType = InstallType.ScopedRegistry, scopedRegistry = WithScope(AmanotesGitLab, "com.amanotes.magictilescore"), }, new Entry { name = "com.amanotes.orchestra", displayName = "Orchestra", installType = InstallType.ScopedRegistry, scopedRegistry = WithScope(NpmJs, "com.amanotes"), }, // ── Unity Registry packages ──────────────────────────────── new Entry { name = "com.unity.nuget.newtonsoft-json", displayName = "Newtonsoft Json", installType = InstallType.UnityRegistry, }, }; /// Clone a registry info with a specific scope. private static ScopedRegistryInfo WithScope(ScopedRegistryInfo template, string scope) { return new ScopedRegistryInfo { registryName = template.registryName, url = template.url, scope = scope, tag = template.tag, }; } } }