alt icon indicating copy to clipboard operation
alt copied to clipboard

Monorepo support

Open Fetz opened this issue 7 years ago • 9 comments

When using in a monorepo (example Lerna), if you run alt from root of the repo, alt is not working. You need to go the first to one of the package folder

// repo tree example

├── package.json (private module)
├── packages/
│   ├── module1/
│   │   ├── package.json (module)
│   │   ├── src/
│   │   ├── tests/
│   ├── module2/
│   │   ├── package.json (module)
│   │   ├── src/
│   │   ├── tests/

Fetz avatar Jul 25 '18 11:07 Fetz

Is there a public repo I can test against and see exactly what you are seeing @Fetz?

drewdeponte avatar Jan 23 '19 17:01 drewdeponte

@Fetz also can you more precisely define what "not working" means?

drewdeponte avatar Jan 27 '19 05:01 drewdeponte

Is there a public repo I can test against and see exactly what you are seeing? No sadly not

also can you more precisely define what "not working" means? Doesn't find the alternate file, since the test file isn't in the expected folder.

If I understand correctly, how alt works, in a folder structure like this:

root of the project (git root)
.
├──packages/
│   ├── module1/
│   │   ├── src/
│   │   │   ├── file1.js

alt should try to look for the alt test here:

root of the project (git root)
.
├──test/
│   ├── packages/
│   │   ├── module1/
│   │   │   ├── src/
│   │   │   │   ├── file1.spec.js

but the tests are in this folder:

root of the project (git root)
.
├──packages/
│   ├── module1/
│   │   ├── tests/
│   │   │   ├── file1.spec.js

As well, I found as well that with new version of jest it supports tests files like this:

├──packages/
│   ├── file1.js
│   ├── __tests__ /
│   │   ├── file1.spec.js

Fetz avatar Jan 28 '19 10:01 Fetz

The only way I managed to handle all those variations from projects, was by using a configuration file for example using projectionist

Fetz avatar Jan 28 '19 10:01 Fetz

@Fetz I created a branch with a potential fix in it for this. Can you grab the "monorepo_support_22" branch and build it locally and use the appropriate build in the targets folder to test out if it is working correctly now?

If you have any questions or need guidance just hit me up.

drewdeponte avatar Jan 28 '19 21:01 drewdeponte

@Fetz bump ^

drewdeponte avatar Apr 15 '19 22:04 drewdeponte

@drewdeponte I will check today and I will let you know

Fetz avatar Apr 16 '19 11:04 Fetz

@Fetz did you ever get around to testing this?

drewdeponte avatar Jan 11 '22 05:01 drewdeponte

I just released a new major version bump of this, v4.0.0 which I believe should help this scenario.

drewdeponte avatar May 08 '23 04:05 drewdeponte