devDependencies and turborepo #1728
Replies: 2 comments
-
I think it'd be a good idea to make our dependencies match their architecture as much as we can – so including components for tests as In terms of pie-form-label being linked to pie-switch and textarea – would the solution be to simply mock native inputs rather than use our components, and then let aperture handle testing full integration? I'm guessing we import them so that we test the integration between the label and some of our components, but I wonder what the best way arounf this would be (or just to choose a different form component that isn't linked to icons, if build time is the main issue). |
Beta Was this translation helpful? Give feedback.
-
I believe with the migration work we are doing at the moment should fix this issue. We'll look to have more details when we get into implementation but at that stage we'll have the tests running on storybook that should only need to build once on a deployment and then we can then test all the components that way. |
Beta Was this translation helpful? Give feedback.
-
For some components, we include other components inside
devDependencies
so that we can import them in a test.This works well from a testing perspective, however in terms of how turborepo interprets this, it can cause some issues.
For example,
pie-textarea
depends onpie-form-label
.pie-form-label
does not depend directly on any other components to function, however it has a dev dependency onpie-switch
andpie-text-input
, because these are imported in some tests.Because
pie-switch
depends onpie-icons-webc
, this means that buildingpie-textarea
causes turborepo to build all of the following:pie-css
pie-icons
pie-icons-webc
pie-webc-core
pie-switch
pie-assistive-text
pie-text-input
pie-form-label
pie-textarea
Ideally, it should only trigger the following:
pie-css
pie-webc-core
pie-form-label
pie-textarea
This is only really problematic because the icon builds are particularly slow.
As far as turborepo is concerned, this is apparently a problem with the package manager, so there is no config option we can choose to fix this.
I think there are two approaches (feel free to leave a comment if you think there are any more):
Beta Was this translation helpful? Give feedback.
All reactions