diff --git a/scripts/run-demo.ts b/scripts/run-demo.ts new file mode 100644 index 0000000..c0808ef --- /dev/null +++ b/scripts/run-demo.ts @@ -0,0 +1,33 @@ +import * as fs from 'node:fs'; +import * as path from 'node:path'; +import { ProofCodeEngine } from '../src/engine/proofCodeEngine'; +import { ReportFormatter } from '../src/engine/reportFormatter'; + +async function main() { + const demoRoot = path.resolve(__dirname, '../examples/demo-app'); + console.log('\n==============================================================='); + console.log(' šŸš€ PROOFCODE KILLER WORKFLOW DEMO (Next.js AI Change) '); + console.log('==============================================================='); + console.log(`Analyzing codebase at: ${demoRoot}\n`); + + const engine = new ProofCodeEngine(demoRoot); + const report = await engine.verify(); + + console.log(ReportFormatter.toTerminal(report)); + + // Write demo report + const reportDir = path.join(demoRoot, '.proofcode'); + if (!fs.existsSync(reportDir)) { + fs.mkdirSync(reportDir, { recursive: true }); + } + + const reportPath = path.join(reportDir, 'report.md'); + fs.writeFileSync(reportPath, ReportFormatter.toMarkdown(report), 'utf8'); + + console.log(`\nšŸ“„ Generated Markdown Verification Report at:\n${reportPath}\n`); +} + +main().catch((err) => { + console.error(err); + process.exit(1); +});