@wtdlee/repomap 0.3.0 → 0.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.
Files changed (71) hide show
  1. package/dist/analyzers/index.d.ts +69 -5
  2. package/dist/analyzers/index.js +1 -5
  3. package/dist/chunk-3PWXDB7B.js +153 -0
  4. package/dist/{generators/page-map-generator.js → chunk-3YFXZAP7.js} +322 -358
  5. package/dist/chunk-6F4PWJZI.js +1 -0
  6. package/dist/{generators/rails-map-generator.js → chunk-E4WRODSI.js} +86 -94
  7. package/dist/chunk-GNBMJMET.js +2519 -0
  8. package/dist/{server/doc-server.js → chunk-M6YNU536.js} +702 -303
  9. package/dist/chunk-OWM6WNLE.js +2610 -0
  10. package/dist/chunk-SSU6QFTX.js +1058 -0
  11. package/dist/cli.d.ts +0 -1
  12. package/dist/cli.js +348 -452
  13. package/dist/dataflow-analyzer-BfAiqVUp.d.ts +180 -0
  14. package/dist/env-detector-EEMVUEIA.js +1 -0
  15. package/dist/generators/index.d.ts +431 -3
  16. package/dist/generators/index.js +2 -3
  17. package/dist/index.d.ts +53 -10
  18. package/dist/index.js +8 -11
  19. package/dist/page-map-generator-6MJGPBVA.js +1 -0
  20. package/dist/rails-UWSDRS33.js +1 -0
  21. package/dist/rails-map-generator-D2URLMVJ.js +2 -0
  22. package/dist/server/index.d.ts +33 -1
  23. package/dist/server/index.js +7 -1
  24. package/dist/types.d.ts +39 -37
  25. package/dist/types.js +1 -5
  26. package/package.json +4 -2
  27. package/dist/analyzers/base-analyzer.d.ts +0 -45
  28. package/dist/analyzers/base-analyzer.js +0 -47
  29. package/dist/analyzers/dataflow-analyzer.d.ts +0 -29
  30. package/dist/analyzers/dataflow-analyzer.js +0 -425
  31. package/dist/analyzers/graphql-analyzer.d.ts +0 -22
  32. package/dist/analyzers/graphql-analyzer.js +0 -386
  33. package/dist/analyzers/pages-analyzer.d.ts +0 -84
  34. package/dist/analyzers/pages-analyzer.js +0 -1695
  35. package/dist/analyzers/rails/index.d.ts +0 -46
  36. package/dist/analyzers/rails/index.js +0 -145
  37. package/dist/analyzers/rails/rails-controller-analyzer.d.ts +0 -82
  38. package/dist/analyzers/rails/rails-controller-analyzer.js +0 -478
  39. package/dist/analyzers/rails/rails-grpc-analyzer.d.ts +0 -44
  40. package/dist/analyzers/rails/rails-grpc-analyzer.js +0 -262
  41. package/dist/analyzers/rails/rails-model-analyzer.d.ts +0 -88
  42. package/dist/analyzers/rails/rails-model-analyzer.js +0 -493
  43. package/dist/analyzers/rails/rails-react-analyzer.d.ts +0 -41
  44. package/dist/analyzers/rails/rails-react-analyzer.js +0 -529
  45. package/dist/analyzers/rails/rails-routes-analyzer.d.ts +0 -62
  46. package/dist/analyzers/rails/rails-routes-analyzer.js +0 -540
  47. package/dist/analyzers/rails/rails-view-analyzer.d.ts +0 -49
  48. package/dist/analyzers/rails/rails-view-analyzer.js +0 -386
  49. package/dist/analyzers/rails/ruby-parser.d.ts +0 -63
  50. package/dist/analyzers/rails/ruby-parser.js +0 -212
  51. package/dist/analyzers/rest-api-analyzer.d.ts +0 -65
  52. package/dist/analyzers/rest-api-analyzer.js +0 -479
  53. package/dist/core/cache.d.ts +0 -47
  54. package/dist/core/cache.js +0 -151
  55. package/dist/core/engine.d.ts +0 -46
  56. package/dist/core/engine.js +0 -319
  57. package/dist/core/index.d.ts +0 -2
  58. package/dist/core/index.js +0 -2
  59. package/dist/generators/markdown-generator.d.ts +0 -25
  60. package/dist/generators/markdown-generator.js +0 -782
  61. package/dist/generators/mermaid-generator.d.ts +0 -35
  62. package/dist/generators/mermaid-generator.js +0 -364
  63. package/dist/generators/page-map-generator.d.ts +0 -22
  64. package/dist/generators/rails-map-generator.d.ts +0 -21
  65. package/dist/server/doc-server.d.ts +0 -30
  66. package/dist/utils/env-detector.d.ts +0 -31
  67. package/dist/utils/env-detector.js +0 -188
  68. package/dist/utils/parallel.d.ts +0 -23
  69. package/dist/utils/parallel.js +0 -70
  70. package/dist/utils/port.d.ts +0 -15
  71. package/dist/utils/port.js +0 -41
@@ -0,0 +1 @@
1
+
@@ -1,41 +1,33 @@
1
- /**
2
- * Rails Map Generator
3
- * Rails分析結果をインタラクティブなHTMLページとして生成する
4
- */
1
+ import { analyzeRailsApp } from './chunk-OWM6WNLE.js';
5
2
  import * as fs from 'fs';
6
3
  import * as path from 'path';
7
- import { analyzeRailsApp, } from '../analyzers/rails/index.js';
8
- export class RailsMapGenerator {
9
- rootPath;
10
- result = null;
11
- constructor(rootPath) {
12
- this.rootPath = rootPath;
13
- }
14
- async generate(options = {}) {
15
- if (!this.rootPath)
16
- throw new Error('Root path required for analysis');
17
- const { title = 'Rails Application Map' } = options;
18
- // Run analysis
19
- this.result = await analyzeRailsApp(this.rootPath);
20
- // Generate HTML
21
- const html = this.generateHTML(title);
22
- // Save if output path specified
23
- if (options.outputPath) {
24
- fs.writeFileSync(options.outputPath, html);
25
- console.log(`\n📄 Generated: ${options.outputPath}`);
26
- }
27
- return html;
28
- }
29
- // Generate from existing analysis result (for doc-server)
30
- generateFromResult(analysisResult, title = 'Rails Application Map') {
31
- this.result = analysisResult;
32
- return this.generateHTML(title);
4
+
5
+ var RailsMapGenerator = class {
6
+ constructor(rootPath) {
7
+ this.rootPath = rootPath;
8
+ }
9
+ result = null;
10
+ async generate(options = {}) {
11
+ if (!this.rootPath) throw new Error("Root path required for analysis");
12
+ const { title = "Rails Application Map" } = options;
13
+ this.result = await analyzeRailsApp(this.rootPath);
14
+ const html = this.generateHTML(title);
15
+ if (options.outputPath) {
16
+ fs.writeFileSync(options.outputPath, html);
17
+ console.log(`
18
+ \u{1F4C4} Generated: ${options.outputPath}`);
33
19
  }
34
- generateHTML(title) {
35
- if (!this.result)
36
- throw new Error('Analysis not run');
37
- const { routes, controllers, models, grpc, summary } = this.result;
38
- return `<!DOCTYPE html>
20
+ return html;
21
+ }
22
+ // Generate from existing analysis result (for doc-server)
23
+ generateFromResult(analysisResult, title = "Rails Application Map") {
24
+ this.result = analysisResult;
25
+ return this.generateHTML(title);
26
+ }
27
+ generateHTML(title) {
28
+ if (!this.result) throw new Error("Analysis not run");
29
+ const { routes, controllers, models, grpc, summary } = this.result;
30
+ return `<!DOCTYPE html>
39
31
  <html lang="en">
40
32
  <head>
41
33
  <meta charset="UTF-8">
@@ -45,7 +37,7 @@ export class RailsMapGenerator {
45
37
  </head>
46
38
  <body>
47
39
  <header>
48
- <h1>🛤️ ${title}</h1>
40
+ <h1>\u{1F6E4}\uFE0F ${title}</h1>
49
41
  <nav class="header-nav">
50
42
  <a href="/page-map" class="nav-link">Page Map</a>
51
43
  <a href="/rails-map" class="nav-link active">Rails Map</a>
@@ -78,7 +70,7 @@ export class RailsMapGenerator {
78
70
  </div>
79
71
  <div class="stat" data-view="diagram">
80
72
  <div>
81
- <div class="stat-value">📊</div>
73
+ <div class="stat-value">\u{1F4CA}</div>
82
74
  <div class="stat-label">Diagram</div>
83
75
  </div>
84
76
  </div>
@@ -117,7 +109,7 @@ export class RailsMapGenerator {
117
109
 
118
110
  <aside class="detail-panel" id="detailPanel">
119
111
  <div class="empty-state">
120
- <div class="empty-state-icon">👆</div>
112
+ <div class="empty-state-icon">\u{1F446}</div>
121
113
  <div>Select an item to view details</div>
122
114
  </div>
123
115
  </aside>
@@ -399,9 +391,9 @@ export class RailsMapGenerator {
399
391
  <div class="controller-header">
400
392
  <div>
401
393
  <div class="controller-name">\${ctrl.className}</div>
402
- <div class="controller-namespace">\${ctrl.namespace || 'root'} \${ctrl.actions.length} actions</div>
394
+ <div class="controller-namespace">\${ctrl.namespace || 'root'} \u2022 \${ctrl.actions.length} actions</div>
403
395
  </div>
404
- <span>▶</span>
396
+ <span>\u25B6</span>
405
397
  </div>
406
398
  <div class="controller-actions">
407
399
  \${ctrl.actions.map(action => \`
@@ -496,11 +488,11 @@ export class RailsMapGenerator {
496
488
  \${displayedGrpc.map((svc, idx) => \`
497
489
  <div class="model-card" onclick="showGrpcDetail(\${idx})">
498
490
  <div class="model-name">
499
- 🔌 \${svc.className || 'Unknown'}
491
+ \u{1F50C} \${svc.className || 'Unknown'}
500
492
  </div>
501
493
  <div class="model-stats">
502
- \${svc.namespace ? \`<span>📁 \${svc.namespace}</span>\` : ''}
503
- <span>⚡ \${svc.rpcs ? svc.rpcs.length : 0} RPCs</span>
494
+ \${svc.namespace ? \`<span>\u{1F4C1} \${svc.namespace}</span>\` : ''}
495
+ <span>\u26A1 \${svc.rpcs ? svc.rpcs.length : 0} RPCs</span>
504
496
  </div>
505
497
  </div>
506
498
  \`).join('')}
@@ -525,8 +517,8 @@ export class RailsMapGenerator {
525
517
 
526
518
  let detail = \`
527
519
  <div class="detail-header">
528
- <div class="detail-title">🔌 \${svc.className || 'gRPC Service'}</div>
529
- <button class="close-btn" onclick="closeDetail()">×</button>
520
+ <div class="detail-title">\u{1F50C} \${svc.className || 'gRPC Service'}</div>
521
+ <button class="close-btn" onclick="closeDetail()">\xD7</button>
530
522
  </div>
531
523
  <div class="detail-content">
532
524
  <div class="detail-section">
@@ -683,7 +675,7 @@ export class RailsMapGenerator {
683
675
  detailPanel.innerHTML = \`
684
676
  <div class="detail-header">
685
677
  <div class="detail-title">Route Details</div>
686
- <button class="close-btn" onclick="clearDetail()">×</button>
678
+ <button class="close-btn" onclick="clearDetail()">\xD7</button>
687
679
  </div>
688
680
  <div class="detail-content">
689
681
  <div class="detail-section">
@@ -715,7 +707,7 @@ export class RailsMapGenerator {
715
707
  detailPanel.innerHTML = \`
716
708
  <div class="detail-header">
717
709
  <div class="detail-title">Controller Details</div>
718
- <button class="close-btn" onclick="clearDetail()">×</button>
710
+ <button class="close-btn" onclick="clearDetail()">\xD7</button>
719
711
  </div>
720
712
  <div class="detail-content">
721
713
  <div class="detail-section">
@@ -759,7 +751,7 @@ export class RailsMapGenerator {
759
751
  detailPanel.innerHTML = \`
760
752
  <div class="detail-header">
761
753
  <div class="detail-title">Model Details</div>
762
- <button class="close-btn" onclick="clearDetail()">×</button>
754
+ <button class="close-btn" onclick="clearDetail()">\xD7</button>
763
755
  </div>
764
756
  <div class="detail-content">
765
757
  <div class="detail-section">
@@ -816,7 +808,7 @@ export class RailsMapGenerator {
816
808
  function clearDetail() {
817
809
  detailPanel.innerHTML = \`
818
810
  <div class="empty-state">
819
- <div class="empty-state-icon">👆</div>
811
+ <div class="empty-state-icon">\u{1F446}</div>
820
812
  <div>Select an item to view details</div>
821
813
  </div>
822
814
  \`;
@@ -828,40 +820,40 @@ export class RailsMapGenerator {
828
820
  </script>
829
821
  </body>
830
822
  </html>`;
823
+ }
824
+ generateNamespaceList(routes) {
825
+ const namespaces = /* @__PURE__ */ new Map();
826
+ for (const route of routes) {
827
+ const ns = route.namespace || "root";
828
+ namespaces.set(ns, (namespaces.get(ns) || 0) + 1);
831
829
  }
832
- generateNamespaceList(routes) {
833
- const namespaces = new Map();
834
- for (const route of routes) {
835
- const ns = route.namespace || 'root';
836
- namespaces.set(ns, (namespaces.get(ns) || 0) + 1);
837
- }
838
- const sorted = [...namespaces.entries()].sort((a, b) => b[1] - a[1]);
839
- return sorted
840
- .map(([ns, count]) => `
841
- <div class="namespace-item" data-namespace="${ns === 'root' ? '' : ns}">
830
+ const sorted = [...namespaces.entries()].sort((a, b) => b[1] - a[1]);
831
+ return sorted.map(
832
+ ([ns, count]) => `
833
+ <div class="namespace-item" data-namespace="${ns === "root" ? "" : ns}">
842
834
  <span>${ns}</span>
843
835
  <span class="namespace-count">${count}</span>
844
836
  </div>
845
- `)
846
- .join('');
837
+ `
838
+ ).join("");
839
+ }
840
+ generateMethodFilters(routes) {
841
+ const methods = ["GET", "POST", "PUT", "PATCH", "DELETE"];
842
+ const counts = /* @__PURE__ */ new Map();
843
+ for (const route of routes) {
844
+ counts.set(route.method, (counts.get(route.method) || 0) + 1);
847
845
  }
848
- generateMethodFilters(routes) {
849
- const methods = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'];
850
- const counts = new Map();
851
- for (const route of routes) {
852
- counts.set(route.method, (counts.get(route.method) || 0) + 1);
853
- }
854
- return methods
855
- .map((method) => `
846
+ return methods.map(
847
+ (method) => `
856
848
  <div class="namespace-item" data-method="${method}">
857
849
  <span class="method-badge method-${method}">${method}</span>
858
850
  <span class="namespace-count">${counts.get(method) || 0}</span>
859
851
  </div>
860
- `)
861
- .join('');
862
- }
863
- generateRoutesView(routes) {
864
- return `
852
+ `
853
+ ).join("");
854
+ }
855
+ generateRoutesView(routes) {
856
+ return `
865
857
  <div class="panel-header">
866
858
  <div class="panel-title">Routes (${routes.length})</div>
867
859
  </div>
@@ -874,35 +866,35 @@ export class RailsMapGenerator {
874
866
  </tr>
875
867
  </thead>
876
868
  <tbody>
877
- ${routes
878
- .slice(0, 200)
879
- .map((route, idx) => `
869
+ ${routes.slice(0, 200).map(
870
+ (route, idx) => `
880
871
  <tr data-type="route" data-index="${idx}">
881
872
  <td><span class="method-badge method-${route.method}">${route.method}</span></td>
882
873
  <td class="path-text">${this.highlightParams(route.path)}</td>
883
874
  <td class="controller-text">${route.controller}#${route.action}</td>
884
875
  </tr>
885
- `)
886
- .join('')}
876
+ `
877
+ ).join("")}
887
878
  </tbody>
888
879
  </table>
889
880
  `;
890
- }
891
- highlightParams(path) {
892
- return path.replace(/:([a-zA-Z_]+)/g, '<span class="param">:$1</span>');
893
- }
894
- }
895
- // Standalone execution
881
+ }
882
+ highlightParams(path2) {
883
+ return path2.replace(/:([a-zA-Z_]+)/g, '<span class="param">:$1</span>');
884
+ }
885
+ };
896
886
  async function main() {
897
- const targetPath = process.argv[2] || process.cwd();
898
- const outputPath = process.argv[3] || path.join(targetPath, 'rails-map.html');
899
- const generator = new RailsMapGenerator(targetPath);
900
- await generator.generate({
901
- title: 'Rails Application Map',
902
- outputPath,
903
- });
887
+ const targetPath = process.argv[2] || process.cwd();
888
+ const outputPath = process.argv[3] || path.join(targetPath, "rails-map.html");
889
+ const generator = new RailsMapGenerator(targetPath);
890
+ await generator.generate({
891
+ title: "Rails Application Map",
892
+ outputPath
893
+ });
904
894
  }
905
- const isMainModule = import.meta.url === `file://${process.argv[1]}`;
895
+ var isMainModule = import.meta.url === `file://${process.argv[1]}`;
906
896
  if (isMainModule) {
907
- main().catch(console.error);
897
+ main().catch(console.error);
908
898
  }
899
+
900
+ export { RailsMapGenerator };