Closed leostera closed 10 years ago
@adnan-i what do you think about this?
I agree about the second, more modularised approach, where all dependant files are contained inside the module. I guess the module-specific routes should/could also be defined in each module's routes file, because, from my experience, routes config grows pretty quickly.
Also, it looks like a simple module generator/scaffolding grunt command could come in handy.
Also, I don't know if requireJS plays nice with modularised config, but I believe it does. Currently, main.js file for the unit tests and for the app has lots of duplicated configuration. This would need to be optimised in the process.
Also, Karma would need to be adjusted to pick up all the tests, across the modules.
Either way, I think this is proper way to structuring mid-size to large CleverStack applications.
Apps should be able to be designed using small
modules
that provide certain functionality. Like apolls module
, or auser module
. Somemodules
will becommon modules
, some will have very specific functionality. This layout comes to mind:This way all the scripts are separated nicely. An even better approach in my opinion would be to have each
module
include all it's necessary elements:This way adding a module to a project would be a matter of copy-paste and could even be easily automated when
cleverstack-cli
is available. The build process would have to change, same as the bootstrapping. Perhaps this could be the chance to reconsider a leaner dependency management tool.Any thoughts team? @danielyoung @pilsy @nailgun @simonwjackson