nuxtrdev / nuxtr-vscode

An extension offering commands and tools to make your experience with Nuxt more pleasant.
https://marketplace.visualstudio.com/items?itemName=Nuxtr.nuxtr-vscode
338 stars 13 forks source link

[Bug]: Issue with bun support #63

Closed Blaquewithaq closed 1 year ago

Blaquewithaq commented 1 year ago

Environment

Nuxt project info:

What went wrong?

When using bun as the default package manager, the commands still use npm as the default manager.

I'm running linux in WSL on windows. I dont have npm install, only bun.

I've checked the developer logs on vscode to find this:

image

How to reproduce it?

Create an environment with ONLY bun (NO NPM). And try to update dependencies or install modules via the Nuxtr extension.

Blaquewithaq commented 1 year ago

Update on the issue:

I downloaded the extension repo and went digging around.

  1. bun doesn't have a version of this command: npm view ${package} versions
  2. bun when run does replacements of everything related to npm,yarn,pnpm,etc, therefor since there isn't a bun replacement command for this functionality, it is not replaced and therefor wont work.

The closest thing they have is bun pm ls which only lists the locally installed packages.

My idea for a solution (that will work for all) is to call the npm registry via their api and get the versions that way.

adhamfarrag commented 1 year ago

I love your excitement and thanks for making the time to do the PR! But I wish you discussed it first before making the time to implement it..

We're refactoring this feature soon and I'll consider your solution.

Blaquewithaq commented 1 year ago

I love your excitement and thanks for making the time to do the PR! But I wish you discussed it first before making the time to implement it..

We're refactoring this feature soon and I'll consider your solution.

No problem! If anything was fun to figure out. Cant wait to see what you've got in store

adhamfarrag commented 1 year ago

@Blaquewithaq Do you face any other issues with Linux via WSL?

Blaquewithaq commented 1 year ago

@Blaquewithaq Do you face any other issues with Linux via WSL?

Yes, there is another problem I came across after doing this PR. The function getOutdatedPackages needs to be reworked because bun does NOT have the command: bun outdated. This causes the update dependencies icon (in the status bar) to always be loading.

I did find an issue for the missing feature and it looks like it may be added in the future: https://github.com/oven-sh/bun/issues/1223