How to enforce separation of concerns between workspace packages? #2356
adam-arthur
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
It'll be via the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm working on a project where I have multiple packages in the same workspace. I want to enforce it such that Package A can only use items exposed via Package B's "main" file. Basically, limited to the api that somebody who does an npm/yarn install would see.
Why?
Separation of concerns. I don't want my codebase to devolve into a spaghetti-mess by having every project import implementation details from every other package. It's better to have a hard barrier, rather than rely on discipline... especially because in many cases there are files with the same name between projects.
Example:
I'm not sure where the best place to enforce this is though. Is it better that this be a TypeScript plugin? Should I be using Lerna? Regardless, having this capability would be a huge win for code quality and the value proposition of a monorepo setup.
Beta Was this translation helpful? Give feedback.
All reactions