Skip to content

Commit

Permalink
make sure destroy leaves no vestiges
Browse files Browse the repository at this point in the history
  • Loading branch information
yawboakye committed Jun 21, 2024
1 parent b93dac0 commit 9e67101
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/generators/categoria/domain_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ def setup_new_domain
domain_dir = Pathname.new("app/lib/#{file_name}")

in_root do
# turns out that in order to cleanly undo the changes
# introduced by the generator, we should make a few of
# the actions more explicit, and independent, like the
# creation of the domain directory itself.
empty_directory domain_dir

%w[
internal/commands
internal/models
Expand All @@ -26,7 +32,16 @@ def setup_new_domain
at: domain_dir.join(component_path)
end

create_file domain_dir.join("description.yml")
template \
"domain_description.yml.erb",
domain_dir.join("description.yml")
create_file domain_dir.join("README.md"), <<~README
# About #{module_name}
Describe the domain. You may provide usage guide for your public interfaces (commands).
Feel free to describe explicitly what may be implicit (e.g. triggered jobs, emitted
events, sent emails, etc).
README
end

template \
Expand Down
Empty file.
12 changes: 12 additions & 0 deletions lib/generators/categoria/templates/domain_description.yml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Domains are typically owned by one team (and one team can own)
# many domains. The contents of this yaml file help other teams
# quickly learn about the domain, and figure out how to contact
# the owners.
---

manifest:
owner:
github_username: "@owner-github-username"
slack_channel: "#owner-slack-channel"
email: "[email protected]"
team: "org-team-name"

0 comments on commit 9e67101

Please sign in to comment.