Skip to content

feat: strip jsr meta module graph data on global to local copy#78

Merged
dsherret merged 9 commits intodenoland:mainfrom
dsherret:feat_strip_module_graph_data_global_to_local_copy
Apr 30, 2025
Merged

feat: strip jsr meta module graph data on global to local copy#78
dsherret merged 9 commits intodenoland:mainfrom
dsherret:feat_strip_module_graph_data_global_to_local_copy

Conversation

@dsherret
Copy link
Member

@dsherret dsherret commented Apr 30, 2025

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

@dsherret dsherret requested a review from Copilot April 30, 2025 21:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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>
@dsherret dsherret marked this pull request as ready for review April 30, 2025 21:33
@dsherret dsherret requested a review from nathanwhit April 30, 2025 21:33
@dsherret dsherret changed the title fix: strip jsr meta module graph data on global to local copy feat: strip jsr meta module graph data on global to local copy Apr 30, 2025
Copy link
Member

@nathanwhit nathanwhit 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 ab2d57f into denoland:main Apr 30, 2025
5 checks passed
@dsherret dsherret deleted the feat_strip_module_graph_data_global_to_local_copy branch April 30, 2025 21:53
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.

3 participants