prelude-context 1.4.0 → 1.4.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/src/core/exporter.d.ts.map +1 -1
- package/dist/src/core/exporter.js +60 -0
- package/dist/src/core/exporter.js.map +1 -1
- package/dist/src/core/infer.d.ts.map +1 -1
- package/dist/src/core/infer.js +68 -0
- package/dist/src/core/infer.js.map +1 -1
- package/dist/src/core/query-engine.d.ts.map +1 -1
- package/dist/src/core/query-engine.js +77 -0
- package/dist/src/core/query-engine.js.map +1 -1
- package/dist/src/core/source-scanner.d.ts +49 -0
- package/dist/src/core/source-scanner.d.ts.map +1 -0
- package/dist/src/core/source-scanner.js +322 -0
- package/dist/src/core/source-scanner.js.map +1 -0
- package/dist/src/schema/architecture.d.ts +197 -0
- package/dist/src/schema/architecture.d.ts.map +1 -1
- package/dist/src/schema/architecture.js +41 -1
- package/dist/src/schema/architecture.js.map +1 -1
- package/package.json +1 -1
- package/schemas/architecture.schema.json +119 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface SourceScanResult {
|
|
2
|
+
reactPatterns: {
|
|
3
|
+
serverComponents: string[];
|
|
4
|
+
clientComponents: string[];
|
|
5
|
+
serverActions: string[];
|
|
6
|
+
hooks: HookInfo[];
|
|
7
|
+
providers: ProviderInfo[];
|
|
8
|
+
layouts: string[];
|
|
9
|
+
};
|
|
10
|
+
routes: RouteInfo[];
|
|
11
|
+
middleware: MiddlewareInfo[];
|
|
12
|
+
apiEndpoints: APIEndpointInfo[];
|
|
13
|
+
keyFiles: KeyFileInfo[];
|
|
14
|
+
importPatterns: {
|
|
15
|
+
internalAliases: string[];
|
|
16
|
+
heavyImporters: string[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface HookInfo {
|
|
20
|
+
file: string;
|
|
21
|
+
hooks: string[];
|
|
22
|
+
}
|
|
23
|
+
export interface ProviderInfo {
|
|
24
|
+
file: string;
|
|
25
|
+
name: string;
|
|
26
|
+
contextName?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface RouteInfo {
|
|
29
|
+
file: string;
|
|
30
|
+
path: string;
|
|
31
|
+
methods?: string[];
|
|
32
|
+
isDynamic: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface MiddlewareInfo {
|
|
35
|
+
file: string;
|
|
36
|
+
type: string;
|
|
37
|
+
guards?: string[];
|
|
38
|
+
}
|
|
39
|
+
export interface APIEndpointInfo {
|
|
40
|
+
file: string;
|
|
41
|
+
path: string;
|
|
42
|
+
methods: string[];
|
|
43
|
+
}
|
|
44
|
+
export interface KeyFileInfo {
|
|
45
|
+
file: string;
|
|
46
|
+
role: string;
|
|
47
|
+
}
|
|
48
|
+
export declare function scanSources(rootDir: string): Promise<SourceScanResult>;
|
|
49
|
+
//# sourceMappingURL=source-scanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-scanner.d.ts","sourceRoot":"","sources":["../../../src/core/source-scanner.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE;QACb,gBAAgB,EAAE,MAAM,EAAE,CAAC;QAC3B,gBAAgB,EAAE,MAAM,EAAE,CAAC;QAC3B,aAAa,EAAE,MAAM,EAAE,CAAC;QACxB,KAAK,EAAE,QAAQ,EAAE,CAAC;QAClB,SAAS,EAAE,YAAY,EAAE,CAAC;QAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;IACF,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,cAAc,EAAE;QACd,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,cAAc,EAAE,MAAM,EAAE,CAAC;KAC1B,CAAC;CACH;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AA6TD,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAuC5E"}
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { readdir } from 'fs/promises';
|
|
2
|
+
import { join, relative, basename, dirname, extname } from 'path';
|
|
3
|
+
import { IGNORE_PATTERNS } from '../constants.js';
|
|
4
|
+
// --- Constants ---
|
|
5
|
+
const SOURCE_EXTENSIONS = new Set(['.ts', '.tsx', '.js', '.jsx']);
|
|
6
|
+
const MAX_READ_LINES = 100;
|
|
7
|
+
const MAX_READ_BYTES = 4096;
|
|
8
|
+
const SKIP_DIRS = new Set(['node_modules', '.next', 'dist', 'build', '.git', '.context', 'coverage', '.turbo']);
|
|
9
|
+
const HTTP_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'];
|
|
10
|
+
// --- Helpers ---
|
|
11
|
+
function matchesIgnorePattern(filePath) {
|
|
12
|
+
for (const pattern of IGNORE_PATTERNS) {
|
|
13
|
+
// Convert glob pattern to a simple check
|
|
14
|
+
const stripped = pattern.replace(/\*\*/g, '').replace(/\*/g, '');
|
|
15
|
+
if (stripped && filePath.includes(stripped.replace(/\//g, '/'))) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
async function collectSourceFiles(rootDir) {
|
|
22
|
+
const files = [];
|
|
23
|
+
async function walk(dir, depth) {
|
|
24
|
+
if (depth > 5)
|
|
25
|
+
return;
|
|
26
|
+
let entries;
|
|
27
|
+
try {
|
|
28
|
+
entries = await readdir(dir, { withFileTypes: true });
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
for (const entry of entries) {
|
|
34
|
+
const fullPath = join(dir, entry.name);
|
|
35
|
+
if (entry.isDirectory()) {
|
|
36
|
+
if (!SKIP_DIRS.has(entry.name) && !entry.name.startsWith('.')) {
|
|
37
|
+
await walk(fullPath, depth + 1);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else if (entry.isFile()) {
|
|
41
|
+
const ext = extname(entry.name);
|
|
42
|
+
if (SOURCE_EXTENSIONS.has(ext)) {
|
|
43
|
+
const rel = relative(rootDir, fullPath);
|
|
44
|
+
if (!matchesIgnorePattern(rel)) {
|
|
45
|
+
files.push(rel);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
await walk(rootDir, 0);
|
|
52
|
+
return files;
|
|
53
|
+
}
|
|
54
|
+
async function readFileHead(rootDir, file) {
|
|
55
|
+
try {
|
|
56
|
+
const fullPath = join(rootDir, file);
|
|
57
|
+
const buf = Buffer.alloc(MAX_READ_BYTES);
|
|
58
|
+
const { createReadStream } = await import('fs');
|
|
59
|
+
return await new Promise((resolve) => {
|
|
60
|
+
const chunks = [];
|
|
61
|
+
let totalBytes = 0;
|
|
62
|
+
const stream = createReadStream(fullPath, { end: MAX_READ_BYTES - 1 });
|
|
63
|
+
stream.on('data', (chunk) => {
|
|
64
|
+
const buf = typeof chunk === 'string' ? Buffer.from(chunk) : chunk;
|
|
65
|
+
chunks.push(buf);
|
|
66
|
+
totalBytes += buf.length;
|
|
67
|
+
});
|
|
68
|
+
stream.on('end', () => {
|
|
69
|
+
const content = Buffer.concat(chunks).toString('utf-8');
|
|
70
|
+
// Check for binary content (null bytes in first 512 bytes)
|
|
71
|
+
if (content.slice(0, 512).includes('\0')) {
|
|
72
|
+
resolve(null);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
// Limit to first MAX_READ_LINES lines
|
|
76
|
+
const lines = content.split('\n');
|
|
77
|
+
resolve(lines.slice(0, MAX_READ_LINES).join('\n'));
|
|
78
|
+
});
|
|
79
|
+
stream.on('error', () => resolve(null));
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function inferRoutePath(file) {
|
|
87
|
+
// app/dashboard/settings/page.tsx → /dashboard/settings
|
|
88
|
+
// app/api/users/route.ts → /api/users
|
|
89
|
+
// pages/api/hello.ts → /api/hello
|
|
90
|
+
let routePath = file
|
|
91
|
+
.replace(/^(src\/)?app\//, '/')
|
|
92
|
+
.replace(/^(src\/)?pages\//, '/')
|
|
93
|
+
.replace(/\/(page|route)\.(tsx?|jsx?)$/, '')
|
|
94
|
+
.replace(/\.(tsx?|jsx?)$/, '')
|
|
95
|
+
.replace(/\/index$/, '/');
|
|
96
|
+
// Normalize double slashes
|
|
97
|
+
routePath = routePath.replace(/\/+/g, '/');
|
|
98
|
+
// Convert [param] to :param for readability
|
|
99
|
+
routePath = routePath.replace(/\[([^\]]+)\]/g, ':$1');
|
|
100
|
+
return routePath || '/';
|
|
101
|
+
}
|
|
102
|
+
// --- Scanner functions ---
|
|
103
|
+
function scanReactPatterns(file, content, result) {
|
|
104
|
+
const firstNonComment = content.replace(/^\s*(\/\/[^\n]*\n|\/\*[\s\S]*?\*\/\s*)*/, '').trimStart();
|
|
105
|
+
// "use client" / "use server" directives at file top
|
|
106
|
+
if (/^["']use client["']/.test(firstNonComment)) {
|
|
107
|
+
result.reactPatterns.clientComponents.push(file);
|
|
108
|
+
}
|
|
109
|
+
if (/^["']use server["']/.test(firstNonComment)) {
|
|
110
|
+
result.reactPatterns.serverComponents.push(file);
|
|
111
|
+
}
|
|
112
|
+
// "use server" inside function body (not at top) → server actions
|
|
113
|
+
if (!/^["']use server["']/.test(firstNonComment)) {
|
|
114
|
+
if (/["']use server["']/.test(content)) {
|
|
115
|
+
result.reactPatterns.serverActions.push(file);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// Custom hooks: exported functions matching use[A-Z]
|
|
119
|
+
const hookNames = [];
|
|
120
|
+
const hookPatterns = [
|
|
121
|
+
/export\s+(?:default\s+)?function\s+(use[A-Z]\w+)/g,
|
|
122
|
+
/export\s+const\s+(use[A-Z]\w+)/g,
|
|
123
|
+
];
|
|
124
|
+
for (const pattern of hookPatterns) {
|
|
125
|
+
let match;
|
|
126
|
+
while ((match = pattern.exec(content)) !== null) {
|
|
127
|
+
hookNames.push(match[1]);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (hookNames.length > 0) {
|
|
131
|
+
result.reactPatterns.hooks.push({ file, hooks: hookNames });
|
|
132
|
+
}
|
|
133
|
+
// Context providers
|
|
134
|
+
const hasCreateContext = /createContext[<(]/.test(content);
|
|
135
|
+
if (hasCreateContext) {
|
|
136
|
+
const providerMatch = content.match(/export\s+(?:const|function|default\s+function)\s+(\w*(?:Provider|Context)\w*)/);
|
|
137
|
+
const contextMatch = content.match(/(?:const|let)\s+(\w+)\s*=\s*createContext/);
|
|
138
|
+
if (providerMatch || contextMatch) {
|
|
139
|
+
result.reactPatterns.providers.push({
|
|
140
|
+
file,
|
|
141
|
+
name: providerMatch?.[1] || contextMatch?.[1] || 'Unknown',
|
|
142
|
+
contextName: contextMatch?.[1],
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// Layouts (Next.js App Router)
|
|
147
|
+
if (/^(src\/)?app\//.test(file) && /layout\.(tsx?|jsx?)$/.test(file)) {
|
|
148
|
+
result.reactPatterns.layouts.push(file);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function scanRoutes(file, content, result) {
|
|
152
|
+
// Next.js App Router pages
|
|
153
|
+
if (/^(src\/)?app\/.*\/page\.(tsx?|jsx?)$/.test(file) || /^(src\/)?app\/page\.(tsx?|jsx?)$/.test(file)) {
|
|
154
|
+
result.routes.push({
|
|
155
|
+
file,
|
|
156
|
+
path: inferRoutePath(file),
|
|
157
|
+
isDynamic: file.includes('['),
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
// Next.js App Router route handlers
|
|
161
|
+
if (/^(src\/)?app\/.*\/route\.(tsx?|jsx?)$/.test(file) || /^(src\/)?app\/route\.(tsx?|jsx?)$/.test(file)) {
|
|
162
|
+
const methods = [];
|
|
163
|
+
for (const method of HTTP_METHODS) {
|
|
164
|
+
const re = new RegExp(`export\\s+(?:async\\s+)?function\\s+${method}\\b`);
|
|
165
|
+
if (re.test(content)) {
|
|
166
|
+
methods.push(method);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
const path = inferRoutePath(file);
|
|
170
|
+
result.apiEndpoints.push({ file, path, methods });
|
|
171
|
+
}
|
|
172
|
+
// Pages Router API routes
|
|
173
|
+
if (/^(src\/)?pages\/api\//.test(file)) {
|
|
174
|
+
result.apiEndpoints.push({
|
|
175
|
+
file,
|
|
176
|
+
path: inferRoutePath(file),
|
|
177
|
+
methods: ['handler'],
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
// Express-style routes
|
|
181
|
+
const expressRoutePattern = /(?:router|app)\.(get|post|put|patch|delete)\s*\(/gi;
|
|
182
|
+
const expressMethods = [];
|
|
183
|
+
let match;
|
|
184
|
+
while ((match = expressRoutePattern.exec(content)) !== null) {
|
|
185
|
+
const method = match[1].toUpperCase();
|
|
186
|
+
if (!expressMethods.includes(method)) {
|
|
187
|
+
expressMethods.push(method);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (expressMethods.length > 0) {
|
|
191
|
+
result.routes.push({
|
|
192
|
+
file,
|
|
193
|
+
path: file,
|
|
194
|
+
methods: expressMethods,
|
|
195
|
+
isDynamic: false,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
function scanMiddleware(file, content, result) {
|
|
200
|
+
const fileName = basename(file);
|
|
201
|
+
const dirName = dirname(file);
|
|
202
|
+
// Next.js middleware at root or src/
|
|
203
|
+
if ((fileName === 'middleware.ts' || fileName === 'middleware.js') &&
|
|
204
|
+
(dirName === '.' || dirName === 'src')) {
|
|
205
|
+
const guards = [];
|
|
206
|
+
const matcherMatch = content.match(/matcher\s*:\s*\[(.*?)\]/s);
|
|
207
|
+
if (matcherMatch) {
|
|
208
|
+
const matcherContent = matcherMatch[1];
|
|
209
|
+
const pathMatches = matcherContent.match(/['"]([^'"]+)['"]/g);
|
|
210
|
+
if (pathMatches) {
|
|
211
|
+
guards.push(...pathMatches.map(m => m.replace(/['"]/g, '')));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
result.middleware.push({
|
|
215
|
+
file,
|
|
216
|
+
type: 'Next.js middleware',
|
|
217
|
+
...(guards.length > 0 ? { guards } : {}),
|
|
218
|
+
});
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
// Files in a middleware/ directory
|
|
222
|
+
if (/(?:^|\/)middleware\//.test(file)) {
|
|
223
|
+
result.middleware.push({
|
|
224
|
+
file,
|
|
225
|
+
type: 'custom',
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function scanKeyFiles(file, content, result) {
|
|
230
|
+
const fileName = basename(file);
|
|
231
|
+
const fileLower = file.toLowerCase();
|
|
232
|
+
// Database connections
|
|
233
|
+
if (/drizzle\(/.test(content) || /new PrismaClient/.test(content) || /createClient/.test(content)) {
|
|
234
|
+
if (/(?:db|database|drizzle|prisma|supabase)/i.test(fileLower)) {
|
|
235
|
+
result.keyFiles.push({ file, role: 'database connection' });
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (/^(src\/)?(lib\/)?db\.\w+$/.test(file) || /^db\/index\.\w+$/.test(file)) {
|
|
240
|
+
result.keyFiles.push({ file, role: 'database connection' });
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
// Auth config
|
|
244
|
+
if (/(?:next-auth|@clerk|lucia|@supabase\/auth-helpers|@auth\/)/.test(content)) {
|
|
245
|
+
result.keyFiles.push({ file, role: 'auth config' });
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (/^(src\/)?(lib\/)?auth\.\w+$/.test(file)) {
|
|
249
|
+
result.keyFiles.push({ file, role: 'auth config' });
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
// Framework config
|
|
253
|
+
if (/^(next|vite|nuxt|svelte)\.config\.\w+$/.test(fileName)) {
|
|
254
|
+
result.keyFiles.push({ file, role: 'framework config' });
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
// Env config
|
|
258
|
+
if (/^env\.\w+$/.test(fileName)) {
|
|
259
|
+
result.keyFiles.push({ file, role: 'env config' });
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const envCount = (content.match(/process\.env\./g) || []).length;
|
|
263
|
+
if (envCount >= 5) {
|
|
264
|
+
result.keyFiles.push({ file, role: 'env config' });
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function scanImportPatterns(file, content, result) {
|
|
268
|
+
// Internal aliases
|
|
269
|
+
const aliasPattern = /from\s+['"](@\/|~\/|#)/g;
|
|
270
|
+
let match;
|
|
271
|
+
while ((match = aliasPattern.exec(content)) !== null) {
|
|
272
|
+
const alias = match[1];
|
|
273
|
+
if (!result.importPatterns.internalAliases.includes(alias)) {
|
|
274
|
+
result.importPatterns.internalAliases.push(alias);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
// Heavy importers (10+ import lines)
|
|
278
|
+
const importLines = content.split('\n').filter(line => /^import\s/.test(line.trimStart()));
|
|
279
|
+
if (importLines.length >= 10) {
|
|
280
|
+
result.importPatterns.heavyImporters.push(file);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
// --- Main export ---
|
|
284
|
+
export async function scanSources(rootDir) {
|
|
285
|
+
const result = {
|
|
286
|
+
reactPatterns: {
|
|
287
|
+
serverComponents: [],
|
|
288
|
+
clientComponents: [],
|
|
289
|
+
serverActions: [],
|
|
290
|
+
hooks: [],
|
|
291
|
+
providers: [],
|
|
292
|
+
layouts: [],
|
|
293
|
+
},
|
|
294
|
+
routes: [],
|
|
295
|
+
middleware: [],
|
|
296
|
+
apiEndpoints: [],
|
|
297
|
+
keyFiles: [],
|
|
298
|
+
importPatterns: {
|
|
299
|
+
internalAliases: [],
|
|
300
|
+
heavyImporters: [],
|
|
301
|
+
},
|
|
302
|
+
};
|
|
303
|
+
const files = await collectSourceFiles(rootDir);
|
|
304
|
+
for (const file of files) {
|
|
305
|
+
const content = await readFileHead(rootDir, file);
|
|
306
|
+
if (content === null)
|
|
307
|
+
continue;
|
|
308
|
+
try {
|
|
309
|
+
scanReactPatterns(file, content, result);
|
|
310
|
+
scanRoutes(file, content, result);
|
|
311
|
+
scanMiddleware(file, content, result);
|
|
312
|
+
scanKeyFiles(file, content, result);
|
|
313
|
+
scanImportPatterns(file, content, result);
|
|
314
|
+
}
|
|
315
|
+
catch {
|
|
316
|
+
// Skip files that cause errors in any scanner
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
return result;
|
|
321
|
+
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33
|
apiStyle: z.ZodOptional<z.ZodEnum<["REST", "GraphQL", "tRPC", "gRPC", "mixed", "none"]>>;
|
|
34
34
|
dataFlow: z.ZodOptional<z.ZodString>;
|
|
35
|
+
reactPatterns: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
serverComponents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
37
|
+
clientComponents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
38
|
+
serverActions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
39
|
+
hooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
40
|
+
file: z.ZodString;
|
|
41
|
+
hooks: z.ZodArray<z.ZodString, "many">;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
file: string;
|
|
44
|
+
hooks: string[];
|
|
45
|
+
}, {
|
|
46
|
+
file: string;
|
|
47
|
+
hooks: string[];
|
|
48
|
+
}>, "many">>;
|
|
49
|
+
providers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
50
|
+
file: z.ZodString;
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
contextName: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
name: string;
|
|
55
|
+
file: string;
|
|
56
|
+
contextName?: string | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
name: string;
|
|
59
|
+
file: string;
|
|
60
|
+
contextName?: string | undefined;
|
|
61
|
+
}>, "many">>;
|
|
62
|
+
layouts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
serverComponents?: string[] | undefined;
|
|
65
|
+
clientComponents?: string[] | undefined;
|
|
66
|
+
serverActions?: string[] | undefined;
|
|
67
|
+
hooks?: {
|
|
68
|
+
file: string;
|
|
69
|
+
hooks: string[];
|
|
70
|
+
}[] | undefined;
|
|
71
|
+
providers?: {
|
|
72
|
+
name: string;
|
|
73
|
+
file: string;
|
|
74
|
+
contextName?: string | undefined;
|
|
75
|
+
}[] | undefined;
|
|
76
|
+
layouts?: string[] | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
serverComponents?: string[] | undefined;
|
|
79
|
+
clientComponents?: string[] | undefined;
|
|
80
|
+
serverActions?: string[] | undefined;
|
|
81
|
+
hooks?: {
|
|
82
|
+
file: string;
|
|
83
|
+
hooks: string[];
|
|
84
|
+
}[] | undefined;
|
|
85
|
+
providers?: {
|
|
86
|
+
name: string;
|
|
87
|
+
file: string;
|
|
88
|
+
contextName?: string | undefined;
|
|
89
|
+
}[] | undefined;
|
|
90
|
+
layouts?: string[] | undefined;
|
|
91
|
+
}>>;
|
|
92
|
+
routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
93
|
+
file: z.ZodString;
|
|
94
|
+
path: z.ZodString;
|
|
95
|
+
methods: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
96
|
+
isDynamic: z.ZodBoolean;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
path: string;
|
|
99
|
+
file: string;
|
|
100
|
+
isDynamic: boolean;
|
|
101
|
+
methods?: string[] | undefined;
|
|
102
|
+
}, {
|
|
103
|
+
path: string;
|
|
104
|
+
file: string;
|
|
105
|
+
isDynamic: boolean;
|
|
106
|
+
methods?: string[] | undefined;
|
|
107
|
+
}>, "many">>;
|
|
108
|
+
middleware: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
109
|
+
file: z.ZodString;
|
|
110
|
+
type: z.ZodString;
|
|
111
|
+
guards: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
type: string;
|
|
114
|
+
file: string;
|
|
115
|
+
guards?: string[] | undefined;
|
|
116
|
+
}, {
|
|
117
|
+
type: string;
|
|
118
|
+
file: string;
|
|
119
|
+
guards?: string[] | undefined;
|
|
120
|
+
}>, "many">>;
|
|
121
|
+
apiEndpoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
122
|
+
file: z.ZodString;
|
|
123
|
+
path: z.ZodString;
|
|
124
|
+
methods: z.ZodArray<z.ZodString, "many">;
|
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
|
126
|
+
path: string;
|
|
127
|
+
file: string;
|
|
128
|
+
methods: string[];
|
|
129
|
+
}, {
|
|
130
|
+
path: string;
|
|
131
|
+
file: string;
|
|
132
|
+
methods: string[];
|
|
133
|
+
}>, "many">>;
|
|
134
|
+
keyFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
135
|
+
file: z.ZodString;
|
|
136
|
+
role: z.ZodString;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
role: string;
|
|
139
|
+
file: string;
|
|
140
|
+
}, {
|
|
141
|
+
role: string;
|
|
142
|
+
file: string;
|
|
143
|
+
}>, "many">>;
|
|
144
|
+
importPatterns: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
internalAliases: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
146
|
+
heavyImporters: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
internalAliases?: string[] | undefined;
|
|
149
|
+
heavyImporters?: string[] | undefined;
|
|
150
|
+
}, {
|
|
151
|
+
internalAliases?: string[] | undefined;
|
|
152
|
+
heavyImporters?: string[] | undefined;
|
|
153
|
+
}>>;
|
|
35
154
|
}, "strip", z.ZodTypeAny, {
|
|
36
155
|
$schema: string;
|
|
37
156
|
version: string;
|
|
@@ -51,6 +170,45 @@ export declare const ArchitectureSchema: z.ZodObject<{
|
|
|
51
170
|
routing?: "file-based" | "config-based" | "none" | undefined;
|
|
52
171
|
apiStyle?: "none" | "REST" | "GraphQL" | "tRPC" | "gRPC" | "mixed" | undefined;
|
|
53
172
|
dataFlow?: string | undefined;
|
|
173
|
+
reactPatterns?: {
|
|
174
|
+
serverComponents?: string[] | undefined;
|
|
175
|
+
clientComponents?: string[] | undefined;
|
|
176
|
+
serverActions?: string[] | undefined;
|
|
177
|
+
hooks?: {
|
|
178
|
+
file: string;
|
|
179
|
+
hooks: string[];
|
|
180
|
+
}[] | undefined;
|
|
181
|
+
providers?: {
|
|
182
|
+
name: string;
|
|
183
|
+
file: string;
|
|
184
|
+
contextName?: string | undefined;
|
|
185
|
+
}[] | undefined;
|
|
186
|
+
layouts?: string[] | undefined;
|
|
187
|
+
} | undefined;
|
|
188
|
+
routes?: {
|
|
189
|
+
path: string;
|
|
190
|
+
file: string;
|
|
191
|
+
isDynamic: boolean;
|
|
192
|
+
methods?: string[] | undefined;
|
|
193
|
+
}[] | undefined;
|
|
194
|
+
middleware?: {
|
|
195
|
+
type: string;
|
|
196
|
+
file: string;
|
|
197
|
+
guards?: string[] | undefined;
|
|
198
|
+
}[] | undefined;
|
|
199
|
+
apiEndpoints?: {
|
|
200
|
+
path: string;
|
|
201
|
+
file: string;
|
|
202
|
+
methods: string[];
|
|
203
|
+
}[] | undefined;
|
|
204
|
+
keyFiles?: {
|
|
205
|
+
role: string;
|
|
206
|
+
file: string;
|
|
207
|
+
}[] | undefined;
|
|
208
|
+
importPatterns?: {
|
|
209
|
+
internalAliases?: string[] | undefined;
|
|
210
|
+
heavyImporters?: string[] | undefined;
|
|
211
|
+
} | undefined;
|
|
54
212
|
}, {
|
|
55
213
|
directories: {
|
|
56
214
|
path: string;
|
|
@@ -70,6 +228,45 @@ export declare const ArchitectureSchema: z.ZodObject<{
|
|
|
70
228
|
routing?: "file-based" | "config-based" | "none" | undefined;
|
|
71
229
|
apiStyle?: "none" | "REST" | "GraphQL" | "tRPC" | "gRPC" | "mixed" | undefined;
|
|
72
230
|
dataFlow?: string | undefined;
|
|
231
|
+
reactPatterns?: {
|
|
232
|
+
serverComponents?: string[] | undefined;
|
|
233
|
+
clientComponents?: string[] | undefined;
|
|
234
|
+
serverActions?: string[] | undefined;
|
|
235
|
+
hooks?: {
|
|
236
|
+
file: string;
|
|
237
|
+
hooks: string[];
|
|
238
|
+
}[] | undefined;
|
|
239
|
+
providers?: {
|
|
240
|
+
name: string;
|
|
241
|
+
file: string;
|
|
242
|
+
contextName?: string | undefined;
|
|
243
|
+
}[] | undefined;
|
|
244
|
+
layouts?: string[] | undefined;
|
|
245
|
+
} | undefined;
|
|
246
|
+
routes?: {
|
|
247
|
+
path: string;
|
|
248
|
+
file: string;
|
|
249
|
+
isDynamic: boolean;
|
|
250
|
+
methods?: string[] | undefined;
|
|
251
|
+
}[] | undefined;
|
|
252
|
+
middleware?: {
|
|
253
|
+
type: string;
|
|
254
|
+
file: string;
|
|
255
|
+
guards?: string[] | undefined;
|
|
256
|
+
}[] | undefined;
|
|
257
|
+
apiEndpoints?: {
|
|
258
|
+
path: string;
|
|
259
|
+
file: string;
|
|
260
|
+
methods: string[];
|
|
261
|
+
}[] | undefined;
|
|
262
|
+
keyFiles?: {
|
|
263
|
+
role: string;
|
|
264
|
+
file: string;
|
|
265
|
+
}[] | undefined;
|
|
266
|
+
importPatterns?: {
|
|
267
|
+
internalAliases?: string[] | undefined;
|
|
268
|
+
heavyImporters?: string[] | undefined;
|
|
269
|
+
} | undefined;
|
|
73
270
|
}>;
|
|
74
271
|
export type Architecture = z.infer<typeof ArchitectureSchema>;
|
|
75
272
|
//# sourceMappingURL=architecture.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"architecture.d.ts","sourceRoot":"","sources":["../../../src/schema/architecture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"architecture.d.ts","sourceRoot":"","sources":["../../../src/schema/architecture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiE7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -19,6 +19,46 @@ export const ArchitectureSchema = z.object({
|
|
|
19
19
|
routing: z.enum(['file-based', 'config-based', 'none']).optional(),
|
|
20
20
|
stateManagement: z.string().optional(),
|
|
21
21
|
apiStyle: z.enum(['REST', 'GraphQL', 'tRPC', 'gRPC', 'mixed', 'none']).optional(),
|
|
22
|
-
dataFlow: z.string().optional()
|
|
22
|
+
dataFlow: z.string().optional(),
|
|
23
|
+
// Source-level findings (inferred from actual code, not just config)
|
|
24
|
+
reactPatterns: z.object({
|
|
25
|
+
serverComponents: z.array(z.string()).optional(),
|
|
26
|
+
clientComponents: z.array(z.string()).optional(),
|
|
27
|
+
serverActions: z.array(z.string()).optional(),
|
|
28
|
+
hooks: z.array(z.object({
|
|
29
|
+
file: z.string(),
|
|
30
|
+
hooks: z.array(z.string())
|
|
31
|
+
})).optional(),
|
|
32
|
+
providers: z.array(z.object({
|
|
33
|
+
file: z.string(),
|
|
34
|
+
name: z.string(),
|
|
35
|
+
contextName: z.string().optional()
|
|
36
|
+
})).optional(),
|
|
37
|
+
layouts: z.array(z.string()).optional()
|
|
38
|
+
}).optional(),
|
|
39
|
+
routes: z.array(z.object({
|
|
40
|
+
file: z.string(),
|
|
41
|
+
path: z.string(),
|
|
42
|
+
methods: z.array(z.string()).optional(),
|
|
43
|
+
isDynamic: z.boolean()
|
|
44
|
+
})).optional(),
|
|
45
|
+
middleware: z.array(z.object({
|
|
46
|
+
file: z.string(),
|
|
47
|
+
type: z.string(),
|
|
48
|
+
guards: z.array(z.string()).optional()
|
|
49
|
+
})).optional(),
|
|
50
|
+
apiEndpoints: z.array(z.object({
|
|
51
|
+
file: z.string(),
|
|
52
|
+
path: z.string(),
|
|
53
|
+
methods: z.array(z.string())
|
|
54
|
+
})).optional(),
|
|
55
|
+
keyFiles: z.array(z.object({
|
|
56
|
+
file: z.string(),
|
|
57
|
+
role: z.string()
|
|
58
|
+
})).optional(),
|
|
59
|
+
importPatterns: z.object({
|
|
60
|
+
internalAliases: z.array(z.string()).optional(),
|
|
61
|
+
heavyImporters: z.array(z.string()).optional()
|
|
62
|
+
}).optional()
|
|
23
63
|
});
|
|
24
64
|
//# sourceMappingURL=architecture.js.map
|