Skip to content

fix(workspace): support resolving bare specifiers to npm pkgs within a workspace #24611

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

Merged
merged 6 commits into from
Jul 17, 2024

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Jul 16, 2024

This makes bare specifiers for npm packages work when inside a workspace, which emulates the same behaviour as when there's a node_modules directory. The bare specifier can be overwritten by specifying an import map entry or package.json dependency entry.

Closes #24605

@@ -1,9 +1,7 @@
import * as a1 from "@denotest/a";
import * as a2 from "npm:@denotest/a@1";
import * as a3 from "npm:@denotest/a@workspace";
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

@dsherret dsherret Jul 16, 2024

Choose a reason for hiding this comment

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

The LSP doesn't support npm workspaces yet, so I did not implement this there (I'll add this PR as something to consider for #24505)

Copy link
Contributor

@nayeemrmn nayeemrmn 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 f4b9d85 into denoland:main Jul 17, 2024
17 checks passed
@dsherret dsherret deleted the fix_support_bare_specifiers_npm_pkgs branch July 17, 2024 13:13
bartlomieju pushed a commit that referenced this pull request Jul 22, 2024
…a workspace (#24611)

This makes bare specifiers for npm packages work when inside a
workspace, which emulates the same behaviour as when there's a
node_modules directory. The bare specifier can be overwritten by
specifying an import map entry or package.json dependency entry.

* denoland/deno_config#88

Closes #24605
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.

Support bare specifiers for npm package members in a workspace
3 participants