turbo icon indicating copy to clipboard operation
turbo copied to clipboard

[VS Code Extension] Remove global `turbo` requirement

Open alan-nf opened this issue 1 year ago • 1 comments

Which project is this feature idea for?

Turborepo

Describe the feature you'd like to request

Feature Request: make the extension just gracefully, and silently, be quiet if it can't talk to the turbo server.

Explanation:

I work in an environment where npm/node are never installed globally and are driven by project installations. I cannot install turbo globally through npm, as I don't have a global npm installation.

In my turborepo-powered monorepo I added this to my .vscode/settings.json workspace settings to make it so that the extension works fine:

{
  "turbo.path": "./node_modules/.bin/turbo"
}

And this works great! Except when I load up a repository that either doesn't have turbo or doesn't have this setting:

image

Describe the solution you'd like

I would love it if the extension just gracefully, and silently, was quiet if it can't talk to the turbo server.

Bonus points: you can have some kind of error/warning if I open a turbo.json file and the extension is off/not functioning.

Describe alternatives you've considered

I'm trying out the extension and dealing with the annoyance of dismissing the errors when I open my non-turborepo projects. It's not killing me yet!

alan-nf avatar Feb 20 '24 03:02 alan-nf

Thanks for the patience while we sort out the various edge cases :) Assuming global turbo simplifies the logic but I do see there are probably cases (shared machines, or your scenario) where that is infeasible. I'll see if I can brainstorm some solution.

arlyon avatar Feb 20 '24 16:02 arlyon

Yeah, having the same issue even when I globally install the turbo package. Maybe it's related to my use of asdf to manage Node.js

weyert avatar Mar 06 '24 16:03 weyert

We try to detect using nvm but the issue is that vscode is likely not inheriting the env vars / path that inserts. If you can't install turbo globally the only solution is to override per-repo which is annoying however I would like to:

  • add support for querying asdf to find global turbo
  • try to fall back to querying the local package manager using pnpm ls and friends

I will get a PR up for this soon :)

arlyon avatar Mar 07 '24 09:03 arlyon

Heyo, new version with some better detection logic is being reviewed as we speak :)

arlyon avatar Mar 26 '24 12:03 arlyon