You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Protean uses Copier to render project templates. A few enhancements are necessary to align it with Protean's overall philosophy:
Change the position of config.py to be within the bounded context directory:
Currently, config.py is initialized in the main project directory. But each project can contain multiple bounded contexts in separate subdirectories typically deployed as microservices. Since each bounded context can independently decide its own infra choices and configuration options, it is best to house the config.py within the bounded context, beside the domain definition file (domain.py).
Generate new Bounded Contexts
Currently, protean new initializes a new project structure, including a directory. But a more typical use case is to create multiple bounded contexts within the project directory. This is similar to project and apps in Django. So protean cli should support two options: new-app and new-domain, which spin up a new application and bounded contexts within it, respectively.
The current template structure generates a setup.py file for publishing the generated template, but it is better to migrate to Poetry to be future-proof. This can even be a choice for the user if setuptools and poetry diverge in functionality. We should ensure that packages are auto-detected with poetry, which is accomplished by find_packages in setuptools.
Add Test cases
There are no test cases for project structure generation, but we should write some primary sanity test cases. There are other projects which have added tests for their copier templates.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Protean uses Copier to render project templates. A few enhancements are necessary to align it with Protean's overall philosophy:
Change the position of
config.py
to be within the bounded context directory:Currently,
config.py
is initialized in the main project directory. But each project can contain multiple bounded contexts in separate subdirectories typically deployed as microservices. Since each bounded context can independently decide its own infra choices and configuration options, it is best to house theconfig.py
within the bounded context, beside the domain definition file (domain.py
).Generate new Bounded Contexts
Currently,
protean new
initializes a new project structure, including a directory. But a more typical use case is to create multiple bounded contexts within the project directory. This is similar toproject
andapps
in Django. Soprotean
cli should support two options:new-app
andnew-domain
, which spin up a new application and bounded contexts within it, respectively.Refer to
django-admin
documentation for examples.Switch to poetry
The current template structure generates a
setup.py
file for publishing the generated template, but it is better to migrate to Poetry to be future-proof. This can even be a choice for the user ifsetuptools
andpoetry
diverge in functionality. We should ensure that packages are auto-detected with poetry, which is accomplished byfind_packages
insetuptools
.Add Test cases
There are no test cases for project structure generation, but we should write some primary sanity test cases. There are other projects which have added tests for their copier templates.
Beta Was this translation helpful? Give feedback.
All reactions