@noyrax/documentation-system-plugin 1.0.4-beta.13 → 1.0.4-beta.15
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/package.json +1 -1
- package/scripts/verify-adrs.js +29 -14
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@noyrax/documentation-system-plugin",
|
|
3
3
|
"displayName": "Noyrax",
|
|
4
4
|
"description": "Documentation that never drifts. Automatic documentation generation with validation and drift detection. Generates 5-dimensional documentation structure (modules, symbols, dependencies, ADRs, changes) for codebases.",
|
|
5
|
-
"version": "1.0.4-beta.
|
|
5
|
+
"version": "1.0.4-beta.15",
|
|
6
6
|
"publisher": "noyrax",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
package/scripts/verify-adrs.js
CHANGED
|
@@ -188,13 +188,15 @@ function resolvePathWithAlias(filePath, workspaceRoot, aliasMap) {
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
/**
|
|
191
|
-
* Findet src/
|
|
191
|
+
* Findet alle src/ Verzeichnisse (und app/ für Next.js) mit Hilfe der Alias-Map
|
|
192
192
|
*/
|
|
193
|
-
function
|
|
193
|
+
function findAllSourceDirectories(workspaceRoot, aliasMap) {
|
|
194
|
+
const sourceDirs = [];
|
|
195
|
+
|
|
194
196
|
// Standard: src/ im Workspace-Root
|
|
195
197
|
const standardSrc = path.join(workspaceRoot, 'src');
|
|
196
198
|
if (fs.existsSync(standardSrc)) {
|
|
197
|
-
|
|
199
|
+
sourceDirs.push(standardSrc);
|
|
198
200
|
}
|
|
199
201
|
|
|
200
202
|
// Suche in Alias-Map nach src/ Pfaden
|
|
@@ -206,8 +208,8 @@ function findSrcDirectory(workspaceRoot, aliasMap) {
|
|
|
206
208
|
if (srcIndex > 0) {
|
|
207
209
|
const pluginRoot = targetParts.slice(0, srcIndex).join('/');
|
|
208
210
|
const srcDir = path.join(workspaceRoot, pluginRoot, 'src');
|
|
209
|
-
if (fs.existsSync(srcDir)) {
|
|
210
|
-
|
|
211
|
+
if (fs.existsSync(srcDir) && !sourceDirs.includes(srcDir)) {
|
|
212
|
+
sourceDirs.push(srcDir);
|
|
211
213
|
}
|
|
212
214
|
}
|
|
213
215
|
}
|
|
@@ -223,16 +225,23 @@ function findSrcDirectory(workspaceRoot, aliasMap) {
|
|
|
223
225
|
];
|
|
224
226
|
|
|
225
227
|
for (const searchDir of searchDirs) {
|
|
228
|
+
// src/ Verzeichnisse
|
|
226
229
|
const srcDir = path.join(searchDir, 'src');
|
|
227
|
-
if (fs.existsSync(srcDir)) {
|
|
228
|
-
|
|
230
|
+
if (fs.existsSync(srcDir) && !sourceDirs.includes(srcDir)) {
|
|
231
|
+
sourceDirs.push(srcDir);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// app/ Verzeichnisse (Next.js)
|
|
235
|
+
const appDir = path.join(searchDir, 'app');
|
|
236
|
+
if (fs.existsSync(appDir) && !sourceDirs.includes(appDir)) {
|
|
237
|
+
sourceDirs.push(appDir);
|
|
229
238
|
}
|
|
230
239
|
}
|
|
231
240
|
} catch (error) {
|
|
232
241
|
// Ignore errors
|
|
233
242
|
}
|
|
234
243
|
|
|
235
|
-
return null;
|
|
244
|
+
return sourceDirs.length > 0 ? sourceDirs : null;
|
|
236
245
|
}
|
|
237
246
|
|
|
238
247
|
/**
|
|
@@ -281,20 +290,26 @@ function verifyClaim(claim, workspaceRoot) {
|
|
|
281
290
|
|
|
282
291
|
if (claim.type === 'function-exists') {
|
|
283
292
|
try {
|
|
284
|
-
// Finde src/
|
|
285
|
-
const
|
|
286
|
-
if (!
|
|
293
|
+
// Finde alle src/ und app/ Verzeichnisse mit Hilfe der Alias-Map
|
|
294
|
+
const sourceDirs = findAllSourceDirectories(workspaceRoot, aliasMap);
|
|
295
|
+
if (!sourceDirs || sourceDirs.length === 0) {
|
|
287
296
|
warnings.push({
|
|
288
297
|
adr: claim.adr,
|
|
289
298
|
line: claim.line,
|
|
290
|
-
claim: `Could not verify function ${claim.name} (src/ directory not found)`,
|
|
299
|
+
claim: `Could not verify function ${claim.name} (src/ or app/ directory not found)`,
|
|
291
300
|
type: 'function-exists'
|
|
292
301
|
});
|
|
293
302
|
return true;
|
|
294
303
|
}
|
|
295
304
|
|
|
296
|
-
// Rekursive Suche in TypeScript-Dateien
|
|
297
|
-
|
|
305
|
+
// Rekursive Suche in allen TypeScript-Dateien (src/ und app/)
|
|
306
|
+
let found = false;
|
|
307
|
+
for (const srcDir of sourceDirs) {
|
|
308
|
+
if (searchInDirectory(srcDir, claim.name)) {
|
|
309
|
+
found = true;
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
298
313
|
|
|
299
314
|
if (!found) {
|
|
300
315
|
if (claim.explicit || claim.autoGenerated) {
|