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: ability to patch jsr packages with local copies #100

Merged
merged 20 commits into from
Aug 18, 2024

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Aug 14, 2024

For denoland/deno#23412

Allows specifying the directory to another package or workspace similar to patch in cargo (https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html).

// deno.json
{
  "patch": [
    "../some-package-or-workspace"
  ]
}

@dsherret dsherret marked this pull request as ready for review August 15, 2024 16:59
@dsherret dsherret changed the title feat: ability to patch jsr packages with local copies feat: ability to patch npm and jsr packages with local copies Aug 16, 2024
@dsherret dsherret changed the title feat: ability to patch npm and jsr packages with local copies feat: ability to patch jsr packages with local copies Aug 17, 2024
Comment on lines +2324 to +2331
json!({
"patch": ["../dir"],
}),
json!({
"patch": [
"../../dir"
],
}),
Copy link
Member

Choose a reason for hiding this comment

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

I find this confusing. From what I can tell, you can specify a path to a directory that contains one or more packages that should be used for "patching". But to see which packages will actually be patched I need to go to that directory and look up all the configs to figure out the names.

Is there a reason why you went with a list for patch directories instead of having to specify a mapping between package name and its patch directory instead?

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 seems confusing because the test has the name dir. Usually the directory name would be something like ../deno_std/path or something like that. The user having to specify the package name in addition to the directory just seems like unnecessary bookkeeping since we can already tell the package name from the directory?

Copy link
Member

Choose a reason for hiding this comment

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

Okayi guess that's reaaonable

@dsherret dsherret merged commit ddb8183 into denoland:main Aug 18, 2024
3 checks passed
@dsherret dsherret deleted the feat_patch_config branch August 18, 2024 22:09
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