refactor: clean upload pipeline and restore draco delivery

This commit is contained in:
Tom Boullay
2026-04-29 16:29:32 +02:00
parent 097b8f6486
commit 498765db61
32 changed files with 769 additions and 215 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ import { getModelFolderPath } from '@/lib/model-paths'
import { ensurePreparedStagingAssets } from '@/lib/upload-staging'
import { parseStagingRequestBody } from '@/lib/upload-request'
import { getErrorMessage } from '@/lib/guards'
import type { FileDiff } from '@/lib/types'
export const runtime = 'nodejs'
export const dynamic = 'force-dynamic'
@@ -37,7 +38,7 @@ export async function POST(req: NextRequest) {
const remoteFileMap = new Map(files.map((file) => [file.name.toLowerCase(), file.size]))
const { fileChanges, deletedFileNames } = classifyFileChanges(filesToPush, remoteFileMap, folderPath)
const diffs: Array<{ name: string; status: 'new' | 'changed' | 'deleted' }> = []
const diffs: FileDiff[] = []
for (const [name, status] of fileChanges.entries()) {
if (status === 'new' || status === 'changed') {
+2 -1
View File
@@ -10,6 +10,7 @@ import {
import { acquireUploadLock, releaseUploadLock } from '@/lib/upload-lock'
import { parseDriveRequestBody } from '@/lib/upload-request'
import { getErrorMessage } from '@/lib/guards'
import type { DriveAction } from '@/lib/types'
export const runtime = 'nodejs'
export const dynamic = 'force-dynamic'
@@ -27,7 +28,7 @@ export async function POST(req: NextRequest) {
let folderName: string
let parsedFiles: Awaited<ReturnType<typeof readStagedOriginalFiles>>['files']
let action: 'new' | 'replace'
let action: DriveAction
try {
const body: unknown = await req.json()
+1 -1
View File
@@ -13,7 +13,7 @@ export async function POST(req: NextRequest) {
try {
const parsed = await parseMultiUpload(req)
const staged = await createStagingUpload(parsed.folderName, parsed.files)
const staged = await createStagingUpload(parsed.folderName, parsed.files, parsed.gitModelMode)
return NextResponse.json({ success: true, ...staged })
} catch (err) {
const message = getErrorMessage(err)