GeWuYou 01616c745d feat(config-tool): 添加配置验证工具和相关功能
- 实现了配置模式解析器,支持嵌套对象和数组结构
- 添加了YAML解析和验证功能,支持语法检查和类型匹配
- 实现了批量编辑器,支持标量和标量数组属性的更新
- 添加了表单更新应用功能,可将更改写回YAML文件
- 提供了完整的单元测试覆盖核心功能验证
- 配置了项目依赖管理和忽略规则
- 添加了Apache 2.0许可证文件
2026-04-01 23:06:44 +08:00

56 lines
1.8 KiB
Markdown

# 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/`
- 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
- 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
```bash
cd tools/vscode-config-extension
bun install
bun run test
```
## Packaging And Publishing
```bash
cd tools/vscode-config-extension
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`