Skip to content

feat: subSeries 重构为子目录前缀映射#23

Merged
TrueNine merged 2 commits intomainfrom
dev
Feb 18, 2026
Merged

feat: subSeries 重构为子目录前缀映射#23
TrueNine merged 2 commits intomainfrom
dev

Conversation

@TrueNine
Copy link
Copy Markdown
Owner

@TrueNine TrueNine commented Feb 18, 2026

Summary

  • 重构 subSeries 语义:从规则系列扩展改为子目录前缀映射
  • 新增 applySubSeriesGlobPrefix 函数,支持智能 glob 拼接和重复前缀检测
  • 更新所有 OutputPlugin 以支持新的 subSeries 功能

Changes

核心功能变更

subSeries 语义变更:

// 新语义:子目录前缀映射
{
  "rules": {
    "subSeries": {
      "applet": ["uniapp3"],           // uniapp3 规则的 globs 加 applet/ 前缀
      "example_applet": ["uniapp3"]    // uniapp3 规则的 globs 加 example_applet/ 前缀
    }
  }
}

修改的文件

文件 变更
cli/src/utils/ruleFilter.ts 删除 expandWithSubSeries,简化 filterRulesByProjectConfig,新增 applySubSeriesGlobPrefix
cli/src/plugins/CursorOutputPlugin.ts 添加 applySubSeriesGlobPrefix 调用
cli/src/plugins/KiroCLIOutputPlugin.ts 添加 applySubSeriesGlobPrefix 调用
cli/src/plugins/ClaudeCodeCLIOutputPlugin.ts 添加 applySubSeriesGlobPrefix 调用
cli/src/plugins/WindsurfOutputPlugin.ts 添加 applySubSeriesGlobPrefix 调用
测试文件 更新所有 subSeries 相关测试

功能特性

  • 智能 glob 转换*.vue{prefix}/**/*.vue
  • 重复前缀跳过:glob 已有某前缀时保留原样,仅添加缺失的前缀
  • 路径标准化:自动处理 ./prefixprefix/
  • 仅项目级规则:全局规则不受影响

Test plan

  • 单元测试:ruleFilter.test.ts 新增 applySubSeriesGlobPrefix 测试
  • 属性测试:ruleFilter.property.test.ts 新增属性测试
  • 集成测试:所有 OutputPlugin 的 projectConfig 测试已更新
  • 实际验证:在 wuzhiyuan-t0003 项目中验证 globs 前缀正确添加

Enhanced the rule filtering logic across multiple output plugins by introducing the `applySubSeriesGlobPrefix` function. This function modifies the glob patterns of rules based on their associated subSeries in the project configuration, ensuring more accurate file matching. Additionally, removed redundant test cases related to subSeries expansion and updated existing tests to reflect the new functionality. This change improves the flexibility and accuracy of rule handling in project configurations.
@TrueNine TrueNine merged commit 23a8066 into main Feb 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant