Closed jonathanj closed 3 months ago
You should be able to achieve per-workspace output by first executing yarn workspaces focus ...
. Let me know if that works.
Maybe we could add support for a --focus ...
flag that acts like yarn workspaces focus ...
. One potential downside I see is that focus
will include workspaces that are dependencies of the focused workspace, which may not be desired.
@jonathanj I've put up a PR for a new --focus
flag. Can you try it out?
yarn plugin import https://raw.githubusercontent.com/mhassan1/yarn-plugin-licenses/focus/bundles/@yarnpkg/plugin-licenses.js
yarn licenses list --focus <workspace-a> --focus <workspace-b>
@jonathanj ☝️ Any thoughts?
@mhassan1 Sorry for the late reply. I needed this for work and ended up forking the project and implementing --include
with minimatch
(like Yarn does), as well as a --json
flag to output an array of license objects.
I tried out your focus flag and it works well, thank you! I'm sure anyone with a monorepo would find this useful, as I have.
Unrelated to this issue, I'm still dependent on my --json
output (it just outputs JSON, not NDJSON), is there some interest in adding this to the plugin?
@jonathanj Thanks! I'll release that PR.
Please create a new issue for the JSON request.
I'm not sure if I'm doing something wrong, but I would expect that running
yarn licenses generate-disclaimer
within a specific workspace would generate only the licenses applicable to that workspace.However, I'm seeing dependencies that exist in other (unrelated) workspaces within the project.
The relevant part of my
.yarnrc.yml
:If what I'm asking for is new behaviour, would you consider a PR that adds support for this, maybe via a
--include a,b,c
type option (to followyarn workspaces foreach --include
)?