create-dwy 0.28.0 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/cli-help.js +1 -1
- package/src/sync-all.js +4 -15
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/cli-help.js
CHANGED
|
@@ -63,7 +63,7 @@ export function buildHelpText(version) {
|
|
|
63
63
|
'全局 Hook 的脚本与对应事件、matcher、完整命令注册均有效时,项目禁止重复安装。',
|
|
64
64
|
'任一适用 CLI 已有 dwy 全局通用规范时,项目继承并清理重复基线;其他 CLI 缺失的全局规范另选全局范围补齐。',
|
|
65
65
|
'手写 AGENTS.md 本身不算全局已安装;通用规范仅管理其托管块,保留手写内容。',
|
|
66
|
-
'旧托管 Rules
|
|
66
|
+
'旧托管 Rules 确认后清理,Skills 自行选择;无法确认归属的内容保留。',
|
|
67
67
|
'全局启用会明确列出当前项目重复项清理;全局移除不会自动向项目补装。',
|
|
68
68
|
'项目同步只清理项目重复入口,不改写有效全局提供者;真实目录先备份。',
|
|
69
69
|
'确认前不改项目/全局配置或已安装共享内容;确认后才同步配置,并刷新所选共享 Skills。',
|
package/src/sync-all.js
CHANGED
|
@@ -182,11 +182,6 @@ const RULE_SKILL_MIGRATIONS = {
|
|
|
182
182
|
'dwy-prod-branch.md': ['dwy-publish'],
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
/** 将旧托管规则映射为可选的对应技能,保留用户最终选择。 */
|
|
186
|
-
export function migratedRuleSkills(names) {
|
|
187
|
-
return new Set([...names].flatMap(name => RULE_SKILL_MIGRATIONS[name] || []))
|
|
188
|
-
}
|
|
189
|
-
|
|
190
185
|
function staleEntries(scans, state, existing, platforms) {
|
|
191
186
|
const current = Object.fromEntries(['skills', 'rules', 'hooks'].map(type => [type, new Set(scans[type].map(item => item.name))]))
|
|
192
187
|
const result = {}
|
|
@@ -330,10 +325,6 @@ export async function syncAll({
|
|
|
330
325
|
unionSets(...platforms.map(platform => platform === 'cursor' && type === 'rules' ? cursorRules : existing[platform][type]))]))
|
|
331
326
|
const defaults = buildSelectionDefaultsFromSyncState(current, targetState, platforms)
|
|
332
327
|
for (const type of ['skills', 'rules', 'hooks']) defaults[type] = unionSets(defaults[type], current[type])
|
|
333
|
-
if (!global && contentTypes.includes('skills')) {
|
|
334
|
-
const oldRules = unionSets(current.rules, ...platforms.map(platform => new Set(targetState.platforms[platform]?.rules || [])))
|
|
335
|
-
defaults.skills = unionSets(defaults.skills, migratedRuleSkills(oldRules))
|
|
336
|
-
}
|
|
337
328
|
const choices = !global && contentTypes.includes('skills')
|
|
338
329
|
? { ...scans, skills: await projectSkillChoices(scans.skills, platforms, { homeDir, codexHome }) } : scans
|
|
339
330
|
const selected = selectedOverride
|
|
@@ -385,15 +376,13 @@ export async function syncAll({
|
|
|
385
376
|
const stale = staleEntries(scans, targetState, existing, platforms)
|
|
386
377
|
const removals = normalizeRemovals(removalsOverride || stale)
|
|
387
378
|
if (!removalsOverride) {
|
|
388
|
-
const availableSkills = new Set(scans.skills.map(skill => skill.name))
|
|
389
|
-
const selectedSkills = new Set(selected.skills.map(skill => skill.name).filter(name => availableSkills.has(name)))
|
|
390
379
|
for (const platform of platforms) for (const name of removals[platform]?.rules || []) {
|
|
391
|
-
const
|
|
392
|
-
if (!
|
|
380
|
+
const knownRule = RULE_SKILL_MIGRATIONS[name]
|
|
381
|
+
if (!knownRule && !scans.rules.length) {
|
|
393
382
|
removals[platform].rules.delete(name)
|
|
394
383
|
continue
|
|
395
384
|
}
|
|
396
|
-
if (
|
|
385
|
+
if (knownRule && platform === 'cursor') {
|
|
397
386
|
removals[platform].rules.delete(name)
|
|
398
387
|
}
|
|
399
388
|
}
|
|
@@ -430,7 +419,7 @@ export async function syncAll({
|
|
|
430
419
|
if (contentTypes.includes('skills')) console.log(`Skills:${selected.skills.map(item => item.name).join('、') || '无项目安装选择;已有全局入口仅去重'}`)
|
|
431
420
|
if (contentTypes.includes('rules')) console.log(scans.rules.length
|
|
432
421
|
? `Rules:${selected.rules.map(item => item.name).join('、') || '移除当前项目托管规则'}`
|
|
433
|
-
: '旧 Rules
|
|
422
|
+
: '旧 Rules:清理可识别的托管项,其他内容保留;Skills 自行选择')
|
|
434
423
|
if (contentTypes.includes('baseline')) console.log(`通用规范:${contentActions.baseline === 'remove' ? '显式移除' : baseline.split('\n').filter(line => /^#/.test(line)).slice(0,3).join(';')}`)
|
|
435
424
|
for (const operation of plan.operations) {
|
|
436
425
|
console.log(operation.label)
|