refactor(cli): introduce shared package metadata model#1467
refactor(cli): introduce shared package metadata model#1467Harsh-Sahu43 wants to merge 1 commit into
Conversation
|
Hi @Harsh-Sahu43, thanks for putting this together — the code itself is clean (PackageIdentity / PackageDefinition / DependencyRequirement is a reasonable shape, and the validator helpers are well-factored). Closing this one as part of the broader call on the package-management track. Where the project is right now:
This is not a quality judgment on the work — closing it on direction, not merit. Your other contributions are exactly the kind we want:
Both landed cleanly because they tackled concrete pain the project already had. If you're looking for the next thing to work on, the patterns that rescue well are: defensive fixes for crashes / panics, gaps in cross-platform CI, missing CLI ergonomics, and edge cases in existing features. The recent rescue stack (#1855, #1859, #1861, #1864, #1865, #1869, #1870) is a good shape to mirror. Thanks again — please don't read this close as "stop contributing." Just "the foundation isn't laid here yet." |
Problem
Dora.tomlmetadata and registry metadata describe the same package semantics but are evolving independently.If these paths define and validate package data independently, they can drift quickly as Project #2 grows. That would make later resolver, install, publish, and lockfile work harder to align.
Related context
This PR is aligned with the same package-management direction being explored in:
What this PR changes
This PR introduces a shared package metadata model inside the CLI crate and makes both manifest and registry parsing normalize into it. This PR is intentionally scoped to the shared semantic layer and does not introduce new CLI surface.
Added
binaries/cli/src/package_metadata.rsRefactored
binaries/cli/src/dora_toml.rsDora.tomlparsing separatebinaries/cli/src/registry.rsWhy this matters
This establishes a clean architectural foundation:
This prevents schema drift and ensures that future layers (resolver, lockfile, install, publish) operate on a single consistent package representation.
Design
Inspired by Cargo’s separation of concerns:
Resolver and higher-level workflows are intentionally deferred.
Validation