Skip to content

Suggestion: running ng init against existing project should only check configuration files #4029

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

Closed
rexebin opened this issue Jan 15, 2017 · 7 comments
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@rexebin
Copy link

rexebin commented Jan 15, 2017

At the moment, after updating angular-cli packages, running ng init would go through all the generated files, including initial NgModules, AppComponent etc, which most likely would be changed by the developer to fit their apps' needs.

I think when running ng init against existing projects, we should be only asked if we want to update important configuration files that matters to angular-cli.

@filipesilva
Copy link
Contributor

This is actually something we're looking at, yes. This exact same suggestion.

I think the main ones are package.json and angular-cli.json, updated in a non-destructive fashion.

@filipesilva filipesilva added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: enhancement labels Jan 16, 2017
@CarreraPHP
Copy link
Contributor

@filipesilva , What about the possible breaking changes involved in the angular major version upgrade which may involve changes in the cli blueprints? Why not have a configuration within angular-cli.json file which can conditionally check the files other than package.json & angular-cli.json.

@zsfarkas
Copy link

I prefer updating everything with ng init and using the ide or a diff tool to compare the changes, so I can be sure that everything is up-to-date.

@rexebin
Copy link
Author

rexebin commented Jan 19, 2017

@zsfarkas I do the same for now, but find that it can be better to exclude app-related files.

@arlowhite
Copy link

I've gone through 4 or 5 angular-cli upgrades. These are the only times I recall needing to modifying other files aside from package.json and angular-cli.json

NgModule bootstrap change from Angular2 project
app.module.ts needed to be updated and possibly a couple other app files.

angular-cli testing changes

Two or three versions ago, the unit testing configuration was updated.

So +1, it would be nice if the update process didn't go through a diff on all files unless necessary for that release.

Also, someone suggested making the command ng update #4007

@filipesilva
Copy link
Contributor

We've removed ng init for now. In the future we're going to add a 'real' update functionality that would do this and more.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

5 participants