feat(export-package): enforce complete game asset packages - #97
feat(export-package): enforce complete game asset packages#97xyh202131 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| return safeSegment(id, 'id').slice(-8) || 'id' | ||
| } | ||
|
|
||
| function packageRoot(model: ExportPackageModel): string { |
There was a problem hiding this comment.
High: this root omits outfitId/outfitName, even though the app routes exports by characterId and outfitId. Two outfits for the same character will generate the same ZIP name and internal folder root, so one export can overwrite or mask another on disk. Include the outfit identifier in the package root or filename.
| const reason = error instanceof Error ? error.message : '未知错误' | ||
| throw new Error(`${field}: 图片读取失败(${reason})`) | ||
| } | ||
| if (blob.type.toLowerCase() !== 'image/png') throw new Error(`${field}: 文件类型必须是 image/png`) |
There was a problem hiding this comment.
Medium: this hard MIME check rejects valid PNG bytes whenever the response Blob has an empty or generic type (common when the server omits Content-Type). The code already validates the PNG signature and alpha channel from the bytes, so this extra gate can fail legitimate exports unnecessarily.
功能项
提供浏览器端游戏资产打包与导出边界,将已确认且质量合格的动作整理为结构稳定、可校验的 ZIP 资源包。
本次更新
meta.json契约与 JSON Schema,并在打包前执行字段级校验。meta.json和包内 README。AssetExportTarget扩展边界与 Cocos target 占位实现,通用导出层不绑定具体引擎。业务边界
.anim/.meta尚未生成:在真实 Creator 3.x 验证格式前,不宣称支持“拖入即播放”。提交范围
frontend/src/features/export-package/下 11 个模块、测试与说明文件。frontend/package.json、frontend/package-lock.json,用于gifenc与 Schema 测试依赖。验证
git diff --check:通过Refs #94