mskelton / yarn-plugin-outdated

Yarn plugin to show outdated dependencies.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Filtering workspaces

rightaway opened this issue · comments

Could --workspace take an argument that filters the names so we can just check some of them? If there's a big monorepo with lots of projects and subprojects you could only be responsible for updating a some projects instead of everything so this argument can help.

  • --workspace @project/* get all subprojects for a project
  • --workspace */subproject get the same subproject from all projects
  • --workspace @project1/subproject1,@project2/subproject3 get unrelated subprojects

Or could be a new argument like --filter.

Yeah, I like that idea, and using the existing workspace option makes sense. Without passing anything it's sort of like saying "use the current workspace" but when specifying the option it's more granular.

It's telling me Usage Error: Pattern @project/subproject doesn't match any packages referenced by any workspace but that project is there in the Workspace column when I don't include --workspace. I tried it with @project/subproject plus the 3 patterns in the usual and it's the same error for all.

Likely the workspace name is being confused as the dependency pattern. I'm still iterating on the feature that I merged the other day, I'll likely be making it a breaking change to fix this bug since --workspace will soon require an argument rather than allowing a boolean.

For now though, this will work:

yarn outdated --workspace=@project/subproject

#61 includes some details about my upcoming plans for the --workspace flag.