Skip to content

[break] fix(assets): align property schema with config schema#688

Open
Changdw wants to merge 1 commit into
cocos:mainfrom
Changdw:fix/assets-query-property-schema-config-schema
Open

[break] fix(assets): align property schema with config schema#688
Changdw wants to merge 1 commit into
cocos:mainfrom
Changdw:fix/assets-query-property-schema-config-schema

Conversation

@Changdw

@Changdw Changdw commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

主要变更

#677 上做的一点调整
本 PR 的核心变更是:assets.queryPropertySchema(importer) 返回的属性 schema,改为直接使用配置系统的 ICocosConfigurationPropertySchema

顶层返回仍保持 Record<string, ICocosConfigurationPropertySchema>,不额外包 { type: 'object', properties: ... }。调用方拿到的仍是“属性名 -> 属性 schema”的 map,但 value 字段与配置系统保持一致。

配套变更

为支持主变更,同步做了这些调整:

  • AssetPropertySchemaMap 改为 Record<string, ICocosConfigurationPropertySchema>
  • 移除旧的 AssetPropertySchema / AssetPropertySchemaOption / AssetPropertySchemaType
  • assets-query-property-schema 的 Zod result schema 改为配置系统字段
  • propertySchemaConfig 源头从旧 Creator 风格配置改为配置系统 schema
  • queryPropertySchema 不再从 userDataConfig.default fallback 转换,只返回显式声明的 propertySchemaConfig
  • queryAssetConfigMap 的旧 userData config 行为保持不变
  • 更新 dts snapshot 和相关测试

字段变化:

旧字段 新字段
label title
options enum + enumDescriptions
min minimum
max maximum
itemConfigs properties
raw 不再返回

@Changdw Changdw requested a review from yanOO1497 June 26, 2026 08:57
@Changdw Changdw changed the title fix(assets): align property schema with config schema [break] fix(assets): align property schema with config schema Jun 26, 2026
@star-e star-e added the pending Not ready yet label Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending Not ready yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants