📦 deps(thirdparty): update snapshots
This commit is contained in:
@@ -27,6 +27,16 @@ const skillsSourceRoot = join(repoRoot, '.claude', 'skills');
|
||||
const skillsAssetRoot = join(assetRoot, 'skills');
|
||||
const subSkills = ['banner-design', 'brand', 'design', 'design-system', 'slides', 'ui-styling'];
|
||||
|
||||
// The repo's own .claude/skills/ui-ux-pro-max/{data,scripts} is a second,
|
||||
// independent copy of src/ui-ux-pro-max/{data,scripts} -- it's what Claude
|
||||
// Code actually loads when this repo is installed as a plugin. Nothing
|
||||
// previously checked it against src/, so it silently drifted (missing stack
|
||||
// CSVs, stale content in several data files). SKILL.md there is hand-authored
|
||||
// (not template-rendered like the CLI's copy), so only data/ and scripts/
|
||||
// are mirrored -- never templates/ or SKILL.md itself.
|
||||
const orchestratorSkillTargetRoot = join(skillsSourceRoot, 'ui-ux-pro-max');
|
||||
const orchestratorDirsToSync = ['data', 'scripts'];
|
||||
|
||||
// ponytail: only text is bundled. Excludes (a) heavy binary assets — the
|
||||
// canvas fonts are ~5.8MB and a skill registers from its SKILL.md, not its
|
||||
// fonts — and (b) Python build cruft (__pycache__/*.pyc, .coverage) that would
|
||||
@@ -79,74 +89,81 @@ async function fileHash(path) {
|
||||
return createHash('sha256').update(content).digest('hex');
|
||||
}
|
||||
|
||||
// Compares one source dir against one target dir; pushes human-readable
|
||||
// drift descriptions (prefixed with `label`) onto `drift`.
|
||||
async function diffDir(sourceDir, targetDir, label, drift) {
|
||||
if (!(await exists(sourceDir))) {
|
||||
drift.push(`missing source directory: ${relative(repoRoot, sourceDir)}`);
|
||||
return;
|
||||
}
|
||||
if (!(await exists(targetDir))) {
|
||||
drift.push(`missing asset directory: ${relative(repoRoot, targetDir)}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const sourceFiles = (await listFiles(sourceDir)).filter((f) => !isExcludedAssetFile(f));
|
||||
const targetFiles = (await listFiles(targetDir)).filter((f) => !isExcludedAssetFile(f));
|
||||
const allFiles = [...new Set([...sourceFiles, ...targetFiles])].sort();
|
||||
|
||||
for (const file of allFiles) {
|
||||
const sourcePath = join(sourceDir, file);
|
||||
const targetPath = join(targetDir, file);
|
||||
|
||||
if (!sourceFiles.includes(file)) {
|
||||
drift.push(`extra asset file: ${label}/${file}`);
|
||||
} else if (!targetFiles.includes(file)) {
|
||||
drift.push(`missing asset file: ${label}/${file}`);
|
||||
} else if ((await fileHash(sourcePath)) !== (await fileHash(targetPath))) {
|
||||
drift.push(`stale asset file: ${label}/${file}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Mirrors sourceDir -> targetDir (deletes targetDir first, so removed
|
||||
// source files don't linger as orphans in the target).
|
||||
async function syncDir(sourceDir, targetDir) {
|
||||
if (!(await exists(sourceDir))) {
|
||||
throw new Error(`Source directory does not exist: ${sourceDir}`);
|
||||
}
|
||||
|
||||
const resolvedTarget = assertInsideRepo(targetDir);
|
||||
if (await exists(resolvedTarget)) {
|
||||
await rm(resolvedTarget, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
for (const file of await listFiles(sourceDir)) {
|
||||
if (isExcludedAssetFile(file)) continue;
|
||||
const targetPath = assertInsideRepo(join(resolvedTarget, file));
|
||||
await mkdir(dirname(targetPath), { recursive: true });
|
||||
await writeFile(targetPath, toLF(await readFile(join(sourceDir, file), 'utf8')));
|
||||
}
|
||||
}
|
||||
|
||||
async function checkAssets() {
|
||||
const drift = [];
|
||||
|
||||
for (const dir of dirsToSync) {
|
||||
const sourceDir = join(sourceRoot, dir);
|
||||
const targetDir = join(assetRoot, dir);
|
||||
|
||||
if (!(await exists(sourceDir))) {
|
||||
drift.push(`missing source directory: ${relative(repoRoot, sourceDir)}`);
|
||||
continue;
|
||||
}
|
||||
if (!(await exists(targetDir))) {
|
||||
drift.push(`missing asset directory: ${relative(repoRoot, targetDir)}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const sourceFiles = (await listFiles(sourceDir)).filter((f) => !isExcludedAssetFile(f));
|
||||
const targetFiles = (await listFiles(targetDir)).filter((f) => !isExcludedAssetFile(f));
|
||||
const allFiles = [...new Set([...sourceFiles, ...targetFiles])].sort();
|
||||
|
||||
for (const file of allFiles) {
|
||||
const sourcePath = join(sourceDir, file);
|
||||
const targetPath = join(targetDir, file);
|
||||
|
||||
if (!sourceFiles.includes(file)) {
|
||||
drift.push(`extra asset file: ${dir}/${file}`);
|
||||
} else if (!targetFiles.includes(file)) {
|
||||
drift.push(`missing asset file: ${dir}/${file}`);
|
||||
} else if ((await fileHash(sourcePath)) !== (await fileHash(targetPath))) {
|
||||
drift.push(`stale asset file: ${dir}/${file}`);
|
||||
}
|
||||
}
|
||||
await diffDir(join(sourceRoot, dir), join(assetRoot, dir), dir, drift);
|
||||
}
|
||||
|
||||
// Sub-skills (text content only; fonts/binaries intentionally excluded)
|
||||
for (const name of subSkills) {
|
||||
const sourceDir = join(skillsSourceRoot, name);
|
||||
const targetDir = join(skillsAssetRoot, name);
|
||||
await diffDir(join(skillsSourceRoot, name), join(skillsAssetRoot, name), `skills/${name}`, drift);
|
||||
}
|
||||
|
||||
if (!(await exists(sourceDir))) {
|
||||
drift.push(`missing source sub-skill: ${relative(repoRoot, sourceDir)}`);
|
||||
continue;
|
||||
}
|
||||
if (!(await exists(targetDir))) {
|
||||
drift.push(`missing asset sub-skill: skills/${name}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const sourceFiles = (await listFiles(sourceDir)).filter((f) => !isExcludedAssetFile(f));
|
||||
const targetFiles = (await listFiles(targetDir)).filter((f) => !isExcludedAssetFile(f));
|
||||
const allFiles = [...new Set([...sourceFiles, ...targetFiles])].sort();
|
||||
|
||||
for (const file of allFiles) {
|
||||
const sourcePath = join(sourceDir, file);
|
||||
const targetPath = join(targetDir, file);
|
||||
|
||||
if (!sourceFiles.includes(file)) {
|
||||
drift.push(`extra asset file: skills/${name}/${file}`);
|
||||
} else if (!targetFiles.includes(file)) {
|
||||
drift.push(`missing asset file: skills/${name}/${file}`);
|
||||
} else if ((await fileHash(sourcePath)) !== (await fileHash(targetPath))) {
|
||||
drift.push(`stale asset file: skills/${name}/${file}`);
|
||||
}
|
||||
}
|
||||
// Orchestrator skill's own data/scripts copy under .claude/skills/ui-ux-pro-max/
|
||||
// (the copy Claude Code actually loads when this repo is a plugin).
|
||||
for (const dir of orchestratorDirsToSync) {
|
||||
await diffDir(
|
||||
join(sourceRoot, dir),
|
||||
join(orchestratorSkillTargetRoot, dir),
|
||||
`.claude/skills/ui-ux-pro-max/${dir}`,
|
||||
drift,
|
||||
);
|
||||
}
|
||||
|
||||
if (drift.length > 0) {
|
||||
console.error('CLI assets are out of sync with src/ui-ux-pro-max:');
|
||||
console.error('Assets are out of sync with src/ui-ux-pro-max:');
|
||||
for (const item of drift) {
|
||||
console.error(` - ${item}`);
|
||||
}
|
||||
@@ -154,7 +171,7 @@ async function checkAssets() {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log('CLI assets are in sync.');
|
||||
console.log('Assets are in sync.');
|
||||
}
|
||||
|
||||
async function syncAssets() {
|
||||
@@ -162,23 +179,7 @@ async function syncAssets() {
|
||||
await mkdir(assetRoot, { recursive: true });
|
||||
|
||||
for (const dir of dirsToSync) {
|
||||
const sourceDir = join(sourceRoot, dir);
|
||||
const targetDir = assertInsideRepo(join(assetRoot, dir));
|
||||
|
||||
if (!(await exists(sourceDir))) {
|
||||
throw new Error(`Source directory does not exist: ${sourceDir}`);
|
||||
}
|
||||
|
||||
if (await exists(targetDir)) {
|
||||
await rm(targetDir, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
for (const file of await listFiles(sourceDir)) {
|
||||
if (isExcludedAssetFile(file)) continue;
|
||||
const targetPath = assertInsideRepo(join(targetDir, file));
|
||||
await mkdir(dirname(targetPath), { recursive: true });
|
||||
await writeFile(targetPath, toLF(await readFile(join(sourceDir, file), 'utf8')));
|
||||
}
|
||||
await syncDir(join(sourceRoot, dir), join(assetRoot, dir));
|
||||
}
|
||||
|
||||
// Sub-skills: copy text content only (fonts/binaries excluded) so all 7
|
||||
@@ -188,19 +189,15 @@ async function syncAssets() {
|
||||
await rm(skillsTarget, { recursive: true, force: true });
|
||||
}
|
||||
for (const name of subSkills) {
|
||||
const sourceDir = join(skillsSourceRoot, name);
|
||||
if (!(await exists(sourceDir))) {
|
||||
throw new Error(`Source sub-skill does not exist: ${sourceDir}`);
|
||||
}
|
||||
for (const file of await listFiles(sourceDir)) {
|
||||
if (isExcludedAssetFile(file)) continue;
|
||||
const targetPath = assertInsideRepo(join(skillsTarget, name, file));
|
||||
await mkdir(dirname(targetPath), { recursive: true });
|
||||
await writeFile(targetPath, toLF(await readFile(join(sourceDir, file), 'utf8')));
|
||||
}
|
||||
await syncDir(join(skillsSourceRoot, name), join(skillsTarget, name));
|
||||
}
|
||||
|
||||
console.log('Synced CLI assets from src/ui-ux-pro-max + 6 sub-skills (normalized to LF).');
|
||||
// Orchestrator skill's own data/scripts copy under .claude/skills/ui-ux-pro-max/.
|
||||
for (const dir of orchestratorDirsToSync) {
|
||||
await syncDir(join(sourceRoot, dir), join(orchestratorSkillTargetRoot, dir));
|
||||
}
|
||||
|
||||
console.log('Synced CLI assets + .claude/skills/ui-ux-pro-max data/scripts from src/ui-ux-pro-max, and 6 sub-skills (normalized to LF).');
|
||||
}
|
||||
|
||||
if (checkOnly) {
|
||||
|
||||
Reference in New Issue
Block a user