Skip to content

Implement lockfile importers and migration CLI command - #12

Merged
lahiruudayakumara merged 6 commits into
mainfrom
feat/migration-and-compatibility
Aug 29, 2026
Merged

Implement lockfile importers and migration CLI command#12
lahiruudayakumara merged 6 commits into
mainfrom
feat/migration-and-compatibility

Conversation

@lahiruudayakumara

Copy link
Copy Markdown
Contributor

Summary

This pull request introduces a comprehensive implementation of foreign lockfile migration to CorexPM, robustly supporting the conversion of npm, pnpm, Yarn, and Bun lockfiles into the canonical corex.lock.json format while preserving the original lockfiles. It also adds extensive documentation covering migration guarantees, compatibility matrices, error code catalogs, and benchmarking methodology. The CLI and core libraries are updated to support and test these features.

The most important changes are:

Lockfile Migration Implementation

  • Added the migrate_lockfile function to corex-core, which detects foreign lockfiles, converts them to corex.lock.json, and ensures the original lockfile remains untouched. It returns a structured MigrationSummary for reporting.
  • Updated the CLI (corex-cli) to support the migrate (and alias import) command, invoking the migration logic and providing both human-readable and JSON output.

Testing and Dependency Updates

  • Introduced tests for the migrate command in the CLI to verify correct migration and preservation of the source lockfile. Added tempfile as a dev dependency to facilitate isolated test environments. [1] [2] [3] [4]

Documentation: Migration and Compatibility

  • Added a detailed migration guide emphasizing the invariant that foreign lockfiles are never deleted or mutated, and providing troubleshooting steps for migration errors.
  • Updated the npm compatibility matrix to reflect that lockfile import from npm, pnpm, Yarn, and Bun is now implemented. Clarified migration behavior to state that all foreign lockfiles are detected and left untouched. [1] [2]
  • Documented the framework and native addon compatibility matrix, including supported migration commands for each package manager.

Error Handling and Reporting

  • Added a stable diagnostic error code catalog, mapping error codes to actionable guidance for all major CorexPM subsystems, including lockfile migration errors.

Benchmarking and Roadmap

  • Added a benchmarking methodology report for disk efficiency and performance, including sample metrics and instructions for users to measure disk savings.
  • Updated the project roadmap to mark migration, compatibility, error-code catalog, and benchmarking as completed for phase 0.9.

Validation

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace

Compatibility and security

  • Documentation and compatibility matrix are updated if behavior changed.
  • Threat model or security documentation is updated for new trust boundaries.
  • Persistent format/API changes have an RFC and migration story.
  • Performance claims include reproducible evidence.

@lahiruudayakumara
lahiruudayakumara merged commit 93bdc39 into main Aug 29, 2026
3 checks passed
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.

1 participant