Closed richardliebmann closed 9 months ago
Hi Richard, yes there is one: https://github.com/angular-architects/flight-app/tree/lab501-sheriff
Once Sheriff is activated, the module encapsulation feature is enabled for all libraries (same as in nx).
It is possible, though, to use the dependency rules for one library.
In sheriff.config.ts
, you would have to come up with something like this:
import { noDependencies, sameTag, SheriffConfig } from '@softarc/sheriff-core';
export const sheriffConfig: SheriffConfig = {
tagging: {
libs: {
'ui/src': ['shared', 'type:ui'],
'util-<util>/src': ['domain:all', 'type:all', 'shared'],
},
'apps/<app>/src/app': {
'domains/<domain>/<type>': ['domain:domain', 'type:all'],
},
},
depRules: {
root: ['*'],
'domain:': '*',
'type:*': '*',
'shared': 'shared'
},
};
In that case, the lib ui is not allowed to access anything from the domains.
Let me know, if you have any issues or something is not working.
Hi @richardliebmann , I hope that you could make use of the example. I'm going to close this issue. If there are some further questions, create a new issue. Thanks
Is there any example how to use sheriff with an nx monorepo workspace? I'd like to use it for only one library. Where have I place the config-file and the eslint rule? Currently I only get errors.
Thank's for your help!