Skip to content

feat(manifest): parse Cargo.lock and package-lock.json for transitive dependencies (closes #6) - #17

Open
NePreby wants to merge 1 commit into
Flow-Pulse:mainfrom
NePreby:feat/lockfile-transitive-dependencies
Open

NePreby wants to merge 1 commit into
Flow-Pulse:mainfrom
NePreby:feat/lockfile-transitive-dependencies

Conversation

@NePreby

@NePreby NePreby commented Nov 6, 2026

Copy link
Copy Markdown

📌 Summary & Motivation

Resolves #6 by implementing comprehensive lockfile parsing for both Cargo.lock and package-lock.json (v1, v2, v3 formats) in frontend/src/lib/manifest.ts, with full support for transitive dependencies, de-duplication, and capping at 32 rows (MAX_SPLIT_ROWS = 32).


🎯 Acceptance Criteria Verification

  • Cargo.lock parser:
    • Implemented parseCargoLock(text, options).
    • Supports both direct-only and transitive dependency graphs.
    • Correctly resolves package names, semver strings, external crate registries, and workspace root isolation.
  • package-lock.json parser:
    • Implemented parsePackageLockJson(text, options).
    • Supports modern v2/v3 npm lockfiles via packages (including @scope/package and deeply nested node_modules/.../node_modules/pkg structures).
    • Supports legacy v1 lockfiles via recursive tree traversal of dependencies.
  • Transitive option & de-duplication:
    • Controlled by options.includeTransitive (defaults to direct dependencies).
    • De-duplicates dependencies by package name while retaining resolved version and metadata.
    • Strictly caps split rows to options.maxRows ?? MAX_SPLIT_ROWS (32 rows, conforming to Soroban cascade_splitter contract bounds).
  • Unified parseManifest routing:
    • Automatically identifies lockfiles by filename extension (.lock, Cargo.lock, package-lock.json) or file content heuristics ([[package]], "lockfileVersion").
  • Unit & Regression Test Coverage:
    • Added comprehensive test suites in frontend/src/lib/__tests__/manifest.test.ts covering all lockfile versions, transitive extraction, scoping, de-duplication, and 32-row capping.
    • Verified 100% green with vitest run and tsc -b.

🧪 Verification Logs

 ✓ src/lib/__tests__/manifest.test.ts (13 tests) 11ms
 ✓ src/lib/__tests__/format.test.ts (4 tests) 22ms
 ✓ src/lib/__tests__/ci.test.ts (3 tests) 4ms
 ✓ src/lib/__tests__/receipts.test.ts (5 tests) 54ms
 ↓ src/lib/__tests__/testnet.integration.test.ts (5 tests | 5 skipped)

 Test Files  4 passed | 1 skipped (5)
      Tests  25 passed | 5 skipped (30)

💰 Bounty Payout Wallet Information

  • Network: TRX Tron (TRC20)
  • Binance Address: TMqmJjRgVS21NL2eFtfyHciTxvE4BqGmEv

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parse Cargo.lock and package-lock.json for transitive dependencies

1 participant