dsifford / yarn-completion

Bash completion for Yarn
MIT License
277 stars 25 forks source link

fix: use workspace package name instead of directory basename #30

Closed n1ru4l closed 5 years ago

n1ru4l commented 5 years ago

Fixes #29

n1ru4l commented 5 years ago

@dsifford I have not used nohoist yet, IMHO we could merge this first and afterwards work on a solution that also works with nohoist.

dsifford commented 5 years ago

@n1ru4l Yeah, that's fine by me.

jgornick commented 5 years ago

Any updates on this? Anything I can help with?

dsifford commented 5 years ago

@jgornick The issue is coming up with a way to resolve the nohoist form of workspaces reliably using only posix-compatible shell tools (i.e., without introducing a dependency to the completions)

See here: https://github.com/dsifford/yarn-completion/pull/30#pullrequestreview-194687300

borekb commented 5 years ago

Have you considered yarn workspaces info to power this?

dsifford commented 5 years ago

@borekb yep, and that's prob what will have to happen unfortunately.

I was hesitant to add anything that depended on yarn running in the background because that is the singular annoyance I have with npm's completions; they are painfully slow due to having to wait for npm's filesystem I/O for a majority of things (notably, npm run <Tab>).

I'll make a note to get to this soon. Got some other things that are taking priority at the moment.

dsifford commented 5 years ago

@n1ru4l I just pushed a fix for this that properly parses out the workspaces using yarn workspaces info... The fix also now properly completes scripts from workspaces.. (so now yarn workspace foo run <Tab> will autocomplete script names in workspace foo).

Sorry for stepping on your toes. Thanks for your work on this nevertheless!

n1ru4l commented 5 years ago

No problems :) had no time to complete this anyways.

borekb commented 5 years ago

Doesn't quite work for me but it's probably some small thing: https://github.com/dsifford/yarn-completion/commit/4d4089296c032419968da68e4cf8086b602b51a8#r33134964. Otherwise, very happy for this!