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

import-js compliant #1053

Open
zirho opened this issue Mar 25, 2019 · 5 comments
Open

import-js compliant #1053

zirho opened this issue Mar 25, 2019 · 5 comments

Comments

@zirho
Copy link
Contributor

zirho commented Mar 25, 2019

Kutos to Lerna!
Hey guys, thank you for the great work.
Just wanted to fire up a conversation about recent Lerna migration.
I believe that it will give us a lot of advantages on maintainability in a long run.

Here is a thing I believe this project can do better.
For me, It became a second nature to use import-js to import other files' exports automatically.
Recent Lerna integration totally dismissed the advantage of it and affecting productivity due to the missing property 'main' in each of package.json.

At the same time, I am not 100% sure that I set my dev environment correctly so that auto import to work.
For me, I have to calculate how many folders I should hop through manually to import the file correctly.
Which is totally feasible compare to the advantage this project gives but I feel like it can be improved.

Do you guys have plan to battle that? or can you explain the way you guys auto-import exports if yours work?

Thanks!

related discussion
Galooshi/import-js#504

@larixer
Copy link
Member

larixer commented Mar 25, 2019

@zirho Hi. I'm not aware of this import-js tool. In your issue report you mention that module-packages have no, main. I think adding that is trivial. Will it make import-js work properly?

@zirho
Copy link
Contributor Author

zirho commented Mar 25, 2019

Hey Victor,
Thank you for the response.
I will test it out to see if it works later tonight.
I believe dependencies also should be populated but I saw you guys talking about that in another issue.

Thanks!

@larixer
Copy link
Member

larixer commented Mar 25, 2019

@zirho Yes, the dependencies need to be populated as well, but I guess not all of the dependencies, we certainly don't want to declare react dependency in each of the modules, only in core module

@larixer
Copy link
Member

larixer commented Mar 25, 2019

@zirho ... though if we have react as a peerDependency in every module, and specify exact react version in core module, that would be fine. I just don't want to update react dependency version in 30 packages, only in one package

@zirho
Copy link
Contributor Author

zirho commented Mar 31, 2019

@Vlasenko
Sorry for the late response.

Although I don't completely understand lerna architecture, just skimmed through the doc briefly, I see what you are saying.
Can we have core depends on react and have others depend on core so that they can import react from core?
It is just random thought.

Anyway, it seems importjs tries to parse the file and add import code when I add sibling packages in dependencies and add main: index.ts key in package.json.
However, it errors out due to the lack of typescript support. (parsing error)

There are certainly few more hoops required to get this working.
Maybe import-js can address this by getting aware of yarn workspace feature.

Let me dig more into it.
Thanks

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