GFramework/tools/gframework-config-tool
GeWuYou 0320404514 docs(config): 添加游戏内容配置系统完整文档与验证工具实现
- 新增游戏内容配置系统详细文档,涵盖 YAML 配置、JSON Schema 结构、目录组织等核心概念
- 实现配置验证工具,支持运行时校验、类型检查、引用验证等功能
- 提供完整的接入模板,包括项目结构、CSProj 配置、启动帮助器等推荐实践
- 集成 VS Code 插件支持,提供配置浏览、表单编辑、递归校验等开发期工具能力
- 实现热重载机制,支持开发期配置文件变更自动刷新运行时表
- 添加详细的 Schema 示例和 YAML 示例,展示怪物、物品等游戏内容配置的实际应用
- 提供 Architecture 接入模板,支持与现有架构的无缝集成
- 实现跨表引用校验,确保配置数据的一致性和完整性
2026-04-10 12:22:20 +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