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

feat: reset --reinstall --hard #777

Merged
merged 4 commits into from
Jan 31, 2024
Merged

feat: reset --reinstall --hard #777

merged 4 commits into from
Jan 31, 2024

Conversation

mdonnalley
Copy link
Contributor

@mdonnalley mdonnalley commented Jan 24, 2024

Adds --reinstall and --hard flags to plugins reset

--reinstall allows users to automatically reinstall every plugin that gets uninstalled
--hard will force remove all package manager related files (node_modules, package.json, yarn.lock, package-lock.json) from data directory (~/.local/share/<CLI>)

The goal is to provide users an easy way to get themselves into a clean state if something should go wrong in the upcoming transition from yarn to npm (#776)

reset.mov

Copy link

git2gus bot commented Jan 24, 2024

This issue has been linked to a new work item: W-14888440

@iowillhoit
Copy link
Contributor

iowillhoit commented Jan 26, 2024

QA NOTES

  • 🟢 Reinstalls signed, unsigned, and linked plugins
  • 🟡 When using --resinstall, it does not prompt to approve unsigned plugins (probably ok)
  • 🟢 Reinstalls the exact same version of a plugin
  • 🟢 The --hard command works as expected, removes all files
  • 🟠 If --hard is passed, there is no need to run plugins.uninstall first, right? Just delete the directory/files
  • 🟡 Suggestion: display the plugin version found [and optionally reinstalled]
  • 🟡 Suggestion: When a linked plugin is removed, display "✅ Unlinking plugin-x" (instead of "Uninstalling"). Similar to what is displayed during reinstall "✅ Relinked plugin-x"

@mdonnalley
Copy link
Contributor Author

🟡 When using --resinstall, it does not prompt to approve unsigned plugins (probably ok)

Yeah, not sure how I feel about this... Having them reconfirm could be annoying if they have a lot of plugins. Also, they've already installed them once so I'm not sure there's much value in asking again.

🟠 If --hard is passed, there is no need to run plugins.uninstall first, right? Just delete the directory/files

👍

🟡 Suggestion: display the plugin version found [and optionally reinstalled]

👍

🟡 Suggestion: When a linked plugin is removed, display "✅ Unlinking plugin-x" (instead of "Uninstalling"). Similar to what is displayed during reinstall "✅ Relinked plugin-x"

👍

@iowillhoit
Copy link
Contributor

QA UPDATE

  • 🟢 Versions of plugins are now displayed
    • 🟡 Version is not displayed on a relinked plugin. Not a huge deal since it is displayed in the unlinked message. See plugin-info below:
Found 4 plugins:
- @cristiand391/sf-plugin-api 0.1.0 (user)
- @salesforce/plugin-info 3.0.7 (link)
- @salesforce/plugin-community 3.0.1 (user)
- @salesforce/sfdx-scanner 3.20.0 (user)
✅ Uninstalled @cristiand391/sf-plugin-api
✅ Unlinked @salesforce/plugin-info
✅ Uninstalled @salesforce/plugin-community
✅ Uninstalled @salesforce/sfdx-scanner
✅ Reinstalled @cristiand391/sf-plugin-api@latest -> 0.1.0
✅ Relinked @salesforce/plugin-info <-- HERE
✅ Reinstalled @salesforce/[email protected] -> 3.0.1
✅ Reinstalled @salesforce/sfdx-scanner@latest -> 3.20.0
  • 🟢 Linked plugins now use "unlinked" and "relinked" in logs
  • 🟢 --hard deletes the folders without an uninstall
  • 🟠 I got an error once using sf plugins reset --hard --reinstall. I have not been able to reproduce it...
Found 4 plugins:
- @cristiand391/sf-plugin-api 0.1.0 (user)
- @salesforce/plugin-info 3.0.7 (link)
- @salesforce/plugin-community 3.0.1 (user)
- @salesforce/sfdx-scanner 3.20.0 (user)
✅ Removed the following files:
- /Users/ewillhoit/.local/share/sf/node_modules
- /Users/ewillhoit/.local/share/sf/package.json
- /Users/ewillhoit/.local/share/sf/yarn.lock
- /Users/ewillhoit/.local/share/sf/package-lock.json
    Error: ENOTEMPTY: directory not empty, rmdir '/Users/ewillhoit/.local/share/sf/node_modules/@typescript-eslint/scope-manager'
    Code: ENOTEMPTY

@mdonnalley mdonnalley merged commit 27504a2 into main Jan 31, 2024
13 checks passed
@mdonnalley mdonnalley deleted the mdonnalley/reinstall branch January 31, 2024 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants