Skip to content
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 support #22

Open
Fetz opened this issue Jul 25, 2018 · 9 comments
Open

Monorepo support #22

Fetz opened this issue Jul 25, 2018 · 9 comments

Comments

@Fetz
Copy link

Fetz commented Jul 25, 2018

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/
@drewdeponte
Copy link
Owner

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

@drewdeponte
Copy link
Owner

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

@Fetz
Copy link
Author

Fetz commented Jan 28, 2019

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
Copy link
Author

Fetz commented Jan 28, 2019

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

@drewdeponte
Copy link
Owner

@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
Copy link
Owner

@Fetz bump ^

@Fetz
Copy link
Author

Fetz commented Apr 16, 2019

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

@drewdeponte
Copy link
Owner

@Fetz did you ever get around to testing this?

@drewdeponte
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants