@wtdlee/repomap 0.2.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 (69) 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 -290
  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 +5 -3
  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
@@ -0,0 +1 @@
1
+ export { RailsControllerAnalyzer, RailsGrpcAnalyzer, RailsModelAnalyzer, RailsRoutesAnalyzer, analyzeRailsApp, analyzeRailsViews, analyzeReactComponents, findNodes, initRubyParser, parseRuby, parseRubyFile } from './chunk-OWM6WNLE.js';
@@ -0,0 +1,2 @@
1
+ export { RailsMapGenerator } from './chunk-E4WRODSI.js';
2
+ import './chunk-OWM6WNLE.js';
@@ -1 +1,33 @@
1
- export * from './doc-server.js';
1
+ import { DocGeneratorConfig } from '../types.js';
2
+
3
+ interface DocServerOptions {
4
+ noCache?: boolean;
5
+ }
6
+ /**
7
+ * Documentation server with live reload
8
+ * ライブリロード機能付きドキュメントサーバー
9
+ */
10
+ declare class DocServer {
11
+ private config;
12
+ private port;
13
+ private app;
14
+ private server;
15
+ private io;
16
+ private engine;
17
+ private currentReport;
18
+ private envResult;
19
+ private railsAnalysis;
20
+ constructor(config: DocGeneratorConfig, port?: number, options?: DocServerOptions);
21
+ private setupRoutes;
22
+ private setupSocketIO;
23
+ private renderPage;
24
+ private getGraphQLData;
25
+ private getApiCallsData;
26
+ private getHtmlTemplate;
27
+ start(openBrowser?: boolean): Promise<void>;
28
+ private regenerate;
29
+ private watchForChanges;
30
+ stop(): void;
31
+ }
32
+
33
+ export { DocServer, type DocServerOptions };
@@ -1 +1,7 @@
1
- export * from './doc-server.js';
1
+ export { DocServer } from '../chunk-M6YNU536.js';
2
+ import '../chunk-E4WRODSI.js';
3
+ import '../chunk-3PWXDB7B.js';
4
+ import '../chunk-GNBMJMET.js';
5
+ import '../chunk-SSU6QFTX.js';
6
+ import '../chunk-3YFXZAP7.js';
7
+ import '../chunk-OWM6WNLE.js';
package/dist/types.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Type definitions for the documentation generator
3
3
  * ドキュメント生成ツールの型定義
4
4
  */
5
- export interface DocGeneratorConfig {
5
+ interface DocGeneratorConfig {
6
6
  outputDir: string;
7
7
  site: SiteConfig;
8
8
  repositories: RepositoryConfig[];
@@ -11,12 +11,12 @@ export interface DocGeneratorConfig {
11
11
  watch: WatchConfig;
12
12
  integrations: IntegrationsConfig;
13
13
  }
14
- export interface SiteConfig {
14
+ interface SiteConfig {
15
15
  title: string;
16
16
  description: string;
17
17
  baseUrl: string;
18
18
  }
19
- export interface RepositoryConfig {
19
+ interface RepositoryConfig {
20
20
  name: string;
21
21
  displayName: string;
22
22
  description: string;
@@ -27,23 +27,23 @@ export interface RepositoryConfig {
27
27
  analyzers: AnalyzerType[];
28
28
  settings: Record<string, string>;
29
29
  }
30
- export type AnalyzerType = 'pages' | 'graphql' | 'components' | 'dataflow' | 'rest-api' | 'api-endpoints' | 'graphql-schema' | 'models' | 'controllers' | 'routes' | 'grpc';
31
- export interface AnalysisConfig {
30
+ type AnalyzerType = 'pages' | 'graphql' | 'components' | 'dataflow' | 'rest-api' | 'api-endpoints' | 'graphql-schema' | 'models' | 'controllers' | 'routes' | 'grpc';
31
+ interface AnalysisConfig {
32
32
  include: string[];
33
33
  exclude: string[];
34
34
  maxDepth: number;
35
35
  }
36
- export interface DiagramConfig {
36
+ interface DiagramConfig {
37
37
  enabled: boolean;
38
38
  types: DiagramType[];
39
39
  theme: string;
40
40
  }
41
- export type DiagramType = 'flowchart' | 'sequence' | 'er' | 'class';
42
- export interface WatchConfig {
41
+ type DiagramType = 'flowchart' | 'sequence' | 'er' | 'class';
42
+ interface WatchConfig {
43
43
  enabled: boolean;
44
44
  debounce: number;
45
45
  }
46
- export interface IntegrationsConfig {
46
+ interface IntegrationsConfig {
47
47
  github: {
48
48
  enabled: boolean;
49
49
  organization: string;
@@ -53,7 +53,7 @@ export interface IntegrationsConfig {
53
53
  webhook?: string;
54
54
  };
55
55
  }
56
- export interface AnalysisResult {
56
+ interface AnalysisResult {
57
57
  repository: string;
58
58
  timestamp: string;
59
59
  version: string;
@@ -71,7 +71,7 @@ export interface AnalysisResult {
71
71
  * Frontend API call information
72
72
  * フロントエンドAPIコール情報
73
73
  */
74
- export interface APICall {
74
+ interface APICall {
75
75
  /** Unique identifier */
76
76
  id: string;
77
77
  /** HTTP method (GET, POST, PUT, DELETE, etc.) */
@@ -99,7 +99,7 @@ export interface APICall {
99
99
  /** API category (e.g., 'HubSpot', 'AWS S3', 'Internal API') */
100
100
  category?: string;
101
101
  }
102
- export interface PageInfo {
102
+ interface PageInfo {
103
103
  path: string;
104
104
  filePath: string;
105
105
  component: string;
@@ -113,7 +113,7 @@ export interface PageInfo {
113
113
  /** Multi-step flow information (wizard, onboarding, etc.) */
114
114
  steps?: StepInfo[];
115
115
  }
116
- export interface StepInfo {
116
+ interface StepInfo {
117
117
  /** Step number or identifier */
118
118
  id: number | string;
119
119
  /** Step name/label if available */
@@ -123,24 +123,24 @@ export interface StepInfo {
123
123
  /** Condition to show this step */
124
124
  condition?: string;
125
125
  }
126
- export interface AuthRequirement {
126
+ interface AuthRequirement {
127
127
  required: boolean;
128
128
  roles?: string[];
129
129
  condition?: string;
130
130
  }
131
- export interface DataFetchingInfo {
131
+ interface DataFetchingInfo {
132
132
  type: 'useQuery' | 'useMutation' | 'useLazyQuery' | 'getServerSideProps' | 'getStaticProps' | 'component' | 'useSubscription';
133
133
  operationName: string;
134
134
  variables?: string[];
135
135
  source?: string;
136
136
  }
137
- export interface NavigationInfo {
137
+ interface NavigationInfo {
138
138
  visible: boolean;
139
139
  currentNavItem: string | null;
140
140
  mini?: boolean;
141
141
  mainPageStyle?: Record<string, unknown>;
142
142
  }
143
- export interface GraphQLOperation {
143
+ interface GraphQLOperation {
144
144
  name: string;
145
145
  type: 'query' | 'mutation' | 'subscription' | 'fragment';
146
146
  filePath: string;
@@ -150,17 +150,17 @@ export interface GraphQLOperation {
150
150
  fragments: string[];
151
151
  fields: GraphQLField[];
152
152
  }
153
- export interface GraphQLField {
153
+ interface GraphQLField {
154
154
  name: string;
155
155
  type?: string;
156
156
  fields?: GraphQLField[];
157
157
  }
158
- export interface VariableInfo {
158
+ interface VariableInfo {
159
159
  name: string;
160
160
  type: string;
161
161
  required: boolean;
162
162
  }
163
- export interface ComponentInfo {
163
+ interface ComponentInfo {
164
164
  name: string;
165
165
  filePath: string;
166
166
  type: 'page' | 'container' | 'presentational' | 'layout' | 'hook';
@@ -170,13 +170,13 @@ export interface ComponentInfo {
170
170
  hooks: string[];
171
171
  stateManagement: string[];
172
172
  }
173
- export interface PropInfo {
173
+ interface PropInfo {
174
174
  name: string;
175
175
  type: string;
176
176
  required: boolean;
177
177
  defaultValue?: string;
178
178
  }
179
- export interface DataFlow {
179
+ interface DataFlow {
180
180
  id: string;
181
181
  name: string;
182
182
  description: string;
@@ -185,12 +185,12 @@ export interface DataFlow {
185
185
  via: DataFlowNode[];
186
186
  operations: string[];
187
187
  }
188
- export interface DataFlowNode {
188
+ interface DataFlowNode {
189
189
  type: 'component' | 'hook' | 'context' | 'api' | 'cache' | 'store';
190
190
  name: string;
191
191
  repository?: string;
192
192
  }
193
- export interface APIEndpoint {
193
+ interface APIEndpoint {
194
194
  method: string;
195
195
  path: string;
196
196
  controller: string;
@@ -200,18 +200,18 @@ export interface APIEndpoint {
200
200
  parameters: ParameterInfo[];
201
201
  responses: ResponseInfo[];
202
202
  }
203
- export interface ParameterInfo {
203
+ interface ParameterInfo {
204
204
  name: string;
205
205
  type: string;
206
206
  location: 'path' | 'query' | 'body' | 'header';
207
207
  required: boolean;
208
208
  }
209
- export interface ResponseInfo {
209
+ interface ResponseInfo {
210
210
  status: number;
211
211
  description: string;
212
212
  schema?: string;
213
213
  }
214
- export interface ModelInfo {
214
+ interface ModelInfo {
215
215
  name: string;
216
216
  tableName: string;
217
217
  filePath: string;
@@ -220,19 +220,19 @@ export interface ModelInfo {
220
220
  validations: string[];
221
221
  scopes: string[];
222
222
  }
223
- export interface AttributeInfo {
223
+ interface AttributeInfo {
224
224
  name: string;
225
225
  type: string;
226
226
  nullable: boolean;
227
227
  default?: string;
228
228
  }
229
- export interface AssociationInfo {
229
+ interface AssociationInfo {
230
230
  type: 'belongs_to' | 'has_one' | 'has_many' | 'has_and_belongs_to_many';
231
231
  name: string;
232
232
  model: string;
233
233
  foreignKey?: string;
234
234
  }
235
- export interface CrossRepoLink {
235
+ interface CrossRepoLink {
236
236
  sourceRepo: string;
237
237
  sourcePath: string;
238
238
  targetRepo: string;
@@ -240,19 +240,19 @@ export interface CrossRepoLink {
240
240
  linkType: 'api-call' | 'shared-type' | 'graphql-operation' | 'navigation';
241
241
  description: string;
242
242
  }
243
- export interface MermaidDiagram {
243
+ interface MermaidDiagram {
244
244
  type: DiagramType;
245
245
  title: string;
246
246
  content: string;
247
247
  relatedFiles: string[];
248
248
  }
249
- export interface DocumentationReport {
249
+ interface DocumentationReport {
250
250
  generatedAt: string;
251
251
  repositories: RepositoryReport[];
252
252
  crossRepoAnalysis: CrossRepoAnalysis;
253
253
  diagrams: MermaidDiagram[];
254
254
  }
255
- export interface RepositoryReport {
255
+ interface RepositoryReport {
256
256
  name: string;
257
257
  displayName: string;
258
258
  version: string;
@@ -260,7 +260,7 @@ export interface RepositoryReport {
260
260
  analysis: AnalysisResult;
261
261
  summary: RepositorySummary;
262
262
  }
263
- export interface RepositorySummary {
263
+ interface RepositorySummary {
264
264
  totalPages: number;
265
265
  totalComponents: number;
266
266
  totalGraphQLOperations: number;
@@ -268,19 +268,19 @@ export interface RepositorySummary {
268
268
  authRequiredPages: number;
269
269
  publicPages: number;
270
270
  }
271
- export interface CrossRepoAnalysis {
271
+ interface CrossRepoAnalysis {
272
272
  sharedTypes: string[];
273
273
  apiConnections: APIConnection[];
274
274
  navigationFlows: NavigationFlow[];
275
275
  dataFlowAcrossRepos: DataFlow[];
276
276
  }
277
- export interface APIConnection {
277
+ interface APIConnection {
278
278
  frontend: string;
279
279
  backend: string;
280
280
  endpoint: string;
281
281
  operations: string[];
282
282
  }
283
- export interface NavigationFlow {
283
+ interface NavigationFlow {
284
284
  from: {
285
285
  repo: string;
286
286
  page: string;
@@ -291,3 +291,5 @@ export interface NavigationFlow {
291
291
  };
292
292
  trigger: string;
293
293
  }
294
+
295
+ export type { APICall, APIConnection, APIEndpoint, AnalysisConfig, AnalysisResult, AnalyzerType, AssociationInfo, AttributeInfo, AuthRequirement, ComponentInfo, CrossRepoAnalysis, CrossRepoLink, DataFetchingInfo, DataFlow, DataFlowNode, DiagramConfig, DiagramType, DocGeneratorConfig, DocumentationReport, GraphQLField, GraphQLOperation, IntegrationsConfig, MermaidDiagram, ModelInfo, NavigationFlow, NavigationInfo, PageInfo, ParameterInfo, PropInfo, RepositoryConfig, RepositoryReport, RepositorySummary, ResponseInfo, SiteConfig, StepInfo, VariableInfo, WatchConfig };
package/dist/types.js CHANGED
@@ -1,5 +1 @@
1
- /**
2
- * Type definitions for the documentation generator
3
- * ドキュメント生成ツールの型定義
4
- */
5
- export {};
1
+ import './chunk-6F4PWJZI.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wtdlee/repomap",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Interactive documentation generator for code repositories - visualize pages, components, GraphQL operations, and data flows",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -79,6 +79,7 @@
79
79
  "@babel/traverse": "^7.23.0",
80
80
  "chalk": "^5.3.0",
81
81
  "commander": "^14.0.2",
82
+ "express": "^5.2.1",
82
83
  "fast-glob": "^3.3.2",
83
84
  "glob": "^13.0.0",
84
85
  "graphql": "^16.8.1",
@@ -100,18 +101,19 @@
100
101
  "eslint": "^9.39.1",
101
102
  "eslint-config-prettier": "^10.1.8",
102
103
  "eslint-plugin-prettier": "^5.5.4",
103
- "express": "^5.2.1",
104
104
  "globals": "^16.5.0",
105
105
  "husky": "^9.1.7",
106
106
  "lint-staged": "^16.2.7",
107
107
  "prettier": "^3.7.4",
108
+ "tsup": "^8.5.1",
108
109
  "tsx": "^4.6.2",
109
110
  "typescript": "^5.3.2",
110
111
  "typescript-eslint": "^8.49.0",
111
112
  "vitest": "^4.0.15"
112
113
  },
113
114
  "scripts": {
114
- "build": "tsc && npm run copy-assets",
115
+ "build": "tsup",
116
+ "build:tsc": "tsc && npm run copy-assets",
115
117
  "copy-assets": "mkdir -p dist/generators/assets && cp src/generators/assets/*.css dist/generators/assets/",
116
118
  "dev": "tsx watch src/cli.ts",
117
119
  "dev:serve": "tsx watch --clear-screen=false src/cli.ts serve --no-cache",
@@ -1,45 +0,0 @@
1
- import type { RepositoryConfig, AnalysisResult } from '../types.js';
2
- /**
3
- * Base class for all analyzers
4
- * 全分析器の基底クラス
5
- */
6
- export declare abstract class BaseAnalyzer {
7
- protected config: RepositoryConfig;
8
- protected basePath: string;
9
- constructor(config: RepositoryConfig);
10
- /**
11
- * Run the analysis
12
- * 分析を実行
13
- */
14
- abstract analyze(): Promise<Partial<AnalysisResult>>;
15
- /**
16
- * Get the analyzer name
17
- * 分析器名を取得
18
- */
19
- abstract getName(): string;
20
- /**
21
- * Resolve path relative to repository root
22
- * リポジトリルートからの相対パスを解決
23
- */
24
- protected resolvePath(relativePath: string): string;
25
- /**
26
- * Get setting value with fallback
27
- * 設定値を取得(フォールバック付き)
28
- */
29
- protected getSetting(key: string, defaultValue?: string): string;
30
- /**
31
- * Log analysis progress
32
- * 分析進捗をログ出力
33
- */
34
- protected log(message: string): void;
35
- /**
36
- * Log warning
37
- * 警告をログ出力
38
- */
39
- protected warn(message: string): void;
40
- /**
41
- * Log error
42
- * エラーをログ出力
43
- */
44
- protected error(message: string, error?: Error): void;
45
- }
@@ -1,47 +0,0 @@
1
- /**
2
- * Base class for all analyzers
3
- * 全分析器の基底クラス
4
- */
5
- export class BaseAnalyzer {
6
- config;
7
- basePath;
8
- constructor(config) {
9
- this.config = config;
10
- this.basePath = config.path;
11
- }
12
- /**
13
- * Resolve path relative to repository root
14
- * リポジトリルートからの相対パスを解決
15
- */
16
- resolvePath(relativePath) {
17
- return `${this.basePath}/${relativePath}`;
18
- }
19
- /**
20
- * Get setting value with fallback
21
- * 設定値を取得(フォールバック付き)
22
- */
23
- getSetting(key, defaultValue = '') {
24
- return this.config.settings[key] ?? defaultValue;
25
- }
26
- /**
27
- * Log analysis progress
28
- * 分析進捗をログ出力
29
- */
30
- log(message) {
31
- console.log(`[${this.getName()}] ${message}`);
32
- }
33
- /**
34
- * Log warning
35
- * 警告をログ出力
36
- */
37
- warn(message) {
38
- console.warn(`[${this.getName()}] ⚠️ ${message}`);
39
- }
40
- /**
41
- * Log error
42
- * エラーをログ出力
43
- */
44
- error(message, error) {
45
- console.error(`[${this.getName()}] ❌ ${message}`, error?.message || '');
46
- }
47
- }
@@ -1,29 +0,0 @@
1
- import { BaseAnalyzer } from './base-analyzer.js';
2
- import type { AnalysisResult, RepositoryConfig } from '../types.js';
3
- /**
4
- * Analyzer for data flow patterns
5
- * データフローパターンの分析器
6
- */
7
- export declare class DataFlowAnalyzer extends BaseAnalyzer {
8
- private project;
9
- private componentCache;
10
- constructor(config: RepositoryConfig);
11
- getName(): string;
12
- analyze(): Promise<Partial<AnalysisResult>>;
13
- private analyzeComponents;
14
- private analyzeComponentFile;
15
- private isComponentName;
16
- private extractComponentInfo;
17
- private extractHookInfo;
18
- private extractProps;
19
- private extractHooksUsed;
20
- private extractOperationName;
21
- private extractContextName;
22
- private extractDependencies;
23
- private extractStateManagement;
24
- private buildDependencyGraph;
25
- private analyzeDataFlows;
26
- private analyzeContextFlows;
27
- private analyzeApolloFlows;
28
- private analyzePropDrilling;
29
- }