@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.
- package/dist/analyzers/index.d.ts +69 -5
- package/dist/analyzers/index.js +1 -5
- package/dist/chunk-3PWXDB7B.js +153 -0
- package/dist/{generators/page-map-generator.js → chunk-3YFXZAP7.js} +322 -358
- package/dist/chunk-6F4PWJZI.js +1 -0
- package/dist/{generators/rails-map-generator.js → chunk-E4WRODSI.js} +86 -94
- package/dist/chunk-GNBMJMET.js +2519 -0
- package/dist/{server/doc-server.js → chunk-M6YNU536.js} +702 -303
- package/dist/chunk-OWM6WNLE.js +2610 -0
- package/dist/chunk-SSU6QFTX.js +1058 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +348 -452
- package/dist/dataflow-analyzer-BfAiqVUp.d.ts +180 -0
- package/dist/env-detector-EEMVUEIA.js +1 -0
- package/dist/generators/index.d.ts +431 -3
- package/dist/generators/index.js +2 -3
- package/dist/index.d.ts +53 -10
- package/dist/index.js +8 -11
- package/dist/page-map-generator-6MJGPBVA.js +1 -0
- package/dist/rails-UWSDRS33.js +1 -0
- package/dist/rails-map-generator-D2URLMVJ.js +2 -0
- package/dist/server/index.d.ts +33 -1
- package/dist/server/index.js +7 -1
- package/dist/types.d.ts +39 -37
- package/dist/types.js +1 -5
- package/package.json +4 -2
- package/dist/analyzers/base-analyzer.d.ts +0 -45
- package/dist/analyzers/base-analyzer.js +0 -47
- package/dist/analyzers/dataflow-analyzer.d.ts +0 -29
- package/dist/analyzers/dataflow-analyzer.js +0 -425
- package/dist/analyzers/graphql-analyzer.d.ts +0 -22
- package/dist/analyzers/graphql-analyzer.js +0 -386
- package/dist/analyzers/pages-analyzer.d.ts +0 -84
- package/dist/analyzers/pages-analyzer.js +0 -1695
- package/dist/analyzers/rails/index.d.ts +0 -46
- package/dist/analyzers/rails/index.js +0 -145
- package/dist/analyzers/rails/rails-controller-analyzer.d.ts +0 -82
- package/dist/analyzers/rails/rails-controller-analyzer.js +0 -478
- package/dist/analyzers/rails/rails-grpc-analyzer.d.ts +0 -44
- package/dist/analyzers/rails/rails-grpc-analyzer.js +0 -262
- package/dist/analyzers/rails/rails-model-analyzer.d.ts +0 -88
- package/dist/analyzers/rails/rails-model-analyzer.js +0 -493
- package/dist/analyzers/rails/rails-react-analyzer.d.ts +0 -41
- package/dist/analyzers/rails/rails-react-analyzer.js +0 -529
- package/dist/analyzers/rails/rails-routes-analyzer.d.ts +0 -62
- package/dist/analyzers/rails/rails-routes-analyzer.js +0 -540
- package/dist/analyzers/rails/rails-view-analyzer.d.ts +0 -49
- package/dist/analyzers/rails/rails-view-analyzer.js +0 -386
- package/dist/analyzers/rails/ruby-parser.d.ts +0 -63
- package/dist/analyzers/rails/ruby-parser.js +0 -212
- package/dist/analyzers/rest-api-analyzer.d.ts +0 -65
- package/dist/analyzers/rest-api-analyzer.js +0 -479
- package/dist/core/cache.d.ts +0 -47
- package/dist/core/cache.js +0 -151
- package/dist/core/engine.d.ts +0 -46
- package/dist/core/engine.js +0 -319
- package/dist/core/index.d.ts +0 -2
- package/dist/core/index.js +0 -2
- package/dist/generators/markdown-generator.d.ts +0 -25
- package/dist/generators/markdown-generator.js +0 -782
- package/dist/generators/mermaid-generator.d.ts +0 -35
- package/dist/generators/mermaid-generator.js +0 -364
- package/dist/generators/page-map-generator.d.ts +0 -22
- package/dist/generators/rails-map-generator.d.ts +0 -21
- package/dist/server/doc-server.d.ts +0 -30
- package/dist/utils/env-detector.d.ts +0 -31
- package/dist/utils/env-detector.js +0 -188
- package/dist/utils/parallel.d.ts +0 -23
- package/dist/utils/parallel.js +0 -70
- package/dist/utils/port.d.ts +0 -15
- package/dist/utils/port.js +0 -41
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Environment detection utilities
|
|
3
|
-
* 環境検出ユーティリティ
|
|
4
|
-
*/
|
|
5
|
-
import * as fs from 'fs/promises';
|
|
6
|
-
import * as path from 'path';
|
|
7
|
-
/**
|
|
8
|
-
* Detect all environments in the given directory
|
|
9
|
-
* 指定されたディレクトリ内のすべての環境を検出
|
|
10
|
-
*/
|
|
11
|
-
export async function detectEnvironments(rootPath) {
|
|
12
|
-
const environments = [];
|
|
13
|
-
// Check for Rails
|
|
14
|
-
const railsEnv = await detectRails(rootPath);
|
|
15
|
-
if (railsEnv.detected) {
|
|
16
|
-
environments.push(railsEnv);
|
|
17
|
-
}
|
|
18
|
-
// Check for Next.js / React
|
|
19
|
-
const jsEnv = await detectJsEnvironment(rootPath);
|
|
20
|
-
if (jsEnv.detected) {
|
|
21
|
-
environments.push(jsEnv);
|
|
22
|
-
}
|
|
23
|
-
const hasNextjs = environments.some((e) => e.type === 'nextjs');
|
|
24
|
-
const hasReact = environments.some((e) => e.type === 'react' || e.type === 'nextjs');
|
|
25
|
-
const hasRails = environments.some((e) => e.type === 'rails');
|
|
26
|
-
// Determine primary environment
|
|
27
|
-
let primary = 'generic';
|
|
28
|
-
if (hasNextjs) {
|
|
29
|
-
primary = 'nextjs';
|
|
30
|
-
}
|
|
31
|
-
else if (hasReact) {
|
|
32
|
-
primary = 'react';
|
|
33
|
-
}
|
|
34
|
-
else if (hasRails) {
|
|
35
|
-
primary = 'rails';
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
environments,
|
|
39
|
-
hasNextjs,
|
|
40
|
-
hasReact,
|
|
41
|
-
hasRails,
|
|
42
|
-
primary,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Detect Rails environment
|
|
47
|
-
*/
|
|
48
|
-
async function detectRails(rootPath) {
|
|
49
|
-
const result = {
|
|
50
|
-
type: 'rails',
|
|
51
|
-
detected: false,
|
|
52
|
-
path: rootPath,
|
|
53
|
-
features: [],
|
|
54
|
-
};
|
|
55
|
-
try {
|
|
56
|
-
const gemfilePath = path.join(rootPath, 'Gemfile');
|
|
57
|
-
const routesPath = path.join(rootPath, 'config', 'routes.rb');
|
|
58
|
-
// Check for Gemfile
|
|
59
|
-
await fs.access(gemfilePath);
|
|
60
|
-
await fs.access(routesPath);
|
|
61
|
-
const gemfile = await fs.readFile(gemfilePath, 'utf-8');
|
|
62
|
-
const isRails = gemfile.includes("gem 'rails'") || gemfile.includes('gem "rails"');
|
|
63
|
-
if (!isRails) {
|
|
64
|
-
return result;
|
|
65
|
-
}
|
|
66
|
-
result.detected = true;
|
|
67
|
-
// Extract Rails version
|
|
68
|
-
const versionMatch = gemfile.match(/gem ['"]rails['"],\s*['"]([^'"]+)['"]/);
|
|
69
|
-
if (versionMatch) {
|
|
70
|
-
result.version = versionMatch[1];
|
|
71
|
-
}
|
|
72
|
-
// Detect features
|
|
73
|
-
const features = [];
|
|
74
|
-
// Check for gRPC services
|
|
75
|
-
try {
|
|
76
|
-
await fs.access(path.join(rootPath, 'app', 'grpc_services'));
|
|
77
|
-
features.push('grpc');
|
|
78
|
-
}
|
|
79
|
-
catch { }
|
|
80
|
-
// Check for API mode
|
|
81
|
-
try {
|
|
82
|
-
const appConfig = await fs.readFile(path.join(rootPath, 'config', 'application.rb'), 'utf-8');
|
|
83
|
-
if (appConfig.includes('config.api_only = true')) {
|
|
84
|
-
features.push('api-only');
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
catch { }
|
|
88
|
-
// Check for GraphQL
|
|
89
|
-
if (gemfile.includes("gem 'graphql'") || gemfile.includes('gem "graphql"')) {
|
|
90
|
-
features.push('graphql');
|
|
91
|
-
}
|
|
92
|
-
// Check for Devise
|
|
93
|
-
if (gemfile.includes("gem 'devise'") || gemfile.includes('gem "devise"')) {
|
|
94
|
-
features.push('devise');
|
|
95
|
-
}
|
|
96
|
-
result.features = features;
|
|
97
|
-
}
|
|
98
|
-
catch {
|
|
99
|
-
// Not a Rails project
|
|
100
|
-
}
|
|
101
|
-
return result;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Detect JavaScript environment (Next.js or React)
|
|
105
|
-
*/
|
|
106
|
-
async function detectJsEnvironment(rootPath) {
|
|
107
|
-
const result = {
|
|
108
|
-
type: 'react',
|
|
109
|
-
detected: false,
|
|
110
|
-
path: rootPath,
|
|
111
|
-
features: [],
|
|
112
|
-
};
|
|
113
|
-
try {
|
|
114
|
-
const packageJsonPath = path.join(rootPath, 'package.json');
|
|
115
|
-
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));
|
|
116
|
-
const deps = { ...packageJson.dependencies, ...packageJson.devDependencies };
|
|
117
|
-
// Check for React
|
|
118
|
-
if (!deps['react']) {
|
|
119
|
-
return result;
|
|
120
|
-
}
|
|
121
|
-
result.detected = true;
|
|
122
|
-
result.version = deps['react'];
|
|
123
|
-
const features = [];
|
|
124
|
-
// Check for Next.js
|
|
125
|
-
if (deps['next']) {
|
|
126
|
-
result.type = 'nextjs';
|
|
127
|
-
result.version = deps['next'];
|
|
128
|
-
// Check for App Router vs Pages Router
|
|
129
|
-
try {
|
|
130
|
-
await fs.access(path.join(rootPath, 'app'));
|
|
131
|
-
features.push('app-router');
|
|
132
|
-
}
|
|
133
|
-
catch { }
|
|
134
|
-
try {
|
|
135
|
-
await fs.access(path.join(rootPath, 'pages'));
|
|
136
|
-
features.push('pages-router');
|
|
137
|
-
}
|
|
138
|
-
catch { }
|
|
139
|
-
try {
|
|
140
|
-
await fs.access(path.join(rootPath, 'src', 'pages'));
|
|
141
|
-
features.push('pages-router');
|
|
142
|
-
}
|
|
143
|
-
catch { }
|
|
144
|
-
try {
|
|
145
|
-
await fs.access(path.join(rootPath, 'src', 'app'));
|
|
146
|
-
features.push('app-router');
|
|
147
|
-
}
|
|
148
|
-
catch { }
|
|
149
|
-
}
|
|
150
|
-
// Check for GraphQL
|
|
151
|
-
if (deps['@apollo/client'] || deps['graphql'] || deps['graphql-request'] || deps['urql']) {
|
|
152
|
-
features.push('graphql');
|
|
153
|
-
}
|
|
154
|
-
// Check for TypeScript
|
|
155
|
-
if (deps['typescript']) {
|
|
156
|
-
features.push('typescript');
|
|
157
|
-
}
|
|
158
|
-
// Check for state management
|
|
159
|
-
if (deps['redux'] || deps['@reduxjs/toolkit']) {
|
|
160
|
-
features.push('redux');
|
|
161
|
-
}
|
|
162
|
-
if (deps['zustand']) {
|
|
163
|
-
features.push('zustand');
|
|
164
|
-
}
|
|
165
|
-
if (deps['jotai'] || deps['recoil']) {
|
|
166
|
-
features.push('atomic-state');
|
|
167
|
-
}
|
|
168
|
-
result.features = features;
|
|
169
|
-
}
|
|
170
|
-
catch {
|
|
171
|
-
// Not a JS project
|
|
172
|
-
}
|
|
173
|
-
return result;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Get analyzer types for detected environments
|
|
177
|
-
*/
|
|
178
|
-
export function getAnalyzersForEnvironments(envResult) {
|
|
179
|
-
const frontend = [];
|
|
180
|
-
const backend = [];
|
|
181
|
-
if (envResult.hasNextjs || envResult.hasReact) {
|
|
182
|
-
frontend.push('pages', 'graphql', 'dataflow', 'rest-api');
|
|
183
|
-
}
|
|
184
|
-
if (envResult.hasRails) {
|
|
185
|
-
backend.push('routes', 'controllers', 'models', 'grpc');
|
|
186
|
-
}
|
|
187
|
-
return { frontend, backend };
|
|
188
|
-
}
|
package/dist/utils/parallel.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parallel processing utilities
|
|
3
|
-
* 병렬 처리 유틸리티
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Process items in parallel with concurrency limit
|
|
7
|
-
* 동시성 제한을 두고 아이템들을 병렬 처리
|
|
8
|
-
*
|
|
9
|
-
* @param items - Items to process
|
|
10
|
-
* @param fn - Async function to apply to each item
|
|
11
|
-
* @param concurrency - Maximum concurrent operations (default: CPU cores)
|
|
12
|
-
*/
|
|
13
|
-
export declare function parallelMap<T, R>(items: T[], fn: (item: T, index: number) => Promise<R>, concurrency?: number): Promise<R[]>;
|
|
14
|
-
/**
|
|
15
|
-
* Process items in parallel, collecting successful results
|
|
16
|
-
* 실패한 항목은 무시하고 성공한 결과만 수집
|
|
17
|
-
*/
|
|
18
|
-
export declare function parallelMapSafe<T, R>(items: T[], fn: (item: T, index: number) => Promise<R>, concurrency?: number): Promise<R[]>;
|
|
19
|
-
/**
|
|
20
|
-
* Process items in batches
|
|
21
|
-
* 배치 단위로 처리
|
|
22
|
-
*/
|
|
23
|
-
export declare function batchProcess<T, R>(items: T[], fn: (batch: T[]) => Promise<R[]>, batchSize?: number): Promise<R[]>;
|
package/dist/utils/parallel.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parallel processing utilities
|
|
3
|
-
* 병렬 처리 유틸리티
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Process items in parallel with concurrency limit
|
|
7
|
-
* 동시성 제한을 두고 아이템들을 병렬 처리
|
|
8
|
-
*
|
|
9
|
-
* @param items - Items to process
|
|
10
|
-
* @param fn - Async function to apply to each item
|
|
11
|
-
* @param concurrency - Maximum concurrent operations (default: CPU cores)
|
|
12
|
-
*/
|
|
13
|
-
export async function parallelMap(items, fn, concurrency = 8) {
|
|
14
|
-
const results = new Array(items.length);
|
|
15
|
-
let currentIndex = 0;
|
|
16
|
-
async function worker() {
|
|
17
|
-
while (currentIndex < items.length) {
|
|
18
|
-
const index = currentIndex++;
|
|
19
|
-
if (index < items.length) {
|
|
20
|
-
results[index] = await fn(items[index], index);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
// Create workers up to concurrency limit
|
|
25
|
-
const workers = Array(Math.min(concurrency, items.length))
|
|
26
|
-
.fill(null)
|
|
27
|
-
.map(() => worker());
|
|
28
|
-
await Promise.all(workers);
|
|
29
|
-
return results;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Process items in parallel, collecting successful results
|
|
33
|
-
* 실패한 항목은 무시하고 성공한 결과만 수집
|
|
34
|
-
*/
|
|
35
|
-
export async function parallelMapSafe(items, fn, concurrency = 8) {
|
|
36
|
-
const results = new Array(items.length).fill(null);
|
|
37
|
-
let currentIndex = 0;
|
|
38
|
-
async function worker() {
|
|
39
|
-
while (currentIndex < items.length) {
|
|
40
|
-
const index = currentIndex++;
|
|
41
|
-
if (index < items.length) {
|
|
42
|
-
try {
|
|
43
|
-
results[index] = await fn(items[index], index);
|
|
44
|
-
}
|
|
45
|
-
catch {
|
|
46
|
-
// Silently ignore errors
|
|
47
|
-
results[index] = null;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
const workers = Array(Math.min(concurrency, items.length))
|
|
53
|
-
.fill(null)
|
|
54
|
-
.map(() => worker());
|
|
55
|
-
await Promise.all(workers);
|
|
56
|
-
return results.filter((r) => r !== null);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Process items in batches
|
|
60
|
-
* 배치 단위로 처리
|
|
61
|
-
*/
|
|
62
|
-
export async function batchProcess(items, fn, batchSize = 50) {
|
|
63
|
-
const results = [];
|
|
64
|
-
for (let i = 0; i < items.length; i += batchSize) {
|
|
65
|
-
const batch = items.slice(i, i + batchSize);
|
|
66
|
-
const batchResults = await fn(batch);
|
|
67
|
-
results.push(...batchResults);
|
|
68
|
-
}
|
|
69
|
-
return results;
|
|
70
|
-
}
|
package/dist/utils/port.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if a port is available
|
|
3
|
-
* ポートが使用可能かどうかを確認
|
|
4
|
-
*/
|
|
5
|
-
export declare function isPortAvailable(port: number): Promise<boolean>;
|
|
6
|
-
/**
|
|
7
|
-
* Find an available port starting from the given port
|
|
8
|
-
* 指定されたポートから利用可能なポートを探す
|
|
9
|
-
*
|
|
10
|
-
* @param startPort - Port to start searching from
|
|
11
|
-
* @param maxAttempts - Maximum number of ports to try (default: 10)
|
|
12
|
-
* @returns Available port number
|
|
13
|
-
* @throws Error if no available port found within maxAttempts
|
|
14
|
-
*/
|
|
15
|
-
export declare function findAvailablePort(startPort: number, maxAttempts?: number): Promise<number>;
|
package/dist/utils/port.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import * as net from 'net';
|
|
2
|
-
/**
|
|
3
|
-
* Check if a port is available
|
|
4
|
-
* ポートが使用可能かどうかを確認
|
|
5
|
-
*/
|
|
6
|
-
export function isPortAvailable(port) {
|
|
7
|
-
return new Promise((resolve) => {
|
|
8
|
-
const server = net.createServer();
|
|
9
|
-
server.once('error', (err) => {
|
|
10
|
-
if (err.code === 'EADDRINUSE') {
|
|
11
|
-
resolve(false);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
resolve(false);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
server.once('listening', () => {
|
|
18
|
-
server.close();
|
|
19
|
-
resolve(true);
|
|
20
|
-
});
|
|
21
|
-
server.listen(port);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Find an available port starting from the given port
|
|
26
|
-
* 指定されたポートから利用可能なポートを探す
|
|
27
|
-
*
|
|
28
|
-
* @param startPort - Port to start searching from
|
|
29
|
-
* @param maxAttempts - Maximum number of ports to try (default: 10)
|
|
30
|
-
* @returns Available port number
|
|
31
|
-
* @throws Error if no available port found within maxAttempts
|
|
32
|
-
*/
|
|
33
|
-
export async function findAvailablePort(startPort, maxAttempts = 10) {
|
|
34
|
-
for (let i = 0; i < maxAttempts; i++) {
|
|
35
|
-
const port = startPort + i;
|
|
36
|
-
if (await isPortAvailable(port)) {
|
|
37
|
-
return port;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
throw new Error(`No available port found between ${startPort} and ${startPort + maxAttempts - 1}`);
|
|
41
|
-
}
|