Is your feature request related to a problem? Please describe.
We should have a recommended way of organizing includes/utilities in our projects. I've seen some variations of:
- A
utils directory with a single index.ts file (doesn't make sense to me at all)
- A
modules/includes/utils directory with separate files with default exports
Describe the solution you'd like
I'd like to have a recommended way of adding utilities to a project. Personally I dislike creating a lot of folder structure with complex names, so I usually prefer a includes/modules directory with a file for each utility context or for each method. I also dislike having them exported as default since the name can be easily changed wherever they're imported.
Example:
src/runtime/
├── includes/
│ ├── flatObj.ts
│ ├── formatters.ts
│ ├── getClientLocale.ts
│ ├── loaderQueue.ts
│ ├── lookup.ts
│ └── memoize.ts
Or
src/runtime/
├── modules/
│ ├── flatObj.ts
│ ├── formatters.ts
│ ├── getClientLocale.ts
│ ├── loaderQueue.ts
│ ├── lookup.ts
│ └── memoize.ts
Describe alternatives you've considered
Additional context
Is your feature request related to a problem? Please describe.
We should have a recommended way of organizing includes/utilities in our projects. I've seen some variations of:
utilsdirectory with a singleindex.tsfile (doesn't make sense to me at all)modules/includes/utilsdirectory with separate files withdefaultexportsDescribe the solution you'd like
I'd like to have a recommended way of adding utilities to a project. Personally I dislike creating a lot of folder structure with complex names, so I usually prefer a
includes/modulesdirectory with a file for each utility context or for each method. I also dislike having them exported asdefaultsince the name can be easily changed wherever they're imported.Example:
Or
Describe alternatives you've consideredAdditional context