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

Remove config files after a 'npm uninstall' #6616

Open
Jwaegebaert opened this issue Feb 28, 2025 · 3 comments
Open

Remove config files after a 'npm uninstall' #6616

Jwaegebaert opened this issue Feb 28, 2025 · 3 comments

Comments

@Jwaegebaert
Copy link
Contributor

Jwaegebaert commented Feb 28, 2025

When a user uninstalls our package, config files like .cli-m365-all-connections.json are not automatically removed. These leftover files should be cleaned up to maintain a tidy environment and prevent potential issues. We need to explore a solution that ensures these files are properly deleted during the uninstallation process, avoiding unnecessary data persistence.

Ref: #6601 (comment)

@Jwaegebaert
Copy link
Contributor Author

Just had a quick look at the npm docs and it doesn't seem like we'll have an easy way to hook onto uninstall events:

Due to the lack of necessary context, uninstall lifecycle scripts are not implemented and will not function.

ref: https://docs.npmjs.com/cli/v11/using-npm/scripts#a-note-on-a-lack-of-npm-uninstall-scripts

@waldekmastykarz
Copy link
Member

Good find. We might need to consider a separate command that does the cleanup such as m365 uninstall. After cleaning up, it would show a message to run npm uninstall.

@Adam-it
Copy link
Member

Adam-it commented Mar 7, 2025

What if we just create some uninstallation guidance around that? A separate command to do that seems a bit if an overkill for me.

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

No branches or pull requests

3 participants