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): ability to use a local copy of jsr packages #25068

Merged
merged 21 commits into from
Aug 20, 2024

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Aug 16, 2024

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"
  ]
}
  1. The referenced directory can be a JSR package or workspace. Referencing a single package found in a workspace will discover that entire workspace.
  2. The patch field is only respected in the workspace root. Other locations cause warnings.
  3. Referencing an npm package will currently warn and do nothing. Implementing this is probably two weeks of work in order to get the resolver working correctly so I removed it from this PR.

Going to land this as unstable in order to get feedback. I'm not really sure about the name because it sounds like it will be confusing with the concept of patching dependencies in npm or patching the vendor folder.

Closes #23412
Closes #24931

@dsherret dsherret changed the title feat: ability to use a local copy of a remote jsr package feat: ability to use a local copy of jsr and npm packages Aug 17, 2024
@dsherret dsherret changed the title feat: ability to use a local copy of jsr and npm packages feat(unstable): ability to use a local copy of jsr and npm packages Aug 17, 2024
@dsherret dsherret changed the title feat(unstable): ability to use a local copy of jsr and npm packages feat(unstable): ability to use a local copy of jsr packages Aug 17, 2024
@dsherret dsherret marked this pull request as ready for review August 18, 2024 22:15
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, I'm not sure about the name either, but I think we can safely land it as unstable feature for now.

Comment on lines +559 to +561
if self.warned_pkgs.insert(reference.req().clone()) {
log::warn!("{} {}\n at {}", colors::yellow("Warning"), diagnostic, referrer_range);
}
Copy link
Member

Choose a reason for hiding this comment

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

Does the message say that this patch was not used due to not matching constraints?

Comment on lines +1 to +2
Warning Workspace member '@denotest/[email protected]' was not used because it did not match '@denotest/add@1'
at file:///[WILDLINE]/mod.ts:1:21
Copy link
Member

Choose a reason for hiding this comment

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

Yes it does :)

@dsherret dsherret merged commit f1c58ec into denoland:main Aug 20, 2024
17 checks passed
@dsherret dsherret deleted the feat_patch_option branch August 20, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants