MCPcopy Create free account
hub / github.com/dyoshikawa/rulesync / processFeatureConversion

Function processFeatureConversion

src/lib/fetch.ts:105–126  ·  view source on GitHub ↗

* Process feature conversion for a single feature type * @param processor - The processor to use for loading and converting files * @param outputDir - Output directory for converted files * @returns The paths of converted files

(params: {
  processor: FeatureProcessor;
  outputDir: string;
})

Source from the content-addressed store, hash-verified

103 * @returns The paths of converted files
104 */
105async function processFeatureConversion(params: {
106 processor: FeatureProcessor;
107 outputDir: string;
108}): Promise<{ paths: string[] }> {
109 const { processor, outputDir } = params;
110 const paths: string[] = [];
111
112 const toolFiles = await processor.loadToolFiles();
113 if (toolFiles.length === 0) {
114 return { paths: [] };
115 }
116
117 const rulesyncFiles = await processor.convertToolFilesToRulesyncFiles(toolFiles);
118 for (const file of rulesyncFiles) {
119 const relativePath = join(file.getRelativeDirPath(), file.getRelativeFilePath());
120 const outputPath = join(outputDir, relativePath);
121 await writeFileContent(outputPath, file.getFileContent());
122 paths.push(relativePath);
123 }
124
125 return { paths };
126}
127
128/**
129 * Convert fetched tool-specific files to rulesync format

Callers 1

Calls 4

writeFileContentFunction · 0.85
loadToolFilesMethod · 0.45
getFileContentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…