mirror of
https://github.com/supabase/agent-skills.git
synced 2026-03-27 10:09:26 +08:00
fix: revert build.ts to flat structure version
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
|||||||
unlinkSync,
|
unlinkSync,
|
||||||
writeFileSync,
|
writeFileSync,
|
||||||
} from "node:fs";
|
} from "node:fs";
|
||||||
import { basename, join, relative } from "node:path";
|
import { basename, join } from "node:path";
|
||||||
import {
|
import {
|
||||||
discoverSkills,
|
discoverSkills,
|
||||||
getSkillPaths,
|
getSkillPaths,
|
||||||
@@ -327,10 +327,8 @@ function buildSkill(paths: SkillPaths): void {
|
|||||||
for (const file of referenceFiles) {
|
for (const file of referenceFiles) {
|
||||||
const name = basename(file, ".md");
|
const name = basename(file, ".md");
|
||||||
const prefix = name.split("-")[0];
|
const prefix = name.split("-")[0];
|
||||||
// Compute relative path from references directory
|
|
||||||
const relativePath = relative(paths.referencesDir, file);
|
|
||||||
const group = grouped.get(prefix) || [];
|
const group = grouped.get(prefix) || [];
|
||||||
group.push(relativePath);
|
group.push(name);
|
||||||
grouped.set(prefix, group);
|
grouped.set(prefix, group);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,7 +337,7 @@ function buildSkill(paths: SkillPaths): void {
|
|||||||
const title = section ? section.title : prefix;
|
const title = section ? section.title : prefix;
|
||||||
output.push(`**${title}** (\`${prefix}-\`):`);
|
output.push(`**${title}** (\`${prefix}-\`):`);
|
||||||
for (const file of files.sort()) {
|
for (const file of files.sort()) {
|
||||||
output.push(`- \`references/${file}\``);
|
output.push(`- \`references/${file}.md\``);
|
||||||
}
|
}
|
||||||
output.push("");
|
output.push("");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user