dsifford / yarn-completion

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

Feature request: support workspaces run through scripts #27

Closed Infiltrator closed 5 years ago

Infiltrator commented 5 years ago

package.json:

{
  "scripts": {
    "bar": "dotenv yarn -- workspace @foo/bar"
  }
}

Curruntly trying completion: yarn bar <TAB> defaults to file completion in the CWD.

It should instead use the scripts from the workspace's package.json.

dsifford commented 5 years ago

Just making sure I'm understanding this correctly. You'd like completion to be able to parse out and then complete directory names in individual scripts, if and only if script refer to a project workspace?

If so, then that's not feasible to add in. Too complex.

Infiltrator commented 5 years ago

Almost, but not quite. I would like it to complete using the scripts in the workspace's package.json instead of the ones in the root. It should do this if the script is a workspace script.

dsifford commented 5 years ago

Hey sorry about not getting back with you.

I'm working on an update that should close out #29 that might help you out with this.

I'm not going to support doing what I think you're describing because that's not how workspaces are supposed to function.

You should just be able to call yarn workspace <workspace-name> run <script-name> and that should be completed as expected.