重构:更新前端开发者角色文档,移除冗余的执行策略,新增微信小程序专项开发部分;更新资源注册表,统一时间戳格式,移除不再使用的资源注册逻辑,优化工具定义获取方式,提升代码可读性和维护性。

This commit is contained in:
sean
2025-06-13 22:57:17 +08:00
parent ac74f37f6c
commit 714c01c4f4
18 changed files with 550 additions and 1117 deletions

View File

@ -46,7 +46,7 @@ class ResourceData {
/**
* 从文件路径和协议推断创建ResourceData
* @param {string} filePath - 文件路径
* @param {string} filePath - 文件路径仅用于提取ID不保存
* @param {string} source - 资源来源
* @param {string} protocol - 资源协议
* @param {string} reference - 资源引用
@ -64,7 +64,6 @@ class ResourceData {
description: ResourceData._generateDefaultDescription(fileName, protocol),
reference,
metadata: {
filePath,
inferredFromFile: true
}
})
@ -189,6 +188,23 @@ class ResourceData {
}
}
/**
* 动态获取文件路径
* 通过解析 reference 动态计算实际的文件路径
* @returns {Promise<string>} 文件路径
*/
async getFilePath() {
const ProtocolResolver = require('./ProtocolResolver')
const resolver = new ProtocolResolver()
try {
const resolvedPath = await resolver.resolve(this.reference)
return resolvedPath
} catch (error) {
throw new Error(`无法解析资源路径 ${this.reference}: ${error.message}`)
}
}
/**
* 克隆资源数据
* @returns {ResourceData} 克隆的实例