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(unstable): single checksum per JSR package in the lockfile #22421

Merged
merged 20 commits into from
Feb 15, 2024

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Feb 15, 2024

This changes the lockfile to not store JSR specifiers in the "remote" section. Instead a single JSR integrity is stored per package in the lockfile, which is a hash of the version's x.x.x_meta.json file, which contains hashes for every file in the package. The hashes in this file are then compared against when loading.

Additionally, when using { "vendor": true } in a deno.json, the files can be modified without causing lockfile errors—the checksum is only checked when copying into the vendor folder and not afterwards (eventually we should add this behaviour for non-jsr specifiers as well). As part of this change, the vendor folder creation is not always automatic in the LSP and running an explicit cache command is necessary. The code required to track checksums in the LSP would have been too complex for this PR, so that all goes through deno_graph now. The vendoring is still automatic when running from the CLI.

PRs that enabled this change:

@dsherret dsherret marked this pull request as ready for review February 15, 2024 15:53
Copy link
Contributor

@mmastrac mmastrac left a comment

Choose a reason for hiding this comment

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

LGTM

@dsherret dsherret merged commit 4f80d83 into denoland:main Feb 15, 2024
17 of 20 checks passed
@dsherret dsherret deleted the feat_jsr_integrity branch February 15, 2024 19:49
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