feat: strip jsr meta module graph data on global to local copy#78
Merged
dsherret merged 9 commits intodenoland:mainfrom Apr 30, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces functionality to strip JSR meta module graph data when copying from the global cache to the local cache. Key changes include:
- Adding a helper function (jsr_url) to generate a JSR registry URL for use in tests.
- Modifying constructors in both LocalHttpCache and LocalLspHttpCache to accept a jsr_registry_url parameter.
- Implementing URL transformation logic to remove moduleGraph* keys from JSON metadata.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| rs_lib/tests/integration_test.rs | Adds a helper function and updates tests to pass the JSR registry URL. |
| rs_lib/src/local.rs | Updates constructors and implements transformation functions for metadata. |
| rs_lib/src/lib.rs | Retrieves the JSR registry URL from environment variables and passes it on. |
Comments suppressed due to low confidence (1)
rs_lib/src/local.rs:260
- [nitpick] Add documentation for the new jsr_registry_url parameter in the LocalHttpCache constructor, clarifying its role when GlobalToLocalCopy is set to Allow.
pub fn new( path: PathBuf, global_cache: GlobalHttpCacheRc<TSys>, allow_global_to_local: GlobalToLocalCopy, jsr_registry_url: Url,
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The logic for this is in this crate so that it works the same way when people use this crate from Wasm.
Part of denoland/deno#28427