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
Add option to limit Lerna to symlink only packages defined in scope #1766
Comments
We faced a similar problem. I'm also interested in the solution. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
For anyone who will have this issue there is workaround with writing custom script: It still is not as perfect as native lerna functionality, but at least it solves this issue without touching Lerna code. |
I don't believe altering the initial graph painting is the right place, it should be a method similar to |
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
A - monorepo packages
S - scope packages, list of packages combined together by
--scope
,--include-filtered-dependents
,--include-filtered-dependencies
,--since
N - 'not in scope' packages: A - S
Expected Behavior
Lerna symlinks only projects from list S to their dependents from list S.
Current Behavior
Lerna symlinks projects from list A to their dependents from list A
Tested locally
lerna/core/package-graph/index.js
Line 116 in d6e6a42
If I change above line into:
then
node_modules/project-name
in all lerna.json packages will not be replaced with symlink.Solution
We need to filter out some packages from being symlinked
Option 1
To add cli parameter (let's say,
--exclude-from-local-dependencies
) and pass its argument (list of packages or minimatch patterns) into PackageGraph (for all commands).But is more like tricky workaround - we will need to manually calculate difference between
lerna ls
andlerna ls --since --include-filtered-dependents
, and pass diff to--exclude-from-local-dependencies
Option 2 (best solution)
To add cli parameter (let's say,
--exclude-non-scope-from-local-dependencies
, or--scope-local
by analogy withforce-local
) and auto-diff by lerna and pass result to PackageGraph (for all commands). It would be the best solutionContext
We have couple of monorepos with ~200 projects in each, and with current behavior of Lerna we have to manually build almost all our projects just to test couple of them.
Related issues
#1421 - is about
--ignore
option, and this issue is aboutscope
Your Environment
lerna --version
npm --version
node --version
The text was updated successfully, but these errors were encountered: