-
Notifications
You must be signed in to change notification settings - Fork 12k
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
feat(@schematics/angular): Add the option to create an empty workspace #12223
Conversation
867b10e
to
444aca3
Compare
@@ -131,6 +131,12 @@ | |||
"type": "boolean", | |||
"default": false, | |||
"alias": "S" | |||
}, | |||
"empty": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, what do you think about reversing the logic, so that the options all represent positives? Otherwise it feels like it's added retroactively
- new option would be
createProject
or similar - it defaults to true
- if you want an empty project you do
ng new --createProject=false
(or do we supportng new --noCreateProject
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually disagree with this. I think the default should be negative and the options "turn them on"
As a user the cognitive load of turning on "empty" via --empty
is easier that the idea of "create project false" via `--noCreateProject".
This is the same approach for most CLI tools I've used.
deleting a directory: rm -rf
where you're setting recursive and force to true
pushing a branch git push origin some-branch -f
sets force to true
Taking this to the next level, I think a standardization of the provided boolean options for schematics and architect should be done at some point. It will provide consistency to users about how to use any of the available boolean options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I'm saying is, imagine you didn't know what is the current behavior of Angular CLI.
There is a command that creates a new workspace, it can optionally also create a project.
Empty is the natural default state of the new workspace. The option --createProject
also does a second step of populating the new workspace.
When I say negative, I mean that --empty
is saying that there's something that should not be created.
Now, it so happens that for backwards compat, our users expect that --createProject
should be the default since that matches what we do today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I certainly concede to that idea, but one of the principles on which the CLI was started (at least in my eyes) was to get started quickly by reducing the barrier to entry. With that being said, I think the idea of changing the default behavior of ng new
to not create a project would be a mistake.
Also, I think this conversation could/should be moved over to the actual issue for historical purposes.
444aca3
to
ab1de04
Compare
Hi @Brocco! This PR has merge conflicts due to recent upstream merges. |
ab1de04
to
cb69c95
Compare
I added a comment on the attached issue, good point about keeping discussion there |
Discussed in team meeting, we'd like the new option to be We decided having positive flags outweighs the desire to have defaults be false. |
Thanks @alexeagle I will update the PR to reflect that decision. |
Possible 3rd option... instead of having a boolean create an enumeration option named |
fine with me to have |
Leaving this opened, but it seems it will miss the 7.0 RC deadline. I'll keep it on our backlog so we can look at it again around 7.1. Cheers! |
cb69c95
to
1f09502
Compare
…ation of an application Fixes angular#12216
1f09502
to
6aea2dd
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes #12216