Skip to content

v0.8.0 — Project config + dry-run

Choose a tag to compare

@Rosalina7515 Rosalina7515 released this 18 May 14:38
· 3 commits to main since this release

What's new

Added

  • .ui-modernizer.json project config. Drop this at your project root to encode team-level defaults: which profile, which files to ignore, max files cap, strict mode, screenshot routes, substitution component
    allowlist, AST-required gate. Full schema in references/config-file.md.
  • scripts/dry-run.mjs — read-only modernization preview. Walks UI files, counts stale class patterns by rule and by file, exits 0 normally or 1 in --ci / strict mode if any candidates exist. Drop-in for
    pre-commit and CI lint jobs.
  • scripts/load-config.mjs — config loader/validator. CLI: node scripts/load-config.mjs --pretty. Programmatic: import { loadConfig } from './scripts/load-config.mjs'.
  • New reference: references/config-file.md — full schema, field reference, common recipes.
  • New example file: .ui-modernizer.example.json.

Changed

  • SKILL.md Step 0 (new) loads config before detection. Step 2 (PLAN) respects profile, brand override, ignore, maxFiles, strict.
  • scripts/ast-extract.mjs refactored to export extractFile() (CLI behavior preserved).

新增

  • .ui-modernizer.json 项目级配置。在项目根目录放这个文件,把团队级默认行为固化下来:用哪个 profile、忽略哪些文件、单次最大文件数、严格模式、截图路由、可替换组件白名单、AST 是否强制。完整 schema 见
    references/config-file.md
  • scripts/dry-run.mjs —— 只读的现代化预览。扫描 UI 文件,按规则和文件统计陈旧 class 候选,正常退出 0,--cistrict: true 模式下发现候选时退出 1。可挂 pre-commit 或 CI lint job。
  • scripts/load-config.mjs —— 配置加载器 / 校验器。CLI:node scripts/load-config.mjs --pretty。也可作为模块 import。
  • 新增参考文档:references/config-file.md —— 完整 schema、字段说明、常用 recipe。
  • 新增示例文件:.ui-modernizer.example.json

改动

  • SKILL.md 新增 Step 0(LOAD CONFIG)在检测之前。Step 2(PLAN)尊重 profile / brand 覆盖 / ignore / maxFiles / strict
  • scripts/ast-extract.mjs 重构以 export extractFile()(CLI 行为保留)。