mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-10-21 04:44:20 +08:00
fix: 补齐市场静态事实并保持旧客户端兼容 (#184)
## 中文 补齐已有 owner 与已锁定上游内容可证明的许可证、技能类型和收录版本。保留 Anthropic Source Available 和其他附加条件,不把所有内容统一标为 MIT,不提升 listing-only 的安装准入。 README 保留最新的双语结构及以 manifest 为准的数量口径,增加静态目录不存访问量、下载量、评分或 Stars 的边界。 发布兼容性:**本 PR 不包含**两支团队新增的本地化字段,也不包含微信支付 `latestVersion: 1.0`;旧客户端会拒绝这些新字段,另以待发布 PR 保留,等匹配客户端发布后再合并。 验证:47 项目录校验测试、19 项 i18n 测试、5 项合集生成测试通过;完整目录/i18n/翻译新鲜度检查通过,6 个固定来源合集的生成检查通过,2 个浮动来源按既有规则明确跳过。发现并修复了生成器在 Windows 使用反斜杠造成的误报:输出改为 POSIX 路径,比较规则不放宽、不重写合集数据。 ## English Fill only license, type and listed-release facts supported by existing owners or pinned upstream content. Preserve custom license restrictions and acquisition eligibility. Keep the current bilingual README and manifest-derived inventory; do not author usage analytics. This PR deliberately excludes localized team fields and the two-part WeChat Pay version that older clients reject. Those changes remain pending a compatible client release. Validation passes: 47 catalog-validator tests, 19 i18n tests, five collection-generator tests, complete catalog and translation checks, and generated inventory checks for six pinned collections. Two mutable sources remain explicitly skipped. Fix Windows-generated path separators without weakening comparison or changing declared children.
This commit is contained in:
@@ -66,6 +66,16 @@ class CollectionGeneratorCheckTests(unittest.TestCase):
|
||||
self.assertEqual(before, self.entry_path.read_bytes(), "--check must never write entry.json")
|
||||
return result
|
||||
|
||||
def test_discovery_uses_portable_git_paths(self) -> None:
|
||||
repo = Path(self.tempdir.name) / "repo"
|
||||
skill_dir = repo / "skills" / "child-one"
|
||||
skill_dir.mkdir(parents=True)
|
||||
(skill_dir / "SKILL.md").write_text("---\nname: child-one\n---\n", encoding="utf-8")
|
||||
self.assertEqual(
|
||||
GENERATOR.discover_children(repo),
|
||||
[{"id": "child-one", "path": "skills/child-one"}],
|
||||
)
|
||||
|
||||
def test_check_accepts_current_children_without_writing(self) -> None:
|
||||
self.assertTrue(self.run_check(self.children))
|
||||
|
||||
|
||||
@@ -145,7 +145,8 @@ def discover_children(repo_dir: Path) -> list[dict]:
|
||||
seen[child_id] = str(rel.parent)
|
||||
|
||||
fm = parse_frontmatter(skill_md)
|
||||
child: dict = {"id": child_id, "path": str(rel.parent)}
|
||||
# Git catalog paths use POSIX separators on every contributor platform.
|
||||
child: dict = {"id": child_id, "path": rel.parent.as_posix()}
|
||||
name = fm.get("display_name") or fm.get("name")
|
||||
if name and str(name) != child_id:
|
||||
child["name"] = str(name)
|
||||
|
||||
Reference in New Issue
Block a user