I’ve realized that my module ‘stack’ has ended up being complex enough that it has an unintended architecture (a tightly-coupled n-tier architecture aka the ‘big ball of mud’ architecture). As is typical of an ad hoc architecture it grew this way because I didn’t realize I was going to be doing enough ‘stuff’ to need to think about architecture — so I didn’t.
If you look at my various public non-archived Hugo repositories on GitHub and dig into the module dependencies you might see what I mean.
I has gotten me far enough for my highly altered version of ‘Ananke’, which I call ‘Dananke’ has reached enough of a point that I think my two websites that use it Princes and Madmen - my personal and political blog and Wild Tech “Garden” - my technical and professional website are working reasonably well, and I can no longer say that I am not a web developer / front-end developer (though I wouldn’t go so far as to claim I am a ‘good’ web developer / front-end developer).
That too grew organically and is going to fall into the re-architecture of my modules. I guess, without realizing it, I’ve been developing a good chunk of a framework.
Bottom line: two ‘best practices’ for module and theme development are to avoid tightly coupling module, and to plan one’s architecture before building more than one or two modules.
Live, learn, fix, repeat.