-
Notifications
You must be signed in to change notification settings - Fork 256
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
Monorepo: Unexpected Error: Unusal baseDir passed to package reading function: #575
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. |
hi @jubairsaidi thanks for raising this bug. My guess is that this is because the dependency is found 'above' the folder dependency-cruiser is run from. I'll have to ponder a solution for that. |
@sverweij are dependencies that are part of the workspace supposed to be detected and not trigger |
@danielo515 (completely missed your question for some reason - hope the answer is still relevant for you) The answer is yes - Two caveats:
|
Thanks for the clarification |
@sverweij I'm trying to use the
|
I've tracked the second problem to dividab/tsconfig-paths#236 |
What I'd propose is to add a config option to mark the monorepo root for the purpose of finding This way a |
When setting
combinedDependencies
totrue
for my projects in a monorepo, and I runnpm run deps:check --workspace apps/users
from my monorepo root (which runs deps:check for just the one workspace) I get an error. When I remove the setting, I getno-non-package-json
errors as expected since the child package.json file has no deps specified.Expected Behavior
dep cruiser properly resolves the packages from my monorepo root.
Current Behavior
I get this error:
Possible Solution
Steps to Reproduce (for bugs)
create a project with the following structure:
in your
monodash/apps/users/src/index.ts
file, add an import that will cause dependency cruiser to fail if run withcombinedDependencies
tofalse
and pass if it's set totrue
.contents of
monodash/tsconfig.json
:contents of
monodash/apps/users/tsconfig.build.json
:add the following to your
monodash/package.json
file:add the following options to your
monodash/apps/users/.dependency-cruiser.json
file:add the following command to your
monodash/apps/users/package.json
file:then from your project root run:
Context
Your Environment
The text was updated successfully, but these errors were encountered: