-
Notifications
You must be signed in to change notification settings - Fork 6
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
Question: Public API in shared layer #45
Comments
That's currently how the public API rule is formulated:
The case with |
|
How would they degrade DX? And also what solution would you prefer? |
How it would degrade - I would have to go and configure every folder in As I said in my Russian comment - configure depth may be could solve it? |
Yes, if you want every folder in shared/ui to be an index, which I don't think is a great idea, because it kind of defeats the purpose of Public API
This rule is concerned with the presence of public API, so I would want any modifications to this rule to be modifications to the rules of public API. Currently, the public API is required on every slice and on every segment in Shared. If this requirement doesn't work well for your project, then we can discuss how we can change the definition of what a public API is |
I have another issue, but it's closely related to this discussion. ✘ Forbidden sidestep of public API when importing "shared/ui/form/index.tsx" from "features/my-feature/ui/Component.tsx". // no-public-api-sidestep As you can see I have segment
So, is it a bug, should we allow usage of deep index.ts? Or I have to flatten segments to have |
With Steiger 0.5.0, the public API rule was relaxed in |
@vdanchenkov your case should now be possible as well |
Как мы знаем shared слой состоит не из слайсов, а из сегментов. Требование Public API для сегментов shared слоя не кажется избыточным? Может вы не учли исключение shared слоя при написании этого правила?
Sandbox: https://codesandbox.io/p/devbox/steiger-test-g4f4wp
==================================================
Из этого вытекает вторая проблема: если в shared слое т.к. он состоит из сегментов убирать Public API - в линтере нужна настройка разрешенной глубины импортов для конкретного слоя, чтобы это не выглядело нарушением Public API, e.g.:
import from 'shared/ui/card'
Воспроизвести в сэндбоксе быстро не получилось.
The text was updated successfully, but these errors were encountered: