dsifford / yarn-completion

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

use package name instead of directory basename for workspace #29

Closed n1ru4l closed 5 years ago

n1ru4l commented 5 years ago

I think this are the relevant lines: https://github.com/dsifford/yarn-completion/blob/f0d517043b7f6d4244b82d57c0a28cacc5d0d08d/yarn-completion.bash#L905

The package name of a workspace package is not always equal to the folder name. E.g. a scoped package @organisation/foobar could be located under packages/foobar.

yarn-completion only completes with foobar instead of @organisation/foobar.

Therefore yarn-completion should rely on parsing the package name from the actual package.json of the workspace package.

dsifford commented 5 years ago

Good point. I'll look into getting this fixed as soon as I get some free time. PRs accepted also.