@chappibunny/repolens 1.2.0 → 1.3.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/CHANGELOG.md +27 -1
- package/README.md +78 -1108
- package/RELEASE.md +1 -1
- package/package.json +1 -1
- package/src/cli.js +92 -1
package/RELEASE.md
CHANGED
|
@@ -22,7 +22,7 @@ RepoLens uses semantic versioning:
|
|
|
22
22
|
8. Push branch and tag: `git push --follow-tags`
|
|
23
23
|
9. GitHub Actions `release.yml` runs automatically:
|
|
24
24
|
- Security audit (dependency + secrets scanning)
|
|
25
|
-
- Test suite (
|
|
25
|
+
- Test suite (185 tests)
|
|
26
26
|
- Create GitHub Release with tarball
|
|
27
27
|
- Publish to npm (`npm publish --access public`)
|
|
28
28
|
10. Verify on npm: `npm view @chappibunny/repolens version`
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -143,6 +143,7 @@ Commands:
|
|
|
143
143
|
doctor Validate your RepoLens setup
|
|
144
144
|
migrate Upgrade workflow files to current format
|
|
145
145
|
publish Scan, render, and publish documentation
|
|
146
|
+
demo Generate local docs without API keys (quick preview)
|
|
146
147
|
watch Watch for file changes and regenerate docs
|
|
147
148
|
feedback Send feedback to the RepoLens team
|
|
148
149
|
version Print the current RepoLens version
|
|
@@ -166,6 +167,7 @@ Examples:
|
|
|
166
167
|
repolens migrate --dry-run # Preview changes without applying
|
|
167
168
|
repolens publish # Auto-discovers .repolens.yml
|
|
168
169
|
repolens publish --config /path/.repolens.yml # Explicit config path
|
|
170
|
+
repolens demo # Quick local preview (no API keys)
|
|
169
171
|
repolens watch # Watch mode (Markdown only)
|
|
170
172
|
repolens --version
|
|
171
173
|
`);
|
|
@@ -424,6 +426,95 @@ async function main() {
|
|
|
424
426
|
return;
|
|
425
427
|
}
|
|
426
428
|
|
|
429
|
+
if (command === "demo") {
|
|
430
|
+
await printBanner();
|
|
431
|
+
info("Demo mode — generating local documentation (no API keys required)...");
|
|
432
|
+
|
|
433
|
+
const commandTimer = startTimer("demo");
|
|
434
|
+
const targetDir = getArg("--target") || process.cwd();
|
|
435
|
+
|
|
436
|
+
// Try to load existing config, otherwise use sensible defaults
|
|
437
|
+
let cfg;
|
|
438
|
+
try {
|
|
439
|
+
const configPath = getArg("--config") || await findConfig();
|
|
440
|
+
info(`Using config: ${configPath}`);
|
|
441
|
+
cfg = await loadConfig(configPath);
|
|
442
|
+
} catch {
|
|
443
|
+
info("No .repolens.yml found — using default scan patterns");
|
|
444
|
+
cfg = {
|
|
445
|
+
configVersion: 1,
|
|
446
|
+
project: { name: path.basename(targetDir) },
|
|
447
|
+
publishers: ["markdown"],
|
|
448
|
+
scan: {
|
|
449
|
+
include: ["**/*.{js,ts,jsx,tsx,mjs,cjs,py,go,rs,java,rb,php,cs,swift,kt}"],
|
|
450
|
+
ignore: ["**/node_modules/**", "**/dist/**", "**/build/**", "**/.git/**", "**/vendor/**", "**/target/**", "**/__pycache__/**"],
|
|
451
|
+
},
|
|
452
|
+
module_roots: ["src", "lib", "app", "packages"],
|
|
453
|
+
outputs: {
|
|
454
|
+
pages: [
|
|
455
|
+
{ key: "system_overview", title: "System Overview" },
|
|
456
|
+
{ key: "module_catalog", title: "Module Catalog" },
|
|
457
|
+
{ key: "api_surface", title: "API Surface" },
|
|
458
|
+
{ key: "route_map", title: "Route Map" },
|
|
459
|
+
{ key: "system_map", title: "System Map" },
|
|
460
|
+
{ key: "executive_summary", title: "Executive Summary" },
|
|
461
|
+
{ key: "business_domains", title: "Business Domains" },
|
|
462
|
+
{ key: "architecture_overview", title: "Architecture Overview" },
|
|
463
|
+
{ key: "data_flows", title: "Data Flows" },
|
|
464
|
+
{ key: "developer_onboarding", title: "Developer Onboarding" },
|
|
465
|
+
],
|
|
466
|
+
},
|
|
467
|
+
__repoRoot: targetDir,
|
|
468
|
+
__configPath: path.join(targetDir, ".repolens.yml"),
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
try {
|
|
473
|
+
info("Scanning repository...");
|
|
474
|
+
const scanTimer = startTimer("scan");
|
|
475
|
+
const scan = await scanRepo(cfg);
|
|
476
|
+
stopTimer(scanTimer);
|
|
477
|
+
info(`Detected ${scan.modules?.length || 0} modules, ${scan.filesCount || 0} files`);
|
|
478
|
+
|
|
479
|
+
const rawDiff = getGitDiff("origin/main");
|
|
480
|
+
|
|
481
|
+
info("Generating documentation set...");
|
|
482
|
+
const renderTimer = startTimer("render");
|
|
483
|
+
const docSet = await generateDocumentSet(scan, cfg, rawDiff);
|
|
484
|
+
stopTimer(renderTimer);
|
|
485
|
+
|
|
486
|
+
info("Writing documentation to disk...");
|
|
487
|
+
const writeResult = await writeDocumentSet(docSet, targetDir);
|
|
488
|
+
|
|
489
|
+
const totalDuration = stopTimer(commandTimer);
|
|
490
|
+
|
|
491
|
+
info(`\n✓ Generated ${writeResult.documentCount} documents in ${writeResult.outputDir}`);
|
|
492
|
+
info("Browse your docs: open the .repolens/ directory");
|
|
493
|
+
info("\nTo publish to Notion, Confluence, or GitHub Wiki, run: repolens publish");
|
|
494
|
+
|
|
495
|
+
printPerformanceSummary();
|
|
496
|
+
|
|
497
|
+
trackUsage("demo", "success", {
|
|
498
|
+
duration: totalDuration,
|
|
499
|
+
fileCount: scan.filesCount || 0,
|
|
500
|
+
moduleCount: scan.modules?.length || 0,
|
|
501
|
+
documentCount: writeResult.documentCount,
|
|
502
|
+
usedConfig: Boolean(cfg.__configPath && cfg.__configPath !== path.join(targetDir, ".repolens.yml")),
|
|
503
|
+
});
|
|
504
|
+
} catch (err) {
|
|
505
|
+
stopTimer(commandTimer);
|
|
506
|
+
captureError(err, { command: "demo", targetDir });
|
|
507
|
+
trackUsage("demo", "failure");
|
|
508
|
+
error("Demo failed:");
|
|
509
|
+
error(err.message);
|
|
510
|
+
await closeTelemetry();
|
|
511
|
+
process.exit(EXIT_ERROR);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
await closeTelemetry();
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
|
|
427
518
|
if (command === "feedback") {
|
|
428
519
|
await printBanner();
|
|
429
520
|
info("Send feedback to the RepoLens team");
|
|
@@ -470,7 +561,7 @@ async function main() {
|
|
|
470
561
|
}
|
|
471
562
|
|
|
472
563
|
error(`Unknown command: ${command}`);
|
|
473
|
-
error("Available commands: init, doctor, migrate, publish, watch, feedback, version, help");
|
|
564
|
+
error("Available commands: init, doctor, migrate, publish, demo, watch, feedback, version, help");
|
|
474
565
|
process.exit(EXIT_ERROR);
|
|
475
566
|
}
|
|
476
567
|
|