FortAwesome / angular-fontawesome

Official Angular component for Font Awesome 5+
https://fontawesome.com
MIT License
1.49k stars 152 forks source link

Unable to remove Angular fontawesome from project #363

Closed 0x4a61636f62 closed 2 years ago

0x4a61636f62 commented 2 years ago

Describe the problem

When trying to uninstall the package, all node_modules are still present and my package.json still includes the dependencies.

What did you expect?

Modules removed from node_modules and dependencies removed from package.son

Reproducible test case

  1. Install Angular fontawesome with ng add @fortawesome/angular-fontawesome@latest.
  2. Remove Angular fontawesome with npm uninstall @fortawesome/angular-fontawesome

image

devoto13 commented 2 years ago

@99JS Thanks for the issue, but it works as intended.

npm uninstall @fortawesome/angular-fontawesome is an npm command to remove the @fortawesome/angular-fontawesome package and it did remove that package. It has no idea about the connection to other packages or code in your project and therefore it can't remove those.

ng add @fortawesome/angular-fontawesome@latest is our schematic to make it easier for users to get started with the library. It provides an interactive setup approach instead of a user reading the docs and adding dependencies/code manually.

We don't intend to provide any ng remove schematic to remove FontAwesome from the project because it is not a standard practice and it is not trivial to implement it. That's because the code could have been edited and undoing exactly what ng add did is a very niche use case. If you want to undo changes done by the ng add schematic, I would suggest using your VCS (Git, etc) to undo those changes. Or alternatively, you can run npm uninstall <package> for each of the packages you want to uninstall.