Description
Current behavior
Cypress does not resolve CT Framework Definition correctly in monorepos with hoisted modules.
Desired behavior
Should correctly resolve.
Test code to reproduce
Use a monorepo, eg https://github.com/lmiller1990/ct-monorepo-bug
- yarn install
- notice
@lmiller1990/cypress-ct-solid-js
is in the root node_modules cd packages/foo
yarn cypress open
- Select CT
- Notice Solid.js is NOT shown in the list
Problem is we can't just require.resolve
- we first need to find all node_modules matching the cypress-ct-
glob. We currently do this by globbing the projectRoot - that's where the Cypress project is currently, so in this case it'll be packages/foo/node_modules/cypress-ct-*
. Code here:
cypress/packages/scaffold-config/src/ct-detect-third-party.ts
Lines 49 to 56 in e674f43
We need to recursively check up to the workspace root, I think - how you identify this, I'm not sure (eg if we are in an Nx repo, how to know the top level? Yarn monorepo? Other type of repo)?
Cypress Version
12.7.0
Node version
v16.17
Operating System
All
Debug Logs
n/a
Other
n/a