@@RainerHahnekamp In your example why do we need to specify '/src': 'nx-lib' ? We only care about the folders within it which are already handled by the config of tagging/modules right ?
@@dhavalv Sheriff marks every folder with an index.ts as a module. If I wouldn't have tagged /src then it would have received automatically the tag "noTag" (autoTagging feature). Strictly speaking, if you are fine with "noTag", you don't have to specify '/src'.
Is there any article for the same, I would love to watch it but I don't have much free time.
4 дня назад+1
Really great presentation as always @RainerHahnekamp. So if we want the Nx libs + Sheriff benefits at the same time as Nx requires index.ts by design currently, then how we can prevent developers using that Nx lib barrels (has a tsconfig paths) config not to reintroduce the tree-shaking issue with barrel files Sheriff solved with barrel less config. Is this something we cannot restrict programmatically and should have the team always in mind and not use that index.ts import and keep always empty (and update generated tsconfig from "@app/customers": ["libs/customers/src/index.ts"] to "@app/customers/*": ["libs/customers/src/lib/*"])? Thanks for your view on this.
Once you have an nx publishable library, it needs to have a barrel file. That's why I meant don't have so many "barrel modules" and keep them larger. So whenever you create an Nx library you should more think about it as a cacheable unit (which tends to be larger hopefully) and not so much of a module where you want to introduce encapsulation and dependency rules.
Talk that I was waiting for. Thank you @Rainer Hahnekamp
You're welcome Dhaval
@@RainerHahnekamp In your example why do we need to specify '/src': 'nx-lib' ? We only care about the folders within it which are already handled by the config of tagging/modules right ?
@@dhavalv Sheriff marks every folder with an index.ts as a module. If I wouldn't have tagged /src then it would have received automatically the tag "noTag" (autoTagging feature).
Strictly speaking, if you are fine with "noTag", you don't have to specify '/src'.
@@RainerHahnekampThank you for the reply.
@@dhavalv Always Dhaval 👍
Is there any article for the same, I would love to watch it but I don't have much free time.
Really great presentation as always @RainerHahnekamp. So if we want the Nx libs + Sheriff benefits at the same time as Nx requires index.ts by design currently, then how we can prevent developers using that Nx lib barrels (has a tsconfig paths) config not to reintroduce the tree-shaking issue with barrel files Sheriff solved with barrel less config. Is this something we cannot restrict programmatically and should have the team always in mind and not use that index.ts import and keep always empty (and update generated tsconfig from "@app/customers": ["libs/customers/src/index.ts"] to "@app/customers/*": ["libs/customers/src/lib/*"])? Thanks for your view on this.
Once you have an nx publishable library, it needs to have a barrel file. That's why I meant don't have so many "barrel modules" and keep them larger. So whenever you create an Nx library you should more think about it as a cacheable unit (which tends to be larger hopefully) and not so much of a module where you want to introduce encapsulation and dependency rules.