driftdetect-core 0.7.1 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/boundaries/types.d.ts +1 -1
- package/dist/boundaries/types.d.ts.map +1 -1
- package/dist/call-graph/analysis/graph-builder.d.ts.map +1 -1
- package/dist/call-graph/analysis/graph-builder.js +2 -0
- package/dist/call-graph/analysis/graph-builder.js.map +1 -1
- package/dist/call-graph/extractors/cpp-data-access-extractor.d.ts +37 -0
- package/dist/call-graph/extractors/cpp-data-access-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/cpp-data-access-extractor.js +467 -0
- package/dist/call-graph/extractors/cpp-data-access-extractor.js.map +1 -0
- package/dist/call-graph/extractors/cpp-hybrid-extractor.d.ts +89 -0
- package/dist/call-graph/extractors/cpp-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/cpp-hybrid-extractor.js +541 -0
- package/dist/call-graph/extractors/cpp-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/index.d.ts +8 -1
- package/dist/call-graph/extractors/index.d.ts.map +1 -1
- package/dist/call-graph/extractors/index.js +9 -1
- package/dist/call-graph/extractors/index.js.map +1 -1
- package/dist/call-graph/extractors/regex/cpp-regex.d.ts +46 -0
- package/dist/call-graph/extractors/regex/cpp-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/cpp-regex.js +325 -0
- package/dist/call-graph/extractors/regex/cpp-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/index.d.ts +2 -0
- package/dist/call-graph/extractors/regex/index.d.ts.map +1 -1
- package/dist/call-graph/extractors/regex/index.js +16 -0
- package/dist/call-graph/extractors/regex/index.js.map +1 -1
- package/dist/call-graph/extractors/regex/rust-regex.d.ts +45 -0
- package/dist/call-graph/extractors/regex/rust-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/rust-regex.js +517 -0
- package/dist/call-graph/extractors/regex/rust-regex.js.map +1 -0
- package/dist/call-graph/extractors/rust-data-access-extractor.d.ts +35 -0
- package/dist/call-graph/extractors/rust-data-access-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/rust-data-access-extractor.js +349 -0
- package/dist/call-graph/extractors/rust-data-access-extractor.js.map +1 -0
- package/dist/call-graph/extractors/rust-extractor.d.ts +125 -0
- package/dist/call-graph/extractors/rust-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/rust-extractor.js +604 -0
- package/dist/call-graph/extractors/rust-extractor.js.map +1 -0
- package/dist/call-graph/extractors/rust-hybrid-extractor.d.ts +119 -0
- package/dist/call-graph/extractors/rust-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/rust-hybrid-extractor.js +548 -0
- package/dist/call-graph/extractors/rust-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/index.d.ts +2 -0
- package/dist/call-graph/index.d.ts.map +1 -1
- package/dist/call-graph/index.js +4 -0
- package/dist/call-graph/index.js.map +1 -1
- package/dist/call-graph/streaming-builder.d.ts +60 -0
- package/dist/call-graph/streaming-builder.d.ts.map +1 -0
- package/dist/call-graph/streaming-builder.js +204 -0
- package/dist/call-graph/streaming-builder.js.map +1 -0
- package/dist/call-graph/types.d.ts +1 -1
- package/dist/call-graph/types.d.ts.map +1 -1
- package/dist/call-graph/unified-provider.d.ts +72 -0
- package/dist/call-graph/unified-provider.d.ts.map +1 -0
- package/dist/call-graph/unified-provider.js +502 -0
- package/dist/call-graph/unified-provider.js.map +1 -0
- package/dist/constants/extractors/regex/rust-regex.d.ts +43 -0
- package/dist/constants/extractors/regex/rust-regex.d.ts.map +1 -0
- package/dist/constants/extractors/regex/rust-regex.js +370 -0
- package/dist/constants/extractors/regex/rust-regex.js.map +1 -0
- package/dist/constants/types.d.ts +1 -1
- package/dist/constants/types.d.ts.map +1 -1
- package/dist/constants/types.js.map +1 -1
- package/dist/constraints/store/constraint-store.d.ts.map +1 -1
- package/dist/constraints/store/constraint-store.js +2 -0
- package/dist/constraints/store/constraint-store.js.map +1 -1
- package/dist/constraints/types.d.ts +1 -1
- package/dist/constraints/types.d.ts.map +1 -1
- package/dist/constraints/types.js +2 -0
- package/dist/constraints/types.js.map +1 -1
- package/dist/context/context-generator.d.ts +38 -0
- package/dist/context/context-generator.d.ts.map +1 -0
- package/dist/context/context-generator.js +392 -0
- package/dist/context/context-generator.js.map +1 -0
- package/dist/context/index.d.ts +13 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +14 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/package-detector.d.ts +53 -0
- package/dist/context/package-detector.d.ts.map +1 -0
- package/dist/context/package-detector.js +672 -0
- package/dist/context/package-detector.js.map +1 -0
- package/dist/context/types.d.ts +258 -0
- package/dist/context/types.d.ts.map +1 -0
- package/dist/context/types.js +10 -0
- package/dist/context/types.js.map +1 -0
- package/dist/cpp/cpp-analyzer.d.ts +179 -0
- package/dist/cpp/cpp-analyzer.d.ts.map +1 -0
- package/dist/cpp/cpp-analyzer.js +532 -0
- package/dist/cpp/cpp-analyzer.js.map +1 -0
- package/dist/cpp/index.d.ts +9 -0
- package/dist/cpp/index.d.ts.map +1 -0
- package/dist/cpp/index.js +9 -0
- package/dist/cpp/index.js.map +1 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.d.ts.map +1 -1
- package/dist/decisions/analyzer/decision-mining-analyzer.js +4 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.js.map +1 -1
- package/dist/decisions/types.d.ts +1 -1
- package/dist/decisions/types.d.ts.map +1 -1
- package/dist/environment/extractors/cpp-env-extractor.d.ts +58 -0
- package/dist/environment/extractors/cpp-env-extractor.d.ts.map +1 -0
- package/dist/environment/extractors/cpp-env-extractor.js +298 -0
- package/dist/environment/extractors/cpp-env-extractor.js.map +1 -0
- package/dist/environment/extractors/index.d.ts +2 -0
- package/dist/environment/extractors/index.d.ts.map +1 -1
- package/dist/environment/extractors/index.js +2 -0
- package/dist/environment/extractors/index.js.map +1 -1
- package/dist/environment/extractors/rust-env-extractor.d.ts +58 -0
- package/dist/environment/extractors/rust-env-extractor.d.ts.map +1 -0
- package/dist/environment/extractors/rust-env-extractor.js +297 -0
- package/dist/environment/extractors/rust-env-extractor.js.map +1 -0
- package/dist/environment/index.d.ts +1 -1
- package/dist/environment/index.d.ts.map +1 -1
- package/dist/environment/index.js +1 -1
- package/dist/environment/index.js.map +1 -1
- package/dist/environment/types.d.ts +2 -2
- package/dist/environment/types.d.ts.map +1 -1
- package/dist/environment/types.js.map +1 -1
- package/dist/index.d.ts +15 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -2
- package/dist/index.js.map +1 -1
- package/dist/licensing/feature-guard.d.ts +103 -0
- package/dist/licensing/feature-guard.d.ts.map +1 -0
- package/dist/licensing/feature-guard.js +195 -0
- package/dist/licensing/feature-guard.js.map +1 -0
- package/dist/licensing/index.d.ts +46 -0
- package/dist/licensing/index.d.ts.map +1 -0
- package/dist/licensing/index.js +47 -0
- package/dist/licensing/index.js.map +1 -0
- package/dist/licensing/license-manager.d.ts +88 -0
- package/dist/licensing/license-manager.d.ts.map +1 -0
- package/dist/licensing/license-manager.js +251 -0
- package/dist/licensing/license-manager.js.map +1 -0
- package/dist/licensing/license-validator.d.ts +60 -0
- package/dist/licensing/license-validator.d.ts.map +1 -0
- package/dist/licensing/license-validator.js +300 -0
- package/dist/licensing/license-validator.js.map +1 -0
- package/dist/licensing/types.d.ts +76 -0
- package/dist/licensing/types.d.ts.map +1 -0
- package/dist/licensing/types.js +51 -0
- package/dist/licensing/types.js.map +1 -0
- package/dist/parsers/tree-sitter/cpp-loader.d.ts +51 -0
- package/dist/parsers/tree-sitter/cpp-loader.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/cpp-loader.js +162 -0
- package/dist/parsers/tree-sitter/cpp-loader.js.map +1 -0
- package/dist/parsers/tree-sitter/index.d.ts +6 -0
- package/dist/parsers/tree-sitter/index.d.ts.map +1 -1
- package/dist/parsers/tree-sitter/index.js +16 -0
- package/dist/parsers/tree-sitter/index.js.map +1 -1
- package/dist/parsers/tree-sitter/rust-loader.d.ts +50 -0
- package/dist/parsers/tree-sitter/rust-loader.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/rust-loader.js +161 -0
- package/dist/parsers/tree-sitter/rust-loader.js.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-cpp-parser.d.ts +198 -0
- package/dist/parsers/tree-sitter/tree-sitter-cpp-parser.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-cpp-parser.js +671 -0
- package/dist/parsers/tree-sitter/tree-sitter-cpp-parser.js.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-rust-parser.d.ts +180 -0
- package/dist/parsers/tree-sitter/tree-sitter-rust-parser.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-rust-parser.js +478 -0
- package/dist/parsers/tree-sitter/tree-sitter-rust-parser.js.map +1 -0
- package/dist/parsers/types.d.ts +1 -1
- package/dist/parsers/types.d.ts.map +1 -1
- package/dist/patterns/adapters/pattern-store-adapter.d.ts.map +1 -1
- package/dist/patterns/adapters/pattern-store-adapter.js +35 -10
- package/dist/patterns/adapters/pattern-store-adapter.js.map +1 -1
- package/dist/quality-gates/gates/base-gate.d.ts +71 -0
- package/dist/quality-gates/gates/base-gate.d.ts.map +1 -0
- package/dist/quality-gates/gates/base-gate.js +178 -0
- package/dist/quality-gates/gates/base-gate.js.map +1 -0
- package/dist/quality-gates/gates/constraint-verification/constraint-verification-gate.d.ts +62 -0
- package/dist/quality-gates/gates/constraint-verification/constraint-verification-gate.d.ts.map +1 -0
- package/dist/quality-gates/gates/constraint-verification/constraint-verification-gate.js +255 -0
- package/dist/quality-gates/gates/constraint-verification/constraint-verification-gate.js.map +1 -0
- package/dist/quality-gates/gates/constraint-verification/index.d.ts +7 -0
- package/dist/quality-gates/gates/constraint-verification/index.d.ts.map +1 -0
- package/dist/quality-gates/gates/constraint-verification/index.js +7 -0
- package/dist/quality-gates/gates/constraint-verification/index.js.map +1 -0
- package/dist/quality-gates/gates/custom-rules/custom-rules-gate.d.ts +73 -0
- package/dist/quality-gates/gates/custom-rules/custom-rules-gate.d.ts.map +1 -0
- package/dist/quality-gates/gates/custom-rules/custom-rules-gate.js +351 -0
- package/dist/quality-gates/gates/custom-rules/custom-rules-gate.js.map +1 -0
- package/dist/quality-gates/gates/custom-rules/index.d.ts +7 -0
- package/dist/quality-gates/gates/custom-rules/index.d.ts.map +1 -0
- package/dist/quality-gates/gates/custom-rules/index.js +7 -0
- package/dist/quality-gates/gates/custom-rules/index.js.map +1 -0
- package/dist/quality-gates/gates/impact-simulation/impact-simulation-gate.d.ts +61 -0
- package/dist/quality-gates/gates/impact-simulation/impact-simulation-gate.d.ts.map +1 -0
- package/dist/quality-gates/gates/impact-simulation/impact-simulation-gate.js +318 -0
- package/dist/quality-gates/gates/impact-simulation/impact-simulation-gate.js.map +1 -0
- package/dist/quality-gates/gates/impact-simulation/index.d.ts +7 -0
- package/dist/quality-gates/gates/impact-simulation/index.d.ts.map +1 -0
- package/dist/quality-gates/gates/impact-simulation/index.js +7 -0
- package/dist/quality-gates/gates/impact-simulation/index.js.map +1 -0
- package/dist/quality-gates/gates/index.d.ts +13 -0
- package/dist/quality-gates/gates/index.d.ts.map +1 -0
- package/dist/quality-gates/gates/index.js +13 -0
- package/dist/quality-gates/gates/index.js.map +1 -0
- package/dist/quality-gates/gates/pattern-compliance/index.d.ts +7 -0
- package/dist/quality-gates/gates/pattern-compliance/index.d.ts.map +1 -0
- package/dist/quality-gates/gates/pattern-compliance/index.js +7 -0
- package/dist/quality-gates/gates/pattern-compliance/index.js.map +1 -0
- package/dist/quality-gates/gates/pattern-compliance/pattern-compliance-gate.d.ts +61 -0
- package/dist/quality-gates/gates/pattern-compliance/pattern-compliance-gate.d.ts.map +1 -0
- package/dist/quality-gates/gates/pattern-compliance/pattern-compliance-gate.js +261 -0
- package/dist/quality-gates/gates/pattern-compliance/pattern-compliance-gate.js.map +1 -0
- package/dist/quality-gates/gates/regression-detection/index.d.ts +7 -0
- package/dist/quality-gates/gates/regression-detection/index.d.ts.map +1 -0
- package/dist/quality-gates/gates/regression-detection/index.js +7 -0
- package/dist/quality-gates/gates/regression-detection/index.js.map +1 -0
- package/dist/quality-gates/gates/regression-detection/regression-detection-gate.d.ts +69 -0
- package/dist/quality-gates/gates/regression-detection/regression-detection-gate.d.ts.map +1 -0
- package/dist/quality-gates/gates/regression-detection/regression-detection-gate.js +330 -0
- package/dist/quality-gates/gates/regression-detection/regression-detection-gate.js.map +1 -0
- package/dist/quality-gates/gates/security-boundary/index.d.ts +7 -0
- package/dist/quality-gates/gates/security-boundary/index.d.ts.map +1 -0
- package/dist/quality-gates/gates/security-boundary/index.js +7 -0
- package/dist/quality-gates/gates/security-boundary/index.js.map +1 -0
- package/dist/quality-gates/gates/security-boundary/security-boundary-gate.d.ts +65 -0
- package/dist/quality-gates/gates/security-boundary/security-boundary-gate.d.ts.map +1 -0
- package/dist/quality-gates/gates/security-boundary/security-boundary-gate.js +307 -0
- package/dist/quality-gates/gates/security-boundary/security-boundary-gate.js.map +1 -0
- package/dist/quality-gates/index.d.ts +35 -0
- package/dist/quality-gates/index.d.ts.map +1 -0
- package/dist/quality-gates/index.js +43 -0
- package/dist/quality-gates/index.js.map +1 -0
- package/dist/quality-gates/orchestrator/gate-orchestrator.d.ts +79 -0
- package/dist/quality-gates/orchestrator/gate-orchestrator.d.ts.map +1 -0
- package/dist/quality-gates/orchestrator/gate-orchestrator.js +314 -0
- package/dist/quality-gates/orchestrator/gate-orchestrator.js.map +1 -0
- package/dist/quality-gates/orchestrator/gate-registry.d.ts +53 -0
- package/dist/quality-gates/orchestrator/gate-registry.d.ts.map +1 -0
- package/dist/quality-gates/orchestrator/gate-registry.js +141 -0
- package/dist/quality-gates/orchestrator/gate-registry.js.map +1 -0
- package/dist/quality-gates/orchestrator/index.d.ts +10 -0
- package/dist/quality-gates/orchestrator/index.d.ts.map +1 -0
- package/dist/quality-gates/orchestrator/index.js +10 -0
- package/dist/quality-gates/orchestrator/index.js.map +1 -0
- package/dist/quality-gates/orchestrator/parallel-executor.d.ts +35 -0
- package/dist/quality-gates/orchestrator/parallel-executor.d.ts.map +1 -0
- package/dist/quality-gates/orchestrator/parallel-executor.js +70 -0
- package/dist/quality-gates/orchestrator/parallel-executor.js.map +1 -0
- package/dist/quality-gates/orchestrator/result-aggregator.d.ts +27 -0
- package/dist/quality-gates/orchestrator/result-aggregator.d.ts.map +1 -0
- package/dist/quality-gates/orchestrator/result-aggregator.js +70 -0
- package/dist/quality-gates/orchestrator/result-aggregator.js.map +1 -0
- package/dist/quality-gates/policy/default-policies.d.ts +14 -0
- package/dist/quality-gates/policy/default-policies.d.ts.map +1 -0
- package/dist/quality-gates/policy/default-policies.js +266 -0
- package/dist/quality-gates/policy/default-policies.js.map +1 -0
- package/dist/quality-gates/policy/index.d.ts +9 -0
- package/dist/quality-gates/policy/index.d.ts.map +1 -0
- package/dist/quality-gates/policy/index.js +9 -0
- package/dist/quality-gates/policy/index.js.map +1 -0
- package/dist/quality-gates/policy/policy-evaluator.d.ts +43 -0
- package/dist/quality-gates/policy/policy-evaluator.d.ts.map +1 -0
- package/dist/quality-gates/policy/policy-evaluator.js +136 -0
- package/dist/quality-gates/policy/policy-evaluator.js.map +1 -0
- package/dist/quality-gates/policy/policy-loader.d.ts +72 -0
- package/dist/quality-gates/policy/policy-loader.d.ts.map +1 -0
- package/dist/quality-gates/policy/policy-loader.js +228 -0
- package/dist/quality-gates/policy/policy-loader.js.map +1 -0
- package/dist/quality-gates/reporters/github-reporter.d.ts +19 -0
- package/dist/quality-gates/reporters/github-reporter.d.ts.map +1 -0
- package/dist/quality-gates/reporters/github-reporter.js +49 -0
- package/dist/quality-gates/reporters/github-reporter.js.map +1 -0
- package/dist/quality-gates/reporters/gitlab-reporter.d.ts +20 -0
- package/dist/quality-gates/reporters/gitlab-reporter.d.ts.map +1 -0
- package/dist/quality-gates/reporters/gitlab-reporter.js +42 -0
- package/dist/quality-gates/reporters/gitlab-reporter.js.map +1 -0
- package/dist/quality-gates/reporters/index.d.ts +12 -0
- package/dist/quality-gates/reporters/index.d.ts.map +1 -0
- package/dist/quality-gates/reporters/index.js +12 -0
- package/dist/quality-gates/reporters/index.js.map +1 -0
- package/dist/quality-gates/reporters/json-reporter.d.ts +18 -0
- package/dist/quality-gates/reporters/json-reporter.d.ts.map +1 -0
- package/dist/quality-gates/reporters/json-reporter.js +51 -0
- package/dist/quality-gates/reporters/json-reporter.js.map +1 -0
- package/dist/quality-gates/reporters/reporter-interface.d.ts +35 -0
- package/dist/quality-gates/reporters/reporter-interface.d.ts.map +1 -0
- package/dist/quality-gates/reporters/reporter-interface.js +22 -0
- package/dist/quality-gates/reporters/reporter-interface.js.map +1 -0
- package/dist/quality-gates/reporters/sarif-reporter.d.ts +22 -0
- package/dist/quality-gates/reporters/sarif-reporter.d.ts.map +1 -0
- package/dist/quality-gates/reporters/sarif-reporter.js +85 -0
- package/dist/quality-gates/reporters/sarif-reporter.js.map +1 -0
- package/dist/quality-gates/reporters/text-reporter.d.ts +18 -0
- package/dist/quality-gates/reporters/text-reporter.d.ts.map +1 -0
- package/dist/quality-gates/reporters/text-reporter.js +92 -0
- package/dist/quality-gates/reporters/text-reporter.js.map +1 -0
- package/dist/quality-gates/store/gate-run-store.d.ts +37 -0
- package/dist/quality-gates/store/gate-run-store.d.ts.map +1 -0
- package/dist/quality-gates/store/gate-run-store.js +104 -0
- package/dist/quality-gates/store/gate-run-store.js.map +1 -0
- package/dist/quality-gates/store/index.d.ts +8 -0
- package/dist/quality-gates/store/index.d.ts.map +1 -0
- package/dist/quality-gates/store/index.js +8 -0
- package/dist/quality-gates/store/index.js.map +1 -0
- package/dist/quality-gates/store/snapshot-store.d.ts +41 -0
- package/dist/quality-gates/store/snapshot-store.d.ts.map +1 -0
- package/dist/quality-gates/store/snapshot-store.js +117 -0
- package/dist/quality-gates/store/snapshot-store.js.map +1 -0
- package/dist/quality-gates/types.d.ts +992 -0
- package/dist/quality-gates/types.d.ts.map +1 -0
- package/dist/quality-gates/types.js +14 -0
- package/dist/quality-gates/types.js.map +1 -0
- package/dist/rust/index.d.ts +7 -0
- package/dist/rust/index.d.ts.map +1 -0
- package/dist/rust/index.js +8 -0
- package/dist/rust/index.js.map +1 -0
- package/dist/rust/rust-analyzer.d.ts +185 -0
- package/dist/rust/rust-analyzer.d.ts.map +1 -0
- package/dist/rust/rust-analyzer.js +538 -0
- package/dist/rust/rust-analyzer.js.map +1 -0
- package/dist/scanner/file-walker.d.ts.map +1 -1
- package/dist/scanner/file-walker.js +11 -0
- package/dist/scanner/file-walker.js.map +1 -1
- package/dist/simulation/simulation-engine.d.ts +6 -0
- package/dist/simulation/simulation-engine.d.ts.map +1 -1
- package/dist/simulation/simulation-engine.js +6 -0
- package/dist/simulation/simulation-engine.js.map +1 -1
- package/dist/speculative/types.d.ts +1 -1
- package/dist/speculative/types.d.ts.map +1 -1
- package/dist/speculative/types.js +2 -0
- package/dist/speculative/types.js.map +1 -1
- package/dist/store/project-config.d.ts +19 -0
- package/dist/store/project-config.d.ts.map +1 -1
- package/dist/store/project-config.js.map +1 -1
- package/dist/telemetry/index.d.ts +10 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +11 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/telemetry-client.d.ts +127 -0
- package/dist/telemetry/telemetry-client.d.ts.map +1 -0
- package/dist/telemetry/telemetry-client.js +373 -0
- package/dist/telemetry/telemetry-client.js.map +1 -0
- package/dist/telemetry/types.d.ts +160 -0
- package/dist/telemetry/types.d.ts.map +1 -0
- package/dist/telemetry/types.js +27 -0
- package/dist/telemetry/types.js.map +1 -0
- package/dist/test-topology/extractors/cpp-test-extractor.d.ts +38 -0
- package/dist/test-topology/extractors/cpp-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/cpp-test-extractor.js +507 -0
- package/dist/test-topology/extractors/cpp-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/index.d.ts +2 -0
- package/dist/test-topology/extractors/index.d.ts.map +1 -1
- package/dist/test-topology/extractors/index.js +2 -0
- package/dist/test-topology/extractors/index.js.map +1 -1
- package/dist/test-topology/extractors/regex/index.d.ts +1 -0
- package/dist/test-topology/extractors/regex/index.d.ts.map +1 -1
- package/dist/test-topology/extractors/regex/index.js +4 -0
- package/dist/test-topology/extractors/regex/index.js.map +1 -1
- package/dist/test-topology/extractors/regex/rust-test-regex.d.ts +66 -0
- package/dist/test-topology/extractors/regex/rust-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/rust-test-regex.js +565 -0
- package/dist/test-topology/extractors/regex/rust-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/rust-test-extractor.d.ts +49 -0
- package/dist/test-topology/extractors/rust-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/rust-test-extractor.js +422 -0
- package/dist/test-topology/extractors/rust-test-extractor.js.map +1 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.d.ts.map +1 -1
- package/dist/test-topology/hybrid-test-topology-analyzer.js +2 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.js.map +1 -1
- package/dist/test-topology/test-topology-analyzer.d.ts.map +1 -1
- package/dist/test-topology/test-topology-analyzer.js +2 -0
- package/dist/test-topology/test-topology-analyzer.js.map +1 -1
- package/dist/test-topology/types.d.ts +2 -2
- package/dist/test-topology/types.d.ts.map +1 -1
- package/dist/unified-provider/integration/unified-scanner.d.ts.map +1 -1
- package/dist/unified-provider/integration/unified-scanner.js +3 -0
- package/dist/unified-provider/integration/unified-scanner.js.map +1 -1
- package/dist/unified-provider/matching/diesel-matcher.d.ts +33 -0
- package/dist/unified-provider/matching/diesel-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/diesel-matcher.js +210 -0
- package/dist/unified-provider/matching/diesel-matcher.js.map +1 -0
- package/dist/unified-provider/matching/index.d.ts +3 -1
- package/dist/unified-provider/matching/index.d.ts.map +1 -1
- package/dist/unified-provider/matching/index.js +4 -1
- package/dist/unified-provider/matching/index.js.map +1 -1
- package/dist/unified-provider/matching/matcher-registry.d.ts.map +1 -1
- package/dist/unified-provider/matching/matcher-registry.js +7 -2
- package/dist/unified-provider/matching/matcher-registry.js.map +1 -1
- package/dist/unified-provider/matching/seaorm-matcher.d.ts +35 -0
- package/dist/unified-provider/matching/seaorm-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/seaorm-matcher.js +200 -0
- package/dist/unified-provider/matching/seaorm-matcher.js.map +1 -0
- package/dist/unified-provider/matching/sqlx-matcher.d.ts +19 -24
- package/dist/unified-provider/matching/sqlx-matcher.d.ts.map +1 -1
- package/dist/unified-provider/matching/sqlx-matcher.js +171 -149
- package/dist/unified-provider/matching/sqlx-matcher.js.map +1 -1
- package/dist/unified-provider/normalization/cpp-normalizer.d.ts +62 -0
- package/dist/unified-provider/normalization/cpp-normalizer.d.ts.map +1 -0
- package/dist/unified-provider/normalization/cpp-normalizer.js +581 -0
- package/dist/unified-provider/normalization/cpp-normalizer.js.map +1 -0
- package/dist/unified-provider/normalization/index.d.ts +2 -0
- package/dist/unified-provider/normalization/index.d.ts.map +1 -1
- package/dist/unified-provider/normalization/index.js +11 -1
- package/dist/unified-provider/normalization/index.js.map +1 -1
- package/dist/unified-provider/normalization/rust-normalizer.d.ts +71 -0
- package/dist/unified-provider/normalization/rust-normalizer.d.ts.map +1 -0
- package/dist/unified-provider/normalization/rust-normalizer.js +670 -0
- package/dist/unified-provider/normalization/rust-normalizer.js.map +1 -0
- package/dist/unified-provider/parsing/parser-registry.d.ts.map +1 -1
- package/dist/unified-provider/parsing/parser-registry.js +62 -1
- package/dist/unified-provider/parsing/parser-registry.js.map +1 -1
- package/dist/unified-provider/provider/unified-language-provider.js +1 -1
- package/dist/unified-provider/provider/unified-language-provider.js.map +1 -1
- package/dist/unified-provider/types.d.ts +1 -1
- package/dist/unified-provider/types.d.ts.map +1 -1
- package/dist/wrappers/index.d.ts.map +1 -1
- package/dist/wrappers/index.js +2 -0
- package/dist/wrappers/index.js.map +1 -1
- package/dist/wrappers/integration/adapter.d.ts.map +1 -1
- package/dist/wrappers/integration/adapter.js +2 -0
- package/dist/wrappers/integration/adapter.js.map +1 -1
- package/dist/wrappers/integration/scanner.d.ts.map +1 -1
- package/dist/wrappers/integration/scanner.js +2 -0
- package/dist/wrappers/integration/scanner.js.map +1 -1
- package/dist/wrappers/primitives/registry.d.ts +18 -0
- package/dist/wrappers/primitives/registry.d.ts.map +1 -1
- package/dist/wrappers/primitives/registry.js +190 -0
- package/dist/wrappers/primitives/registry.js.map +1 -1
- package/dist/wrappers/types.d.ts +1 -1
- package/dist/wrappers/types.d.ts.map +1 -1
- package/package.json +5 -2
- package/LICENSE +0 -21
- package/dist/lake/lake.bak/index-store.d.ts +0 -82
- package/dist/lake/lake.bak/index-store.d.ts.map +0 -1
- package/dist/lake/lake.bak/index-store.js +0 -357
- package/dist/lake/lake.bak/index-store.js.map +0 -1
- package/dist/lake/lake.bak/index.d.ts +0 -81
- package/dist/lake/lake.bak/index.d.ts.map +0 -1
- package/dist/lake/lake.bak/index.js +0 -114
- package/dist/lake/lake.bak/index.js.map +0 -1
- package/dist/lake/lake.bak/manifest-store.d.ts +0 -51
- package/dist/lake/lake.bak/manifest-store.d.ts.map +0 -1
- package/dist/lake/lake.bak/manifest-store.js +0 -347
- package/dist/lake/lake.bak/manifest-store.js.map +0 -1
- package/dist/lake/lake.bak/query-engine.d.ts +0 -112
- package/dist/lake/lake.bak/query-engine.d.ts.map +0 -1
- package/dist/lake/lake.bak/query-engine.js +0 -370
- package/dist/lake/lake.bak/query-engine.js.map +0 -1
- package/dist/lake/lake.bak/types.d.ts +0 -428
- package/dist/lake/lake.bak/types.d.ts.map +0 -1
- package/dist/lake/lake.bak/types.js +0 -46
- package/dist/lake/lake.bak/types.js.map +0 -1
- package/dist/lake/lake.bak/view-materializer.d.ts +0 -70
- package/dist/lake/lake.bak/view-materializer.d.ts.map +0 -1
- package/dist/lake/lake.bak/view-materializer.js +0 -314
- package/dist/lake/lake.bak/view-materializer.js.map +0 -1
- package/dist/lake/lake.bak/view-store.d.ts +0 -57
- package/dist/lake/lake.bak/view-store.d.ts.map +0 -1
- package/dist/lake/lake.bak/view-store.js +0 -348
- package/dist/lake/lake.bak/view-store.js.map +0 -1
- package/dist/unified-provider/migration/deprecated-extractors.d.ts +0 -104
- package/dist/unified-provider/migration/deprecated-extractors.d.ts.map +0 -1
- package/dist/unified-provider/migration/deprecated-extractors.js +0 -129
- package/dist/unified-provider/migration/deprecated-extractors.js.map +0 -1
- package/dist/unified-provider/migration/deprecated-scanner.d.ts +0 -40
- package/dist/unified-provider/migration/deprecated-scanner.d.ts.map +0 -1
- package/dist/unified-provider/migration/deprecated-scanner.js +0 -49
- package/dist/unified-provider/migration/deprecated-scanner.js.map +0 -1
- package/dist/unified-provider/migration/index.d.ts +0 -41
- package/dist/unified-provider/migration/index.d.ts.map +0 -1
- package/dist/unified-provider/migration/index.js +0 -43
- package/dist/unified-provider/migration/index.js.map +0 -1
|
@@ -0,0 +1,672 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package Detector
|
|
3
|
+
*
|
|
4
|
+
* @license Apache-2.0
|
|
5
|
+
*
|
|
6
|
+
* Detects packages in monorepos across different package managers.
|
|
7
|
+
* Supports npm/pnpm/yarn workspaces, Python, Go, Java, C#, PHP, and Rust.
|
|
8
|
+
*/
|
|
9
|
+
import * as fs from 'node:fs/promises';
|
|
10
|
+
import * as path from 'node:path';
|
|
11
|
+
import { EventEmitter } from 'node:events';
|
|
12
|
+
// =============================================================================
|
|
13
|
+
// Constants
|
|
14
|
+
// =============================================================================
|
|
15
|
+
const LANGUAGE_MAP = {
|
|
16
|
+
npm: 'typescript',
|
|
17
|
+
pnpm: 'typescript',
|
|
18
|
+
yarn: 'typescript',
|
|
19
|
+
pip: 'python',
|
|
20
|
+
poetry: 'python',
|
|
21
|
+
cargo: 'rust',
|
|
22
|
+
go: 'go',
|
|
23
|
+
maven: 'java',
|
|
24
|
+
gradle: 'java',
|
|
25
|
+
composer: 'php',
|
|
26
|
+
nuget: 'csharp',
|
|
27
|
+
unknown: 'unknown',
|
|
28
|
+
};
|
|
29
|
+
// =============================================================================
|
|
30
|
+
// Package Detector
|
|
31
|
+
// =============================================================================
|
|
32
|
+
/**
|
|
33
|
+
* Detects packages in monorepos
|
|
34
|
+
*/
|
|
35
|
+
export class PackageDetector extends EventEmitter {
|
|
36
|
+
rootDir;
|
|
37
|
+
cache = null;
|
|
38
|
+
constructor(rootDir) {
|
|
39
|
+
super();
|
|
40
|
+
this.rootDir = rootDir;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Detect monorepo structure
|
|
44
|
+
*/
|
|
45
|
+
async detect() {
|
|
46
|
+
if (this.cache) {
|
|
47
|
+
return this.cache;
|
|
48
|
+
}
|
|
49
|
+
const structure = {
|
|
50
|
+
rootDir: this.rootDir,
|
|
51
|
+
isMonorepo: false,
|
|
52
|
+
packages: [],
|
|
53
|
+
packageManager: 'unknown',
|
|
54
|
+
};
|
|
55
|
+
const detectors = [
|
|
56
|
+
this.detectNpmWorkspaces.bind(this),
|
|
57
|
+
this.detectPnpmWorkspaces.bind(this),
|
|
58
|
+
this.detectYarnWorkspaces.bind(this),
|
|
59
|
+
this.detectPythonPackages.bind(this),
|
|
60
|
+
this.detectGoModules.bind(this),
|
|
61
|
+
this.detectMavenModules.bind(this),
|
|
62
|
+
this.detectGradleModules.bind(this),
|
|
63
|
+
this.detectComposerPackages.bind(this),
|
|
64
|
+
this.detectDotNetProjects.bind(this),
|
|
65
|
+
this.detectCargoWorkspaces.bind(this),
|
|
66
|
+
];
|
|
67
|
+
for (const detector of detectors) {
|
|
68
|
+
try {
|
|
69
|
+
const result = await detector();
|
|
70
|
+
if (result.packages && result.packages.length > 0) {
|
|
71
|
+
structure.packages.push(...result.packages);
|
|
72
|
+
if (result.packageManager) {
|
|
73
|
+
structure.packageManager = result.packageManager;
|
|
74
|
+
}
|
|
75
|
+
if (result.workspaceConfig) {
|
|
76
|
+
structure.workspaceConfig = result.workspaceConfig;
|
|
77
|
+
}
|
|
78
|
+
structure.isMonorepo = result.packages.length > 1;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
// Continue to next detector
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (structure.packages.length === 0) {
|
|
87
|
+
const rootPackage = await this.detectRootPackage();
|
|
88
|
+
if (rootPackage) {
|
|
89
|
+
structure.packages.push(rootPackage);
|
|
90
|
+
structure.packageManager = rootPackage.packageManager;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
this.cache = structure;
|
|
94
|
+
this.emitEvent('monorepo:detected', undefined, {
|
|
95
|
+
isMonorepo: structure.isMonorepo,
|
|
96
|
+
packageCount: structure.packages.length,
|
|
97
|
+
packageManager: structure.packageManager,
|
|
98
|
+
});
|
|
99
|
+
return structure;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get a specific package by name or path
|
|
103
|
+
*/
|
|
104
|
+
async getPackage(nameOrPath) {
|
|
105
|
+
const structure = await this.detect();
|
|
106
|
+
const byName = structure.packages.find(p => p.name === nameOrPath);
|
|
107
|
+
if (byName)
|
|
108
|
+
return byName;
|
|
109
|
+
const normalizedPath = nameOrPath.replace(/\\/g, '/');
|
|
110
|
+
const byPath = structure.packages.find(p => p.path === normalizedPath ||
|
|
111
|
+
p.path.endsWith(normalizedPath) ||
|
|
112
|
+
normalizedPath.endsWith(p.path));
|
|
113
|
+
if (byPath)
|
|
114
|
+
return byPath;
|
|
115
|
+
const byPartialName = structure.packages.find(p => p.name.includes(nameOrPath) || nameOrPath.includes(p.name));
|
|
116
|
+
return byPartialName || null;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Clear cache
|
|
120
|
+
*/
|
|
121
|
+
clearCache() {
|
|
122
|
+
this.cache = null;
|
|
123
|
+
}
|
|
124
|
+
// ===========================================================================
|
|
125
|
+
// NPM/PNPM/Yarn Detection
|
|
126
|
+
// ===========================================================================
|
|
127
|
+
async detectNpmWorkspaces() {
|
|
128
|
+
const pkgPath = path.join(this.rootDir, 'package.json');
|
|
129
|
+
const content = await fs.readFile(pkgPath, 'utf-8');
|
|
130
|
+
const pkg = JSON.parse(content);
|
|
131
|
+
const workspacesRaw = pkg['workspaces'];
|
|
132
|
+
if (!workspacesRaw) {
|
|
133
|
+
return { packages: [], packageManager: 'npm' };
|
|
134
|
+
}
|
|
135
|
+
const workspaces = Array.isArray(workspacesRaw)
|
|
136
|
+
? workspacesRaw
|
|
137
|
+
: (workspacesRaw['packages'] || []);
|
|
138
|
+
const packages = await this.resolveWorkspaceGlobs(workspaces, 'npm');
|
|
139
|
+
return {
|
|
140
|
+
packages,
|
|
141
|
+
packageManager: 'npm',
|
|
142
|
+
workspaceConfig: 'package.json',
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
async detectPnpmWorkspaces() {
|
|
146
|
+
const workspacePath = path.join(this.rootDir, 'pnpm-workspace.yaml');
|
|
147
|
+
try {
|
|
148
|
+
const content = await fs.readFile(workspacePath, 'utf-8');
|
|
149
|
+
const packagesMatch = content.match(/packages:\s*\n((?:\s+-\s+.+\n?)+)/);
|
|
150
|
+
if (!packagesMatch?.[1]) {
|
|
151
|
+
return { packages: [], packageManager: 'pnpm' };
|
|
152
|
+
}
|
|
153
|
+
const workspaces = packagesMatch[1]
|
|
154
|
+
.split('\n')
|
|
155
|
+
.map(line => line.replace(/^\s*-\s*['"]?/, '').replace(/['"]?\s*$/, ''))
|
|
156
|
+
.filter(line => line.length > 0);
|
|
157
|
+
const packages = await this.resolveWorkspaceGlobs(workspaces, 'pnpm');
|
|
158
|
+
return {
|
|
159
|
+
packages,
|
|
160
|
+
packageManager: 'pnpm',
|
|
161
|
+
workspaceConfig: 'pnpm-workspace.yaml',
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
return { packages: [], packageManager: 'pnpm' };
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
async detectYarnWorkspaces() {
|
|
169
|
+
const result = await this.detectNpmWorkspaces();
|
|
170
|
+
if (result.packages && result.packages.length > 0) {
|
|
171
|
+
try {
|
|
172
|
+
await fs.access(path.join(this.rootDir, 'yarn.lock'));
|
|
173
|
+
return { ...result, packageManager: 'yarn' };
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
// Not yarn
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return { packages: [], packageManager: 'yarn' };
|
|
180
|
+
}
|
|
181
|
+
async resolveWorkspaceGlobs(globs, packageManager) {
|
|
182
|
+
const packages = [];
|
|
183
|
+
for (const glob of globs) {
|
|
184
|
+
const basePath = glob.replace(/\/?\*.*$/, '');
|
|
185
|
+
const fullBasePath = path.join(this.rootDir, basePath);
|
|
186
|
+
try {
|
|
187
|
+
const entries = await fs.readdir(fullBasePath, { withFileTypes: true });
|
|
188
|
+
for (const entry of entries) {
|
|
189
|
+
if (!entry.isDirectory())
|
|
190
|
+
continue;
|
|
191
|
+
const pkgDir = path.join(fullBasePath, entry.name);
|
|
192
|
+
const pkgJsonPath = path.join(pkgDir, 'package.json');
|
|
193
|
+
try {
|
|
194
|
+
const pkgContent = await fs.readFile(pkgJsonPath, 'utf-8');
|
|
195
|
+
const pkg = JSON.parse(pkgContent);
|
|
196
|
+
const relativePath = path.relative(this.rootDir, pkgDir).replace(/\\/g, '/');
|
|
197
|
+
const pkgName = pkg['name'] || entry.name;
|
|
198
|
+
const pkgVersion = pkg['version'];
|
|
199
|
+
const pkgDescription = pkg['description'];
|
|
200
|
+
const detectedPkg = {
|
|
201
|
+
name: pkgName,
|
|
202
|
+
path: relativePath,
|
|
203
|
+
absolutePath: pkgDir,
|
|
204
|
+
packageManager,
|
|
205
|
+
language: this.detectLanguageFromPackage(pkg),
|
|
206
|
+
internalDependencies: this.extractInternalDeps(pkg, packages),
|
|
207
|
+
externalDependencies: this.extractExternalDeps(pkg),
|
|
208
|
+
isRoot: false,
|
|
209
|
+
};
|
|
210
|
+
if (pkgVersion)
|
|
211
|
+
detectedPkg.version = pkgVersion;
|
|
212
|
+
if (pkgDescription)
|
|
213
|
+
detectedPkg.description = pkgDescription;
|
|
214
|
+
packages.push(detectedPkg);
|
|
215
|
+
this.emitEvent('package:detected', pkgName);
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
// Not a valid package
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
catch {
|
|
223
|
+
// Directory doesn't exist
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return packages;
|
|
227
|
+
}
|
|
228
|
+
detectLanguageFromPackage(pkg) {
|
|
229
|
+
const deps = {
|
|
230
|
+
...(pkg['dependencies'] || {}),
|
|
231
|
+
...(pkg['devDependencies'] || {}),
|
|
232
|
+
};
|
|
233
|
+
if (deps['typescript'] || deps['@types/node'])
|
|
234
|
+
return 'typescript';
|
|
235
|
+
if (deps['react'] || deps['vue'] || deps['@angular/core'])
|
|
236
|
+
return 'typescript';
|
|
237
|
+
return 'javascript';
|
|
238
|
+
}
|
|
239
|
+
extractInternalDeps(pkg, knownPackages) {
|
|
240
|
+
const deps = {
|
|
241
|
+
...(pkg['dependencies'] || {}),
|
|
242
|
+
...(pkg['devDependencies'] || {}),
|
|
243
|
+
};
|
|
244
|
+
const knownNames = new Set(knownPackages.map(p => p.name));
|
|
245
|
+
return Object.keys(deps).filter(dep => knownNames.has(dep));
|
|
246
|
+
}
|
|
247
|
+
extractExternalDeps(pkg) {
|
|
248
|
+
const deps = pkg['dependencies'] || {};
|
|
249
|
+
return Object.keys(deps).slice(0, 20);
|
|
250
|
+
}
|
|
251
|
+
// ===========================================================================
|
|
252
|
+
// Python Detection
|
|
253
|
+
// ===========================================================================
|
|
254
|
+
async detectPythonPackages() {
|
|
255
|
+
const packages = [];
|
|
256
|
+
try {
|
|
257
|
+
const pyprojectPath = path.join(this.rootDir, 'pyproject.toml');
|
|
258
|
+
const content = await fs.readFile(pyprojectPath, 'utf-8');
|
|
259
|
+
if (content.includes('[tool.poetry]')) {
|
|
260
|
+
const nameMatch = content.match(/name\s*=\s*["']([^"']+)["']/);
|
|
261
|
+
const versionMatch = content.match(/version\s*=\s*["']([^"']+)["']/);
|
|
262
|
+
const detectedPkg = {
|
|
263
|
+
name: nameMatch?.[1] || path.basename(this.rootDir),
|
|
264
|
+
path: '.',
|
|
265
|
+
absolutePath: this.rootDir,
|
|
266
|
+
packageManager: 'poetry',
|
|
267
|
+
language: 'python',
|
|
268
|
+
internalDependencies: [],
|
|
269
|
+
externalDependencies: this.extractPythonDeps(content),
|
|
270
|
+
isRoot: true,
|
|
271
|
+
};
|
|
272
|
+
if (versionMatch?.[1])
|
|
273
|
+
detectedPkg.version = versionMatch[1];
|
|
274
|
+
packages.push(detectedPkg);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
catch {
|
|
278
|
+
// No pyproject.toml
|
|
279
|
+
}
|
|
280
|
+
try {
|
|
281
|
+
const srcPath = path.join(this.rootDir, 'src');
|
|
282
|
+
const entries = await fs.readdir(srcPath, { withFileTypes: true });
|
|
283
|
+
for (const entry of entries) {
|
|
284
|
+
if (entry.isDirectory() && !entry.name.startsWith('_')) {
|
|
285
|
+
const initPath = path.join(srcPath, entry.name, '__init__.py');
|
|
286
|
+
try {
|
|
287
|
+
await fs.access(initPath);
|
|
288
|
+
packages.push({
|
|
289
|
+
name: entry.name,
|
|
290
|
+
path: `src/${entry.name}`,
|
|
291
|
+
absolutePath: path.join(srcPath, entry.name),
|
|
292
|
+
packageManager: 'pip',
|
|
293
|
+
language: 'python',
|
|
294
|
+
internalDependencies: [],
|
|
295
|
+
externalDependencies: [],
|
|
296
|
+
isRoot: false,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
catch {
|
|
300
|
+
// Not a Python package
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
catch {
|
|
306
|
+
// No src directory
|
|
307
|
+
}
|
|
308
|
+
const pm = packages.length > 0 ? packages[0].packageManager : 'pip';
|
|
309
|
+
return { packages, packageManager: pm };
|
|
310
|
+
}
|
|
311
|
+
extractPythonDeps(content) {
|
|
312
|
+
const deps = [];
|
|
313
|
+
const depsMatch = content.match(/\[tool\.poetry\.dependencies\]([\s\S]*?)(?:\[|$)/);
|
|
314
|
+
if (depsMatch?.[1]) {
|
|
315
|
+
const lines = depsMatch[1].split('\n');
|
|
316
|
+
for (const line of lines) {
|
|
317
|
+
const match = line.match(/^(\w[\w-]*)\s*=/);
|
|
318
|
+
if (match?.[1] && match[1] !== 'python') {
|
|
319
|
+
deps.push(match[1]);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return deps.slice(0, 20);
|
|
324
|
+
}
|
|
325
|
+
// ===========================================================================
|
|
326
|
+
// Go Detection
|
|
327
|
+
// ===========================================================================
|
|
328
|
+
async detectGoModules() {
|
|
329
|
+
const packages = [];
|
|
330
|
+
try {
|
|
331
|
+
const goModPath = path.join(this.rootDir, 'go.mod');
|
|
332
|
+
const content = await fs.readFile(goModPath, 'utf-8');
|
|
333
|
+
const moduleMatch = content.match(/module\s+(\S+)/);
|
|
334
|
+
const moduleName = moduleMatch?.[1] || path.basename(this.rootDir);
|
|
335
|
+
packages.push({
|
|
336
|
+
name: moduleName,
|
|
337
|
+
path: '.',
|
|
338
|
+
absolutePath: this.rootDir,
|
|
339
|
+
packageManager: 'go',
|
|
340
|
+
language: 'go',
|
|
341
|
+
internalDependencies: [],
|
|
342
|
+
externalDependencies: this.extractGoDeps(content),
|
|
343
|
+
isRoot: true,
|
|
344
|
+
});
|
|
345
|
+
const internalDirs = ['internal', 'pkg', 'cmd'];
|
|
346
|
+
for (const dir of internalDirs) {
|
|
347
|
+
try {
|
|
348
|
+
const dirPath = path.join(this.rootDir, dir);
|
|
349
|
+
const entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
350
|
+
for (const entry of entries) {
|
|
351
|
+
if (entry.isDirectory()) {
|
|
352
|
+
packages.push({
|
|
353
|
+
name: `${moduleName}/${dir}/${entry.name}`,
|
|
354
|
+
path: `${dir}/${entry.name}`,
|
|
355
|
+
absolutePath: path.join(dirPath, entry.name),
|
|
356
|
+
packageManager: 'go',
|
|
357
|
+
language: 'go',
|
|
358
|
+
internalDependencies: [],
|
|
359
|
+
externalDependencies: [],
|
|
360
|
+
isRoot: false,
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
catch {
|
|
366
|
+
// Directory doesn't exist
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
catch {
|
|
371
|
+
// No go.mod
|
|
372
|
+
}
|
|
373
|
+
return { packages, packageManager: 'go' };
|
|
374
|
+
}
|
|
375
|
+
extractGoDeps(content) {
|
|
376
|
+
const deps = [];
|
|
377
|
+
const requireMatch = content.match(/require\s*\(([\s\S]*?)\)/);
|
|
378
|
+
if (requireMatch?.[1]) {
|
|
379
|
+
const lines = requireMatch[1].split('\n');
|
|
380
|
+
for (const line of lines) {
|
|
381
|
+
const match = line.match(/^\s*(\S+)\s+v/);
|
|
382
|
+
if (match?.[1]) {
|
|
383
|
+
deps.push(match[1]);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return deps.slice(0, 20);
|
|
388
|
+
}
|
|
389
|
+
// ===========================================================================
|
|
390
|
+
// Java Detection (Maven/Gradle)
|
|
391
|
+
// ===========================================================================
|
|
392
|
+
async detectMavenModules() {
|
|
393
|
+
const packages = [];
|
|
394
|
+
try {
|
|
395
|
+
const pomPath = path.join(this.rootDir, 'pom.xml');
|
|
396
|
+
const content = await fs.readFile(pomPath, 'utf-8');
|
|
397
|
+
const artifactMatch = content.match(/<artifactId>([^<]+)<\/artifactId>/);
|
|
398
|
+
const groupMatch = content.match(/<groupId>([^<]+)<\/groupId>/);
|
|
399
|
+
const versionMatch = content.match(/<version>([^<]+)<\/version>/);
|
|
400
|
+
const detectedPkg = {
|
|
401
|
+
name: `${groupMatch?.[1] || 'unknown'}:${artifactMatch?.[1] || 'unknown'}`,
|
|
402
|
+
path: '.',
|
|
403
|
+
absolutePath: this.rootDir,
|
|
404
|
+
packageManager: 'maven',
|
|
405
|
+
language: 'java',
|
|
406
|
+
internalDependencies: [],
|
|
407
|
+
externalDependencies: [],
|
|
408
|
+
isRoot: true,
|
|
409
|
+
};
|
|
410
|
+
if (versionMatch?.[1])
|
|
411
|
+
detectedPkg.version = versionMatch[1];
|
|
412
|
+
packages.push(detectedPkg);
|
|
413
|
+
const modulesMatch = content.match(/<modules>([\s\S]*?)<\/modules>/);
|
|
414
|
+
if (modulesMatch?.[1]) {
|
|
415
|
+
const moduleMatches = modulesMatch[1].matchAll(/<module>([^<]+)<\/module>/g);
|
|
416
|
+
for (const match of moduleMatches) {
|
|
417
|
+
if (match[1]) {
|
|
418
|
+
packages.push({
|
|
419
|
+
name: match[1],
|
|
420
|
+
path: match[1],
|
|
421
|
+
absolutePath: path.join(this.rootDir, match[1]),
|
|
422
|
+
packageManager: 'maven',
|
|
423
|
+
language: 'java',
|
|
424
|
+
internalDependencies: [],
|
|
425
|
+
externalDependencies: [],
|
|
426
|
+
isRoot: false,
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
catch {
|
|
433
|
+
// No pom.xml
|
|
434
|
+
}
|
|
435
|
+
return { packages, packageManager: 'maven' };
|
|
436
|
+
}
|
|
437
|
+
async detectGradleModules() {
|
|
438
|
+
const packages = [];
|
|
439
|
+
try {
|
|
440
|
+
const settingsPath = path.join(this.rootDir, 'settings.gradle');
|
|
441
|
+
let content;
|
|
442
|
+
try {
|
|
443
|
+
content = await fs.readFile(settingsPath, 'utf-8');
|
|
444
|
+
}
|
|
445
|
+
catch {
|
|
446
|
+
content = await fs.readFile(path.join(this.rootDir, 'settings.gradle.kts'), 'utf-8');
|
|
447
|
+
}
|
|
448
|
+
const rootNameMatch = content.match(/rootProject\.name\s*=\s*['"]([^'"]+)['"]/);
|
|
449
|
+
packages.push({
|
|
450
|
+
name: rootNameMatch?.[1] || path.basename(this.rootDir),
|
|
451
|
+
path: '.',
|
|
452
|
+
absolutePath: this.rootDir,
|
|
453
|
+
packageManager: 'gradle',
|
|
454
|
+
language: 'java',
|
|
455
|
+
internalDependencies: [],
|
|
456
|
+
externalDependencies: [],
|
|
457
|
+
isRoot: true,
|
|
458
|
+
});
|
|
459
|
+
const includeMatches = content.matchAll(/include\s*\(?['"]([^'"]+)['"]\)?/g);
|
|
460
|
+
for (const match of includeMatches) {
|
|
461
|
+
if (match[1]) {
|
|
462
|
+
const modulePath = match[1].replace(/:/g, '/');
|
|
463
|
+
packages.push({
|
|
464
|
+
name: match[1],
|
|
465
|
+
path: modulePath,
|
|
466
|
+
absolutePath: path.join(this.rootDir, modulePath),
|
|
467
|
+
packageManager: 'gradle',
|
|
468
|
+
language: 'java',
|
|
469
|
+
internalDependencies: [],
|
|
470
|
+
externalDependencies: [],
|
|
471
|
+
isRoot: false,
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
catch {
|
|
477
|
+
// No settings.gradle
|
|
478
|
+
}
|
|
479
|
+
return { packages, packageManager: 'gradle' };
|
|
480
|
+
}
|
|
481
|
+
// ===========================================================================
|
|
482
|
+
// PHP Detection
|
|
483
|
+
// ===========================================================================
|
|
484
|
+
async detectComposerPackages() {
|
|
485
|
+
const packages = [];
|
|
486
|
+
try {
|
|
487
|
+
const composerPath = path.join(this.rootDir, 'composer.json');
|
|
488
|
+
const content = await fs.readFile(composerPath, 'utf-8');
|
|
489
|
+
const composer = JSON.parse(content);
|
|
490
|
+
const detectedPkg = {
|
|
491
|
+
name: composer['name'] || path.basename(this.rootDir),
|
|
492
|
+
path: '.',
|
|
493
|
+
absolutePath: this.rootDir,
|
|
494
|
+
packageManager: 'composer',
|
|
495
|
+
language: 'php',
|
|
496
|
+
internalDependencies: [],
|
|
497
|
+
externalDependencies: Object.keys(composer['require'] || {}).slice(0, 20),
|
|
498
|
+
isRoot: true,
|
|
499
|
+
};
|
|
500
|
+
const version = composer['version'];
|
|
501
|
+
const description = composer['description'];
|
|
502
|
+
if (version)
|
|
503
|
+
detectedPkg.version = version;
|
|
504
|
+
if (description)
|
|
505
|
+
detectedPkg.description = description;
|
|
506
|
+
packages.push(detectedPkg);
|
|
507
|
+
}
|
|
508
|
+
catch {
|
|
509
|
+
// No composer.json
|
|
510
|
+
}
|
|
511
|
+
return { packages, packageManager: 'composer' };
|
|
512
|
+
}
|
|
513
|
+
// ===========================================================================
|
|
514
|
+
// .NET Detection
|
|
515
|
+
// ===========================================================================
|
|
516
|
+
async detectDotNetProjects() {
|
|
517
|
+
const packages = [];
|
|
518
|
+
try {
|
|
519
|
+
const entries = await fs.readdir(this.rootDir);
|
|
520
|
+
const slnFile = entries.find(e => e.endsWith('.sln'));
|
|
521
|
+
if (slnFile) {
|
|
522
|
+
const slnPath = path.join(this.rootDir, slnFile);
|
|
523
|
+
const content = await fs.readFile(slnPath, 'utf-8');
|
|
524
|
+
const projectMatches = content.matchAll(/Project\([^)]+\)\s*=\s*"([^"]+)",\s*"([^"]+)"/g);
|
|
525
|
+
for (const match of projectMatches) {
|
|
526
|
+
const projectName = match[1];
|
|
527
|
+
const projectPath = match[2]?.replace(/\\/g, '/');
|
|
528
|
+
if (projectName && projectPath?.endsWith('.csproj')) {
|
|
529
|
+
packages.push({
|
|
530
|
+
name: projectName,
|
|
531
|
+
path: path.dirname(projectPath),
|
|
532
|
+
absolutePath: path.join(this.rootDir, path.dirname(projectPath)),
|
|
533
|
+
packageManager: 'nuget',
|
|
534
|
+
language: 'csharp',
|
|
535
|
+
internalDependencies: [],
|
|
536
|
+
externalDependencies: [],
|
|
537
|
+
isRoot: packages.length === 0,
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
catch {
|
|
544
|
+
// No .sln file
|
|
545
|
+
}
|
|
546
|
+
return { packages, packageManager: 'nuget' };
|
|
547
|
+
}
|
|
548
|
+
// ===========================================================================
|
|
549
|
+
// Rust Detection
|
|
550
|
+
// ===========================================================================
|
|
551
|
+
async detectCargoWorkspaces() {
|
|
552
|
+
const packages = [];
|
|
553
|
+
try {
|
|
554
|
+
const cargoPath = path.join(this.rootDir, 'Cargo.toml');
|
|
555
|
+
const content = await fs.readFile(cargoPath, 'utf-8');
|
|
556
|
+
const nameMatch = content.match(/name\s*=\s*"([^"]+)"/);
|
|
557
|
+
const versionMatch = content.match(/version\s*=\s*"([^"]+)"/);
|
|
558
|
+
const detectedPkg = {
|
|
559
|
+
name: nameMatch?.[1] || path.basename(this.rootDir),
|
|
560
|
+
path: '.',
|
|
561
|
+
absolutePath: this.rootDir,
|
|
562
|
+
packageManager: 'cargo',
|
|
563
|
+
language: 'rust',
|
|
564
|
+
internalDependencies: [],
|
|
565
|
+
externalDependencies: [],
|
|
566
|
+
isRoot: true,
|
|
567
|
+
};
|
|
568
|
+
if (versionMatch?.[1])
|
|
569
|
+
detectedPkg.version = versionMatch[1];
|
|
570
|
+
packages.push(detectedPkg);
|
|
571
|
+
const workspaceMatch = content.match(/\[workspace\]([\s\S]*?)(?:\[|$)/);
|
|
572
|
+
if (workspaceMatch?.[1]) {
|
|
573
|
+
const membersMatch = workspaceMatch[1].match(/members\s*=\s*\[([\s\S]*?)\]/);
|
|
574
|
+
if (membersMatch?.[1]) {
|
|
575
|
+
const members = membersMatch[1].match(/"([^"]+)"/g) || [];
|
|
576
|
+
for (const member of members) {
|
|
577
|
+
const memberPath = member.replace(/"/g, '');
|
|
578
|
+
packages.push({
|
|
579
|
+
name: memberPath,
|
|
580
|
+
path: memberPath,
|
|
581
|
+
absolutePath: path.join(this.rootDir, memberPath),
|
|
582
|
+
packageManager: 'cargo',
|
|
583
|
+
language: 'rust',
|
|
584
|
+
internalDependencies: [],
|
|
585
|
+
externalDependencies: [],
|
|
586
|
+
isRoot: false,
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
catch {
|
|
593
|
+
// No Cargo.toml
|
|
594
|
+
}
|
|
595
|
+
return { packages, packageManager: 'cargo' };
|
|
596
|
+
}
|
|
597
|
+
// ===========================================================================
|
|
598
|
+
// Root Package Detection
|
|
599
|
+
// ===========================================================================
|
|
600
|
+
async detectRootPackage() {
|
|
601
|
+
const manifests = [
|
|
602
|
+
{ file: 'package.json', pm: 'npm' },
|
|
603
|
+
{ file: 'pyproject.toml', pm: 'poetry' },
|
|
604
|
+
{ file: 'setup.py', pm: 'pip' },
|
|
605
|
+
{ file: 'Cargo.toml', pm: 'cargo' },
|
|
606
|
+
{ file: 'go.mod', pm: 'go' },
|
|
607
|
+
{ file: 'pom.xml', pm: 'maven' },
|
|
608
|
+
{ file: 'build.gradle', pm: 'gradle' },
|
|
609
|
+
{ file: 'composer.json', pm: 'composer' },
|
|
610
|
+
];
|
|
611
|
+
for (const { file, pm } of manifests) {
|
|
612
|
+
try {
|
|
613
|
+
const manifestPath = path.join(this.rootDir, file);
|
|
614
|
+
await fs.access(manifestPath);
|
|
615
|
+
const content = await fs.readFile(manifestPath, 'utf-8');
|
|
616
|
+
let name = path.basename(this.rootDir);
|
|
617
|
+
let version;
|
|
618
|
+
let description;
|
|
619
|
+
if (file === 'package.json') {
|
|
620
|
+
const pkg = JSON.parse(content);
|
|
621
|
+
name = pkg['name'] || name;
|
|
622
|
+
version = pkg['version'];
|
|
623
|
+
description = pkg['description'];
|
|
624
|
+
}
|
|
625
|
+
const detectedPkg = {
|
|
626
|
+
name,
|
|
627
|
+
path: '.',
|
|
628
|
+
absolutePath: this.rootDir,
|
|
629
|
+
packageManager: pm,
|
|
630
|
+
language: LANGUAGE_MAP[pm],
|
|
631
|
+
internalDependencies: [],
|
|
632
|
+
externalDependencies: [],
|
|
633
|
+
isRoot: true,
|
|
634
|
+
};
|
|
635
|
+
if (version)
|
|
636
|
+
detectedPkg.version = version;
|
|
637
|
+
if (description)
|
|
638
|
+
detectedPkg.description = description;
|
|
639
|
+
return detectedPkg;
|
|
640
|
+
}
|
|
641
|
+
catch {
|
|
642
|
+
// Manifest doesn't exist
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
return null;
|
|
646
|
+
}
|
|
647
|
+
// ===========================================================================
|
|
648
|
+
// Events
|
|
649
|
+
// ===========================================================================
|
|
650
|
+
emitEvent(type, packageName, details) {
|
|
651
|
+
const event = {
|
|
652
|
+
type,
|
|
653
|
+
timestamp: new Date().toISOString(),
|
|
654
|
+
};
|
|
655
|
+
if (packageName)
|
|
656
|
+
event.packageName = packageName;
|
|
657
|
+
if (details)
|
|
658
|
+
event.details = details;
|
|
659
|
+
this.emit(type, event);
|
|
660
|
+
this.emit('*', event);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
// =============================================================================
|
|
664
|
+
// Factory Function
|
|
665
|
+
// =============================================================================
|
|
666
|
+
/**
|
|
667
|
+
* Create a package detector
|
|
668
|
+
*/
|
|
669
|
+
export function createPackageDetector(rootDir) {
|
|
670
|
+
return new PackageDetector(rootDir);
|
|
671
|
+
}
|
|
672
|
+
//# sourceMappingURL=package-detector.js.map
|