kirograph 0.19.0 → 0.20.0
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/README.md +10 -8
- package/dist/architecture/layers/dart.d.ts +10 -0
- package/dist/architecture/layers/dart.d.ts.map +1 -0
- package/dist/architecture/layers/elixir.d.ts +6 -0
- package/dist/architecture/layers/elixir.d.ts.map +1 -0
- package/dist/architecture/layers/index.d.ts.map +1 -1
- package/dist/architecture/layers/ocaml.d.ts +6 -0
- package/dist/architecture/layers/ocaml.d.ts.map +1 -0
- package/dist/architecture/layers/scala.d.ts +6 -0
- package/dist/architecture/layers/scala.d.ts.map +1 -0
- package/dist/architecture/layers/solidity.d.ts +6 -0
- package/dist/architecture/layers/solidity.d.ts.map +1 -0
- package/dist/architecture/layers/vue.d.ts +6 -0
- package/dist/architecture/layers/vue.d.ts.map +1 -0
- package/dist/architecture/manifest/elm.d.ts +3 -0
- package/dist/architecture/manifest/elm.d.ts.map +1 -0
- package/dist/architecture/manifest/index.d.ts.map +1 -1
- package/dist/architecture/manifest/ocaml.d.ts +3 -0
- package/dist/architecture/manifest/ocaml.d.ts.map +1 -0
- package/dist/architecture/manifest/scala.d.ts +3 -0
- package/dist/architecture/manifest/scala.d.ts.map +1 -0
- package/dist/bin/banner.d.ts.map +1 -1
- package/dist/bin/commands/affected.d.ts.map +1 -1
- package/dist/bin/commands/attack-surface.d.ts +3 -0
- package/dist/bin/commands/attack-surface.d.ts.map +1 -0
- package/dist/bin/commands/attack-surface.js +7 -0
- package/dist/bin/commands/attack-surface.js.map +2 -2
- package/dist/bin/commands/benchmark.d.ts +9 -0
- package/dist/bin/commands/benchmark.d.ts.map +1 -0
- package/dist/bin/commands/budget.d.ts +6 -0
- package/dist/bin/commands/budget.d.ts.map +1 -0
- package/dist/bin/commands/caveman.d.ts +7 -0
- package/dist/bin/commands/caveman.d.ts.map +1 -0
- package/dist/bin/commands/communities.d.ts +3 -0
- package/dist/bin/commands/communities.d.ts.map +1 -0
- package/dist/bin/commands/compression.d.ts +7 -0
- package/dist/bin/commands/compression.d.ts.map +1 -0
- package/dist/bin/commands/context.d.ts.map +1 -1
- package/dist/bin/commands/data.d.ts +3 -0
- package/dist/bin/commands/data.d.ts.map +1 -0
- package/dist/bin/commands/dead-code.d.ts +3 -0
- package/dist/bin/commands/dead-code.d.ts.map +1 -0
- package/dist/bin/commands/dep-confusion.d.ts +3 -0
- package/dist/bin/commands/dep-confusion.d.ts.map +1 -0
- package/dist/bin/commands/docs.d.ts +3 -0
- package/dist/bin/commands/docs.d.ts.map +1 -0
- package/dist/bin/commands/exec.d.ts +11 -0
- package/dist/bin/commands/exec.d.ts.map +1 -0
- package/dist/bin/commands/export.d.ts +3 -0
- package/dist/bin/commands/export.d.ts.map +1 -0
- package/dist/bin/commands/flows.d.ts +3 -0
- package/dist/bin/commands/flows.d.ts.map +1 -0
- package/dist/bin/commands/gain.d.ts +6 -0
- package/dist/bin/commands/gain.d.ts.map +1 -0
- package/dist/bin/commands/help.d.ts +7 -0
- package/dist/bin/commands/help.d.ts.map +1 -1
- package/dist/bin/commands/help.js +20 -3
- package/dist/bin/commands/help.js.map +2 -2
- package/dist/bin/commands/hotspots.d.ts +3 -0
- package/dist/bin/commands/hotspots.d.ts.map +1 -0
- package/dist/bin/commands/hotspots.js +94 -1
- package/dist/bin/commands/hotspots.js.map +3 -3
- package/dist/bin/commands/install.d.ts.map +1 -1
- package/dist/bin/commands/install.js +3 -3
- package/dist/bin/commands/install.js.map +2 -2
- package/dist/bin/commands/licenses.d.ts +3 -0
- package/dist/bin/commands/licenses.d.ts.map +1 -0
- package/dist/bin/commands/memory.d.ts +16 -0
- package/dist/bin/commands/memory.d.ts.map +1 -0
- package/dist/bin/commands/memory.js +151 -4
- package/dist/bin/commands/memory.js.map +2 -2
- package/dist/bin/commands/path.d.ts +3 -0
- package/dist/bin/commands/path.d.ts.map +1 -0
- package/dist/bin/commands/pattern.d.ts +3 -0
- package/dist/bin/commands/pattern.d.ts.map +1 -0
- package/dist/bin/commands/pattern.js +592 -0
- package/dist/bin/commands/pattern.js.map +7 -0
- package/dist/bin/commands/query.d.ts.map +1 -1
- package/dist/bin/commands/reachability.d.ts +3 -0
- package/dist/bin/commands/reachability.d.ts.map +1 -0
- package/dist/bin/commands/read.d.ts +6 -0
- package/dist/bin/commands/read.d.ts.map +1 -0
- package/dist/bin/commands/refactor.d.ts +3 -0
- package/dist/bin/commands/refactor.d.ts.map +1 -0
- package/dist/bin/commands/remediation.d.ts +3 -0
- package/dist/bin/commands/remediation.d.ts.map +1 -0
- package/dist/bin/commands/sbom.d.ts +3 -0
- package/dist/bin/commands/sbom.d.ts.map +1 -0
- package/dist/bin/commands/security-ci-report.d.ts +9 -0
- package/dist/bin/commands/security-ci-report.d.ts.map +1 -0
- package/dist/bin/commands/security-export.d.ts +2 -0
- package/dist/bin/commands/security-export.d.ts.map +1 -0
- package/dist/bin/commands/security-flows.d.ts +3 -0
- package/dist/bin/commands/security-flows.d.ts.map +1 -0
- package/dist/bin/commands/security-secrets.d.ts +3 -0
- package/dist/bin/commands/security-secrets.d.ts.map +1 -0
- package/dist/bin/commands/security.d.ts +3 -0
- package/dist/bin/commands/security.d.ts.map +1 -0
- package/dist/bin/commands/security.js +15 -0
- package/dist/bin/commands/security.js.map +2 -2
- package/dist/bin/commands/snapshot.d.ts +3 -0
- package/dist/bin/commands/snapshot.d.ts.map +1 -0
- package/dist/bin/commands/staleness.d.ts +3 -0
- package/dist/bin/commands/staleness.d.ts.map +1 -0
- package/dist/bin/commands/status.d.ts.map +1 -1
- package/dist/bin/commands/status.js +27 -0
- package/dist/bin/commands/status.js.map +2 -2
- package/dist/bin/commands/supply-chain.d.ts +3 -0
- package/dist/bin/commands/supply-chain.d.ts.map +1 -0
- package/dist/bin/commands/surprising.d.ts +3 -0
- package/dist/bin/commands/surprising.d.ts.map +1 -0
- package/dist/bin/commands/sync.d.ts.map +1 -1
- package/dist/bin/commands/uninit.d.ts.map +1 -1
- package/dist/bin/commands/utils.d.ts +5 -0
- package/dist/bin/commands/utils.d.ts.map +1 -1
- package/dist/bin/commands/vex.d.ts +3 -0
- package/dist/bin/commands/vex.d.ts.map +1 -0
- package/dist/bin/commands/vuln-suppress.d.ts +3 -0
- package/dist/bin/commands/vuln-suppress.d.ts.map +1 -0
- package/dist/bin/commands/vulns.d.ts +3 -0
- package/dist/bin/commands/vulns.d.ts.map +1 -0
- package/dist/bin/installer/archive.d.ts +47 -0
- package/dist/bin/installer/archive.d.ts.map +1 -0
- package/dist/bin/installer/auto-detect.d.ts +16 -0
- package/dist/bin/installer/auto-detect.d.ts.map +1 -0
- package/dist/bin/installer/caveman.d.ts +12 -0
- package/dist/bin/installer/caveman.d.ts.map +1 -0
- package/dist/bin/installer/cli-agent.d.ts +7 -2
- package/dist/bin/installer/cli-agent.d.ts.map +1 -1
- package/dist/bin/installer/cli-agent.js +6 -2
- package/dist/bin/installer/cli-agent.js.map +2 -2
- package/dist/bin/installer/common.d.ts +36 -0
- package/dist/bin/installer/common.d.ts.map +1 -0
- package/dist/bin/installer/common.js +2 -1
- package/dist/bin/installer/common.js.map +2 -2
- package/dist/bin/installer/config-prompt.d.ts +1 -1
- package/dist/bin/installer/config-prompt.d.ts.map +1 -1
- package/dist/bin/installer/config-prompt.js +74 -2
- package/dist/bin/installer/config-prompt.js.map +2 -2
- package/dist/bin/installer/dashboard.d.ts.map +1 -1
- package/dist/bin/installer/detect.d.ts +30 -0
- package/dist/bin/installer/detect.d.ts.map +1 -0
- package/dist/bin/installer/hooks.d.ts +4 -1
- package/dist/bin/installer/hooks.d.ts.map +1 -1
- package/dist/bin/installer/hooks.js +34 -0
- package/dist/bin/installer/hooks.js.map +2 -2
- package/dist/bin/installer/index.d.ts +5 -4
- package/dist/bin/installer/index.d.ts.map +1 -1
- package/dist/bin/installer/index.js +38 -8
- package/dist/bin/installer/index.js.map +2 -2
- package/dist/bin/installer/instructions.d.ts +14 -0
- package/dist/bin/installer/instructions.d.ts.map +1 -0
- package/dist/bin/installer/instructions.js +15 -1
- package/dist/bin/installer/instructions.js.map +2 -2
- package/dist/bin/installer/mcp.d.ts.map +1 -1
- package/dist/bin/installer/prompts.d.ts +17 -0
- package/dist/bin/installer/prompts.d.ts.map +1 -1
- package/dist/bin/installer/qdrant-dashboard.d.ts.map +1 -1
- package/dist/bin/installer/steering.d.ts +14 -2
- package/dist/bin/installer/steering.d.ts.map +1 -1
- package/dist/bin/installer/steering.js +81 -0
- package/dist/bin/installer/steering.js.map +2 -2
- package/dist/bin/installer/targets/aider.d.ts +6 -0
- package/dist/bin/installer/targets/aider.d.ts.map +1 -0
- package/dist/bin/installer/targets/aider.js +3 -3
- package/dist/bin/installer/targets/aider.js.map +2 -2
- package/dist/bin/installer/targets/amp.d.ts +6 -0
- package/dist/bin/installer/targets/amp.d.ts.map +1 -0
- package/dist/bin/installer/targets/amp.js +3 -3
- package/dist/bin/installer/targets/amp.js.map +2 -2
- package/dist/bin/installer/targets/antigravity.d.ts +13 -0
- package/dist/bin/installer/targets/antigravity.d.ts.map +1 -0
- package/dist/bin/installer/targets/antigravity.js +2 -2
- package/dist/bin/installer/targets/antigravity.js.map +2 -2
- package/dist/bin/installer/targets/augment.d.ts +6 -0
- package/dist/bin/installer/targets/augment.d.ts.map +1 -0
- package/dist/bin/installer/targets/augment.js +3 -3
- package/dist/bin/installer/targets/augment.js.map +2 -2
- package/dist/bin/installer/targets/claude.d.ts +6 -0
- package/dist/bin/installer/targets/claude.d.ts.map +1 -0
- package/dist/bin/installer/targets/claude.js +2 -2
- package/dist/bin/installer/targets/claude.js.map +2 -2
- package/dist/bin/installer/targets/cline.d.ts +13 -0
- package/dist/bin/installer/targets/cline.d.ts.map +1 -0
- package/dist/bin/installer/targets/cline.js +2 -2
- package/dist/bin/installer/targets/cline.js.map +2 -2
- package/dist/bin/installer/targets/codex.d.ts +6 -0
- package/dist/bin/installer/targets/codex.d.ts.map +1 -0
- package/dist/bin/installer/targets/codex.js +2 -2
- package/dist/bin/installer/targets/codex.js.map +2 -2
- package/dist/bin/installer/targets/continue.d.ts +12 -0
- package/dist/bin/installer/targets/continue.d.ts.map +1 -0
- package/dist/bin/installer/targets/continue.js +2 -2
- package/dist/bin/installer/targets/continue.js.map +2 -2
- package/dist/bin/installer/targets/copilot-cli.d.ts +12 -0
- package/dist/bin/installer/targets/copilot-cli.d.ts.map +1 -0
- package/dist/bin/installer/targets/copilot-cli.js +2 -2
- package/dist/bin/installer/targets/copilot-cli.js.map +2 -2
- package/dist/bin/installer/targets/copilot.d.ts +6 -0
- package/dist/bin/installer/targets/copilot.d.ts.map +1 -0
- package/dist/bin/installer/targets/copilot.js +2 -2
- package/dist/bin/installer/targets/copilot.js.map +2 -2
- package/dist/bin/installer/targets/cursor.d.ts +6 -0
- package/dist/bin/installer/targets/cursor.d.ts.map +1 -0
- package/dist/bin/installer/targets/cursor.js +2 -2
- package/dist/bin/installer/targets/cursor.js.map +2 -2
- package/dist/bin/installer/targets/devin.d.ts +13 -0
- package/dist/bin/installer/targets/devin.d.ts.map +1 -0
- package/dist/bin/installer/targets/devin.js +2 -2
- package/dist/bin/installer/targets/devin.js.map +2 -2
- package/dist/bin/installer/targets/gemini-cli.d.ts +16 -0
- package/dist/bin/installer/targets/gemini-cli.d.ts.map +1 -0
- package/dist/bin/installer/targets/gemini-cli.js +2 -2
- package/dist/bin/installer/targets/gemini-cli.js.map +2 -2
- package/dist/bin/installer/targets/generic.d.ts +59 -0
- package/dist/bin/installer/targets/generic.d.ts.map +1 -0
- package/dist/bin/installer/targets/generic.js +2 -2
- package/dist/bin/installer/targets/generic.js.map +2 -2
- package/dist/bin/installer/targets/goose.d.ts +6 -0
- package/dist/bin/installer/targets/goose.d.ts.map +1 -0
- package/dist/bin/installer/targets/goose.js +3 -3
- package/dist/bin/installer/targets/goose.js.map +2 -2
- package/dist/bin/installer/targets/index.d.ts +11 -0
- package/dist/bin/installer/targets/index.d.ts.map +1 -0
- package/dist/bin/installer/targets/index.js.map +1 -1
- package/dist/bin/installer/targets/junie.d.ts +13 -0
- package/dist/bin/installer/targets/junie.d.ts.map +1 -0
- package/dist/bin/installer/targets/junie.js +2 -2
- package/dist/bin/installer/targets/junie.js.map +2 -2
- package/dist/bin/installer/targets/kilo.d.ts +12 -0
- package/dist/bin/installer/targets/kilo.d.ts.map +1 -0
- package/dist/bin/installer/targets/kilo.js +2 -2
- package/dist/bin/installer/targets/kilo.js.map +2 -2
- package/dist/bin/installer/targets/kiro.d.ts +5 -0
- package/dist/bin/installer/targets/kiro.d.ts.map +1 -0
- package/dist/bin/installer/targets/kiro.js +4 -4
- package/dist/bin/installer/targets/kiro.js.map +2 -2
- package/dist/bin/installer/targets/opencode.d.ts +13 -0
- package/dist/bin/installer/targets/opencode.d.ts.map +1 -0
- package/dist/bin/installer/targets/opencode.js +2 -2
- package/dist/bin/installer/targets/opencode.js.map +2 -2
- package/dist/bin/installer/targets/openhands.d.ts +6 -0
- package/dist/bin/installer/targets/openhands.d.ts.map +1 -0
- package/dist/bin/installer/targets/openhands.js +3 -3
- package/dist/bin/installer/targets/openhands.js.map +2 -2
- package/dist/bin/installer/targets/qoder.d.ts +12 -0
- package/dist/bin/installer/targets/qoder.d.ts.map +1 -0
- package/dist/bin/installer/targets/qoder.js +2 -2
- package/dist/bin/installer/targets/qoder.js.map +2 -2
- package/dist/bin/installer/targets/qwen.d.ts +12 -0
- package/dist/bin/installer/targets/qwen.d.ts.map +1 -0
- package/dist/bin/installer/targets/qwen.js +2 -2
- package/dist/bin/installer/targets/qwen.js.map +2 -2
- package/dist/bin/installer/targets/replit.d.ts +6 -0
- package/dist/bin/installer/targets/replit.d.ts.map +1 -0
- package/dist/bin/installer/targets/replit.js +3 -3
- package/dist/bin/installer/targets/replit.js.map +2 -2
- package/dist/bin/installer/targets/roo.d.ts +13 -0
- package/dist/bin/installer/targets/roo.d.ts.map +1 -0
- package/dist/bin/installer/targets/roo.js +2 -2
- package/dist/bin/installer/targets/roo.js.map +2 -2
- package/dist/bin/installer/targets/tabnine.d.ts +6 -0
- package/dist/bin/installer/targets/tabnine.d.ts.map +1 -0
- package/dist/bin/installer/targets/tabnine.js +3 -3
- package/dist/bin/installer/targets/tabnine.js.map +2 -2
- package/dist/bin/installer/targets/trae.d.ts +6 -0
- package/dist/bin/installer/targets/trae.d.ts.map +1 -0
- package/dist/bin/installer/targets/trae.js +3 -3
- package/dist/bin/installer/targets/trae.js.map +2 -2
- package/dist/bin/installer/targets/warp.d.ts +12 -0
- package/dist/bin/installer/targets/warp.d.ts.map +1 -0
- package/dist/bin/installer/targets/warp.js +2 -2
- package/dist/bin/installer/targets/warp.js.map +2 -2
- package/dist/bin/installer/targets/windsurf.d.ts +13 -0
- package/dist/bin/installer/targets/windsurf.d.ts.map +1 -0
- package/dist/bin/installer/targets/windsurf.js +2 -2
- package/dist/bin/installer/targets/windsurf.js.map +2 -2
- package/dist/bin/kirograph.js +3 -1
- package/dist/bin/kirograph.js.map +3 -3
- package/dist/bin/progress.d.ts +16 -1
- package/dist/bin/progress.d.ts.map +1 -1
- package/dist/compression/filters/aws.d.ts +9 -0
- package/dist/compression/filters/aws.d.ts.map +1 -0
- package/dist/compression/filters/docker.d.ts +6 -0
- package/dist/compression/filters/docker.d.ts.map +1 -0
- package/dist/compression/filters/files.d.ts +6 -0
- package/dist/compression/filters/files.d.ts.map +1 -0
- package/dist/compression/filters/generic.d.ts +7 -0
- package/dist/compression/filters/generic.d.ts.map +1 -0
- package/dist/compression/filters/git.d.ts +6 -0
- package/dist/compression/filters/git.d.ts.map +1 -0
- package/dist/compression/filters/github.d.ts +6 -0
- package/dist/compression/filters/github.d.ts.map +1 -0
- package/dist/compression/filters/lint.d.ts +6 -0
- package/dist/compression/filters/lint.d.ts.map +1 -0
- package/dist/compression/filters/misc.d.ts +6 -0
- package/dist/compression/filters/misc.d.ts.map +1 -0
- package/dist/compression/filters/package.d.ts +6 -0
- package/dist/compression/filters/package.d.ts.map +1 -0
- package/dist/compression/filters/test.d.ts +6 -0
- package/dist/compression/filters/test.d.ts.map +1 -0
- package/dist/compression/index.d.ts +29 -0
- package/dist/compression/index.d.ts.map +1 -0
- package/dist/compression/naive-cost.d.ts +26 -0
- package/dist/compression/naive-cost.d.ts.map +1 -0
- package/dist/compression/tracker.d.ts +155 -0
- package/dist/compression/tracker.d.ts.map +1 -0
- package/dist/compression/types.d.ts +49 -0
- package/dist/compression/types.d.ts.map +1 -0
- package/dist/config.d.ts +90 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +55 -1
- package/dist/config.js.map +2 -2
- package/dist/core/lock-manager.d.ts +2 -0
- package/dist/core/lock-manager.d.ts.map +1 -1
- package/dist/core/pipeline.d.ts +4 -1
- package/dist/core/pipeline.d.ts.map +1 -1
- package/dist/core/pipeline.js +42 -0
- package/dist/core/pipeline.js.map +2 -2
- package/dist/core/snapshot.d.ts +58 -0
- package/dist/core/snapshot.d.ts.map +1 -0
- package/dist/data/filters.d.ts +23 -0
- package/dist/data/filters.d.ts.map +1 -0
- package/dist/data/indexer.d.ts +25 -0
- package/dist/data/indexer.d.ts.map +1 -0
- package/dist/data/linker.d.ts +37 -0
- package/dist/data/linker.d.ts.map +1 -0
- package/dist/data/lint.d.ts +27 -0
- package/dist/data/lint.d.ts.map +1 -0
- package/dist/data/parsers/csv.d.ts +11 -0
- package/dist/data/parsers/csv.d.ts.map +1 -0
- package/dist/data/parsers/excel.d.ts +10 -0
- package/dist/data/parsers/excel.d.ts.map +1 -0
- package/dist/data/parsers/index.d.ts +28 -0
- package/dist/data/parsers/index.d.ts.map +1 -0
- package/dist/data/parsers/json-array.d.ts +9 -0
- package/dist/data/parsers/json-array.d.ts.map +1 -0
- package/dist/data/parsers/jsonl.d.ts +9 -0
- package/dist/data/parsers/jsonl.d.ts.map +1 -0
- package/dist/data/parsers/parquet.d.ts +10 -0
- package/dist/data/parsers/parquet.d.ts.map +1 -0
- package/dist/data/profiler.d.ts +29 -0
- package/dist/data/profiler.d.ts.map +1 -0
- package/dist/data/queries.d.ts +95 -0
- package/dist/data/queries.d.ts.map +1 -0
- package/dist/data/types.d.ts +103 -0
- package/dist/data/types.d.ts.map +1 -0
- package/dist/db/database.d.ts +57 -0
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/database.js +19 -0
- package/dist/db/database.js.map +2 -2
- package/dist/db/patterns-schema.sql +23 -0
- package/dist/docs/formats/asciidoc.d.ts +9 -0
- package/dist/docs/formats/asciidoc.d.ts.map +1 -0
- package/dist/docs/formats/html.d.ts +10 -0
- package/dist/docs/formats/html.d.ts.map +1 -0
- package/dist/docs/formats/index.d.ts +31 -0
- package/dist/docs/formats/index.d.ts.map +1 -0
- package/dist/docs/formats/markdown.d.ts +11 -0
- package/dist/docs/formats/markdown.d.ts.map +1 -0
- package/dist/docs/formats/openapi.d.ts +17 -0
- package/dist/docs/formats/openapi.d.ts.map +1 -0
- package/dist/docs/formats/org.d.ts +9 -0
- package/dist/docs/formats/org.d.ts.map +1 -0
- package/dist/docs/formats/plaintext.d.ts +11 -0
- package/dist/docs/formats/plaintext.d.ts.map +1 -0
- package/dist/docs/formats/rdoc.d.ts +10 -0
- package/dist/docs/formats/rdoc.d.ts.map +1 -0
- package/dist/docs/formats/rst.d.ts +11 -0
- package/dist/docs/formats/rst.d.ts.map +1 -0
- package/dist/docs/indexer.d.ts +49 -0
- package/dist/docs/indexer.d.ts.map +1 -0
- package/dist/docs/linker.d.ts +30 -0
- package/dist/docs/linker.d.ts.map +1 -0
- package/dist/docs/lint.d.ts +27 -0
- package/dist/docs/lint.d.ts.map +1 -0
- package/dist/docs/queries.d.ts +78 -0
- package/dist/docs/queries.d.ts.map +1 -0
- package/dist/docs/section-id.d.ts +48 -0
- package/dist/docs/section-id.d.ts.map +1 -0
- package/dist/docs/summarizer.d.ts +13 -0
- package/dist/docs/summarizer.d.ts.map +1 -0
- package/dist/docs/types.d.ts +71 -0
- package/dist/docs/types.d.ts.map +1 -0
- package/dist/docs/vectors.d.ts +54 -0
- package/dist/docs/vectors.d.ts.map +1 -0
- package/dist/extraction/extractor.d.ts +1 -1
- package/dist/extraction/extractor.d.ts.map +1 -1
- package/dist/extraction/grammars.d.ts +6 -0
- package/dist/extraction/grammars.d.ts.map +1 -1
- package/dist/extraction/languages.d.ts.map +1 -1
- package/dist/extraction/notebook.d.ts +14 -0
- package/dist/extraction/notebook.d.ts.map +1 -0
- package/dist/frameworks/amplify.d.ts +9 -0
- package/dist/frameworks/amplify.d.ts.map +1 -0
- package/dist/frameworks/angular.d.ts +9 -0
- package/dist/frameworks/angular.d.ts.map +1 -0
- package/dist/frameworks/ansible.d.ts +8 -0
- package/dist/frameworks/ansible.d.ts.map +1 -0
- package/dist/frameworks/cloudformation.d.ts +9 -0
- package/dist/frameworks/cloudformation.d.ts.map +1 -0
- package/dist/frameworks/docker.d.ts +9 -0
- package/dist/frameworks/docker.d.ts.map +1 -0
- package/dist/frameworks/elixir.d.ts +6 -0
- package/dist/frameworks/elixir.d.ts.map +1 -0
- package/dist/frameworks/flutter.d.ts +12 -0
- package/dist/frameworks/flutter.d.ts.map +1 -0
- package/dist/frameworks/iac.d.ts +10 -0
- package/dist/frameworks/iac.d.ts.map +1 -0
- package/dist/frameworks/index.d.ts +14 -0
- package/dist/frameworks/index.d.ts.map +1 -1
- package/dist/frameworks/kubernetes.d.ts +9 -0
- package/dist/frameworks/kubernetes.d.ts.map +1 -0
- package/dist/frameworks/pulumi.d.ts +9 -0
- package/dist/frameworks/pulumi.d.ts.map +1 -0
- package/dist/frameworks/scala.d.ts +6 -0
- package/dist/frameworks/scala.d.ts.map +1 -0
- package/dist/frameworks/solidity.d.ts +6 -0
- package/dist/frameworks/solidity.d.ts.map +1 -0
- package/dist/frameworks/terraform.d.ts +14 -0
- package/dist/frameworks/terraform.d.ts.map +1 -0
- package/dist/frameworks/vue.d.ts +7 -0
- package/dist/frameworks/vue.d.ts.map +1 -0
- package/dist/graph/communities.d.ts +43 -0
- package/dist/graph/communities.d.ts.map +1 -0
- package/dist/graph/flows.d.ts +55 -0
- package/dist/graph/flows.d.ts.map +1 -0
- package/dist/graph/refactor.d.ts +43 -0
- package/dist/graph/refactor.d.ts.map +1 -0
- package/dist/index.d.ts +36 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/mcp/cache.d.ts +69 -0
- package/dist/mcp/cache.d.ts.map +1 -0
- package/dist/mcp/read-modes.d.ts +31 -0
- package/dist/mcp/read-modes.d.ts.map +1 -0
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +15 -2
- package/dist/mcp/server.js.map +2 -2
- package/dist/mcp/tool-names.d.ts +2 -0
- package/dist/mcp/tool-names.d.ts.map +1 -0
- package/dist/mcp/tool-names.js +4 -1
- package/dist/mcp/tool-names.js.map +2 -2
- package/dist/mcp/tools.d.ts +12 -0
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +397 -0
- package/dist/mcp/tools.js.map +2 -2
- package/dist/memory/compress.d.ts +19 -0
- package/dist/memory/compress.d.ts.map +1 -0
- package/dist/memory/database.d.ts +92 -0
- package/dist/memory/database.d.ts.map +1 -0
- package/dist/memory/database.js +38 -0
- package/dist/memory/database.js.map +2 -2
- package/dist/memory/index.d.ts +71 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +12 -2
- package/dist/memory/index.js.map +2 -2
- package/dist/memory/symbols.d.ts +21 -0
- package/dist/memory/symbols.d.ts.map +1 -0
- package/dist/memory/types.d.ts +78 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js.map +1 -1
- package/dist/memory/vectors.d.ts +43 -0
- package/dist/memory/vectors.d.ts.map +1 -0
- package/dist/patterns/graph.d.ts +16 -0
- package/dist/patterns/graph.d.ts.map +1 -0
- package/dist/patterns/graph.js +45 -0
- package/dist/patterns/graph.js.map +7 -0
- package/dist/patterns/index.d.ts +4 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +39 -0
- package/dist/patterns/index.js.map +7 -0
- package/dist/patterns/indexer.d.ts +15 -0
- package/dist/patterns/indexer.d.ts.map +1 -0
- package/dist/patterns/indexer.js +97 -0
- package/dist/patterns/indexer.js.map +7 -0
- package/dist/patterns/library/command-injection-go.yaml +11 -0
- package/dist/patterns/library/dangerous-eval-js.yaml +14 -0
- package/dist/patterns/library/dangerous-exec-py.yaml +13 -0
- package/dist/patterns/library/dangerous-reflection-java.yaml +8 -0
- package/dist/patterns/library/path-traversal-go.yaml +11 -0
- package/dist/patterns/library/path-traversal-py.yaml +12 -0
- package/dist/patterns/library/path-traversal-readfile-js.yaml +14 -0
- package/dist/patterns/library/prototype-pollution-js.yaml +12 -0
- package/dist/patterns/library/sql-injection-concat-js.yaml +12 -0
- package/dist/patterns/library/sql-injection-java.yaml +13 -0
- package/dist/patterns/library/sql-injection-py.yaml +12 -0
- package/dist/patterns/library/sql-injection-template-js.yaml +13 -0
- package/dist/patterns/library/weak-crypto-md5-js.yaml +13 -0
- package/dist/patterns/library/weak-crypto-py.yaml +13 -0
- package/dist/patterns/loader.d.ts +18 -0
- package/dist/patterns/loader.d.ts.map +1 -0
- package/dist/patterns/loader.js +277 -0
- package/dist/patterns/loader.js.map +7 -0
- package/dist/patterns/runner.d.ts +42 -0
- package/dist/patterns/runner.d.ts.map +1 -0
- package/dist/patterns/runner.js +277 -0
- package/dist/patterns/runner.js.map +7 -0
- package/dist/patterns/types.d.ts +27 -0
- package/dist/patterns/types.d.ts.map +1 -0
- package/dist/patterns/types.js +34 -0
- package/dist/patterns/types.js.map +7 -0
- package/dist/resolution/bridges/android-rn.d.ts +13 -0
- package/dist/resolution/bridges/android-rn.d.ts.map +1 -0
- package/dist/resolution/bridges/expo-modules.d.ts +10 -0
- package/dist/resolution/bridges/expo-modules.d.ts.map +1 -0
- package/dist/resolution/bridges/flutter-channel.d.ts +14 -0
- package/dist/resolution/bridges/flutter-channel.d.ts.map +1 -0
- package/dist/resolution/bridges/index.d.ts +40 -0
- package/dist/resolution/bridges/index.d.ts.map +1 -0
- package/dist/resolution/bridges/native-events.d.ts +10 -0
- package/dist/resolution/bridges/native-events.d.ts.map +1 -0
- package/dist/resolution/bridges/native-views.d.ts +13 -0
- package/dist/resolution/bridges/native-views.d.ts.map +1 -0
- package/dist/resolution/bridges/react-native.d.ts +9 -0
- package/dist/resolution/bridges/react-native.d.ts.map +1 -0
- package/dist/resolution/bridges/swift-objc.d.ts +14 -0
- package/dist/resolution/bridges/swift-objc.d.ts.map +1 -0
- package/dist/resolution/bridges/turbomodules.d.ts +10 -0
- package/dist/resolution/bridges/turbomodules.d.ts.map +1 -0
- package/dist/resolution/index.d.ts +28 -3
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/security/attack-surface.d.ts +46 -0
- package/dist/security/attack-surface.d.ts.map +1 -0
- package/dist/security/attack-surface.js +43 -1
- package/dist/security/attack-surface.js.map +2 -2
- package/dist/security/context-warnings.d.ts +40 -0
- package/dist/security/context-warnings.d.ts.map +1 -0
- package/dist/security/data-flows.d.ts +33 -0
- package/dist/security/data-flows.d.ts.map +1 -0
- package/dist/security/data-flows.js +65 -7
- package/dist/security/data-flows.js.map +2 -2
- package/dist/security/dep-confusion.d.ts +23 -0
- package/dist/security/dep-confusion.d.ts.map +1 -0
- package/dist/security/errors.d.ts +16 -0
- package/dist/security/errors.d.ts.map +1 -0
- package/dist/security/export/fix-suggestions.d.ts +21 -0
- package/dist/security/export/fix-suggestions.d.ts.map +1 -0
- package/dist/security/export/sbom.d.ts +33 -0
- package/dist/security/export/sbom.d.ts.map +1 -0
- package/dist/security/export/serialization.d.ts +62 -0
- package/dist/security/export/serialization.d.ts.map +1 -0
- package/dist/security/export/vex.d.ts +58 -0
- package/dist/security/export/vex.d.ts.map +1 -0
- package/dist/security/index.d.ts +21 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/integrator.d.ts +63 -0
- package/dist/security/integrator.d.ts.map +1 -0
- package/dist/security/license.d.ts +33 -0
- package/dist/security/license.d.ts.map +1 -0
- package/dist/security/manifest/adapter.d.ts +92 -0
- package/dist/security/manifest/adapter.d.ts.map +1 -0
- package/dist/security/manifest/parser.d.ts +73 -0
- package/dist/security/manifest/parser.d.ts.map +1 -0
- package/dist/security/manifest/plugins/cargo.d.ts +11 -0
- package/dist/security/manifest/plugins/cargo.d.ts.map +1 -0
- package/dist/security/manifest/plugins/composer.d.ts +11 -0
- package/dist/security/manifest/plugins/composer.d.ts.map +1 -0
- package/dist/security/manifest/plugins/go.d.ts +12 -0
- package/dist/security/manifest/plugins/go.d.ts.map +1 -0
- package/dist/security/manifest/plugins/gradle.d.ts +12 -0
- package/dist/security/manifest/plugins/gradle.d.ts.map +1 -0
- package/dist/security/manifest/plugins/hex.d.ts +11 -0
- package/dist/security/manifest/plugins/hex.d.ts.map +1 -0
- package/dist/security/manifest/plugins/maven.d.ts +11 -0
- package/dist/security/manifest/plugins/maven.d.ts.map +1 -0
- package/dist/security/manifest/plugins/npm.d.ts +11 -0
- package/dist/security/manifest/plugins/npm.d.ts.map +1 -0
- package/dist/security/manifest/plugins/nuget.d.ts +12 -0
- package/dist/security/manifest/plugins/nuget.d.ts.map +1 -0
- package/dist/security/manifest/plugins/pip.d.ts +11 -0
- package/dist/security/manifest/plugins/pip.d.ts.map +1 -0
- package/dist/security/manifest/plugins/pubspec.d.ts +11 -0
- package/dist/security/manifest/plugins/pubspec.d.ts.map +1 -0
- package/dist/security/manifest/plugins/pyproject.d.ts +3 -0
- package/dist/security/manifest/plugins/pyproject.d.ts.map +1 -0
- package/dist/security/manifest/plugins/rubygems.d.ts +11 -0
- package/dist/security/manifest/plugins/rubygems.d.ts.map +1 -0
- package/dist/security/manifest/plugins/swift.d.ts +11 -0
- package/dist/security/manifest/plugins/swift.d.ts.map +1 -0
- package/dist/security/owasp.d.ts +16 -0
- package/dist/security/owasp.d.ts.map +1 -0
- package/dist/security/pipeline.d.ts +37 -0
- package/dist/security/pipeline.d.ts.map +1 -0
- package/dist/security/reachability.d.ts +67 -0
- package/dist/security/reachability.d.ts.map +1 -0
- package/dist/security/remediation.d.ts +51 -0
- package/dist/security/remediation.d.ts.map +1 -0
- package/dist/security/secrets.d.ts +38 -0
- package/dist/security/secrets.d.ts.map +1 -0
- package/dist/security/staleness.d.ts +43 -0
- package/dist/security/staleness.d.ts.map +1 -0
- package/dist/security/supply-chain.d.ts +34 -0
- package/dist/security/supply-chain.d.ts.map +1 -0
- package/dist/security/suppressions.d.ts +18 -0
- package/dist/security/suppressions.d.ts.map +1 -0
- package/dist/security/types.d.ts +144 -0
- package/dist/security/types.d.ts.map +1 -0
- package/dist/security/vuln/client.d.ts +90 -0
- package/dist/security/vuln/client.d.ts.map +1 -0
- package/dist/security/vuln/client.js.map +2 -2
- package/dist/security/vuln/epss-client.d.ts +26 -0
- package/dist/security/vuln/epss-client.d.ts.map +1 -0
- package/dist/security/vuln/index.d.ts +6 -0
- package/dist/security/vuln/index.d.ts.map +1 -0
- package/dist/security/vuln/osv-adapter.d.ts +58 -0
- package/dist/security/vuln/osv-adapter.d.ts.map +1 -0
- package/dist/security/vuln/types.d.ts +29 -0
- package/dist/security/vuln/types.d.ts.map +1 -0
- package/dist/sync/index.d.ts +4 -2
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/types.d.ts +10 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/vectors/index.d.ts +11 -3
- package/dist/vectors/index.d.ts.map +1 -1
- package/dist/vectors/qdrant-index.d.ts +10 -3
- package/dist/vectors/qdrant-index.d.ts.map +1 -1
- package/dist/vectors/typesense-index.d.ts.map +1 -1
- package/dist/watchmen/index.js +83 -0
- package/dist/watchmen/index.js.map +7 -0
- package/dist/watchmen/synthesize.js +475 -0
- package/dist/watchmen/synthesize.js.map +7 -0
- package/package.json +5 -2
- package/dist/security/context-warnings.test.js +0 -300
- package/dist/security/context-warnings.test.js.map +0 -7
- package/dist/security/export/fix-suggestions.test.js +0 -74
- package/dist/security/export/fix-suggestions.test.js.map +0 -7
- package/dist/security/export/sbom.test.js +0 -288
- package/dist/security/export/sbom.test.js.map +0 -7
- package/dist/security/export/serialization.test.js +0 -310
- package/dist/security/export/serialization.test.js.map +0 -7
- package/dist/security/export/vex.test.js +0 -278
- package/dist/security/export/vex.test.js.map +0 -7
- package/dist/security/integrator-transitives.test.js +0 -359
- package/dist/security/integrator-transitives.test.js.map +0 -7
- package/dist/security/integrator.test.js +0 -237
- package/dist/security/integrator.test.js.map +0 -7
- package/dist/security/manifest/adapter.test.js +0 -272
- package/dist/security/manifest/adapter.test.js.map +0 -7
- package/dist/security/manifest/parser.test.js +0 -110
- package/dist/security/manifest/parser.test.js.map +0 -7
- package/dist/security/manifest/plugins/cargo.test.js +0 -304
- package/dist/security/manifest/plugins/cargo.test.js.map +0 -7
- package/dist/security/manifest/plugins/go.test.js +0 -341
- package/dist/security/manifest/plugins/go.test.js.map +0 -7
- package/dist/security/manifest/plugins/maven.test.js +0 -389
- package/dist/security/manifest/plugins/maven.test.js.map +0 -7
- package/dist/security/manifest/plugins/npm.test.js +0 -298
- package/dist/security/manifest/plugins/npm.test.js.map +0 -7
- package/dist/security/manifest/plugins/pip.test.js +0 -208
- package/dist/security/manifest/plugins/pip.test.js.map +0 -7
- package/dist/security/reachability.test.js +0 -394
- package/dist/security/reachability.test.js.map +0 -7
- package/dist/security/vuln/client.test.js +0 -288
- package/dist/security/vuln/client.test.js.map +0 -7
- package/dist/security/vuln/osv-adapter.test.js +0 -391
- package/dist/security/vuln/osv-adapter.test.js.map +0 -7
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
var import_vitest = require("vitest");
|
|
25
|
-
var fs = __toESM(require("fs"));
|
|
26
|
-
var path = __toESM(require("path"));
|
|
27
|
-
var os = __toESM(require("os"));
|
|
28
|
-
var import_cargo = require("./cargo");
|
|
29
|
-
(0, import_vitest.describe)("parseCargoManifest", () => {
|
|
30
|
-
let tmpDir;
|
|
31
|
-
(0, import_vitest.beforeEach)(() => {
|
|
32
|
-
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "kirograph-cargo-test-"));
|
|
33
|
-
});
|
|
34
|
-
(0, import_vitest.afterEach)(() => {
|
|
35
|
-
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
36
|
-
});
|
|
37
|
-
function writeCargoToml(content, dir) {
|
|
38
|
-
const targetDir = dir ?? tmpDir;
|
|
39
|
-
fs.mkdirSync(targetDir, { recursive: true });
|
|
40
|
-
const filePath = path.join(targetDir, "Cargo.toml");
|
|
41
|
-
fs.writeFileSync(filePath, content);
|
|
42
|
-
return filePath;
|
|
43
|
-
}
|
|
44
|
-
(0, import_vitest.it)("extracts simple string dependencies with production scope", async () => {
|
|
45
|
-
const manifestPath = writeCargoToml(`
|
|
46
|
-
[package]
|
|
47
|
-
name = "my-app"
|
|
48
|
-
version = "0.1.0"
|
|
49
|
-
|
|
50
|
-
[dependencies]
|
|
51
|
-
serde = "1.0"
|
|
52
|
-
tokio = "1.35"
|
|
53
|
-
`);
|
|
54
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
55
|
-
(0, import_vitest.expect)(deps).toHaveLength(2);
|
|
56
|
-
const serde = deps.find((d) => d.name === "serde");
|
|
57
|
-
(0, import_vitest.expect)(serde).toBeDefined();
|
|
58
|
-
(0, import_vitest.expect)(serde.declaredConstraint).toBe("1.0");
|
|
59
|
-
(0, import_vitest.expect)(serde.scope).toBe("production");
|
|
60
|
-
(0, import_vitest.expect)(serde.ecosystem).toBe("cargo");
|
|
61
|
-
const tokio = deps.find((d) => d.name === "tokio");
|
|
62
|
-
(0, import_vitest.expect)(tokio).toBeDefined();
|
|
63
|
-
(0, import_vitest.expect)(tokio.declaredConstraint).toBe("1.35");
|
|
64
|
-
(0, import_vitest.expect)(tokio.scope).toBe("production");
|
|
65
|
-
});
|
|
66
|
-
(0, import_vitest.it)("extracts table format dependencies with version field", async () => {
|
|
67
|
-
const manifestPath = writeCargoToml(`
|
|
68
|
-
[package]
|
|
69
|
-
name = "my-app"
|
|
70
|
-
version = "0.1.0"
|
|
71
|
-
|
|
72
|
-
[dependencies]
|
|
73
|
-
serde = { version = "1.0", features = ["derive"] }
|
|
74
|
-
tokio = { version = "1.35", features = ["full"] }
|
|
75
|
-
`);
|
|
76
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
77
|
-
(0, import_vitest.expect)(deps).toHaveLength(2);
|
|
78
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "serde").declaredConstraint).toBe("1.0");
|
|
79
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "tokio").declaredConstraint).toBe("1.35");
|
|
80
|
-
});
|
|
81
|
-
(0, import_vitest.it)("extracts dev-dependencies with development scope", async () => {
|
|
82
|
-
const manifestPath = writeCargoToml(`
|
|
83
|
-
[package]
|
|
84
|
-
name = "my-app"
|
|
85
|
-
version = "0.1.0"
|
|
86
|
-
|
|
87
|
-
[dev-dependencies]
|
|
88
|
-
criterion = "0.5"
|
|
89
|
-
proptest = "1.4"
|
|
90
|
-
`);
|
|
91
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
92
|
-
(0, import_vitest.expect)(deps).toHaveLength(2);
|
|
93
|
-
(0, import_vitest.expect)(deps.every((d) => d.scope === "development")).toBe(true);
|
|
94
|
-
});
|
|
95
|
-
(0, import_vitest.it)("extracts build-dependencies with development scope", async () => {
|
|
96
|
-
const manifestPath = writeCargoToml(`
|
|
97
|
-
[package]
|
|
98
|
-
name = "my-app"
|
|
99
|
-
version = "0.1.0"
|
|
100
|
-
|
|
101
|
-
[build-dependencies]
|
|
102
|
-
cc = "1.0"
|
|
103
|
-
bindgen = "0.69"
|
|
104
|
-
`);
|
|
105
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
106
|
-
(0, import_vitest.expect)(deps).toHaveLength(2);
|
|
107
|
-
(0, import_vitest.expect)(deps.every((d) => d.scope === "development")).toBe(true);
|
|
108
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "cc").declaredConstraint).toBe("1.0");
|
|
109
|
-
});
|
|
110
|
-
(0, import_vitest.it)("handles all dependency sections together", async () => {
|
|
111
|
-
const manifestPath = writeCargoToml(`
|
|
112
|
-
[package]
|
|
113
|
-
name = "my-app"
|
|
114
|
-
version = "0.1.0"
|
|
115
|
-
|
|
116
|
-
[dependencies]
|
|
117
|
-
serde = "1.0"
|
|
118
|
-
|
|
119
|
-
[dev-dependencies]
|
|
120
|
-
criterion = "0.5"
|
|
121
|
-
|
|
122
|
-
[build-dependencies]
|
|
123
|
-
cc = "1.0"
|
|
124
|
-
`);
|
|
125
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
126
|
-
(0, import_vitest.expect)(deps).toHaveLength(3);
|
|
127
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "serde").scope).toBe("production");
|
|
128
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "criterion").scope).toBe("development");
|
|
129
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "cc").scope).toBe("development");
|
|
130
|
-
});
|
|
131
|
-
(0, import_vitest.it)("resolves versions from Cargo.lock", async () => {
|
|
132
|
-
writeCargoToml(`
|
|
133
|
-
[package]
|
|
134
|
-
name = "my-app"
|
|
135
|
-
version = "0.1.0"
|
|
136
|
-
|
|
137
|
-
[dependencies]
|
|
138
|
-
serde = "1.0"
|
|
139
|
-
tokio = "1"
|
|
140
|
-
`);
|
|
141
|
-
const lockContent = `# This file is automatically @generated by Cargo.
|
|
142
|
-
# It is not intended for manual editing.
|
|
143
|
-
version = 3
|
|
144
|
-
|
|
145
|
-
[[package]]
|
|
146
|
-
name = "serde"
|
|
147
|
-
version = "1.0.193"
|
|
148
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
149
|
-
|
|
150
|
-
[[package]]
|
|
151
|
-
name = "tokio"
|
|
152
|
-
version = "1.35.1"
|
|
153
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
154
|
-
`;
|
|
155
|
-
fs.writeFileSync(path.join(tmpDir, "Cargo.lock"), lockContent);
|
|
156
|
-
const manifestPath = path.join(tmpDir, "Cargo.toml");
|
|
157
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
158
|
-
(0, import_vitest.expect)(deps).toHaveLength(2);
|
|
159
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "serde").resolvedVersion).toBe("1.0.193");
|
|
160
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "tokio").resolvedVersion).toBe("1.35.1");
|
|
161
|
-
});
|
|
162
|
-
(0, import_vitest.it)("leaves resolvedVersion undefined when no Cargo.lock exists", async () => {
|
|
163
|
-
const manifestPath = writeCargoToml(`
|
|
164
|
-
[package]
|
|
165
|
-
name = "my-app"
|
|
166
|
-
version = "0.1.0"
|
|
167
|
-
|
|
168
|
-
[dependencies]
|
|
169
|
-
serde = "1.0"
|
|
170
|
-
`);
|
|
171
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
172
|
-
(0, import_vitest.expect)(deps).toHaveLength(1);
|
|
173
|
-
(0, import_vitest.expect)(deps[0].resolvedVersion).toBeUndefined();
|
|
174
|
-
});
|
|
175
|
-
(0, import_vitest.it)("handles path dependencies with no version (uses * constraint)", async () => {
|
|
176
|
-
const manifestPath = writeCargoToml(`
|
|
177
|
-
[package]
|
|
178
|
-
name = "my-app"
|
|
179
|
-
version = "0.1.0"
|
|
180
|
-
|
|
181
|
-
[dependencies]
|
|
182
|
-
my-lib = { path = "../my-lib" }
|
|
183
|
-
`);
|
|
184
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
185
|
-
(0, import_vitest.expect)(deps).toHaveLength(1);
|
|
186
|
-
(0, import_vitest.expect)(deps[0].name).toBe("my-lib");
|
|
187
|
-
(0, import_vitest.expect)(deps[0].declaredConstraint).toBe("*");
|
|
188
|
-
});
|
|
189
|
-
(0, import_vitest.it)("handles git dependencies with no version (uses * constraint)", async () => {
|
|
190
|
-
const manifestPath = writeCargoToml(`
|
|
191
|
-
[package]
|
|
192
|
-
name = "my-app"
|
|
193
|
-
version = "0.1.0"
|
|
194
|
-
|
|
195
|
-
[dependencies]
|
|
196
|
-
my-crate = { git = "https://github.com/user/repo" }
|
|
197
|
-
`);
|
|
198
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
199
|
-
(0, import_vitest.expect)(deps).toHaveLength(1);
|
|
200
|
-
(0, import_vitest.expect)(deps[0].name).toBe("my-crate");
|
|
201
|
-
(0, import_vitest.expect)(deps[0].declaredConstraint).toBe("*");
|
|
202
|
-
});
|
|
203
|
-
(0, import_vitest.it)("handles table-style individual dependency sections", async () => {
|
|
204
|
-
const manifestPath = writeCargoToml(`
|
|
205
|
-
[package]
|
|
206
|
-
name = "my-app"
|
|
207
|
-
version = "0.1.0"
|
|
208
|
-
|
|
209
|
-
[dependencies.serde]
|
|
210
|
-
version = "1.0"
|
|
211
|
-
features = ["derive"]
|
|
212
|
-
|
|
213
|
-
[dependencies.tokio]
|
|
214
|
-
version = "1.35"
|
|
215
|
-
features = ["full"]
|
|
216
|
-
`);
|
|
217
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
218
|
-
(0, import_vitest.expect)(deps).toHaveLength(2);
|
|
219
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "serde").declaredConstraint).toBe("1.0");
|
|
220
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "tokio").declaredConstraint).toBe("1.35");
|
|
221
|
-
(0, import_vitest.expect)(deps.every((d) => d.scope === "production")).toBe(true);
|
|
222
|
-
});
|
|
223
|
-
(0, import_vitest.it)("returns empty array for unreadable file", async () => {
|
|
224
|
-
const fakePath = path.join(tmpDir, "nonexistent", "Cargo.toml");
|
|
225
|
-
const deps = await (0, import_cargo.parseCargoManifest)(fakePath, tmpDir);
|
|
226
|
-
(0, import_vitest.expect)(deps).toEqual([]);
|
|
227
|
-
});
|
|
228
|
-
(0, import_vitest.it)("returns empty array for Cargo.toml with no dependency sections", async () => {
|
|
229
|
-
const manifestPath = writeCargoToml(`
|
|
230
|
-
[package]
|
|
231
|
-
name = "my-app"
|
|
232
|
-
version = "0.1.0"
|
|
233
|
-
edition = "2021"
|
|
234
|
-
`);
|
|
235
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
236
|
-
(0, import_vitest.expect)(deps).toEqual([]);
|
|
237
|
-
});
|
|
238
|
-
(0, import_vitest.it)("skips comment lines in dependency sections", async () => {
|
|
239
|
-
const manifestPath = writeCargoToml(`
|
|
240
|
-
[package]
|
|
241
|
-
name = "my-app"
|
|
242
|
-
version = "0.1.0"
|
|
243
|
-
|
|
244
|
-
[dependencies]
|
|
245
|
-
# This is a comment
|
|
246
|
-
serde = "1.0"
|
|
247
|
-
# Another comment
|
|
248
|
-
tokio = "1.35"
|
|
249
|
-
`);
|
|
250
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
251
|
-
(0, import_vitest.expect)(deps).toHaveLength(2);
|
|
252
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "serde")).toBeDefined();
|
|
253
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "tokio")).toBeDefined();
|
|
254
|
-
});
|
|
255
|
-
(0, import_vitest.it)("sets sourceManifest as relative path", async () => {
|
|
256
|
-
const subDir = path.join(tmpDir, "crates", "sub");
|
|
257
|
-
const manifestPath = writeCargoToml(`
|
|
258
|
-
[package]
|
|
259
|
-
name = "sub-crate"
|
|
260
|
-
version = "0.1.0"
|
|
261
|
-
|
|
262
|
-
[dependencies]
|
|
263
|
-
serde = "1.0"
|
|
264
|
-
`, subDir);
|
|
265
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
266
|
-
(0, import_vitest.expect)(deps).toHaveLength(1);
|
|
267
|
-
(0, import_vitest.expect)(deps[0].sourceManifest).toBe("crates/sub/Cargo.toml");
|
|
268
|
-
});
|
|
269
|
-
(0, import_vitest.it)("handles mixed simple and table format in same section", async () => {
|
|
270
|
-
const manifestPath = writeCargoToml(`
|
|
271
|
-
[package]
|
|
272
|
-
name = "my-app"
|
|
273
|
-
version = "0.1.0"
|
|
274
|
-
|
|
275
|
-
[dependencies]
|
|
276
|
-
log = "0.4"
|
|
277
|
-
serde = { version = "1.0", features = ["derive"] }
|
|
278
|
-
rand = "0.8"
|
|
279
|
-
`);
|
|
280
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
281
|
-
(0, import_vitest.expect)(deps).toHaveLength(3);
|
|
282
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "log").declaredConstraint).toBe("0.4");
|
|
283
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "serde").declaredConstraint).toBe("1.0");
|
|
284
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "rand").declaredConstraint).toBe("0.8");
|
|
285
|
-
});
|
|
286
|
-
(0, import_vitest.it)("handles version constraints with operators", async () => {
|
|
287
|
-
const manifestPath = writeCargoToml(`
|
|
288
|
-
[package]
|
|
289
|
-
name = "my-app"
|
|
290
|
-
version = "0.1.0"
|
|
291
|
-
|
|
292
|
-
[dependencies]
|
|
293
|
-
serde = ">=1.0, <2.0"
|
|
294
|
-
tokio = "~1.35"
|
|
295
|
-
rand = "^0.8"
|
|
296
|
-
`);
|
|
297
|
-
const deps = await (0, import_cargo.parseCargoManifest)(manifestPath, tmpDir);
|
|
298
|
-
(0, import_vitest.expect)(deps).toHaveLength(3);
|
|
299
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "serde").declaredConstraint).toBe(">=1.0, <2.0");
|
|
300
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "tokio").declaredConstraint).toBe("~1.35");
|
|
301
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "rand").declaredConstraint).toBe("^0.8");
|
|
302
|
-
});
|
|
303
|
-
});
|
|
304
|
-
//# sourceMappingURL=cargo.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/security/manifest/plugins/cargo.test.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Unit tests for the Cargo security manifest plugin.\n */\nimport { describe, it, expect, beforeEach, afterEach } from 'vitest';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as os from 'os';\nimport { parseCargoManifest } from './cargo';\n\ndescribe('parseCargoManifest', () => {\n let tmpDir: string;\n\n beforeEach(() => {\n tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'kirograph-cargo-test-'));\n });\n\n afterEach(() => {\n fs.rmSync(tmpDir, { recursive: true, force: true });\n });\n\n function writeCargoToml(content: string, dir?: string): string {\n const targetDir = dir ?? tmpDir;\n fs.mkdirSync(targetDir, { recursive: true });\n const filePath = path.join(targetDir, 'Cargo.toml');\n fs.writeFileSync(filePath, content);\n return filePath;\n }\n\n it('extracts simple string dependencies with production scope', async () => {\n const manifestPath = writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\n\n[dependencies]\nserde = \"1.0\"\ntokio = \"1.35\"\n`);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(2);\n const serde = deps.find(d => d.name === 'serde');\n expect(serde).toBeDefined();\n expect(serde!.declaredConstraint).toBe('1.0');\n expect(serde!.scope).toBe('production');\n expect(serde!.ecosystem).toBe('cargo');\n\n const tokio = deps.find(d => d.name === 'tokio');\n expect(tokio).toBeDefined();\n expect(tokio!.declaredConstraint).toBe('1.35');\n expect(tokio!.scope).toBe('production');\n });\n\n it('extracts table format dependencies with version field', async () => {\n const manifestPath = writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\n\n[dependencies]\nserde = { version = \"1.0\", features = [\"derive\"] }\ntokio = { version = \"1.35\", features = [\"full\"] }\n`);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(2);\n expect(deps.find(d => d.name === 'serde')!.declaredConstraint).toBe('1.0');\n expect(deps.find(d => d.name === 'tokio')!.declaredConstraint).toBe('1.35');\n });\n\n it('extracts dev-dependencies with development scope', async () => {\n const manifestPath = writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\n\n[dev-dependencies]\ncriterion = \"0.5\"\nproptest = \"1.4\"\n`);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(2);\n expect(deps.every(d => d.scope === 'development')).toBe(true);\n });\n\n it('extracts build-dependencies with development scope', async () => {\n const manifestPath = writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\n\n[build-dependencies]\ncc = \"1.0\"\nbindgen = \"0.69\"\n`);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(2);\n expect(deps.every(d => d.scope === 'development')).toBe(true);\n expect(deps.find(d => d.name === 'cc')!.declaredConstraint).toBe('1.0');\n });\n\n it('handles all dependency sections together', async () => {\n const manifestPath = writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\n\n[dependencies]\nserde = \"1.0\"\n\n[dev-dependencies]\ncriterion = \"0.5\"\n\n[build-dependencies]\ncc = \"1.0\"\n`);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(3);\n expect(deps.find(d => d.name === 'serde')!.scope).toBe('production');\n expect(deps.find(d => d.name === 'criterion')!.scope).toBe('development');\n expect(deps.find(d => d.name === 'cc')!.scope).toBe('development');\n });\n\n it('resolves versions from Cargo.lock', async () => {\n writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\n\n[dependencies]\nserde = \"1.0\"\ntokio = \"1\"\n`);\n\n const lockContent = `# This file is automatically @generated by Cargo.\n# It is not intended for manual editing.\nversion = 3\n\n[[package]]\nname = \"serde\"\nversion = \"1.0.193\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n\n[[package]]\nname = \"tokio\"\nversion = \"1.35.1\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n`;\n fs.writeFileSync(path.join(tmpDir, 'Cargo.lock'), lockContent);\n\n const manifestPath = path.join(tmpDir, 'Cargo.toml');\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(2);\n expect(deps.find(d => d.name === 'serde')!.resolvedVersion).toBe('1.0.193');\n expect(deps.find(d => d.name === 'tokio')!.resolvedVersion).toBe('1.35.1');\n });\n\n it('leaves resolvedVersion undefined when no Cargo.lock exists', async () => {\n const manifestPath = writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\n\n[dependencies]\nserde = \"1.0\"\n`);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(1);\n expect(deps[0].resolvedVersion).toBeUndefined();\n });\n\n it('handles path dependencies with no version (uses * constraint)', async () => {\n const manifestPath = writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\n\n[dependencies]\nmy-lib = { path = \"../my-lib\" }\n`);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(1);\n expect(deps[0].name).toBe('my-lib');\n expect(deps[0].declaredConstraint).toBe('*');\n });\n\n it('handles git dependencies with no version (uses * constraint)', async () => {\n const manifestPath = writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\n\n[dependencies]\nmy-crate = { git = \"https://github.com/user/repo\" }\n`);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(1);\n expect(deps[0].name).toBe('my-crate');\n expect(deps[0].declaredConstraint).toBe('*');\n });\n\n it('handles table-style individual dependency sections', async () => {\n const manifestPath = writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\n\n[dependencies.serde]\nversion = \"1.0\"\nfeatures = [\"derive\"]\n\n[dependencies.tokio]\nversion = \"1.35\"\nfeatures = [\"full\"]\n`);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(2);\n expect(deps.find(d => d.name === 'serde')!.declaredConstraint).toBe('1.0');\n expect(deps.find(d => d.name === 'tokio')!.declaredConstraint).toBe('1.35');\n expect(deps.every(d => d.scope === 'production')).toBe(true);\n });\n\n it('returns empty array for unreadable file', async () => {\n const fakePath = path.join(tmpDir, 'nonexistent', 'Cargo.toml');\n const deps = await parseCargoManifest(fakePath, tmpDir);\n expect(deps).toEqual([]);\n });\n\n it('returns empty array for Cargo.toml with no dependency sections', async () => {\n const manifestPath = writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\nedition = \"2021\"\n`);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n expect(deps).toEqual([]);\n });\n\n it('skips comment lines in dependency sections', async () => {\n const manifestPath = writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\n\n[dependencies]\n# This is a comment\nserde = \"1.0\"\n# Another comment\ntokio = \"1.35\"\n`);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(2);\n expect(deps.find(d => d.name === 'serde')).toBeDefined();\n expect(deps.find(d => d.name === 'tokio')).toBeDefined();\n });\n\n it('sets sourceManifest as relative path', async () => {\n const subDir = path.join(tmpDir, 'crates', 'sub');\n const manifestPath = writeCargoToml(`\n[package]\nname = \"sub-crate\"\nversion = \"0.1.0\"\n\n[dependencies]\nserde = \"1.0\"\n`, subDir);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(1);\n expect(deps[0].sourceManifest).toBe('crates/sub/Cargo.toml');\n });\n\n it('handles mixed simple and table format in same section', async () => {\n const manifestPath = writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\n\n[dependencies]\nlog = \"0.4\"\nserde = { version = \"1.0\", features = [\"derive\"] }\nrand = \"0.8\"\n`);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(3);\n expect(deps.find(d => d.name === 'log')!.declaredConstraint).toBe('0.4');\n expect(deps.find(d => d.name === 'serde')!.declaredConstraint).toBe('1.0');\n expect(deps.find(d => d.name === 'rand')!.declaredConstraint).toBe('0.8');\n });\n\n it('handles version constraints with operators', async () => {\n const manifestPath = writeCargoToml(`\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\n\n[dependencies]\nserde = \">=1.0, <2.0\"\ntokio = \"~1.35\"\nrand = \"^0.8\"\n`);\n\n const deps = await parseCargoManifest(manifestPath, tmpDir);\n\n expect(deps).toHaveLength(3);\n expect(deps.find(d => d.name === 'serde')!.declaredConstraint).toBe('>=1.0, <2.0');\n expect(deps.find(d => d.name === 'tokio')!.declaredConstraint).toBe('~1.35');\n expect(deps.find(d => d.name === 'rand')!.declaredConstraint).toBe('^0.8');\n });\n});\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
var import_vitest = require("vitest");
|
|
25
|
-
var fs = __toESM(require("fs"));
|
|
26
|
-
var path = __toESM(require("path"));
|
|
27
|
-
var os = __toESM(require("os"));
|
|
28
|
-
var import_go = require("./go");
|
|
29
|
-
(0, import_vitest.describe)("parseGoManifest", () => {
|
|
30
|
-
let tmpDir;
|
|
31
|
-
(0, import_vitest.beforeEach)(() => {
|
|
32
|
-
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "kirograph-go-test-"));
|
|
33
|
-
});
|
|
34
|
-
(0, import_vitest.afterEach)(() => {
|
|
35
|
-
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
36
|
-
});
|
|
37
|
-
function writeGoMod(content, dir) {
|
|
38
|
-
const targetDir = dir ?? tmpDir;
|
|
39
|
-
fs.mkdirSync(targetDir, { recursive: true });
|
|
40
|
-
const filePath = path.join(targetDir, "go.mod");
|
|
41
|
-
fs.writeFileSync(filePath, content);
|
|
42
|
-
return filePath;
|
|
43
|
-
}
|
|
44
|
-
function writeGoSum(content, dir) {
|
|
45
|
-
const targetDir = dir ?? tmpDir;
|
|
46
|
-
fs.mkdirSync(targetDir, { recursive: true });
|
|
47
|
-
fs.writeFileSync(path.join(targetDir, "go.sum"), content);
|
|
48
|
-
}
|
|
49
|
-
(0, import_vitest.it)("extracts dependencies from require block", async () => {
|
|
50
|
-
const manifestPath = writeGoMod(`
|
|
51
|
-
module github.com/example/myproject
|
|
52
|
-
|
|
53
|
-
go 1.21
|
|
54
|
-
|
|
55
|
-
require (
|
|
56
|
-
github.com/gin-gonic/gin v1.9.1
|
|
57
|
-
github.com/stretchr/testify v1.8.4
|
|
58
|
-
)
|
|
59
|
-
`);
|
|
60
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
61
|
-
(0, import_vitest.expect)(deps).toHaveLength(2);
|
|
62
|
-
const gin = deps.find((d) => d.name === "github.com/gin-gonic/gin");
|
|
63
|
-
(0, import_vitest.expect)(gin).toBeDefined();
|
|
64
|
-
(0, import_vitest.expect)(gin.declaredConstraint).toBe("v1.9.1");
|
|
65
|
-
(0, import_vitest.expect)(gin.resolvedVersion).toBe("v1.9.1");
|
|
66
|
-
(0, import_vitest.expect)(gin.scope).toBe("production");
|
|
67
|
-
(0, import_vitest.expect)(gin.ecosystem).toBe("go");
|
|
68
|
-
const testify = deps.find((d) => d.name === "github.com/stretchr/testify");
|
|
69
|
-
(0, import_vitest.expect)(testify).toBeDefined();
|
|
70
|
-
(0, import_vitest.expect)(testify.declaredConstraint).toBe("v1.8.4");
|
|
71
|
-
(0, import_vitest.expect)(testify.resolvedVersion).toBe("v1.8.4");
|
|
72
|
-
});
|
|
73
|
-
(0, import_vitest.it)("extracts single-line require directives", async () => {
|
|
74
|
-
const manifestPath = writeGoMod(`
|
|
75
|
-
module github.com/example/myproject
|
|
76
|
-
|
|
77
|
-
go 1.21
|
|
78
|
-
|
|
79
|
-
require github.com/pkg/errors v0.9.1
|
|
80
|
-
require golang.org/x/text v0.14.0
|
|
81
|
-
`);
|
|
82
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
83
|
-
(0, import_vitest.expect)(deps).toHaveLength(2);
|
|
84
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "github.com/pkg/errors")).toBeDefined();
|
|
85
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "golang.org/x/text")).toBeDefined();
|
|
86
|
-
});
|
|
87
|
-
(0, import_vitest.it)("handles both block and single-line requires together", async () => {
|
|
88
|
-
const manifestPath = writeGoMod(`
|
|
89
|
-
module github.com/example/myproject
|
|
90
|
-
|
|
91
|
-
go 1.21
|
|
92
|
-
|
|
93
|
-
require github.com/pkg/errors v0.9.1
|
|
94
|
-
|
|
95
|
-
require (
|
|
96
|
-
github.com/gin-gonic/gin v1.9.1
|
|
97
|
-
github.com/stretchr/testify v1.8.4
|
|
98
|
-
)
|
|
99
|
-
`);
|
|
100
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
101
|
-
(0, import_vitest.expect)(deps).toHaveLength(3);
|
|
102
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "github.com/pkg/errors")).toBeDefined();
|
|
103
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "github.com/gin-gonic/gin")).toBeDefined();
|
|
104
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "github.com/stretchr/testify")).toBeDefined();
|
|
105
|
-
});
|
|
106
|
-
(0, import_vitest.it)("all dependencies have production scope", async () => {
|
|
107
|
-
const manifestPath = writeGoMod(`
|
|
108
|
-
module github.com/example/myproject
|
|
109
|
-
|
|
110
|
-
go 1.21
|
|
111
|
-
|
|
112
|
-
require (
|
|
113
|
-
github.com/gin-gonic/gin v1.9.1
|
|
114
|
-
github.com/stretchr/testify v1.8.4
|
|
115
|
-
)
|
|
116
|
-
`);
|
|
117
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
118
|
-
(0, import_vitest.expect)(deps.every((d) => d.scope === "production")).toBe(true);
|
|
119
|
-
});
|
|
120
|
-
(0, import_vitest.it)("sets declaredConstraint and resolvedVersion to the same value", async () => {
|
|
121
|
-
const manifestPath = writeGoMod(`
|
|
122
|
-
module github.com/example/myproject
|
|
123
|
-
|
|
124
|
-
go 1.21
|
|
125
|
-
|
|
126
|
-
require github.com/gin-gonic/gin v1.9.1
|
|
127
|
-
`);
|
|
128
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
129
|
-
(0, import_vitest.expect)(deps).toHaveLength(1);
|
|
130
|
-
(0, import_vitest.expect)(deps[0].declaredConstraint).toBe("v1.9.1");
|
|
131
|
-
(0, import_vitest.expect)(deps[0].resolvedVersion).toBe("v1.9.1");
|
|
132
|
-
});
|
|
133
|
-
(0, import_vitest.it)("skips comment lines in require block", async () => {
|
|
134
|
-
const manifestPath = writeGoMod(`
|
|
135
|
-
module github.com/example/myproject
|
|
136
|
-
|
|
137
|
-
go 1.21
|
|
138
|
-
|
|
139
|
-
require (
|
|
140
|
-
// This is a comment
|
|
141
|
-
github.com/gin-gonic/gin v1.9.1
|
|
142
|
-
// Another comment
|
|
143
|
-
github.com/stretchr/testify v1.8.4
|
|
144
|
-
)
|
|
145
|
-
`);
|
|
146
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
147
|
-
(0, import_vitest.expect)(deps).toHaveLength(2);
|
|
148
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "github.com/gin-gonic/gin")).toBeDefined();
|
|
149
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "github.com/stretchr/testify")).toBeDefined();
|
|
150
|
-
});
|
|
151
|
-
(0, import_vitest.it)("handles indirect dependencies (// indirect comment)", async () => {
|
|
152
|
-
const manifestPath = writeGoMod(`
|
|
153
|
-
module github.com/example/myproject
|
|
154
|
-
|
|
155
|
-
go 1.21
|
|
156
|
-
|
|
157
|
-
require (
|
|
158
|
-
github.com/gin-gonic/gin v1.9.1
|
|
159
|
-
golang.org/x/sys v0.15.0 // indirect
|
|
160
|
-
)
|
|
161
|
-
`);
|
|
162
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
163
|
-
(0, import_vitest.expect)(deps).toHaveLength(2);
|
|
164
|
-
const sys = deps.find((d) => d.name === "golang.org/x/sys");
|
|
165
|
-
(0, import_vitest.expect)(sys).toBeDefined();
|
|
166
|
-
(0, import_vitest.expect)(sys.declaredConstraint).toBe("v0.15.0");
|
|
167
|
-
});
|
|
168
|
-
(0, import_vitest.it)("handles pseudo-versions", async () => {
|
|
169
|
-
const manifestPath = writeGoMod(`
|
|
170
|
-
module github.com/example/myproject
|
|
171
|
-
|
|
172
|
-
go 1.21
|
|
173
|
-
|
|
174
|
-
require (
|
|
175
|
-
github.com/some/module v0.0.0-20230101120000-abcdef123456
|
|
176
|
-
)
|
|
177
|
-
`);
|
|
178
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
179
|
-
(0, import_vitest.expect)(deps).toHaveLength(1);
|
|
180
|
-
(0, import_vitest.expect)(deps[0].declaredConstraint).toBe("v0.0.0-20230101120000-abcdef123456");
|
|
181
|
-
(0, import_vitest.expect)(deps[0].resolvedVersion).toBe("v0.0.0-20230101120000-abcdef123456");
|
|
182
|
-
});
|
|
183
|
-
(0, import_vitest.it)("handles +incompatible versions", async () => {
|
|
184
|
-
const manifestPath = writeGoMod(`
|
|
185
|
-
module github.com/example/myproject
|
|
186
|
-
|
|
187
|
-
go 1.21
|
|
188
|
-
|
|
189
|
-
require github.com/some/legacy v3.2.1+incompatible
|
|
190
|
-
`);
|
|
191
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
192
|
-
(0, import_vitest.expect)(deps).toHaveLength(1);
|
|
193
|
-
(0, import_vitest.expect)(deps[0].declaredConstraint).toBe("v3.2.1+incompatible");
|
|
194
|
-
});
|
|
195
|
-
(0, import_vitest.it)("skips entries with invalid module paths", async () => {
|
|
196
|
-
const manifestPath = writeGoMod(`
|
|
197
|
-
module github.com/example/myproject
|
|
198
|
-
|
|
199
|
-
go 1.21
|
|
200
|
-
|
|
201
|
-
require (
|
|
202
|
-
github.com/valid/module v1.0.0
|
|
203
|
-
invalidpath v1.0.0
|
|
204
|
-
)
|
|
205
|
-
`);
|
|
206
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
207
|
-
(0, import_vitest.expect)(deps).toHaveLength(1);
|
|
208
|
-
(0, import_vitest.expect)(deps[0].name).toBe("github.com/valid/module");
|
|
209
|
-
});
|
|
210
|
-
(0, import_vitest.it)("skips entries with invalid version format", async () => {
|
|
211
|
-
const manifestPath = writeGoMod(`
|
|
212
|
-
module github.com/example/myproject
|
|
213
|
-
|
|
214
|
-
go 1.21
|
|
215
|
-
|
|
216
|
-
require (
|
|
217
|
-
github.com/valid/module v1.0.0
|
|
218
|
-
github.com/bad/version 1.0.0
|
|
219
|
-
github.com/bad/version2 latest
|
|
220
|
-
)
|
|
221
|
-
`);
|
|
222
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
223
|
-
(0, import_vitest.expect)(deps).toHaveLength(1);
|
|
224
|
-
(0, import_vitest.expect)(deps[0].name).toBe("github.com/valid/module");
|
|
225
|
-
});
|
|
226
|
-
(0, import_vitest.it)("returns empty array for unreadable file", async () => {
|
|
227
|
-
const deps = await (0, import_go.parseGoManifest)("/nonexistent/go.mod", tmpDir);
|
|
228
|
-
(0, import_vitest.expect)(deps).toEqual([]);
|
|
229
|
-
});
|
|
230
|
-
(0, import_vitest.it)("returns empty array for go.mod with no require directives", async () => {
|
|
231
|
-
const manifestPath = writeGoMod(`
|
|
232
|
-
module github.com/example/myproject
|
|
233
|
-
|
|
234
|
-
go 1.21
|
|
235
|
-
`);
|
|
236
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
237
|
-
(0, import_vitest.expect)(deps).toEqual([]);
|
|
238
|
-
});
|
|
239
|
-
(0, import_vitest.it)("sets sourceManifest as relative path", async () => {
|
|
240
|
-
const subDir = path.join(tmpDir, "services", "api");
|
|
241
|
-
const manifestPath = writeGoMod(`
|
|
242
|
-
module github.com/example/api
|
|
243
|
-
|
|
244
|
-
go 1.21
|
|
245
|
-
|
|
246
|
-
require github.com/gin-gonic/gin v1.9.1
|
|
247
|
-
`, subDir);
|
|
248
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
249
|
-
(0, import_vitest.expect)(deps).toHaveLength(1);
|
|
250
|
-
(0, import_vitest.expect)(deps[0].sourceManifest).toBe("services/api/go.mod");
|
|
251
|
-
});
|
|
252
|
-
(0, import_vitest.it)("reads go.sum for integrity verification", async () => {
|
|
253
|
-
const manifestPath = writeGoMod(`
|
|
254
|
-
module github.com/example/myproject
|
|
255
|
-
|
|
256
|
-
go 1.21
|
|
257
|
-
|
|
258
|
-
require github.com/gin-gonic/gin v1.9.1
|
|
259
|
-
`);
|
|
260
|
-
writeGoSum(`github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqFPSKw=
|
|
261
|
-
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL/0KcuqOSEXQHxOGZp0Lg2g/4wZIgGMnG3w3gI=
|
|
262
|
-
`);
|
|
263
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
264
|
-
(0, import_vitest.expect)(deps).toHaveLength(1);
|
|
265
|
-
(0, import_vitest.expect)(deps[0].name).toBe("github.com/gin-gonic/gin");
|
|
266
|
-
(0, import_vitest.expect)(deps[0].resolvedVersion).toBe("v1.9.1");
|
|
267
|
-
});
|
|
268
|
-
(0, import_vitest.it)("handles go.mod with multiple require blocks", async () => {
|
|
269
|
-
const manifestPath = writeGoMod(`
|
|
270
|
-
module github.com/example/myproject
|
|
271
|
-
|
|
272
|
-
go 1.21
|
|
273
|
-
|
|
274
|
-
require (
|
|
275
|
-
github.com/gin-gonic/gin v1.9.1
|
|
276
|
-
)
|
|
277
|
-
|
|
278
|
-
require (
|
|
279
|
-
golang.org/x/text v0.14.0
|
|
280
|
-
golang.org/x/sys v0.15.0
|
|
281
|
-
)
|
|
282
|
-
`);
|
|
283
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
284
|
-
(0, import_vitest.expect)(deps).toHaveLength(3);
|
|
285
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "github.com/gin-gonic/gin")).toBeDefined();
|
|
286
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "golang.org/x/text")).toBeDefined();
|
|
287
|
-
(0, import_vitest.expect)(deps.find((d) => d.name === "golang.org/x/sys")).toBeDefined();
|
|
288
|
-
});
|
|
289
|
-
(0, import_vitest.it)("handles empty require block", async () => {
|
|
290
|
-
const manifestPath = writeGoMod(`
|
|
291
|
-
module github.com/example/myproject
|
|
292
|
-
|
|
293
|
-
go 1.21
|
|
294
|
-
|
|
295
|
-
require (
|
|
296
|
-
)
|
|
297
|
-
`);
|
|
298
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
299
|
-
(0, import_vitest.expect)(deps).toEqual([]);
|
|
300
|
-
});
|
|
301
|
-
(0, import_vitest.it)("handles pre-release versions", async () => {
|
|
302
|
-
const manifestPath = writeGoMod(`
|
|
303
|
-
module github.com/example/myproject
|
|
304
|
-
|
|
305
|
-
go 1.21
|
|
306
|
-
|
|
307
|
-
require github.com/some/module v1.2.3-beta.1
|
|
308
|
-
`);
|
|
309
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
310
|
-
(0, import_vitest.expect)(deps).toHaveLength(1);
|
|
311
|
-
(0, import_vitest.expect)(deps[0].declaredConstraint).toBe("v1.2.3-beta.1");
|
|
312
|
-
});
|
|
313
|
-
(0, import_vitest.it)("works without go.sum present", async () => {
|
|
314
|
-
const manifestPath = writeGoMod(`
|
|
315
|
-
module github.com/example/myproject
|
|
316
|
-
|
|
317
|
-
go 1.21
|
|
318
|
-
|
|
319
|
-
require github.com/gin-gonic/gin v1.9.1
|
|
320
|
-
`);
|
|
321
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
322
|
-
(0, import_vitest.expect)(deps).toHaveLength(1);
|
|
323
|
-
(0, import_vitest.expect)(deps[0].name).toBe("github.com/gin-gonic/gin");
|
|
324
|
-
(0, import_vitest.expect)(deps[0].resolvedVersion).toBe("v1.9.1");
|
|
325
|
-
});
|
|
326
|
-
(0, import_vitest.it)("sets ecosystem to go for all dependencies", async () => {
|
|
327
|
-
const manifestPath = writeGoMod(`
|
|
328
|
-
module github.com/example/myproject
|
|
329
|
-
|
|
330
|
-
go 1.21
|
|
331
|
-
|
|
332
|
-
require (
|
|
333
|
-
github.com/gin-gonic/gin v1.9.1
|
|
334
|
-
golang.org/x/text v0.14.0
|
|
335
|
-
)
|
|
336
|
-
`);
|
|
337
|
-
const deps = await (0, import_go.parseGoManifest)(manifestPath, tmpDir);
|
|
338
|
-
(0, import_vitest.expect)(deps.every((d) => d.ecosystem === "go")).toBe(true);
|
|
339
|
-
});
|
|
340
|
-
});
|
|
341
|
-
//# sourceMappingURL=go.test.js.map
|