-
Notifications
You must be signed in to change notification settings - Fork 12k
defaultProject deprecated and automatically removed after update to 14.. now ng serve doesn't work #23470
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
Comments
Hi @coenmooij, There are a two main ways to choose which project to use;
Also the project name can autocompletion in the terminal by pressing tab, if autocompletion is supported and setup. I am going to mark this for further discussion with the rest of the team and discuss this a bit further. |
Hi @alan-agius4 , As for the longer typed version, that is more effort. Mainly I just don't see a reason to remove it, doesn't seem to be in the way? Or am I missing something? In the end, I feel a cli is a layer that translates the users command into action, and it should help the user, and make it as easy as possible, right? |
Not really understanding what is the problem with The In a monorepo it's also ambiguously that when running a command like |
Had some discussion on this and there are a number of options for users to consider to fit their workflow:
We briefly considered having We also don't feel that micro-optimizing typing is a real goal of the CLI. Particularly for I do admit that discoverability is a bit of a challenge. Exactly what project names are available is not obvious. Beyond those improvements, our take is that users have enough flexibility in how to control their projects and CLI tools that they shouldn't need |
It's more effort. And I never cd around my projects because I want to always be in root to do any commands. Helps me to have a consistent workflow and no surprises/side-effects.
Exactly because of that ambiguity you want this option. Let the project decide what it wants. The opinionated nature of angular is great but we are forcing workflow here instead of shepherding best practices. Forcing to be verbose in patterns is just adding extra boilerplate of developer time that could be fixed with configuration. Shouldn't commands work by default and with flags/options they become more powerful? I switch a lot between projects and we have some git hooks that we want to run so I always stop the server when I finish a task and get back to the develop branch or onto another issue. I can't be the only one. At the very least, Your considerations about which default project to show is exactly where configuration would be an asset. Because you don't know, you let the workspace decide. I think the commands should definitely behave similarly / as expected, but that doesn't mean they don't have their own uniqueness. How about an optional root 'serve' or 'build' configuration in which you can supply the default project? So with moving away from |
I'm also facing some issues with I have built a library (@hug/ngx-schematics-utilities) that ease the use of angular schematics and since ng14 many of the tests are failing due to When developing a schematic, running The developer is left alone to implement such a --project option inside his schematic to understand where the schematic should be applied. Having the |
I agree that for the Currently however, providing this option is trivial for schematics author. As all they need to do is to add a "project": {
"type": "string",
"description": "The name of the project.",
"$default": {
"$source": "projectName"
}
}, |
Thanks @alan-agius4 ! I was not aware of that provider and it surely is a good start to ease the process. |
- defaultProject was removed from the cli in angular 14 - this sets current working directory as default if --project argument is not specified as recommended here : angular/angular-cli#23470 (comment)
- defaultProject was removed from the cli in angular 14 - this sets current working directory as default if --project argument is not specified as recommended here : angular/angular-cli#23470 (comment)
- defaultProject was removed from the cli in angular 14 - this sets current working directory as default if --project argument is not specified as recommended here : angular/angular-cli#23470 (comment)
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. |
Which @angular/* package(s) are relevant/related to the feature request?
No response
Description
I've updated some workspace projects to angular 14. They contain mostly a library and an app, sometimes multiple of either.
in
angular.json
defaultProject is now removed and CLI gives a warning about it.However spinning up the dev environment is a daily task and ng serve is a nice shorthand to run it. Now I can't use it anymore (unless I change it back to deprecated state)
This is imo a step backwards. Commands should be simple by default and we can do that by configuration. I don't understand why you would remove power from the developer like this.
Proposed solution
Put it back like it was / undeprecate it.
or defaultServeProject or defaultBuildProject (which for most of our projects is different (lib vs app))
Alternatives considered
alternatives would be custom solutions like makefiles or just using npm run start (which is more typing, not that big of a deal but do it 100x per day and it becomes a big deal)
The text was updated successfully, but these errors were encountered: