Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible inconsistency with generate commands and directory options #119

Open
milanc opened this issue Dec 29, 2022 · 1 comment
Open

Possible inconsistency with generate commands and directory options #119

milanc opened this issue Dec 29, 2022 · 1 comment

Comments

@milanc
Copy link

milanc commented Dec 29, 2022

Hi,
First thank you for the great library and work done to help angular developers to be more productive.

I've started with writeup for a possible issue but it seems it is just my misunderstanding of the options in the nx console.
So this could be more of a question and possible need for different labeling/naming of the options.
You can read about my confusion in the initial writeup

When generating feature there are three options that, at least for me, are not clear enough
domain (described as "domain name")

  • was not sure if this will be a new domain or it should be existing
  • learned from the code that I can/should put path to a existing domain root folder if used directory option during domain generation (used "flights" to group)

directory (described as "Subpath within libs directory")

  • looks like the same option used for generating the domain
  • was expecting that I would put the folder I used when generating the domain (used "flights" to group)
  • does not seems to work as described as it creates a subfolder under the domain (provided as domain option) folder

domainDirectory (described as "domain name")

  • because the directory option did not work as expected I thought that this should be the path to the domain "flights/booking"
  • still not sure what this should be used for - possibly for having the different name instead of the predefined "domain" folder
  • was expecting that this should be the same as

Anyway, I think I was able to figure out how to work with this command but I think it these descriptions could use some tweaking.

Thank you,

My initial content
Hi, when you get some time could you please help me to understand the behavior based on few similar directory options

I wanted to create booking domain and the app with same name and separate them from the rest of the mono-repo in subfolder fligths
I used nx console that generates the following command
npx nx generate @angular-architects/ddd:domain booking --directory=flights --addApp --appDirectory=flights
After executed got this structure as expected
apps\flights\booking\project.json
libs\flights\booking\domain\project.json

After that I wanted to create a feature booking-manager as a part of the booking domain and add it to the app
nx console generated this command
npx nx generate @angular-architects/ddd:feature booking-manager --domain=booking --directory=flights --app=booking --appDirectory=flights
My expectation is that this feature will end up in the same place where the initial domain was created but dry run shows this
CREATE libs/**booking**/**flights**/feature-booking-manager/README.md
Am I missing something or the flights and booking folders are switched?
Application structure is recognized correctly
UPDATE apps/flights/booking/src/app/app.module.ts

@JakubPawlak
Copy link

Actually it doesn't work as expected :(
Command with described arguments are messing for example with tags:

npx nx g @angular-architects/ddd:feature booking-manager --domain flights --domainDirectory booking

Will add tag domain:flights. The expected tag is the same as domain - domain:booking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants