@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,202 @@
|
|
|
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.writeSystemMetadata = exports.generateSystemMetadata = void 0;
|
|
27
|
+
const path = __importStar(require("path"));
|
|
28
|
+
const fs = __importStar(require("fs"));
|
|
29
|
+
const crypto = __importStar(require("crypto"));
|
|
30
|
+
/**
|
|
31
|
+
* Generates system metadata JSON.
|
|
32
|
+
*
|
|
33
|
+
* @param workspaceRoot Workspace root directory
|
|
34
|
+
* @returns System metadata object
|
|
35
|
+
*/
|
|
36
|
+
function generateSystemMetadata(workspaceRoot) {
|
|
37
|
+
// Compute system_id (workspace hash)
|
|
38
|
+
const normalizedPath = path.resolve(workspaceRoot).replace(/\\/g, '/').toLowerCase();
|
|
39
|
+
const hash = crypto.createHash('sha256').update(normalizedPath).digest('hex');
|
|
40
|
+
const systemId = hash.substring(0, 16);
|
|
41
|
+
// Read root package.json for version
|
|
42
|
+
const rootPackageJsonPath = path.join(workspaceRoot, 'package.json');
|
|
43
|
+
let version = '0.0.0';
|
|
44
|
+
if (fs.existsSync(rootPackageJsonPath)) {
|
|
45
|
+
try {
|
|
46
|
+
const rootPackageJson = JSON.parse(fs.readFileSync(rootPackageJsonPath, 'utf8'));
|
|
47
|
+
version = rootPackageJson.version || '0.0.0';
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// Use default version
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// Find plugins
|
|
54
|
+
const plugins = [];
|
|
55
|
+
// 5d-database-plugin
|
|
56
|
+
const dbPluginPath = path.join(workspaceRoot, '5d-database-plugin');
|
|
57
|
+
if (fs.existsSync(path.join(dbPluginPath, 'package.json'))) {
|
|
58
|
+
try {
|
|
59
|
+
const dbPackageJson = JSON.parse(fs.readFileSync(path.join(dbPluginPath, 'package.json'), 'utf8'));
|
|
60
|
+
plugins.push({
|
|
61
|
+
name: dbPackageJson.name || '@noyrax/5d-database-plugin',
|
|
62
|
+
version: dbPackageJson.version || '0.0.0',
|
|
63
|
+
path: path.relative(workspaceRoot, dbPluginPath)
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
// Skip if can't read
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// documentation-system-plugin
|
|
71
|
+
const docPluginPath = path.join(workspaceRoot, 'documentation-system-plugin');
|
|
72
|
+
if (fs.existsSync(path.join(docPluginPath, 'package.json'))) {
|
|
73
|
+
try {
|
|
74
|
+
const docPackageJson = JSON.parse(fs.readFileSync(path.join(docPluginPath, 'package.json'), 'utf8'));
|
|
75
|
+
plugins.push({
|
|
76
|
+
name: docPackageJson.name || '@noyrax/documentation-system-plugin',
|
|
77
|
+
version: docPackageJson.version || '0.0.0',
|
|
78
|
+
path: path.relative(workspaceRoot, docPluginPath)
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// Skip if can't read
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// mcp-server
|
|
86
|
+
const mcpServerPath = path.join(workspaceRoot, 'mcp-server');
|
|
87
|
+
if (fs.existsSync(path.join(mcpServerPath, 'package.json'))) {
|
|
88
|
+
try {
|
|
89
|
+
const mcpPackageJson = JSON.parse(fs.readFileSync(path.join(mcpServerPath, 'package.json'), 'utf8'));
|
|
90
|
+
plugins.push({
|
|
91
|
+
name: mcpPackageJson.name || '@noyrax/mcp-server',
|
|
92
|
+
version: mcpPackageJson.version || '0.0.0',
|
|
93
|
+
path: path.relative(workspaceRoot, mcpServerPath)
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// Skip if can't read
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// Dimensions descriptions
|
|
101
|
+
const dimensions = {
|
|
102
|
+
X: {
|
|
103
|
+
name: 'Modules',
|
|
104
|
+
description: 'Module documentation (X-Dimension): API documentation per file'
|
|
105
|
+
},
|
|
106
|
+
Y: {
|
|
107
|
+
name: 'Symbols',
|
|
108
|
+
description: 'Symbol index (Y-Dimension): Symbols with dependencies'
|
|
109
|
+
},
|
|
110
|
+
Z: {
|
|
111
|
+
name: 'Dependencies',
|
|
112
|
+
description: 'Dependency graph (Z-Dimension): Module dependencies'
|
|
113
|
+
},
|
|
114
|
+
W: {
|
|
115
|
+
name: 'ADRs',
|
|
116
|
+
description: 'Architecture Decision Records (W-Dimension): Architecture decisions (map)'
|
|
117
|
+
},
|
|
118
|
+
T: {
|
|
119
|
+
name: 'Changes',
|
|
120
|
+
description: 'Change reports (T-Dimension): Changes over time'
|
|
121
|
+
},
|
|
122
|
+
V: {
|
|
123
|
+
name: 'Vectors',
|
|
124
|
+
description: 'Vector embeddings (V-Dimension): Semantic search vectors'
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
// Public API from package.json exports
|
|
128
|
+
const publicApi = {};
|
|
129
|
+
// Read exports from all plugin package.json files
|
|
130
|
+
for (const plugin of plugins) {
|
|
131
|
+
if (plugin.path) {
|
|
132
|
+
const pluginPackageJsonPath = path.join(workspaceRoot, plugin.path, 'package.json');
|
|
133
|
+
if (fs.existsSync(pluginPackageJsonPath)) {
|
|
134
|
+
try {
|
|
135
|
+
const pluginPackageJson = JSON.parse(fs.readFileSync(pluginPackageJsonPath, 'utf8'));
|
|
136
|
+
if (pluginPackageJson.exports) {
|
|
137
|
+
// Process exports field
|
|
138
|
+
if (typeof pluginPackageJson.exports === 'object') {
|
|
139
|
+
for (const [exportPath, exportValue] of Object.entries(pluginPackageJson.exports)) {
|
|
140
|
+
if (typeof exportValue === 'string') {
|
|
141
|
+
publicApi[`${plugin.name}${exportPath}`] = {
|
|
142
|
+
import: exportValue
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
else if (typeof exportValue === 'object' && exportValue !== null) {
|
|
146
|
+
const exportObj = exportValue;
|
|
147
|
+
publicApi[`${plugin.name}${exportPath}`] = {
|
|
148
|
+
import: exportObj.import || exportObj.default,
|
|
149
|
+
types: exportObj.types
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else if (pluginPackageJson.main) {
|
|
156
|
+
// Fallback to main field
|
|
157
|
+
publicApi[`${plugin.name}/main`] = {
|
|
158
|
+
import: pluginPackageJson.main,
|
|
159
|
+
types: pluginPackageJson.types
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
// Skip if can't read
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// Policies
|
|
170
|
+
const policies = {
|
|
171
|
+
soft_delete: true,
|
|
172
|
+
active_only_default: true
|
|
173
|
+
};
|
|
174
|
+
return {
|
|
175
|
+
system_id: systemId,
|
|
176
|
+
workspace_root: path.resolve(workspaceRoot).replace(/\\/g, '/'),
|
|
177
|
+
version,
|
|
178
|
+
plugins,
|
|
179
|
+
dimensions,
|
|
180
|
+
public_api: publicApi,
|
|
181
|
+
policies
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
exports.generateSystemMetadata = generateSystemMetadata;
|
|
185
|
+
/**
|
|
186
|
+
* Writes system metadata to file.
|
|
187
|
+
*
|
|
188
|
+
* @param workspaceRoot Workspace root directory
|
|
189
|
+
* @param outputPath Output path (default: 'docs/system')
|
|
190
|
+
*/
|
|
191
|
+
function writeSystemMetadata(workspaceRoot, outputPath) {
|
|
192
|
+
const metadata = generateSystemMetadata(workspaceRoot);
|
|
193
|
+
const systemDir = outputPath || path.join(workspaceRoot, 'docs', 'system');
|
|
194
|
+
// Ensure directory exists
|
|
195
|
+
if (!fs.existsSync(systemDir)) {
|
|
196
|
+
fs.mkdirSync(systemDir, { recursive: true });
|
|
197
|
+
}
|
|
198
|
+
const metadataPath = path.join(systemDir, 'SYSTEM_METADATA.json');
|
|
199
|
+
fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2), 'utf8');
|
|
200
|
+
}
|
|
201
|
+
exports.writeSystemMetadata = writeSystemMetadata;
|
|
202
|
+
//# sourceMappingURL=system-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-metadata.js","sourceRoot":"","sources":["../../src/generator/system-metadata.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,uCAAyB;AACzB,+CAAiC;AAgCjC;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAC,aAAqB;IACxD,qCAAqC;IACrC,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;IACrF,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9E,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEvC,qCAAqC;IACrC,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IACrE,IAAI,OAAO,GAAG,OAAO,CAAC;IACtB,IAAI,EAAE,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE;QACpC,IAAI;YACA,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC;YACjF,OAAO,GAAG,eAAe,CAAC,OAAO,IAAI,OAAO,CAAC;SAChD;QAAC,MAAM;YACJ,sBAAsB;SACzB;KACJ;IAED,eAAe;IACf,MAAM,OAAO,GAA4D,EAAE,CAAC;IAE5E,qBAAqB;IACrB,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;IACpE,IAAI,EAAE,CA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mB,EAAE,IAAI;KAC5B,CAAC;IAEF,OAAO;QACH,SAAS,EAAE,QAAQ;QACnB,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;QAC/D,OAAO;QACP,OAAO;QACP,UAAU;QACV,UAAU,EAAE,SAAS;QACrB,QAAQ;KACX,CAAC;AACN,CAAC;AAtJD,wDAsJC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,aAAqB,EAAE,UAAmB;IAC1E,MAAM,QAAQ,GAAG,sBAAsB,CAAC,aAAa,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAE3E,0BAA0B;IAC1B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QAC3B,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;KAChD;IAED,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;IAClE,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC9E,CAAC;AAXD,kDAWC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
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.readSymbolsFromIndex = exports.buildIndexFromSymbols = exports.writeJsonlIndex = void 0;
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const symbols_1 = require("../core/symbols");
|
|
30
|
+
function writeJsonlIndex(rows, outFile) {
|
|
31
|
+
const dir = path.dirname(outFile);
|
|
32
|
+
if (!fs.existsSync(dir))
|
|
33
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
34
|
+
const sorted = [...rows].sort((a, b) => (a.path === b.path ? a.symbol_id.localeCompare(b.symbol_id) : a.path.localeCompare(b.path)));
|
|
35
|
+
const content = sorted.map(r => JSON.stringify(r)).join('\n') + '\n';
|
|
36
|
+
fs.writeFileSync(outFile, content, 'utf8');
|
|
37
|
+
}
|
|
38
|
+
exports.writeJsonlIndex = writeJsonlIndex;
|
|
39
|
+
function buildIndexFromSymbols(symbols, dependencies = []) {
|
|
40
|
+
// Sammle Dependencies pro Quell-Datei und Zielmodul,
|
|
41
|
+
// damit alle Symbolnamen je Modul zusammengeführt werden können.
|
|
42
|
+
const depsByFile = new Map();
|
|
43
|
+
for (const dep of dependencies) {
|
|
44
|
+
if (!depsByFile.has(dep.from)) {
|
|
45
|
+
depsByFile.set(dep.from, new Map());
|
|
46
|
+
}
|
|
47
|
+
const fileDeps = depsByFile.get(dep.from);
|
|
48
|
+
const existing = fileDeps.get(dep.to);
|
|
49
|
+
if (existing) {
|
|
50
|
+
// Merge symbols
|
|
51
|
+
if (dep.symbols && dep.symbols.length > 0) {
|
|
52
|
+
existing.symbols.push(...dep.symbols);
|
|
53
|
+
}
|
|
54
|
+
// isTypeOnly bleibt nur true, wenn ALLE Imports type-only sind
|
|
55
|
+
if (!dep.isTypeOnly) {
|
|
56
|
+
existing.isTypeOnly = false;
|
|
57
|
+
}
|
|
58
|
+
// isReexport wird true, wenn mindestens ein Re-Export existiert
|
|
59
|
+
if (dep.isReexport) {
|
|
60
|
+
existing.isReexport = true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
fileDeps.set(dep.to, {
|
|
65
|
+
module: dep.to,
|
|
66
|
+
symbols: dep.symbols && dep.symbols.length > 0 ? [...dep.symbols] : [],
|
|
67
|
+
isTypeOnly: dep.isTypeOnly ?? false,
|
|
68
|
+
isReexport: dep.isReexport ?? false,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return symbols.map(s => {
|
|
73
|
+
const fileDeps = depsByFile.get(s.filePath);
|
|
74
|
+
let dependencyEntries;
|
|
75
|
+
if (fileDeps && fileDeps.size > 0) {
|
|
76
|
+
// Erzeuge ein deterministisches Array:
|
|
77
|
+
// 1. Sortiere nach Modulpfad
|
|
78
|
+
// 2. Dedupliziere und sortiere Symbolnamen pro Modul
|
|
79
|
+
const entries = Array.from(fileDeps.values()).map(acc => {
|
|
80
|
+
const entry = { module: acc.module };
|
|
81
|
+
if (acc.symbols.length > 0) {
|
|
82
|
+
entry.symbols = Array.from(new Set(acc.symbols)).sort();
|
|
83
|
+
}
|
|
84
|
+
// Nur hinzufügen wenn true (spart Platz im JSON)
|
|
85
|
+
if (acc.isTypeOnly) {
|
|
86
|
+
entry.isTypeOnly = true;
|
|
87
|
+
}
|
|
88
|
+
if (acc.isReexport) {
|
|
89
|
+
entry.isReexport = true;
|
|
90
|
+
}
|
|
91
|
+
return entry;
|
|
92
|
+
});
|
|
93
|
+
entries.sort((a, b) => a.module.localeCompare(b.module));
|
|
94
|
+
dependencyEntries = entries;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
symbol_id: (0, symbols_1.makeStableSymbolId)(s),
|
|
98
|
+
path: s.filePath,
|
|
99
|
+
kind: s.kind,
|
|
100
|
+
name: s.fullyQualifiedName,
|
|
101
|
+
signature: s.signature,
|
|
102
|
+
dependencies: dependencyEntries,
|
|
103
|
+
// Include span information if available
|
|
104
|
+
...(s.start_line !== undefined && { start_line: s.start_line }),
|
|
105
|
+
...(s.end_line !== undefined && { end_line: s.end_line }),
|
|
106
|
+
...(s.start_col !== undefined && { start_col: s.start_col }),
|
|
107
|
+
...(s.end_col !== undefined && { end_col: s.end_col }),
|
|
108
|
+
...(s.byte_offset_start !== undefined && { byte_offset_start: s.byte_offset_start }),
|
|
109
|
+
...(s.byte_offset_end !== undefined && { byte_offset_end: s.byte_offset_end }),
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
exports.buildIndexFromSymbols = buildIndexFromSymbols;
|
|
114
|
+
/**
|
|
115
|
+
* @public
|
|
116
|
+
* Reconstruct ParsedSymbol[] from a JSONL index file.
|
|
117
|
+
* Wird sowohl vom Generate-Flow (als symbolsPrev) als auch vom Validator verwendet,
|
|
118
|
+
* um eine gemeinsame Symbolbasis aus `docs/index/symbols.jsonl` herzustellen.
|
|
119
|
+
*/
|
|
120
|
+
function readSymbolsFromIndex(indexFile) {
|
|
121
|
+
if (!fs.existsSync(indexFile)) {
|
|
122
|
+
return [];
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
const lines = fs.readFileSync(indexFile, 'utf8').split(/\r?\n/).filter(Boolean);
|
|
126
|
+
const symbols = [];
|
|
127
|
+
for (const line of lines) {
|
|
128
|
+
try {
|
|
129
|
+
const row = JSON.parse(line);
|
|
130
|
+
symbols.push({
|
|
131
|
+
language: 'unknown',
|
|
132
|
+
filePath: row.path,
|
|
133
|
+
fullyQualifiedName: row.name,
|
|
134
|
+
kind: row.kind,
|
|
135
|
+
signature: row.signature ?? {
|
|
136
|
+
name: row.name,
|
|
137
|
+
parameters: [],
|
|
138
|
+
returnType: '',
|
|
139
|
+
visibility: 'public',
|
|
140
|
+
},
|
|
141
|
+
// Restore span information if available
|
|
142
|
+
...(row.start_line !== undefined && { start_line: row.start_line }),
|
|
143
|
+
...(row.end_line !== undefined && { end_line: row.end_line }),
|
|
144
|
+
...(row.start_col !== undefined && { start_col: row.start_col }),
|
|
145
|
+
...(row.end_col !== undefined && { end_col: row.end_col }),
|
|
146
|
+
...(row.byte_offset_start !== undefined && { byte_offset_start: row.byte_offset_start }),
|
|
147
|
+
...(row.byte_offset_end !== undefined && { byte_offset_end: row.byte_offset_end }),
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
// Ignoriere defekte Zeilen – Validator/Generator arbeiten dann mit Teilmenge
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return symbols;
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return [];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
exports.readSymbolsFromIndex = readSymbolsFromIndex;
|
|
161
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,6CAAqD;AA8BrD,SAAgB,eAAe,CAAC,IAAgB,EAAE,OAAe;IAC7D,MAAM,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CAAC,GAAG,CAAC,UAAU,KAAK,SAAS,IAAI,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC;oBACnE,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC;oBAC7D,GAAG,CAAC,GAAG,CAAC,SAAS,KAAK,SAAS,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC;oBAChE,GAAG,CAAC,GAAG,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;oBAC1D,GAAG,CAAC,GAAG,CAAC,iBAAiB,KAAK,SAAS,IAAI,EAAE,iBAAiB,EAAE,GAAG,CAAC,iBAAiB,EAAE,CAAC;oBACxF,GAAG,CAAC,GAAG,CAAC,eAAe,KAAK,SAAS,IAAI,EAAE,eAAe,EAAE,GAAG,CAAC,eAAe,EAAE,CAAC;iBACrF,CAAC,CAAC;aACN;YAAC,MAAM;gBACJ,6EAA6E;aAChF;SACJ;QAED,OAAO,OAAO,CAAC;KAClB;IAAC,MAAM;QACJ,OAAO,EAAE,CAAC;KACb;AACL,CAAC;AAxCD,oDAwCC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Logger = void 0;
|
|
4
|
+
class Logger {
|
|
5
|
+
constructor(options) {
|
|
6
|
+
this.component = options.component;
|
|
7
|
+
}
|
|
8
|
+
info(message) {
|
|
9
|
+
console.log(`[${this.component}] ${message}`);
|
|
10
|
+
}
|
|
11
|
+
warn(message) {
|
|
12
|
+
console.warn(`[${this.component}] ${message}`);
|
|
13
|
+
}
|
|
14
|
+
error(message, err) {
|
|
15
|
+
if (err) {
|
|
16
|
+
console.error(`[${this.component}] ${message}:`, err);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
console.error(`[${this.component}] ${message}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.Logger = Logger;
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/logging/index.ts"],"names":[],"mappings":";;;AAMA,MAAa,MAAM;IAGf,YAAY,OAAsB;QAC9B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IACvC,CAAC;IAED,IAAI,CAAC,OAAe;QAChB,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,IAAI,CAAC,OAAe;QAChB,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,GAAa;QAChC,IAAI,GAAG,EAAE;YACL,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,GAAG,EAAE,GAAG,CAAC,CAAC;SACzD;aAAM;YACH,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC,CAAC;SACnD;IACL,CAAC;CACJ;AAtBD,wBAsBC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractPythonDependencies = exports.extractTsJsDependencies = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
* Extract dependencies from TypeScript/JavaScript files
|
|
7
|
+
*/
|
|
8
|
+
function extractTsJsDependencies(sourceFile, repoRelPath) {
|
|
9
|
+
const deps = [];
|
|
10
|
+
// Import declarations
|
|
11
|
+
sourceFile.getImportDeclarations().forEach(imp => {
|
|
12
|
+
const moduleSpec = imp.getModuleSpecifierValue();
|
|
13
|
+
const isTypeOnly = imp.isTypeOnly();
|
|
14
|
+
// Named imports mit Alias-Unterstützung
|
|
15
|
+
const namedImports = imp.getNamedImports().map(ni => {
|
|
16
|
+
const name = ni.getName();
|
|
17
|
+
const alias = ni.getAliasNode()?.getText();
|
|
18
|
+
const isTypeOnlySpecifier = ni.isTypeOnly();
|
|
19
|
+
// Format: "OriginalName" oder "OriginalName as Alias" oder "type OriginalName"
|
|
20
|
+
let result = name;
|
|
21
|
+
if (alias && alias !== name) {
|
|
22
|
+
result = `${name} as ${alias}`;
|
|
23
|
+
}
|
|
24
|
+
if (isTypeOnlySpecifier || isTypeOnly) {
|
|
25
|
+
result = `type ${result}`;
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
});
|
|
29
|
+
const defaultImport = imp.getDefaultImport()?.getText();
|
|
30
|
+
const namespaceImport = imp.getNamespaceImport()?.getText();
|
|
31
|
+
const symbols = [];
|
|
32
|
+
if (defaultImport) {
|
|
33
|
+
const prefix = isTypeOnly ? 'type default as' : 'default as';
|
|
34
|
+
symbols.push(`${prefix} ${defaultImport}`);
|
|
35
|
+
}
|
|
36
|
+
if (namespaceImport) {
|
|
37
|
+
const prefix = isTypeOnly ? 'type * as' : '* as';
|
|
38
|
+
symbols.push(`${prefix} ${namespaceImport}`);
|
|
39
|
+
}
|
|
40
|
+
symbols.push(...namedImports);
|
|
41
|
+
deps.push({
|
|
42
|
+
from: repoRelPath,
|
|
43
|
+
to: moduleSpec,
|
|
44
|
+
type: 'import',
|
|
45
|
+
symbols: symbols.length > 0 ? symbols : undefined,
|
|
46
|
+
isTypeOnly: isTypeOnly || undefined,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
// Export declarations (Re-Exports / Barrel-Pattern)
|
|
50
|
+
sourceFile.getExportDeclarations().forEach(exp => {
|
|
51
|
+
const moduleSpec = exp.getModuleSpecifierValue();
|
|
52
|
+
if (moduleSpec) {
|
|
53
|
+
const isTypeOnly = exp.isTypeOnly();
|
|
54
|
+
const isNamespace = exp.isNamespaceExport();
|
|
55
|
+
// Named exports mit Alias-Unterstützung
|
|
56
|
+
const namedExports = exp.getNamedExports().map(ne => {
|
|
57
|
+
const name = ne.getName();
|
|
58
|
+
const alias = ne.getAliasNode()?.getText();
|
|
59
|
+
const isTypeOnlySpecifier = ne.isTypeOnly();
|
|
60
|
+
// Format: "OriginalName" oder "OriginalName as Alias" oder "type OriginalName"
|
|
61
|
+
let result = name;
|
|
62
|
+
if (alias && alias !== name) {
|
|
63
|
+
result = `${name} as ${alias}`;
|
|
64
|
+
}
|
|
65
|
+
if (isTypeOnlySpecifier || isTypeOnly) {
|
|
66
|
+
result = `type ${result}`;
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
});
|
|
70
|
+
const symbols = [];
|
|
71
|
+
if (isNamespace) {
|
|
72
|
+
symbols.push(isTypeOnly ? 'type *' : '*');
|
|
73
|
+
}
|
|
74
|
+
symbols.push(...namedExports);
|
|
75
|
+
deps.push({
|
|
76
|
+
from: repoRelPath,
|
|
77
|
+
to: moduleSpec,
|
|
78
|
+
type: 'export',
|
|
79
|
+
symbols: symbols.length > 0 ? symbols : undefined,
|
|
80
|
+
isTypeOnly: isTypeOnly || undefined,
|
|
81
|
+
isReexport: true, // Markiert als Re-Export (Barrel-Pattern)
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
return deps;
|
|
86
|
+
}
|
|
87
|
+
exports.extractTsJsDependencies = extractTsJsDependencies;
|
|
88
|
+
/**
|
|
89
|
+
* @public
|
|
90
|
+
* Extract dependencies from Python files
|
|
91
|
+
*/
|
|
92
|
+
function extractPythonDependencies(content, repoRelPath) {
|
|
93
|
+
const deps = [];
|
|
94
|
+
const lines = content.split(/\r?\n/);
|
|
95
|
+
for (const line of lines) {
|
|
96
|
+
const trimmed = line.trim();
|
|
97
|
+
// import module
|
|
98
|
+
const importMatch = trimmed.match(/^import\s+([^#]+)/);
|
|
99
|
+
if (importMatch) {
|
|
100
|
+
const modules = importMatch[1].split(',').map(m => m.trim());
|
|
101
|
+
for (const mod of modules) {
|
|
102
|
+
deps.push({
|
|
103
|
+
from: repoRelPath,
|
|
104
|
+
to: mod,
|
|
105
|
+
type: 'import',
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
// from module import symbols
|
|
111
|
+
const fromMatch = trimmed.match(/^from\s+([^\s]+)\s+import\s+([^#]+)/);
|
|
112
|
+
if (fromMatch) {
|
|
113
|
+
const module = fromMatch[1];
|
|
114
|
+
const symbols = fromMatch[2].split(',').map(s => s.trim());
|
|
115
|
+
deps.push({
|
|
116
|
+
from: repoRelPath,
|
|
117
|
+
to: module,
|
|
118
|
+
type: 'import',
|
|
119
|
+
symbols,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return deps;
|
|
124
|
+
}
|
|
125
|
+
exports.extractPythonDependencies = extractPythonDependencies;
|
|
126
|
+
//# sourceMappingURL=dependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../src/parsers/dependencies.ts"],"names":[],"mappings":";;;AAWA;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,UAAsB,EAAE,WAAmB;IAC/E,MAAM,IAAI,GAAuB,EAAE,CAAC;IAEpC,sBAAsB;IACtB,UAAU,CAAC,qBAAqB,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC7C,MAAM,UAAU,GAAG,GAAG,CAAC,uBAAuB,EAAE,CAAC;QACjD,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;QAEpC,wCAAwC;QACxC,MAAM,YAAY,GAAG,GAAG,CAAC,eAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;YAChD,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;Y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,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YAC3D,IAAI,CAAC,IAAI,CAAC;gBACN,IAAI,EAAE,WAAW;gBACjB,EAAE,EAAE,MAAM;gBACV,IAAI,EAAE,QAAQ;gBACd,OAAO;aACV,CAAC,CAAC;SACN;KACJ;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AApCD,8DAoCC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
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.JsonYamlParser = void 0;
|
|
27
|
+
const path = __importStar(require("path"));
|
|
28
|
+
const YAML = __importStar(require("yaml"));
|
|
29
|
+
function asRepoRel(p) {
|
|
30
|
+
return p.split(path.sep).join('/');
|
|
31
|
+
}
|
|
32
|
+
class JsonYamlParser {
|
|
33
|
+
constructor() {
|
|
34
|
+
this.language = 'json-yaml';
|
|
35
|
+
}
|
|
36
|
+
parse(filePath, fileContent) {
|
|
37
|
+
// ARCHITECTURE DECISION (ADR): JSON/YAML liefern keine Code-Symbole
|
|
38
|
+
// Diese Dateien enthalten Konfiguration, keine Code-Symbole.
|
|
39
|
+
// Root Cause Fix: Verhindert $schema, $ref und andere JSON-Keys als Symbole.
|
|
40
|
+
//
|
|
41
|
+
// Option A (alt): Komplett deaktivieren - return []
|
|
42
|
+
// Option B (implementiert): Nur spezifische Config-Keys extrahieren (z.B. package.json, tsconfig.json)
|
|
43
|
+
//
|
|
44
|
+
// Begründung: JSON/YAML sind Konfigurationsdateien, keine Code-Quellen.
|
|
45
|
+
// Symbole sollten nur aus .ts/.tsx/.js/.jsx extrahiert werden.
|
|
46
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
47
|
+
const base = path.basename(filePath).toLowerCase();
|
|
48
|
+
const repoRel = asRepoRel(filePath);
|
|
49
|
+
// JSON/YAML: standardmäßig keine Symbole extrahieren (Konfiguration ≠ Code),
|
|
50
|
+
// aber für wenige, semantisch nützliche Standarddateien Top-Level-Keys extrahieren.
|
|
51
|
+
if (ext === '.json') {
|
|
52
|
+
if (base === 'package.json' || base === 'tsconfig.json') {
|
|
53
|
+
try {
|
|
54
|
+
const parsed = JSON.parse(fileContent);
|
|
55
|
+
const out = [];
|
|
56
|
+
this.collectFromObject(this.filterConfigKeys(parsed), repoRel, out, this.language);
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// Invalid JSON → keine Symbole
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
if (ext === '.yaml' || ext === '.yml') {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
// Markdown Front-Matter: Auch keine Symbole (nur Metadaten)
|
|
70
|
+
if (ext === '.md') {
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
filterConfigKeys(obj) {
|
|
76
|
+
if (!obj || typeof obj !== 'object' || Array.isArray(obj))
|
|
77
|
+
return {};
|
|
78
|
+
const record = obj;
|
|
79
|
+
const out = {};
|
|
80
|
+
for (const k of Object.keys(record)) {
|
|
81
|
+
// Schutz gegen Noise: $schema, $ref, etc. nie als „Symbol“ behandeln
|
|
82
|
+
if (k.startsWith('$'))
|
|
83
|
+
continue;
|
|
84
|
+
out[k] = record[k];
|
|
85
|
+
}
|
|
86
|
+
return out;
|
|
87
|
+
}
|
|
88
|
+
collectFromObject(obj, repoRel, out, lang) {
|
|
89
|
+
if (!obj || typeof obj !== 'object')
|
|
90
|
+
return;
|
|
91
|
+
const keys = Object.keys(obj).sort();
|
|
92
|
+
for (const k of keys) {
|
|
93
|
+
const v = obj[k];
|
|
94
|
+
const sig = { name: k, parameters: [], returnType: typeof v, visibility: 'public' };
|
|
95
|
+
out.push({
|
|
96
|
+
language: lang,
|
|
97
|
+
filePath: repoRel,
|
|
98
|
+
fullyQualifiedName: k,
|
|
99
|
+
signature: sig,
|
|
100
|
+
kind: 'variable',
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
extractFrontMatter(content) {
|
|
105
|
+
// Einfacher Front-Matter-Parser: erwartet '---' Block am Anfang
|
|
106
|
+
if (!content.startsWith('---'))
|
|
107
|
+
return null;
|
|
108
|
+
const end = content.indexOf('\n---', 3);
|
|
109
|
+
if (end === -1)
|
|
110
|
+
return null;
|
|
111
|
+
const block = content.slice(3, end).trim();
|
|
112
|
+
try {
|
|
113
|
+
return YAML.parse(block);
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.JsonYamlParser = JsonYamlParser;
|
|
121
|
+
//# sourceMappingURL=json-yaml.js.map
|