GFramework/tools/gframework-config-tool
GeWuYou 9fadde0a44 test(config): 添加配置验证功能的全面单元测试
- 实现了对嵌套对象和对象数组元数据捕获的测试
- 添加了标量、对象、数组、整数和布尔类型常量元数据测试
- 验证了空字符串常量原始值和显示元数据的保留功能
- 测试了对象常量可比较键的构建逻辑
- 实现了嵌套映射和对象数组解析功能的测试
- 验证了复杂映射键的保留功能
- 添加了缺失和未知嵌套属性报告的测试
- 实现了对象数组项目问题检测功能的测试
- 验证了深层枚举不匹配的报告功能
- 测试了标量常量不匹配检测功能
- 实现了各种类型常量匹配验证的测试
- 验证了对象常量比较标准化但保持数组顺序的功能
- 添加了对象和数组常量不匹配检测的测试
- 实现了整数和布尔常量标量标准化及不匹配测试
- 验证了数字范围和字符串长度不匹配检测功能
- 测试了独占边界、模式和数组项目计数不匹配检测
- 实现了支持字符串格式验证的测试
- 验证了受支持字符串格式接受功能
- 添加了独占最大值和最大项目违规检测的测试
- 实现了对象属性计数不匹配报告功能的测试
- 验证了唯一对象属性计数约束功能
- 测试了倍数和唯一项目违规检测功能
- 实现了包含匹配计数违规报告的测试
- 验证了结构无效项目时跳过包含匹配计数功能
- 测试了仅值级违规时继续包含匹配计数功能
- 实现了最大包含违规检测的测试
- 验证了满足包含约束接受功能
- 测试了对象包含匹配允许额外声明字段功能
- 实现了大十进制倍数无浮点漂移接受的测试
- 验证了非实际倍数大数字拒绝功能
- 测试了科学记数法数字接受功能
- 实现了Unicode语义应用模式的测试
- 验证了无效数组项目跳过唯一项目检查功能
- 测试了一次通过报告每个唯一项目重复功能
- 实现了避免不同对象唯一项目可比较键冲突的测试
- 验证了标量范围和长度元数据捕获功能
- 测试了独占边界、模式和数组项目计数元数据捕获
- 实现了支持字符串格式元数据捕获的测试
2026-04-16 18:48:15 +08:00
..

GFramework Config Tool

VS Code extension for the GFramework AI-First config workflow.

Current MVP

  • Browse config files from the workspace config/ directory
  • Open raw YAML files
  • Open matching schema files from schemas/
  • Localize extension UI text in English and Simplified Chinese, including the form preview, prompts, and notifications
  • Run lightweight schema validation for nested required fields, unknown nested fields, scalar types, scalar arrays, and arrays of objects
  • Open a lightweight form preview for nested object fields, object arrays, top-level scalar fields, and scalar arrays
  • Render existing YAML comments in the form preview and edit per-field YAML comments directly from the form
  • Jump from reference fields to the referenced schema, config domain, or direct config file when a reference value is present
  • Initialize empty config files from schema-derived example YAML
  • Batch edit one config domain across multiple files for top-level scalar and scalar-array fields
  • Surface schema metadata such as title, description, default, enum, and x-gframework-ref-table in the lightweight editors

Validation Coverage

The extension currently validates the repository's minimal config-schema subset:

  • required properties in nested objects
  • unknown properties in nested objects
  • scalar compatibility for integer, number, boolean, and string
  • scalar arrays with scalar item type checks
  • arrays of objects whose items use the same supported subset recursively
  • scalar enum constraints and scalar-array item enum constraints

Local Testing

cd tools/gframework-config-tool
bun install
bun run test

Packaging And Publishing

cd tools/gframework-config-tool
bun install
bun run package:vsix
VSCE_PAT=your_marketplace_pat bun run publish:marketplace

Current Constraints

  • Multi-root workspaces use the first workspace folder
  • Validation only covers a minimal subset of JSON Schema
  • Form preview supports object-array editing, but nested object arrays inside array items still fall back to raw YAML
  • Batch editing remains limited to top-level scalar fields and top-level scalar arrays

Workspace Settings

  • gframeworkConfig.configPath
  • gframeworkConfig.schemasPath