refactor: clean upload pipeline and restore draco delivery
This commit is contained in:
+31
-14
@@ -1,6 +1,23 @@
|
||||
import type { AssetCategory } from './asset-classification'
|
||||
import type { FileChange } from './types'
|
||||
import type { PreparedAssetSummary } from './types'
|
||||
import { ASSET_FAMILIES } from './asset-naming'
|
||||
import type { AssetCategory, FileChange, PreparedAssetSummary } from './types'
|
||||
|
||||
const ASSET_SECTION_ORDER: AssetCategory[] = [...ASSET_FAMILIES, 'assets']
|
||||
|
||||
function getChangePrefix(change: FileChange) {
|
||||
if (change === 'new') return '✅'
|
||||
if (change === 'changed') return '🔄'
|
||||
return null
|
||||
}
|
||||
|
||||
function addGroupedAssetLine(
|
||||
grouped: Map<AssetCategory, string[]>,
|
||||
category: AssetCategory,
|
||||
line: string,
|
||||
) {
|
||||
const current = grouped.get(category) || []
|
||||
current.push(line)
|
||||
grouped.set(category, current)
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a formatted commit message based on the upload context.
|
||||
@@ -25,7 +42,6 @@ export function buildCommitMessage(
|
||||
|
||||
const lines: string[] = [title, '']
|
||||
|
||||
// Model section — show status for new, changed, or unchanged
|
||||
const modelSummary = assetSummaries.find((asset) => asset.kind === 'model')
|
||||
const modelChange = fileChanges.get(modelFilename.toLowerCase())
|
||||
if (modelChange === 'new') {
|
||||
@@ -45,15 +61,16 @@ export function buildCommitMessage(
|
||||
if (asset.kind === 'model' || !asset.category) continue
|
||||
|
||||
const change = fileChanges.get(asset.filename.toLowerCase())
|
||||
if (change === 'new') {
|
||||
const current = grouped.get(asset.category) || []
|
||||
current.push(` ✅ ${asset.filename}${asset.compressed ? ' (compressed)' : ''}`)
|
||||
grouped.set(asset.category, current)
|
||||
} else if (change === 'changed') {
|
||||
const current = grouped.get(asset.category) || []
|
||||
current.push(` 🔄 ${asset.filename}${asset.compressed ? ' (compressed)' : ''}`)
|
||||
grouped.set(asset.category, current)
|
||||
}
|
||||
if (!change) continue
|
||||
|
||||
const prefix = getChangePrefix(change)
|
||||
if (!prefix) continue
|
||||
|
||||
addGroupedAssetLine(
|
||||
grouped,
|
||||
asset.category,
|
||||
` ${prefix} ${asset.filename}${asset.compressed ? ' (compressed)' : ''}`,
|
||||
)
|
||||
}
|
||||
|
||||
const sectionTitles: Record<AssetCategory, string> = {
|
||||
@@ -69,7 +86,7 @@ export function buildCommitMessage(
|
||||
assets: '🧩 Assets',
|
||||
}
|
||||
|
||||
for (const category of ['color', 'diffuse', 'roughness', 'normal', 'metalness', 'height', 'opacity', 'orm', 'ao', 'assets'] as const) {
|
||||
for (const category of ASSET_SECTION_ORDER) {
|
||||
const entries = grouped.get(category)
|
||||
if (!entries || entries.length === 0) continue
|
||||
lines.push('')
|
||||
|
||||
Reference in New Issue
Block a user