Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Updating plugins #133

Open
Giuspepe opened this issue Dec 7, 2022 · 1 comment
Open

Updating plugins #133

Giuspepe opened this issue Dec 7, 2022 · 1 comment
Labels
plugins All plugin related issues

Comments

@Giuspepe
Copy link
Contributor

Giuspepe commented Dec 7, 2022

We should add a command for updating plugins which have been installed to a sidekick cli.

PluginsUpdateCommand

The usage could look like this: <my_cli> sidekick plugins update <plugin> [version]

The implementation can be similar to UpdateCommand

  1. Download the plugin at the specified version (or latest if none was given)
  2. Run <plugin>/tool/update.dart and pass it the name of the cli, the currently installed plugin version, as well as the target version
  3. The update.dartscript must be implemented by the plugin author. If possible, he can implement automatic migrations. If there are breaking changes without automatic fixes, information messages can be printed or thrown here.
  4. Update the minimum constraint of the plugin dependency in the cli

Update check

How do we let the user know that an update for one of his plugins is available?

It would be nice to do an update check for a specific plugin only when a command of that plugin is run. However, I don't know how we can map the plugin which is currently being run to the plugin it comes from.

An easier way would be to do an update check for every installed plugin when running any command except the PluginsUpdateCommand.

But how do we know which plugins have been installed to the cli?

  1. We could save the information in the sidekick section of pubspec.yaml. A list of all plugins which have been installed under sidekick: plugins: [...]. When installing a plugin, we add its entry to that list.
  2. Read all direct dependencies from the cli's pubspec.yaml. Filter dependencies which themselves have a direct dependency on sidekick_plugin_installer - those are sidekick plugins.
@passsy passsy added the plugins All plugin related issues label Jan 6, 2023
@md-weber
Copy link

md-weber commented Jul 5, 2023

Maybe a short addition it would be great to see which plugins are installed from the CLI

cm plugins list
You have following plugins installed
> plugin_one
> plugin_two

Another idea is like a favorite plugins that will be visible. Something like:

cm plugins remote list
- [x] sidekick_vault - A short descritption
- [ ] dockerize_sidekick_plugin - A short description

You can find more relevant plugins here: https://pub.dev/packages?q=topic%3A+sidekick-plugin

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
plugins All plugin related issues
Projects
None yet
Development

No branches or pull requests

3 participants