@mingfuyun/star-allinone 0.4.10 → 0.4.11
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/package.json +1 -1
- package/scripts/gen/doctor.js +10 -2
package/package.json
CHANGED
package/scripts/gen/doctor.js
CHANGED
|
@@ -71,8 +71,12 @@ function render(content, variables) {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
/** Sync 注入的人读副本,不在 skills/shared 源树内,比对时忽略 */
|
|
75
|
+
const SYNC_INJECTED_DOCS = new Set(['guide.md', 'skills-overview.md']);
|
|
76
|
+
|
|
77
|
+
function hashTree(dir, variables, options = {}) {
|
|
75
78
|
if (!fs.existsSync(dir)) return '';
|
|
79
|
+
const ignoreInjected = options.ignoreInjectedDocs === true;
|
|
76
80
|
const files = [];
|
|
77
81
|
const walk = (current, relative) => {
|
|
78
82
|
for (const entry of fs.readdirSync(current, { withFileTypes: true })) {
|
|
@@ -82,6 +86,9 @@ function hashTree(dir, variables) {
|
|
|
82
86
|
walk(full, nextRel);
|
|
83
87
|
continue;
|
|
84
88
|
}
|
|
89
|
+
if (ignoreInjected && SYNC_INJECTED_DOCS.has(entry.name)) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
85
92
|
let content = fs.readFileSync(full);
|
|
86
93
|
if (variables && TEMPLATE_EXT.has(path.extname(entry.name).toLowerCase())) {
|
|
87
94
|
content = Buffer.from(render(content.toString('utf8'), variables));
|
|
@@ -257,7 +264,8 @@ function runDoctor(cwd, options = {}) {
|
|
|
257
264
|
sharedSkillName: publicName,
|
|
258
265
|
project: { ...config, ...config.variables },
|
|
259
266
|
};
|
|
260
|
-
|
|
267
|
+
// dest 可能多出 docs sync 注入的 guide.md / skills-overview.md,比对时忽略
|
|
268
|
+
if (hashTree(source, variables) !== hashTree(dest, variables, { ignoreInjectedDocs: true })) {
|
|
261
269
|
findings.push(check(false, 'warn', `${publicName} is stale vs this package. Run pnpm exec star-allinone skills sync`));
|
|
262
270
|
} else {
|
|
263
271
|
findings.push(check(true, 'ok', publicName));
|