-
Notifications
You must be signed in to change notification settings - Fork 251
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
Issue: failure to run with combinedDependencies: true on a monorepo #947
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
IRL I've seen this happen when dependency-cruiser is run not in the root of the monorepo but instead in one of its sub folders (workaround then typically: run from the root). Labeled as bug because dependency-cruiser either (1) needs to behave or (2) explain what's going on. |
Looking at the error message again it seems that the yarn workspaces in use in the project at hand has an unexpected non-string entry in the workspaces array (for yarn 2 and up The generic issue mentioned in my previous comment still exists, but seems unrelated to the current issue. |
…gs (instead of throwing) (#955) ## Description - ignore entries in 'workspaces' arrays that aren't strings, instead of throwing an exception Yarn workspaces is an array of strings according to [its documentation](https://yarnpkg.com/configuration/manifest#workspaces). Apparently is possible (and accepted?) to have other types than strings as well. Not sure whether that is _valid_, but at least it's happening in the field, witnessing #947, so we deal with it. ## Motivation and Context Addresses the error mentioned in #947 (and likely fixes it) ## How Has This Been Tested? - [x] green ci - [x] additional automated non-regression tests ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [ ] Documentation only change - [ ] Refactor (non-breaking change which fixes an issue without changing functionality) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist - [x] 📖 - My change doesn't require a documentation update, or ... - it _does_ and I have updated it - [x] ⚖️ - The contribution will be subject to [The MIT license](https://github.com/sverweij/dependency-cruiser/blob/main/LICENSE), and I'm OK with that. - The contribution is my own original work. - I am ok with the stuff in [**CONTRIBUTING.md**](https://github.com/sverweij/dependency-cruiser/blob/main/.github/CONTRIBUTING.md).
The fix mentioned above has shipped with [email protected] (release notes: v16.4.1) |
Expected Behavior
I'm using yarn workspaces, and I expect it to work out of the box
Current Behavior
whenever I turn on the
combinedDependencies: true
option, I get an errorWithout the option it runs ok, but reports packages as missing, where they are specified at the top level workspace package.json file
Possible Solution
I would love to see a more descriptive error, and ideally it would just work...
Steps to Reproduce (for bugs)
depcruise --init
wizard, choose the defaultscombinedDependencies: true
depcruise .
Context
Just trying dependency-cruiser out, as an alternative to circular dependency lint rule of eslint-plugin-import (see rule definition of
import/no-cycle
)I would also accept a workaround that disables the missing dependency check, if circular deps can be checked independently.
Your Environment
The text was updated successfully, but these errors were encountered: