161ef94b4f
Check engine pin consistency / Dockerfile / CI pin consistency (push) Successful in 8s
Sirius CI/CD Pipeline / Detect Changes (push) Successful in 23s
Validate Docker Configuration / Validate Docker Compose Configuration (push) Successful in 47s
Sirius CI/CD Pipeline / Build API (${{ matrix.platform }}) (push) Has been cancelled
Sirius CI/CD Pipeline / Build UI (${{ matrix.platform }}) (push) Has been cancelled
Sirius CI/CD Pipeline / Merge Engine Manifest (push) Has been cancelled
Sirius CI/CD Pipeline / Merge API Manifest (push) Has been cancelled
Sirius CI/CD Pipeline / Merge UI Manifest (push) Has been cancelled
Sirius CI/CD Pipeline / Build Engine (${{ matrix.platform }}) (push) Has been cancelled
Sirius CI/CD Pipeline / Build Infra (${{ matrix.service }}, ${{ matrix.platform }}) (push) Has been cancelled
Sirius CI/CD Pipeline / Merge Infra Manifest (sirius-postgres) (push) Has been cancelled
Sirius CI/CD Pipeline / Merge Infra Manifest (sirius-rabbitmq) (push) Has been cancelled
Sirius CI/CD Pipeline / Merge Infra Manifest (sirius-valkey) (push) Has been cancelled
Sirius CI/CD Pipeline / Integration Test (push) Has been cancelled
Sirius CI/CD Pipeline / Public Stack Contract (push) Has been cancelled
Sirius CI/CD Pipeline / Dispatch Demo Deployment (sirius-demo branch) (push) Has been cancelled
Sirius CI/CD Pipeline / Dispatch Demo Canary (main branch) (push) Has been cancelled
Sirius CI/CD Pipeline / Guard Registry Namespace (push) Has been cancelled
32 lines
968 B
TypeScript
32 lines
968 B
TypeScript
import { readFileContent } from '../utils/file-reader.js';
|
|
import { join } from 'path';
|
|
import { codeBlock } from '../utils/markdown-builder.js';
|
|
|
|
export async function extractConfigExamples(
|
|
productPath: string,
|
|
configFiles: Array<{ path: string; title: string }>
|
|
): Promise<string> {
|
|
let result = '';
|
|
|
|
for (const configFile of configFiles) {
|
|
try {
|
|
const fullPath = join(productPath, configFile.path);
|
|
const content = await readFileContent(fullPath);
|
|
|
|
// Determine language from file extension
|
|
const ext = configFile.path.split('.').pop();
|
|
const language = ext === 'yaml' || ext === 'yml' ? 'yaml' : ext === 'json' ? 'json' : '';
|
|
|
|
result += `**${configFile.title}** (\`${configFile.path}\`):\n\n`;
|
|
result += codeBlock(content, language);
|
|
result += '\n\n';
|
|
} catch (error) {
|
|
result += `**${configFile.title}:** Error reading file - ${error}\n\n`;
|
|
}
|
|
}
|
|
|
|
return result.trim();
|
|
}
|
|
|
|
|