@ccpluginizer/ccpluginizer 0.4.0 → 0.5.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/dist/index.js +24 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1725,11 +1725,11 @@ function detectMarkerFile(repoRoot) {
|
|
|
1725
1725
|
import { existsSync as existsSync3, readdirSync, statSync } from "node:fs";
|
|
1726
1726
|
import { join as join4 } from "node:path";
|
|
1727
1727
|
var FOLDER_KINDS = [
|
|
1728
|
-
{ folder: "skills", kind: "skills" },
|
|
1729
|
-
{ folder: "agents", kind: "agents" },
|
|
1730
|
-
{ folder: "commands", kind: "commands" },
|
|
1731
|
-
{ folder: "output-styles", kind: "outputStyles" },
|
|
1732
|
-
{ folder: "themes", kind: "themes" }
|
|
1728
|
+
{ folder: "skills", kind: "skills", emit: "directory" },
|
|
1729
|
+
{ folder: "agents", kind: "agents", emit: { enumerateFiles: ".md" } },
|
|
1730
|
+
{ folder: "commands", kind: "commands", emit: "directory" },
|
|
1731
|
+
{ folder: "output-styles", kind: "outputStyles", emit: "directory" },
|
|
1732
|
+
{ folder: "themes", kind: "themes", emit: "directory" }
|
|
1733
1733
|
];
|
|
1734
1734
|
var FILE_KINDS = [
|
|
1735
1735
|
{ file: "hooks/hooks.json", kind: "hooks" },
|
|
@@ -1745,16 +1745,29 @@ function scanRoot(repoRoot, prefix) {
|
|
|
1745
1745
|
const findings = [];
|
|
1746
1746
|
const baseDir = prefix === "" ? repoRoot : join4(repoRoot, prefix);
|
|
1747
1747
|
const pathPrefix = prefix === "" ? "./" : `./${prefix}/`;
|
|
1748
|
-
for (const { folder, kind } of FOLDER_KINDS) {
|
|
1748
|
+
for (const { folder, kind, emit } of FOLDER_KINDS) {
|
|
1749
1749
|
const folderPath = join4(baseDir, folder);
|
|
1750
|
-
if (existsSync3(folderPath)
|
|
1751
|
-
|
|
1750
|
+
if (!existsSync3(folderPath) || !statSync(folderPath).isDirectory()) {
|
|
1751
|
+
continue;
|
|
1752
|
+
}
|
|
1753
|
+
const entries = readdirSync(folderPath);
|
|
1754
|
+
if (emit === "directory") {
|
|
1752
1755
|
findings.push({
|
|
1753
1756
|
kind,
|
|
1754
1757
|
paths: [`${pathPrefix}${folder}/`],
|
|
1755
|
-
confidence:
|
|
1758
|
+
confidence: entries.length > 0 ? "high" : "medium",
|
|
1756
1759
|
source: "convention"
|
|
1757
1760
|
});
|
|
1761
|
+
} else {
|
|
1762
|
+
const files = entries.filter((e) => e.endsWith(emit.enumerateFiles));
|
|
1763
|
+
if (files.length > 0) {
|
|
1764
|
+
findings.push({
|
|
1765
|
+
kind,
|
|
1766
|
+
paths: files.map((f) => `${pathPrefix}${folder}/${f}`),
|
|
1767
|
+
confidence: "high",
|
|
1768
|
+
source: "convention"
|
|
1769
|
+
});
|
|
1770
|
+
}
|
|
1758
1771
|
}
|
|
1759
1772
|
}
|
|
1760
1773
|
for (const { file, kind } of FILE_KINDS) {
|
|
@@ -2053,7 +2066,7 @@ function mergeManifestMetadata(entry, manifest) {
|
|
|
2053
2066
|
...manifest.homepage !== undefined ? { homepage: manifest.homepage } : {},
|
|
2054
2067
|
...manifest.repository !== undefined ? { repository: manifest.repository } : {},
|
|
2055
2068
|
...manifest.license !== undefined ? { license: manifest.license } : {},
|
|
2056
|
-
...manifest.author !== undefined ? { author: manifest.author } : {}
|
|
2069
|
+
...manifest.author !== undefined ? { author: typeof manifest.author === "string" ? { name: manifest.author } : manifest.author } : {}
|
|
2057
2070
|
};
|
|
2058
2071
|
}
|
|
2059
2072
|
function buildEntryFromMarker(marker, sourceRepo, repoRoot) {
|
|
@@ -2122,7 +2135,7 @@ function groupByKind(findings) {
|
|
|
2122
2135
|
return map;
|
|
2123
2136
|
}
|
|
2124
2137
|
function makeGithubSource(repo) {
|
|
2125
|
-
return { source: "
|
|
2138
|
+
return { source: "url", url: `https://github.com/${repo}.git` };
|
|
2126
2139
|
}
|
|
2127
2140
|
function defaultEntryName(sourceRepo) {
|
|
2128
2141
|
return sourceRepo.replace("/", "-").toLowerCase();
|