If you're writing a custom / contrib module, it can sometimes be helpful to see how Drupal core organizes its data.
The list in the file(s) below is generated with the following command...
find . -type d -name 'src' -exec ls -F1 '{}' \; | sort | uniq -c | ggrep '/' | sort -r
... which looks for src/
folders, lists what is in them with a depth of 1, sorts the whole thing, filters them out to be unique (printing the number of duplicates), filters the list to only directories, and sorts the result in reverse (i.e.: so the biggest number comes first).
This command has been tested on BSD/MacOS ls
; but it should also work on GNU/Linux ls
. On systems running GNU grep, you may need to replace ggrep
with grep
.
The files in this gist are generated from a vanilla copy of Drupal core at the commit listed at the top; if you run the same command on an existing codebase (i.e.: with contrib/custom modules) you will get different results - but this can help you infer the conventions already used in your codebase.