From 3894c0c599655521e861a92d40cceef23ddff406 Mon Sep 17 00:00:00 2001 From: CPTProgrammer <46586216+CPTProgrammer@users.noreply.github.com> Date: Sat, 19 Sep 2026 00:02:58 +0800 Subject: [PATCH] Add update feature for existing platform versions Extend existing releases' title and compatible MC versions without re-uploading files, via Modrinth PATCH /version/{id} and CurseForge update-file. Adds an UpdateModal with range/title diff preview, an update tRPC mutation sharing the progress subscription with publish, and dry-run interception for Modrinth PATCH requests. --- src/components/MainPage.tsx | 29 +- src/components/UpdateModal.tsx | 684 +++++++++++++++++++++++++++ src/lib/modrinth/client.ts | 7 +- src/lib/utils/dryRun.ts | 6 +- src/lib/utils/mcVersion.ts | 7 + src/services/platforms/curseforge.ts | 115 ++++- src/services/platforms/modrinth.ts | 45 +- src/services/publish.schemas.ts | 39 +- src/services/publish.ts | 209 +++++++- src/services/versions.ts | 21 + src/types/curseforge/files.ts | 2 + src/types/modrinth/version.ts | 2 + 12 files changed, 1108 insertions(+), 58 deletions(-) create mode 100644 src/components/UpdateModal.tsx diff --git a/src/components/MainPage.tsx b/src/components/MainPage.tsx index 1499b0e..0eb7cb0 100644 --- a/src/components/MainPage.tsx +++ b/src/components/MainPage.tsx @@ -2,10 +2,11 @@ import { useState, useCallback } from "react"; import { Typography, Space, Card, Button, theme } from "antd"; -import { CloudUploadOutlined } from "@ant-design/icons"; +import { CloudUploadOutlined, SyncOutlined } from "@ant-design/icons"; import { ConfigSelector } from "./ConfigSelector"; import { VersionTable } from "./VersionTable"; import { PublishModal } from "./PublishModal"; +import { UpdateModal } from "./UpdateModal"; import type { Config } from "@/types"; import type { ParsedProject } from "@/services/project"; import type { McVersionEntry } from "@/lib/utils/mcVersion"; @@ -60,11 +61,16 @@ export function MainPage({ initialConfigs }: MainPageProps) { // ------- Publish ------- const [publishOpen, setPublishOpen] = useState(false); + const [updateOpen, setUpdateOpen] = useState(false); const handlePublishClose = useCallback(() => { setPublishOpen(false); }, []); + const handleUpdateClose = useCallback(() => { + setUpdateOpen(false); + }, []); + const handleRangesChange = useCallback( (_ranges: McVersionEntry[] | null, end: string | null) => { setLastVersionEnd(end); @@ -104,15 +110,23 @@ export function MainPage({ initialConfigs }: MainPageProps) { onRangesChange={handleRangesChange} /> - {/* Publish button */} + {/* Publish & Update buttons */} {parsedProject && parsedProject.artifacts.length > 0 && (
+