-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Add initial support for Lerna monorepos #11
Conversation
This looks great, thanks for the contribution! I tried a couple times to get this working and kept getting stuck, nice to see someone get it figured out. I have some small pieces of feedback, would you like that now, or were you thinking of adding the yarn support to this PR (if you think yarn support may drastically change this PR, I'll wait to provide any detailed feedback until that's ready)? Thanks! |
Please provide any feedback! I will address it as soon as possible :) |
I just added a commit with support for It works exactly the same, apart from looking in |
Awesome, I'll take a closer look today! One question: one thing I kept getting hung up on was how to properly implement support for when VS Code / yarn / lerna workspaces are nested, e.g. a lerna workspace inside a VS Code workspace. Would that be supported with this implementation? |
Ultimately not a blocker if not, as that is something that could be added incrementally. Just wanted to see if that was considered. |
I actually kept it in mind, and this case is fully supported. Let's say your workspace looks like this:
you will first be prompted to choose between |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple comments, otherwise this looks great, thanks again for the contribution!
Thanks for your quick review and feedback! |
Apologies for the delay, have been on vacation and forgot to circle back on this. I'll get this merged and published this weekend. Thanks again! |
@jasonnutter Hi, any news on publishing a new version? |
Sorry for the delay, working on it! See my comment on #13 |
@jasonnutter when will be a release ? |
This is a suggestion to support searching the
node_modules
of child packages inlerna
monorepos.(related to #10)
background
Workspaces that use
lerna
usually have the following file structure:Currently, for workspaces with this structure, the extension will search only in the root
/node_modules
, leaving the user unable to search in one of the child projects.With this PR, the user will be prompted to select which project to search in.
Logic
The logic that is used is as follows:
lerna.json
file at the root level - continue as beforelerna.json
file, and look at thepackages
field.Example json config file:
Search for packages matching the pattern(s) using
glob
.a package is a folder containing a
pakage.json
fileIf no packages are found - search the root
/node_modules
as beforePrompt the user to choose a project to search in: either the root or one of the packages
Search the selected project's
/node_modules
folder using the existing logicNote: patterns containing
**
are ignored for nowPlease tell me what you think.
If you agree with this direction, I would gladly extend the support to also include
**
andyarn
projects.@jasonnutter