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/pm): support npm packages in 'deno add' #22715

Merged
merged 3 commits into from Mar 6, 2024

Conversation

nayeemrmn
Copy link
Collaborator

Also moves the cache for npm package metadata endpoints from $DENO_DIR/registries to the normal http cache like we use for jsr. It's slightly more convenient.

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.

Good job, this looks good to me. I'll leave it to David to do a final pass.

.map_err(|_| anyhow!("Custom jsr URL cannot be a base."))?
.pop_if_empty()
.push("packages");
let mut search_url = jsr_api_url().join("packages")?;
Copy link
Member

Choose a reason for hiding this comment

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

Nice clean up

Comment on lines +219 to +223
let range_symbol = if req.version_req.version_text().starts_with('~') {
'~'
} else {
'^'
};
Copy link
Member

Choose a reason for hiding this comment

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

TIOLI: factor out to a common function to remove duplication?

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

Great! LGTM!

cli/lsp/npm.rs Show resolved Hide resolved
cli/lsp/npm.rs Outdated Show resolved Hide resolved
@bartlomieju
Copy link
Member

Please land with feat(unstable): prefix.

@nayeemrmn nayeemrmn changed the title feat(pm): support npm packages in 'deno add' feat(unstable/pm): support npm packages in 'deno add' Mar 6, 2024
@nayeemrmn nayeemrmn merged commit 01bc2f5 into denoland:main Mar 6, 2024
17 checks passed
@nayeemrmn nayeemrmn deleted the pm-add-npm-packages branch March 6, 2024 13:31
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.

None yet

3 participants