Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: put npm packument info in lockfile #42

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

nathanwhit
Copy link
Member

No description provided.

@nathanwhit nathanwhit marked this pull request as ready for review March 26, 2025 17:17
@nathanwhit nathanwhit requested a review from dsherret March 26, 2025 17:18
)]
pub struct MissingNpmPackageInfo;

pub async fn transform4_to_5(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is async because this transform needs info about the npm packages (which might need to be downloaded). it's annoying because it infects the rest of the API for loading a lockfile

})
}

pub fn new_current_version(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added this to have a sync way to make a lockfile. if it needs to do the async transform, it returns an error (which the caller needs to handle). this is also useful for tests and other places where you know the lockfile is already on the latest version

async fn get_npm_package_info(
&self,
values: &[PackageNv],
) -> Result<Vec<Lockfile5NpmInfo>, Box<dyn std::error::Error + Send + Sync>>;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a better error type

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.

2 participants