nx-examples
nx-examples copied to clipboard
Clarify Naming Convention for classes/interfaces and their file names
Can you please clarify what should be the naming convention for classes, service, interfaces in each lib? Shall they use "ScopeType..." prefix or not? I am seeing different variants being used, even in this example repo and can't produce a clear guideline for the team. For example, I'd expect the interface in https://github.com/nrwl/nx-examples/blob/master/libs/shared/product/types/src/lib/shared-product-types.ts to follow the file name and be called something like SharedProductType
to match the file name, or if this is not the convention why the module in https://github.com/nrwl/nx-examples/blob/master/libs/shared/product/state/src/lib/shared-product-state.module.ts can't simply be named ProductStateModule
? Why does it have scope as part of the name? And so forth.
Can someone please 🙏 explain two things:
- When the file names should have
[scope]-[type]-...
prefix? - When the classes/interfaces/constants in files above should have the same scope/type in their names and when they should not?
SharedUtilCreatePostResponseInterface
inlibs/shared/util-create-post-response-interface/...
lib sounds silly, but at least Nx 8 generates it this way.
Thank you very much.