mirror of
https://github.com/jnMetaCode/superpowers-zh.git
synced 2026-09-02 22:54:06 +08:00
补齐上游漏的根级文件:CLAUDE.md(翻译 + 中文 fork 备注)、
AGENTS.md(symlink → CLAUDE.md,跟上游 mode 120000 一致)、
RELEASE-NOTES.md(上游英文原样 1180 行)、RELEASE-NOTES.zh.md
(新建中文 fork 自身 release log)、.codex-plugin/plugin.json
(中文化)、.version-bump.json、scripts/bump-version.sh、
assets/{app-icon.png,superpowers-small.svg}、4 个上游新增测试。
跟上游意图对齐,删上游已废弃流程:
- commands/ 全 3 个 deprecated stub(上游 #1188)
- agents/code-reviewer.md(已上升进 requesting-code-review skill,
上游 PR #1299)
- bin/superpowers-zh.js 删 install agents 逻辑,保留 uninstall 用
hardcoded LEGACY_AGENT_FILENAMES 列表清理已装用户残留
- .github/workflows/ci.yml 删 "Validate agents" 段
- package.json files 字段移除 agents/ commands/
主动修上游 v5.1.0 疏忽:
- .cursor-plugin/plugin.json 删 dangling 的 "agents": "./agents/"
和 "commands": "./commands/"。上游删目录但忘同步 manifest
(git blame 显示自 2026-02-13 起从未更新)。
配套:
- scripts/sync-plugin-version.js 扩到 .codex-plugin/plugin.json
- npm pack 校验 90 文件 228KB,agents/commands 残留 0 条
中文版"手动新增"叠加层全部保留:bin/ + npx 流程、docs/、
chinese-* skill、mcp-builder、workflow-runner、README 主推 npx、
各 INSTALL.md、.gemini/、sync-plugin-version.js。
详见 RELEASE-NOTES.zh.md v1.3.0 段。
32 lines
1.2 KiB
JavaScript
32 lines
1.2 KiB
JavaScript
#!/usr/bin/env node
|
|
// 把 package.json 的 version 同步到 plugin manifest
|
|
// 由 npm version 钩子触发,跑在 version commit 创建之前
|
|
import { readFileSync, writeFileSync } from 'fs';
|
|
import { resolve, dirname } from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
const pkg = JSON.parse(readFileSync(resolve(root, 'package.json'), 'utf8'));
|
|
const targets = [
|
|
'.claude-plugin/plugin.json',
|
|
'.cursor-plugin/plugin.json',
|
|
'.codex-plugin/plugin.json',
|
|
];
|
|
|
|
let touched = 0;
|
|
for (const rel of targets) {
|
|
const path = resolve(root, rel);
|
|
const text = readFileSync(path, 'utf8');
|
|
const json = JSON.parse(text);
|
|
if (json.version === pkg.version) continue;
|
|
// 只替换顶层 version 字段一行,保留原文件其他字段的格式(数组单行/多行、缩进等)
|
|
const updated = text.replace(/("version":\s*")[^"]+(")/, `$1${pkg.version}$2`);
|
|
if (updated === text) {
|
|
throw new Error(`未能在 ${rel} 中定位 version 字段`);
|
|
}
|
|
writeFileSync(path, updated, 'utf8');
|
|
console.log(` ${rel}: ${json.version} -> ${pkg.version}`);
|
|
touched++;
|
|
}
|
|
if (touched === 0) console.log(` plugin manifests already at ${pkg.version}`);
|