-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Lerna: Dependency cycles in devDependencies #6523
Comments
Perhaps there are some deeper issues. I think we should make our typing resilient and less duplicated. I personally not encourage inline typing and more favour using Most of file will be modularized, which makes typing also modularized and potentially cyclic referenced (but we only need to get the type...). That is how I see why migrate to TS get weird errors. Why not just have a file just for typing?! Maybe less intuitive/convenient but I think the we should not mix type mingle with its implementation. Here is my approach in |
I think we DO NOT have any production cyclic dependencies. it's devDependencies that make things cyclical. The solution is likely to not include the devDependencies in the Because they are guaranteed to be there when developing in the monorepo. Essentially all devDependencies could be in the package.json in the root, and our own packages don't need to appear in package.json if they are ONLY used during dev on that package. |
@ndelangen Yes exactly it's only due to
I'm ok with that and already tried it 😉 by doing so it raises ts-lint error no-implicit-dependencies. BUT I just found that we can, fortunately, add a whitelist of modules that will be skipped during ts-lint check. So if you're ok, I will add a commit to #6500 to remove |
Sounds good! |
Fixed with #6500 |
Storybook monorepo contains some cyclic dependencies, they are listed during
yarn bootstrap
:These cyclic dependencies caused some build to fails because lerna doesn't know which libs should be built first. It was not a big deal when SB was fully JS but since we have some libs in TS type checking during compilation is failing, causing the full build to fail too. For instance, this build linked to #6500.
In fact, there are cyclic dependencies mainly because
@storybook/components
has@storybook/addon-actions
and@storybook/react
asdevDependencies
(and the latter finally depends on@storybook/components
) because we have stories for almost all components from@storybook/components
. I'm a big fan of having stories in the same folder as the components they describe but it looks like it's causing some trouble in our case...As more and more parts of SB will be migrated to TS I think we should discuss and try to find solutions about this.
--
🤷♂️ Not sure which tags I should put on this issue
The text was updated successfully, but these errors were encountered: