@noyrax/documentation-system-plugin 1.0.4-beta.3 → 1.0.4-beta.5
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/out/cache/ast-cache.js +69 -0
- package/out/cache/ast-cache.js.map +1 -0
- package/out/cache/dependencies-cache.js +73 -0
- package/out/cache/dependencies-cache.js.map +1 -0
- package/out/cache/output-cache.js +69 -0
- package/out/cache/output-cache.js.map +1 -0
- package/out/cache/signature-cache.js +60 -0
- package/out/cache/signature-cache.js.map +1 -0
- package/out/cli/generate-cli.js +345 -0
- package/out/cli/generate-cli.js.map +1 -0
- package/out/cli/scan-cli.js +157 -0
- package/out/cli/scan-cli.js.map +1 -0
- package/out/cli/validate-cli.js +258 -0
- package/out/cli/validate-cli.js.map +1 -0
- package/out/core/async.js +38 -0
- package/out/core/async.js.map +1 -0
- package/out/core/consolidation.js +230 -0
- package/out/core/consolidation.js.map +1 -0
- package/out/core/git.js +48 -0
- package/out/core/git.js.map +1 -0
- package/out/core/language-detection.js +29 -0
- package/out/core/language-detection.js.map +1 -0
- package/out/core/scanner.js +180 -0
- package/out/core/scanner.js.map +1 -0
- package/out/core/signature-formatter.js +162 -0
- package/out/core/signature-formatter.js.map +1 -0
- package/out/core/symbol-classifier.js +96 -0
- package/out/core/symbol-classifier.js.map +1 -0
- package/out/core/symbols.js +24 -0
- package/out/core/symbols.js.map +1 -0
- package/out/drift/index.js +28 -0
- package/out/drift/index.js.map +1 -0
- package/out/extension.js +984 -0
- package/out/extension.js.map +1 -0
- package/out/generator/adr-linker.js +216 -0
- package/out/generator/adr-linker.js.map +1 -0
- package/out/generator/change-report.js +124 -0
- package/out/generator/change-report.js.map +1 -0
- package/out/generator/dependency-graph.js +98 -0
- package/out/generator/dependency-graph.js.map +1 -0
- package/out/generator/index.js +117 -0
- package/out/generator/index.js.map +1 -0
- package/out/generator/module-doc.js +438 -0
- package/out/generator/module-doc.js.map +1 -0
- package/out/generator/system-metadata.js +202 -0
- package/out/generator/system-metadata.js.map +1 -0
- package/out/index/index.js +161 -0
- package/out/index/index.js.map +1 -0
- package/out/logging/index.js +24 -0
- package/out/logging/index.js.map +1 -0
- package/out/parsers/dependencies.js +126 -0
- package/out/parsers/dependencies.js.map +1 -0
- package/out/parsers/json-yaml.js +121 -0
- package/out/parsers/json-yaml.js.map +1 -0
- package/out/parsers/python.js +160 -0
- package/out/parsers/python.js.map +1 -0
- package/out/parsers/ts-js.js +598 -0
- package/out/parsers/ts-js.js.map +1 -0
- package/out/parsers/types.js +3 -0
- package/out/parsers/types.js.map +1 -0
- package/out/ui/commands-provider.js +91 -0
- package/out/ui/commands-provider.js.map +1 -0
- package/out/ui/status-bar.js +85 -0
- package/out/ui/status-bar.js.map +1 -0
- package/out/validator/index.js +185 -0
- package/out/validator/index.js.map +1 -0
- package/out/validator/signature-matching.js +261 -0
- package/out/validator/signature-matching.js.map +1 -0
- package/out/validator/status.js +38 -0
- package/out/validator/status.js.map +1 -0
- package/package.json +9 -1
- package/.vscodeignore +0 -41
- package/MCP_SERVER_SETUP.md +0 -371
- package/assets/icon.svg +0 -27
- package/docs/LINKEDIN_ANTWORT_SEQUENZDIAGRAMME.md +0 -190
- package/docs/SEQUENZDIAGRAMM_BEWEIS.md +0 -469
- package/docs/SEQUENZDIAGRAMM_VALIDATE_FLOW.md +0 -282
- package/docs/adr/001-signatur-abweichung-fix.md +0 -54
- package/docs/adr/002-file-specific-validation-1.0.1.md +0 -45
- package/docs/adr/003-documentation-generation-bugs.md +0 -134
- package/docs/adr/004-validator-signature-matching-fix.md +0 -121
- package/docs/adr/005-validator-generic-simplification-tightening.md +0 -35
- package/docs/adr/006-parser-variable-type-extraction.md +0 -33
- package/docs/adr/007-ts-parser-load-libs-for-accurate-types.md +0 -31
- package/docs/adr/008-dependencies-cache-phase1.md +0 -133
- package/docs/adr/009-consolidation-union-logic-phase1-2.md +0 -147
- package/docs/adr/010-extension-union-integration-phase1-3-and-phase2.md +0 -179
- package/docs/adr/011-module-doc-change-tracking-phase3.md +0 -190
- package/docs/adr/012-git-deletions-change-report-phase4.md +0 -235
- package/docs/adr/013-system-functionality-fixes.md +0 -279
- package/docs/adr/014-rules-migration-und-mcp-integration.md +0 -113
- package/docs/adr/015-global-agent-package.md +0 -158
- package/docs/adr/016-produktisierung-docguard.md +0 -193
- package/docs/adr/017-signature-matching-optional-fields.md +0 -128
- package/docs/adr/018-rebranding-docguard-to-noyrax.md +0 -109
- package/docs/adr/019-system-schwachstellen-analyse-und-fixes.md +0 -204
- package/docs/adr/020-api-doc-tiefe-und-signatureformatter.md +0 -74
- package/docs/adr/021-semantic-api-docs-and-symbol-classifier.md +0 -125
- package/docs/adr/022-semantic-class-and-constants-rendering.md +0 -82
- package/docs/adr/023-adr-verknuepfung-modul-doku.md +0 -54
- package/docs/adr/024-cursor-rules-mehrdimensionaler-raum.md +0 -230
- package/docs/adr/025-mcp-tools-scan-validate-cli-bridge.md +0 -202
- package/docs/adr/026-reality-driven-development-system.md +0 -173
- package/docs/adr/027-scanner-excludes-and-union-logic-fix.md +0 -189
- package/docs/adr/028-src-coverage-union-resync.md +0 -124
- package/docs/adr/029-parser-flow-kopplung-und-sync-drift-modi.md +0 -102
- package/docs/adr/030-dependency-import-symbol-names-preservation.md +0 -123
- package/docs/adr/031-generate-cli-vollstaendige-dokumentation.md +0 -99
- package/docs/adr/032-windows-optimized-verification-scripts.md +0 -165
- package/docs/adr/036-enhanced-dependency-metadata.md +0 -190
- package/docs/adr/TEMPLATE.md +0 -76
- package/docs/index/symbols.jsonl +0 -78
- package/docs/modules/action__action.yml.md +0 -50
- package/docs/modules/documentation.config.schema.json.md +0 -37
- package/docs/modules/mcp__package.json.md +0 -130
- package/docs/modules/mcp__src__resources__docs.ts.md +0 -94
- package/docs/modules/mcp__src__server.ts.md +0 -15
- package/docs/modules/mcp__src__tools__drift.ts.md +0 -114
- package/docs/modules/mcp__src__tools__impact.ts.md +0 -130
- package/docs/modules/mcp__src__tools__scan.ts.md +0 -75
- package/docs/modules/mcp__src__tools__validate.ts.md +0 -116
- package/docs/modules/mcp__src__tools__verify-adrs.ts.md +0 -106
- package/docs/modules/mcp__tsconfig.json.md +0 -22
- package/docs/modules/package.json.md +0 -130
- package/docs/modules/packages__doc-system-agent__examples__basic-project__package.json.md +0 -43
- package/docs/modules/packages__doc-system-agent__examples__basic-project__src__calculator.ts.md +0 -81
- package/docs/modules/packages__doc-system-agent__package.json.md +0 -154
- package/docs/modules/packages__doc-system-agent__src__cli__index.ts.md +0 -8
- package/docs/modules/packages__doc-system-agent__src__cli__init.ts.md +0 -93
- package/docs/modules/packages__doc-system-agent__src__cli__update.ts.md +0 -113
- package/docs/modules/packages__doc-system-agent__src__constants.ts.md +0 -29
- package/docs/modules/packages__doc-system-agent__src__index.ts.md +0 -234
- package/docs/modules/packages__doc-system-agent__src__mcp__resources__docs.ts.md +0 -94
- package/docs/modules/packages__doc-system-agent__src__mcp__server.ts.md +0 -17
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__drift.ts.md +0 -38
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__impact.ts.md +0 -75
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__scan.ts.md +0 -23
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__validate.ts.md +0 -23
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__verify-adrs.ts.md +0 -106
- package/docs/modules/packages__doc-system-agent__src__mcp__types.ts.md +0 -355
- package/docs/modules/packages__doc-system-agent__tsconfig.json.md +0 -22
- package/docs/modules/scripts__verify-adrs.js.md +0 -97
- package/docs/modules/scripts__verify-architecture.js.md +0 -93
- package/docs/modules/scripts__verify-imports.js.md +0 -114
- package/docs/modules/src____tests____setup.ts.md +0 -8
- package/docs/modules/src____tests____signature-formatter.test.ts.md +0 -16
- package/docs/modules/src____tests____snapshot-doc-generation.test.ts.md +0 -8
- package/docs/modules/src____tests____symbol-classifier.test.ts.md +0 -16
- package/docs/modules/src__cache__ast-cache.ts.md +0 -91
- package/docs/modules/src__cache__dependencies-cache.ts.md +0 -89
- package/docs/modules/src__cache__output-cache.ts.md +0 -91
- package/docs/modules/src__cache__signature-cache.ts.md +0 -76
- package/docs/modules/src__cli__generate-cli.ts.md +0 -130
- package/docs/modules/src__cli__scan-cli.ts.md +0 -99
- package/docs/modules/src__cli__validate-cli.ts.md +0 -144
- package/docs/modules/src__core__async.ts.md +0 -18
- package/docs/modules/src__core__consolidation.ts.md +0 -157
- package/docs/modules/src__core__git.ts.md +0 -35
- package/docs/modules/src__core__language-detection.ts.md +0 -31
- package/docs/modules/src__core__scanner.ts.md +0 -100
- package/docs/modules/src__core__signature-formatter.ts.md +0 -232
- package/docs/modules/src__core__symbol-classifier.ts.md +0 -178
- package/docs/modules/src__core__symbols.ts.md +0 -31
- package/docs/modules/src__drift__index.ts.md +0 -53
- package/docs/modules/src__extension.ts.md +0 -418
- package/docs/modules/src__generator__adr-linker.ts.md +0 -154
- package/docs/modules/src__generator__change-report.ts.md +0 -85
- package/docs/modules/src__generator__dependency-graph.ts.md +0 -63
- package/docs/modules/src__generator__index.ts.md +0 -40
- package/docs/modules/src__generator__module-doc.ts.md +0 -242
- package/docs/modules/src__index__index.ts.md +0 -159
- package/docs/modules/src__logging__index.ts.md +0 -87
- package/docs/modules/src__parsers__dependencies.ts.md +0 -69
- package/docs/modules/src__parsers__json-yaml.ts.md +0 -96
- package/docs/modules/src__parsers__python.ts.md +0 -73
- package/docs/modules/src__parsers__ts-js.ts.md +0 -48
- package/docs/modules/src__parsers__types.ts.md +0 -117
- package/docs/modules/src__ui__commands-provider.ts.md +0 -70
- package/docs/modules/src__ui__status-bar.ts.md +0 -79
- package/docs/modules/src__validator__index.ts.md +0 -211
- package/docs/modules/src__validator__signature-matching.ts.md +0 -209
- package/docs/modules/src__validator__status.ts.md +0 -72
- package/docs/modules/test-mcp-resources.js.md +0 -27
- package/docs/modules/tsconfig.json.md +0 -22
- package/docs/system/CHANGE_REPORT.md +0 -26
- package/docs/system/DEPENDENCIES.md +0 -403
- package/docs/system/DEPENDENCY_GRAPH.md +0 -336
- package/docs/system/NAVIGATION_SPACE_ANALYSIS.md +0 -244
- package/docs/system/NPX_CACHE_FIX.md +0 -85
- package/docs/system/NPX_LOCAL_USAGE.md +0 -66
- package/docs/system/PLUGIN_ECOSYSTEM_STATUS.md +0 -465
- package/docs/system/PLUGIN_UPDATE_GUIDE.md +0 -212
- package/docs/system/RULES_UPDATE_GUIDE.md +0 -182
- package/docs/system/SYSTEM_ANALYSIS.md +0 -947
- package/docs/system/SYSTEM_METADATA.json +0 -37
- package/documentation.config.schema.json +0 -77
- package/publish.ps1 +0 -21
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.saveAstHashCache = exports.loadAstHashCache = exports.computeFileHash = void 0;
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const crypto_1 = require("crypto");
|
|
30
|
+
/**
|
|
31
|
+
* @public
|
|
32
|
+
* Compute hash for file content
|
|
33
|
+
*/
|
|
34
|
+
function computeFileHash(content) {
|
|
35
|
+
return (0, crypto_1.createHash)('sha256').update(content).digest('hex').slice(0, 16);
|
|
36
|
+
}
|
|
37
|
+
exports.computeFileHash = computeFileHash;
|
|
38
|
+
/**
|
|
39
|
+
* @public
|
|
40
|
+
* Load AST hash cache from file
|
|
41
|
+
*/
|
|
42
|
+
function loadAstHashCache(cacheFile) {
|
|
43
|
+
try {
|
|
44
|
+
if (!fs.existsSync(cacheFile))
|
|
45
|
+
return null;
|
|
46
|
+
const raw = fs.readFileSync(cacheFile, 'utf8');
|
|
47
|
+
const data = JSON.parse(raw);
|
|
48
|
+
if (!data || !Array.isArray(data.entries))
|
|
49
|
+
return null;
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.loadAstHashCache = loadAstHashCache;
|
|
57
|
+
/**
|
|
58
|
+
* @public
|
|
59
|
+
* Save AST hash cache to file
|
|
60
|
+
*/
|
|
61
|
+
function saveAstHashCache(cacheDir, data) {
|
|
62
|
+
if (!fs.existsSync(cacheDir))
|
|
63
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
64
|
+
const file = path.join(cacheDir, 'ast-hashes.json');
|
|
65
|
+
const sorted = { ...data, entries: [...data.entries].sort((a, b) => a.path.localeCompare(b.path)) };
|
|
66
|
+
fs.writeFileSync(file, JSON.stringify(sorted, null, 2) + '\n', 'utf8');
|
|
67
|
+
}
|
|
68
|
+
exports.saveAstHashCache = saveAstHashCache;
|
|
69
|
+
//# sourceMappingURL=ast-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast-cache.js","sourceRoot":"","sources":["../../src/cache/ast-cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,mCAAoC;AAYpC;;;GAGG;AACH,SAAgB,eAAe,CAAC,OAAe;IAC3C,OAAO,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3E,CAAC;AAFD,0CAEC;AAED;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,SAAiB;IAC9C,IAAI;QACA,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC;QAC3C,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QACjD,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,OAAO,IAAI,CAAC;QACvD,OAAO,IAAI,CAAC;KACf;IAAC,MAAM;QACJ,OAAO,IAAI,CAAC;KACf;AACL,CAAC;AAVD,4CAUC;AAED;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,QAAgB,EAAE,IAAsB;IACrE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;IACpG,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3E,CAAC;AALD,4CAKC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.saveDependenciesCache = exports.loadDependenciesCache = void 0;
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
/**
|
|
30
|
+
* @public
|
|
31
|
+
* Load dependencies cache from file
|
|
32
|
+
*/
|
|
33
|
+
function loadDependenciesCache(cacheFile) {
|
|
34
|
+
try {
|
|
35
|
+
if (!fs.existsSync(cacheFile))
|
|
36
|
+
return null;
|
|
37
|
+
const raw = fs.readFileSync(cacheFile, 'utf8');
|
|
38
|
+
const data = JSON.parse(raw);
|
|
39
|
+
if (!data || data.version !== 1 || !Array.isArray(data.entries))
|
|
40
|
+
return null;
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.loadDependenciesCache = loadDependenciesCache;
|
|
48
|
+
/**
|
|
49
|
+
* @public
|
|
50
|
+
* Save dependencies cache to file
|
|
51
|
+
*/
|
|
52
|
+
function saveDependenciesCache(cacheDir, data) {
|
|
53
|
+
if (!fs.existsSync(cacheDir))
|
|
54
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
55
|
+
const file = path.join(cacheDir, 'dependencies.json');
|
|
56
|
+
const sorted = {
|
|
57
|
+
...data,
|
|
58
|
+
entries: [...data.entries].sort((a, b) => {
|
|
59
|
+
if (a.from !== b.from)
|
|
60
|
+
return a.from.localeCompare(b.from);
|
|
61
|
+
if (a.to !== b.to)
|
|
62
|
+
return a.to.localeCompare(b.to);
|
|
63
|
+
if (a.type !== b.type)
|
|
64
|
+
return a.type.localeCompare(b.type);
|
|
65
|
+
const aSymbols = (a.symbols || []).join(',');
|
|
66
|
+
const bSymbols = (b.symbols || []).join(',');
|
|
67
|
+
return aSymbols.localeCompare(bSymbols);
|
|
68
|
+
})
|
|
69
|
+
};
|
|
70
|
+
fs.writeFileSync(file, JSON.stringify(sorted, null, 2) + '\n', 'utf8');
|
|
71
|
+
}
|
|
72
|
+
exports.saveDependenciesCache = saveDependenciesCache;
|
|
73
|
+
//# sourceMappingURL=dependencies-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencies-cache.js","sourceRoot":"","sources":["../../src/cache/dependencies-cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAwB7B;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,SAAiB;IACnD,IAAI;QACA,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC;QAC3C,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA0B,CAAC;QACtD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,OAAO,IAAI,CAAC;QAC7E,OAAO,IAAI,CAAC;KACf;IAAC,MAAM;QACJ,OAAO,IAAI,CAAC;KACf;AACL,CAAC;AAVD,sDAUC;AAED;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,QAAgB,EAAE,IAA2B;IAC/E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG;QACX,GAAG,IAAI;QACP,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACrC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;gBAAE,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC3D,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE;gBAAE,OAAO,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACnD,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;gBAAE,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC3D,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC7C,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC7C,OAAO,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC5C,CAAC,CAAC;KACL,CAAC;IACF,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3E,CAAC;AAfD,sDAeC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.saveOutputHashCache = exports.loadOutputHashCache = exports.computeContentHash = void 0;
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const crypto_1 = require("crypto");
|
|
30
|
+
/**
|
|
31
|
+
* @public
|
|
32
|
+
* Compute content hash for caching
|
|
33
|
+
*/
|
|
34
|
+
function computeContentHash(content) {
|
|
35
|
+
return (0, crypto_1.createHash)('sha256').update(content).digest('hex').slice(0, 16);
|
|
36
|
+
}
|
|
37
|
+
exports.computeContentHash = computeContentHash;
|
|
38
|
+
/**
|
|
39
|
+
* @public
|
|
40
|
+
* Load output hash cache from file
|
|
41
|
+
*/
|
|
42
|
+
function loadOutputHashCache(cacheFile) {
|
|
43
|
+
try {
|
|
44
|
+
if (!fs.existsSync(cacheFile))
|
|
45
|
+
return null;
|
|
46
|
+
const raw = fs.readFileSync(cacheFile, 'utf8');
|
|
47
|
+
const data = JSON.parse(raw);
|
|
48
|
+
if (!data || !Array.isArray(data.entries))
|
|
49
|
+
return null;
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.loadOutputHashCache = loadOutputHashCache;
|
|
57
|
+
/**
|
|
58
|
+
* @public
|
|
59
|
+
* Save output hash cache to file
|
|
60
|
+
*/
|
|
61
|
+
function saveOutputHashCache(cacheDir, data) {
|
|
62
|
+
if (!fs.existsSync(cacheDir))
|
|
63
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
64
|
+
const file = path.join(cacheDir, 'output-hashes.json');
|
|
65
|
+
const sorted = { ...data, entries: [...data.entries].sort((a, b) => a.path.localeCompare(b.path)) };
|
|
66
|
+
fs.writeFileSync(file, JSON.stringify(sorted, null, 2) + '\n', 'utf8');
|
|
67
|
+
}
|
|
68
|
+
exports.saveOutputHashCache = saveOutputHashCache;
|
|
69
|
+
//# sourceMappingURL=output-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-cache.js","sourceRoot":"","sources":["../../src/cache/output-cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,mCAAoC;AAYpC;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,OAAe;IAC9C,OAAO,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3E,CAAC;AAFD,gDAEC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,SAAiB;IACjD,IAAI;QACA,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC;QAC3C,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAwB,CAAC;QACpD,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,OAAO,IAAI,CAAC;QACvD,OAAO,IAAI,CAAC;KACf;IAAC,MAAM;QACJ,OAAO,IAAI,CAAC;KACf;AACL,CAAC;AAVD,kDAUC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,QAAgB,EAAE,IAAyB;IAC3E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;IACvD,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;IACpG,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3E,CAAC;AALD,kDAKC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.saveSignatureCache = exports.loadSignatureCache = void 0;
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
/**
|
|
30
|
+
* @public
|
|
31
|
+
* Load signature cache from file
|
|
32
|
+
*/
|
|
33
|
+
function loadSignatureCache(cacheFile) {
|
|
34
|
+
try {
|
|
35
|
+
if (!fs.existsSync(cacheFile))
|
|
36
|
+
return null;
|
|
37
|
+
const raw = fs.readFileSync(cacheFile, 'utf8');
|
|
38
|
+
const data = JSON.parse(raw);
|
|
39
|
+
if (!data || !Array.isArray(data.entries))
|
|
40
|
+
return null;
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.loadSignatureCache = loadSignatureCache;
|
|
48
|
+
/**
|
|
49
|
+
* @public
|
|
50
|
+
* Save signature cache to file
|
|
51
|
+
*/
|
|
52
|
+
function saveSignatureCache(cacheDir, data) {
|
|
53
|
+
if (!fs.existsSync(cacheDir))
|
|
54
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
55
|
+
const file = path.join(cacheDir, 'signatures.json');
|
|
56
|
+
const sorted = { ...data, entries: [...data.entries].sort((a, b) => a.baseId.localeCompare(b.baseId)) };
|
|
57
|
+
fs.writeFileSync(file, JSON.stringify(sorted, null, 2) + '\n', 'utf8');
|
|
58
|
+
}
|
|
59
|
+
exports.saveSignatureCache = saveSignatureCache;
|
|
60
|
+
//# sourceMappingURL=signature-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-cache.js","sourceRoot":"","sources":["../../src/cache/signature-cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAY7B;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,SAAiB;IAChD,IAAI;QACA,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC;QAC3C,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAuB,CAAC;QACnD,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,OAAO,IAAI,CAAC;QACvD,OAAO,IAAI,CAAC;KACf;IAAC,MAAM;QACJ,OAAO,IAAI,CAAC;KACf;AACL,CAAC;AAVD,gDAUC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,QAAgB,EAAE,IAAwB;IACzE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IACxG,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3E,CAAC;AALD,gDAKC"}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* CLI-Tool für vollständige Dokumentationsgenerierung
|
|
5
|
+
*
|
|
6
|
+
* Generiert alle Dokumentations-Artefakte ohne VS Code APIs:
|
|
7
|
+
* - docs/modules/*.md (Modul-Dokumentation)
|
|
8
|
+
* - docs/index/symbols.jsonl (Symbol-Index mit DependencyEntry[])
|
|
9
|
+
* - docs/system/DEPENDENCIES.md (Import-Übersicht)
|
|
10
|
+
* - docs/system/DEPENDENCY_GRAPH.md (Mermaid-Graph)
|
|
11
|
+
* - docs/system/CHANGE_REPORT.md (Änderungsprotokoll)
|
|
12
|
+
*
|
|
13
|
+
* Wird von postcompile Hook in anderen Plugins aufgerufen.
|
|
14
|
+
*/
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
+
}) : function(o, v) {
|
|
29
|
+
o["default"] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.runGenerateCli = void 0;
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const scanner_1 = require("../core/scanner");
|
|
43
|
+
const ts_js_1 = require("../parsers/ts-js");
|
|
44
|
+
const json_yaml_1 = require("../parsers/json-yaml");
|
|
45
|
+
const python_1 = require("../parsers/python");
|
|
46
|
+
const dependencies_1 = require("../parsers/dependencies");
|
|
47
|
+
const consolidation_1 = require("../core/consolidation");
|
|
48
|
+
const index_1 = require("../generator/index");
|
|
49
|
+
const index_2 = require("../index/index");
|
|
50
|
+
const dependency_graph_1 = require("../generator/dependency-graph");
|
|
51
|
+
const change_report_1 = require("../generator/change-report");
|
|
52
|
+
const system_metadata_1 = require("../generator/system-metadata");
|
|
53
|
+
const ast_cache_1 = require("../cache/ast-cache");
|
|
54
|
+
const dependencies_cache_1 = require("../cache/dependencies-cache");
|
|
55
|
+
const output_cache_1 = require("../cache/output-cache");
|
|
56
|
+
const signature_cache_1 = require("../cache/signature-cache");
|
|
57
|
+
const index_3 = require("../drift/index");
|
|
58
|
+
const git_1 = require("../core/git");
|
|
59
|
+
function log(logs, message, verbose) {
|
|
60
|
+
logs.push(message);
|
|
61
|
+
if (verbose) {
|
|
62
|
+
console.log(message);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async function runGenerateCli(options = {}) {
|
|
66
|
+
const startTime = Date.now();
|
|
67
|
+
const logs = [];
|
|
68
|
+
const errors = [];
|
|
69
|
+
const verbose = options.verbose ?? false;
|
|
70
|
+
try {
|
|
71
|
+
const workspaceRoot = options.workspaceRoot || process.cwd();
|
|
72
|
+
const outputPath = options.outputPath || 'docs';
|
|
73
|
+
const incremental = options.incremental ?? true;
|
|
74
|
+
log(logs, `[generate] Workspace: ${workspaceRoot}`, verbose);
|
|
75
|
+
log(logs, `[generate] Output: ${outputPath}`, verbose);
|
|
76
|
+
log(logs, `[generate] Mode: ${incremental ? 'incremental' : 'full'}`, verbose);
|
|
77
|
+
// Verzeichnisse erstellen
|
|
78
|
+
const docsDir = path.join(workspaceRoot, outputPath);
|
|
79
|
+
const modulesDir = path.join(docsDir, 'modules');
|
|
80
|
+
const indexDir = path.join(docsDir, 'index');
|
|
81
|
+
const systemDir = path.join(docsDir, 'system');
|
|
82
|
+
const cacheDir = path.join(docsDir, '.cache');
|
|
83
|
+
for (const dir of [docsDir, modulesDir, indexDir, systemDir, cacheDir]) {
|
|
84
|
+
if (!fs.existsSync(dir)) {
|
|
85
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Workspace scannen
|
|
89
|
+
const scannedAll = (0, scanner_1.scanWorkspace)({ workspaceRoot }, false);
|
|
90
|
+
log(logs, `[scan] ${scannedAll.length} Dateien gefunden`, verbose);
|
|
91
|
+
// Git-basierte Filterung für inkrementelle Läufe
|
|
92
|
+
let scanned = scannedAll;
|
|
93
|
+
let isFirstRun = false;
|
|
94
|
+
const astCacheFile = path.join(cacheDir, 'ast-hashes.json');
|
|
95
|
+
const prevAst = (0, ast_cache_1.loadAstHashCache)(astCacheFile);
|
|
96
|
+
if (!prevAst || (prevAst.entries ?? []).length === 0) {
|
|
97
|
+
isFirstRun = true;
|
|
98
|
+
log(logs, `[cache] Erster Lauf - kein AST-Cache vorhanden`, verbose);
|
|
99
|
+
}
|
|
100
|
+
if (incremental && !isFirstRun) {
|
|
101
|
+
const changed = (0, git_1.getChangedFiles)(workspaceRoot);
|
|
102
|
+
if (changed && changed.size > 0) {
|
|
103
|
+
const changedSet = new Set(changed);
|
|
104
|
+
scanned = scannedAll.filter(f => changedSet.has(f.repositoryRelativePath));
|
|
105
|
+
log(logs, `[git] ${scanned.length} geänderte Dateien (von ${scannedAll.length})`, verbose);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// Parser initialisieren
|
|
109
|
+
const parsers = [
|
|
110
|
+
new ts_js_1.TsJsParser(),
|
|
111
|
+
new json_yaml_1.JsonYamlParser(),
|
|
112
|
+
new python_1.PythonParser()
|
|
113
|
+
];
|
|
114
|
+
const allSymbols = [];
|
|
115
|
+
const allDependencies = [];
|
|
116
|
+
const astMap = new Map((prevAst?.entries ?? []).map(e => [e.path, e.hash]));
|
|
117
|
+
const nextAstEntries = [];
|
|
118
|
+
const actuallyParsedFiles = new Set();
|
|
119
|
+
// Dateien parsen
|
|
120
|
+
for (const f of scanned) {
|
|
121
|
+
try {
|
|
122
|
+
const content = fs.readFileSync(f.absolutePath, 'utf8');
|
|
123
|
+
const fileHash = (0, ast_cache_1.computeFileHash)(content);
|
|
124
|
+
nextAstEntries.push({ path: f.repositoryRelativePath, hash: fileHash });
|
|
125
|
+
// Cache-Check (außer beim ersten Lauf oder im Full-Modus)
|
|
126
|
+
if (!isFirstRun && incremental) {
|
|
127
|
+
const unchanged = astMap.get(f.repositoryRelativePath) === fileHash;
|
|
128
|
+
if (unchanged) {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
actuallyParsedFiles.add(f.repositoryRelativePath);
|
|
133
|
+
let symbols = [];
|
|
134
|
+
let dependencies = [];
|
|
135
|
+
if (f.language === 'ts' || f.language === 'js') {
|
|
136
|
+
const tsParser = parsers[0];
|
|
137
|
+
symbols = tsParser.parse(f.absolutePath, content)
|
|
138
|
+
.map(s => ({ ...s, filePath: f.repositoryRelativePath }));
|
|
139
|
+
// SourceFile für Dependency-Extraktion
|
|
140
|
+
const sourceFile = tsParser.project.getSourceFile(f.absolutePath);
|
|
141
|
+
if (sourceFile) {
|
|
142
|
+
dependencies = (0, dependencies_1.extractTsJsDependencies)(sourceFile, f.repositoryRelativePath);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else if (f.language === 'json' || f.language === 'yaml' || f.language === 'markdown') {
|
|
146
|
+
symbols = parsers[1].parse(f.absolutePath, content)
|
|
147
|
+
.map(s => ({ ...s, filePath: f.repositoryRelativePath }));
|
|
148
|
+
}
|
|
149
|
+
else if (f.language === 'python') {
|
|
150
|
+
symbols = parsers[2].parse(f.absolutePath, content)
|
|
151
|
+
.map(s => ({ ...s, filePath: f.repositoryRelativePath }));
|
|
152
|
+
dependencies = (0, dependencies_1.extractPythonDependencies)(content, f.repositoryRelativePath);
|
|
153
|
+
}
|
|
154
|
+
allSymbols.push(...symbols);
|
|
155
|
+
allDependencies.push(...dependencies);
|
|
156
|
+
// Log file with symbol count for debugging (only if verbose or no symbols found)
|
|
157
|
+
if (verbose || (symbols.length === 0 && f.language !== 'json' && f.language !== 'yaml')) {
|
|
158
|
+
log(logs, `[parse] ${f.repositoryRelativePath} (${f.language || 'unknown'}): ${symbols.length} symbols, ${dependencies.length} dependencies`, verbose);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
163
|
+
errors.push(`Error parsing ${f.repositoryRelativePath}: ${message}`);
|
|
164
|
+
log(logs, `[warn] Fehler beim Parsen von ${f.repositoryRelativePath}: ${message}`, verbose);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
log(logs, `[parse] ${allSymbols.length} Symbole, ${allDependencies.length} Dependencies (${actuallyParsedFiles.size} Dateien geparst)`, verbose);
|
|
168
|
+
// Union-Bildung
|
|
169
|
+
const depCacheFile = path.join(cacheDir, 'dependencies.json');
|
|
170
|
+
const depCachePrev = (0, dependencies_cache_1.loadDependenciesCache)(depCacheFile);
|
|
171
|
+
const deletedFilesFromGit = (0, git_1.getDeletedFiles)(workspaceRoot) ?? new Set();
|
|
172
|
+
const dependenciesUnion = (0, consolidation_1.buildDependenciesUnion)(allDependencies, depCachePrev?.entries ?? [], actuallyParsedFiles, deletedFilesFromGit);
|
|
173
|
+
// Symbol-Union aus Index laden
|
|
174
|
+
const indexFile = path.join(indexDir, 'symbols.jsonl');
|
|
175
|
+
let symbolsPrev = [];
|
|
176
|
+
if (fs.existsSync(indexFile)) {
|
|
177
|
+
try {
|
|
178
|
+
symbolsPrev = (0, index_2.readSymbolsFromIndex)(indexFile);
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
symbolsPrev = [];
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
const scannedFilesSet = new Set(scannedAll.map(f => f.repositoryRelativePath));
|
|
185
|
+
const symbolsUnion = (0, consolidation_1.buildSymbolsUnion)(allSymbols, symbolsPrev, actuallyParsedFiles, deletedFilesFromGit, scannedFilesSet);
|
|
186
|
+
log(logs, `[union] Symbole: ${allSymbols.length} neu + ${symbolsPrev.length} gecacht → ${symbolsUnion.length} Union`, verbose);
|
|
187
|
+
log(logs, `[union] Dependencies: ${allDependencies.length} neu → ${dependenciesUnion.length} Union`, verbose);
|
|
188
|
+
// AST-Cache speichern
|
|
189
|
+
if (nextAstEntries.length > 0) {
|
|
190
|
+
(0, ast_cache_1.saveAstHashCache)(cacheDir, { version: 1, entries: nextAstEntries });
|
|
191
|
+
}
|
|
192
|
+
// Modul-Dokumentation generieren
|
|
193
|
+
const existingDocs = new Map();
|
|
194
|
+
if (fs.existsSync(modulesDir)) {
|
|
195
|
+
const existingFiles = fs.readdirSync(modulesDir).filter(f => f.endsWith('.md'));
|
|
196
|
+
for (const file of existingFiles) {
|
|
197
|
+
const filePath = path.join(modulesDir, file);
|
|
198
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
199
|
+
const originalPath = file.replace(/__/g, '/').replace(/\.md$/, '');
|
|
200
|
+
existingDocs.set(originalPath, content);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
const files = (0, index_1.generatePerFileDocs)(symbolsUnion, modulesDir, existingDocs);
|
|
204
|
+
// Output-Hash-Cache für inkrementelles Schreiben
|
|
205
|
+
const outHashFile = path.join(cacheDir, 'output-hashes.json');
|
|
206
|
+
const prevOut = (0, output_cache_1.loadOutputHashCache)(outHashFile);
|
|
207
|
+
const prevMap = new Map((prevOut?.entries ?? []).map(e => [e.path, e.hash]));
|
|
208
|
+
const newEntries = [];
|
|
209
|
+
for (const [repoRel, content] of files.entries()) {
|
|
210
|
+
const safe = repoRel.replace(/[^a-zA-Z0-9_\-./]/g, '_').replace(/\//g, '__');
|
|
211
|
+
const target = path.join(modulesDir, `${safe}.md`);
|
|
212
|
+
const hash = (0, output_cache_1.computeContentHash)(content);
|
|
213
|
+
newEntries.push({ path: safe + '.md', hash });
|
|
214
|
+
const before = prevMap.get(safe + '.md');
|
|
215
|
+
if (before !== hash || !fs.existsSync(target)) {
|
|
216
|
+
fs.writeFileSync(target, content, 'utf8');
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (newEntries.length > 0) {
|
|
220
|
+
(0, output_cache_1.saveOutputHashCache)(cacheDir, { version: 1, entries: newEntries });
|
|
221
|
+
}
|
|
222
|
+
// Symbol-Index generieren (mit DependencyEntry[] Format!)
|
|
223
|
+
const indexRows = (0, index_2.buildIndexFromSymbols)(symbolsUnion, dependenciesUnion);
|
|
224
|
+
if (symbolsUnion.length > 0) {
|
|
225
|
+
(0, index_2.writeJsonlIndex)(indexRows, indexFile);
|
|
226
|
+
}
|
|
227
|
+
log(logs, `[index] ${indexRows.length} Einträge in symbols.jsonl geschrieben`, verbose);
|
|
228
|
+
// Dependency-Graph generieren
|
|
229
|
+
const mermaidGraph = (0, dependency_graph_1.generateMermaidGraph)(dependenciesUnion);
|
|
230
|
+
const depOverview = (0, dependency_graph_1.generateDependencyOverview)(dependenciesUnion);
|
|
231
|
+
fs.writeFileSync(path.join(systemDir, 'DEPENDENCY_GRAPH.md'), mermaidGraph, 'utf8');
|
|
232
|
+
fs.writeFileSync(path.join(systemDir, 'DEPENDENCIES.md'), depOverview, 'utf8');
|
|
233
|
+
// Dependencies-Cache speichern
|
|
234
|
+
if (dependenciesUnion.length > 0) {
|
|
235
|
+
(0, dependencies_cache_1.saveDependenciesCache)(cacheDir, { version: 1, entries: dependenciesUnion });
|
|
236
|
+
}
|
|
237
|
+
// Signatur-Cache und Drift-Detection
|
|
238
|
+
const prev = (0, signature_cache_1.loadSignatureCache)(path.join(cacheDir, 'signatures.json'));
|
|
239
|
+
const entries = (0, index_3.computeCacheEntries)(symbolsUnion);
|
|
240
|
+
if (entries.length > 0) {
|
|
241
|
+
(0, signature_cache_1.saveSignatureCache)(cacheDir, { version: 1, entries });
|
|
242
|
+
}
|
|
243
|
+
const drift = (0, index_3.detectDrift)(prev, entries);
|
|
244
|
+
// Change-Report generieren
|
|
245
|
+
const changes = (0, change_report_1.extractChangesFromModuleDocs)(files);
|
|
246
|
+
const prevDepCount = (depCachePrev?.entries ?? []).length;
|
|
247
|
+
const depAdded = dependenciesUnion.length > prevDepCount ? dependenciesUnion.length - prevDepCount : 0;
|
|
248
|
+
const depRemoved = prevDepCount > dependenciesUnion.length ? prevDepCount - dependenciesUnion.length : 0;
|
|
249
|
+
const changeReport = (0, change_report_1.generateChangeReport)({
|
|
250
|
+
runType: incremental ? 'incremental' : 'full',
|
|
251
|
+
parsedFiles: scanned.length,
|
|
252
|
+
skippedFiles: scanned.length - actuallyParsedFiles.size,
|
|
253
|
+
symbolsAdded: changes.symbolsAdded,
|
|
254
|
+
symbolsRemoved: changes.symbolsRemoved,
|
|
255
|
+
symbolsChanged: changes.symbolsChanged,
|
|
256
|
+
dependenciesAdded: depAdded,
|
|
257
|
+
dependenciesRemoved: depRemoved,
|
|
258
|
+
totalDependencies: dependenciesUnion.length,
|
|
259
|
+
validationErrors: 0,
|
|
260
|
+
validationWarnings: drift.staleSymbols.length,
|
|
261
|
+
validationDetails: drift.staleSymbols.length > 0
|
|
262
|
+
? drift.staleSymbols.slice(0, 5).map(id => `Signatur-Abweichung: ${id}`)
|
|
263
|
+
: []
|
|
264
|
+
});
|
|
265
|
+
fs.writeFileSync(path.join(systemDir, 'CHANGE_REPORT.md'), changeReport, 'utf8');
|
|
266
|
+
// Generate system metadata
|
|
267
|
+
try {
|
|
268
|
+
(0, system_metadata_1.writeSystemMetadata)(workspaceRoot, systemDir);
|
|
269
|
+
log(logs, `[metadata] SYSTEM_METADATA.json generiert`, verbose);
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
273
|
+
errors.push(`Error generating system metadata: ${message}`);
|
|
274
|
+
log(logs, `[warn] Fehler beim Generieren von SYSTEM_METADATA.json: ${message}`, verbose);
|
|
275
|
+
}
|
|
276
|
+
const duration = Date.now() - startTime;
|
|
277
|
+
log(logs, `[generate] Fertig: ${symbolsUnion.length} Symbole, ${dependenciesUnion.length} Dependencies, ${files.size} Docs (${duration}ms)`, verbose);
|
|
278
|
+
return {
|
|
279
|
+
status: errors.length > 0 ? 'partial' : 'success',
|
|
280
|
+
filesProcessed: scanned.length,
|
|
281
|
+
symbolsExtracted: symbolsUnion.length,
|
|
282
|
+
dependenciesExtracted: dependenciesUnion.length,
|
|
283
|
+
docsGenerated: files.size,
|
|
284
|
+
duration,
|
|
285
|
+
logs,
|
|
286
|
+
errors: errors.length > 0 ? errors : undefined,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
catch (error) {
|
|
290
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
291
|
+
errors.push(message);
|
|
292
|
+
return {
|
|
293
|
+
status: 'error',
|
|
294
|
+
filesProcessed: 0,
|
|
295
|
+
symbolsExtracted: 0,
|
|
296
|
+
dependenciesExtracted: 0,
|
|
297
|
+
docsGenerated: 0,
|
|
298
|
+
duration: Date.now() - startTime,
|
|
299
|
+
logs,
|
|
300
|
+
errors,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
exports.runGenerateCli = runGenerateCli;
|
|
305
|
+
// CLI-Entry-Point
|
|
306
|
+
if (require.main === module) {
|
|
307
|
+
const args = process.argv.slice(2);
|
|
308
|
+
const options = {};
|
|
309
|
+
// Argument-Parsing
|
|
310
|
+
for (let i = 0; i < args.length; i++) {
|
|
311
|
+
if (args[i] === '--workspace-root' && args[i + 1]) {
|
|
312
|
+
options.workspaceRoot = args[i + 1];
|
|
313
|
+
i++;
|
|
314
|
+
}
|
|
315
|
+
else if (args[i] === '--output-path' && args[i + 1]) {
|
|
316
|
+
options.outputPath = args[i + 1];
|
|
317
|
+
i++;
|
|
318
|
+
}
|
|
319
|
+
else if (args[i] === '--full') {
|
|
320
|
+
options.incremental = false;
|
|
321
|
+
}
|
|
322
|
+
else if (args[i] === '--verbose' || args[i] === '-v') {
|
|
323
|
+
options.verbose = true;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
runGenerateCli(options)
|
|
327
|
+
.then(result => {
|
|
328
|
+
console.log(JSON.stringify(result, null, 2));
|
|
329
|
+
process.exit(result.status === 'error' ? 1 : 0);
|
|
330
|
+
})
|
|
331
|
+
.catch(error => {
|
|
332
|
+
console.error(JSON.stringify({
|
|
333
|
+
status: 'error',
|
|
334
|
+
filesProcessed: 0,
|
|
335
|
+
symbolsExtracted: 0,
|
|
336
|
+
dependenciesExtracted: 0,
|
|
337
|
+
docsGenerated: 0,
|
|
338
|
+
duration: 0,
|
|
339
|
+
logs: [],
|
|
340
|
+
errors: [error instanceof Error ? error.message : String(error)],
|
|
341
|
+
}, null, 2));
|
|
342
|
+
process.exit(1);
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
//# sourceMappingURL=generate-cli.js.map
|