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

Add option for deno add to update package.json for npm packages #25321

Closed
redabacha opened this issue Aug 31, 2024 · 2 comments · Fixed by #25477
Closed

Add option for deno add to update package.json for npm packages #25321

redabacha opened this issue Aug 31, 2024 · 2 comments · Fixed by #25477
Assignees
Milestone

Comments

@redabacha
Copy link

currently running deno add will only update the deno configuration imports field however this isn't always desirable. for example when using typescript directly for type checking in a project rather than deno's type checker, intellisense imports will not work unless they're specified in the package.json.

with npm packages in deno.jsonc imports:
Screenshot 2024-08-31 at 11 15 35

with npm packages in package.json dependencies:
Screenshot 2024-08-31 at 11 16 39

@dsherret dsherret added this to the 2.0.0 milestone Aug 31, 2024
@redabacha
Copy link
Author

i've noticed that if the package.json is gone entirely, then it also seems to work as expected. i'm not familiar with typescript/vscode internals but i guess it's falling back to checking the node_modules folder if the package.json is missing?

@dsherret
Copy link
Member

dsherret commented Sep 3, 2024

We're going to update it for Deno 2.0 to add npm dependencies to the package.json if it exists. Otherwise it will continue to add to the deno.json.

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 a pull request may close this issue.

3 participants