Closed vjau closed 1 year ago
We are not very familiar with rush
, but have spent some time reviewing their docs and setting up a sample and this is what we found.
By default, there are is no package.json
or dependencies installed in the mono-repo root. Unless you configure dependencies to exist in your project root, Wallaby won't run from the root. This means you will need to update your configuration to tell Wallaby to start on a folder containing a package.json
and node_modules
. You can do this by specifying the Root path
in your Run Configuration.
The .npmrc
settings only apply to the project root (e.g. see https://github.com/microsoft/rushstack/issues/3324), which means you will need to: "manually add phantom dependencies in package.json". There seems to be an open issue in the rush repo to fix this limitation: https://github.com/microsoft/rushstack/issues/3542.
In a fresh sample repo, we were able to get Wallaby working with vitest
by explicitly adding these dependencies to the project with vitest
installed:
{
...
"@vitest/runner": "~0.34.3",
"@vitest/snapshot": "~0.34.3"
...
}
Once you've installed the dependencies and updated your your Run Configuration to set the Root path
to your project folder, it should work for you.
It's possible that you will need other dependencies (in addition to @vitest/runner
and @vitest/snapshot
). If you don't need them right now, it's also possible you will need them in the future with vitest
updates. Wallaby will tell you which dependency is missing so you can explicitly install it.
I can confirm this is working by adding those two phantom dependencies.
Issue description or question
I'm trying to get Wallaby to work with vitest with a Rush monorepo using pnpm.
I'm trying to create a Webstorm configuration for one of my subprojects using vitest.
When running the configuration, i get an error about missing @vitest/runner
Per instructions in the docs, i add
to my root .npmrc in
common/config/rush/.npmrc
I then force rush to reinstall everything. I can verify that i have a @vitest/runner installed in .pnpm folder located in
common/temp/node_modules/.pnpm
with a symbolic link incommon/temp/node_modules/@vitest/runner
Sadly, this doesn't fix the problem.
I then wonder if setting the wallaby root to as subfolder prevent it from seeing the root packages.
But setting walaby root to the monorepo root produces this error
Wallaby diagnostics report