Skip to content

feat(config): support globs in links#34849

Merged
littledivy merged 2 commits into
mainfrom
orch/divybot-456
Jun 5, 2026
Merged

feat(config): support globs in links#34849
littledivy merged 2 commits into
mainfrom
orch/divybot-456

Conversation

@divybot

@divybot divybot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Adds glob expansion for deno.json links entries so local JSR/npm package folders can be linked with patterns, including file:// glob URLs.

Updates the config schema description and covers relative globs, file URL globs, and negated link patterns in workspace discovery tests.

Closes #31708
Closes denoland/divybot#456

@bartlomieju bartlomieju left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice — glob expansion, file:// globs, and negation all look correct, validation isn't bypassed (glob results flow through the same WorkspaceMemberNotAllowed/root-self-link checks), and the tests cover the happy paths. One change I'd like before merge:

Replace the "<glob>" placeholder with the actual glob string in errors. Glob-expanded entries currently carry a placeholder as raw_member:

link_dir_urls.extend(
  pattern_link_dir_urls.into_iter().map(|u| ("<glob>".to_string(), u)),
);

That raw_member is what ends up in both the ResolveLink error and the WorkspaceMemberNotAllowed error. So if a glob sweeps in a workspace member or the root (e.g. links: ["../*"]), or a match fails to resolve, the user gets:

... link '<glob>' ...

which is unactionable — it doesn't say which links entry caused it. Could you thread the originating pattern through collect_link_config_folders (return (raw_link, Url) pairs, or a map from result URL back to its source pattern) so the error names the verbatim glob, e.g. link '../*'? Even just the matched directory URL would be a big improvement, but the source pattern is what the user actually wrote, so that's ideal.

And please add a regression test that hits this error path so the message is exercised and locked in — e.g. a glob that expands to include the root config folder (or a workspace member), asserting the resulting diagnostic/error contains the originating pattern string rather than <glob>. Right now all three tests are on the success path, so the error label has no coverage.

Everything else LGTM.

@littledivy
littledivy enabled auto-merge (squash) June 5, 2026 14:10
@littledivy
littledivy merged commit 7dd994e into main Jun 5, 2026
136 checks passed
@littledivy
littledivy deleted the orch/divybot-456 branch June 5, 2026 14:58
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.

Add glob support to the "links" option in deno.json

3 participants