Skip to content

Conversation

@tedraykov
Copy link
Collaborator

Resolves #156

Before comparing the local plugin version with the remote plugin version, check if the remote plugin still exists. In not, display a warning that the local project is using a deprecated plugin.

Test steps:

  1. Create a project through the cli
  2. Install the @reactioncommerce/api-plugin-payments-stripe plugin which has been deprecated
  3. Run the reaction update command
  4. In the logs you should see a warning that the stripe plugin has been deprecated but the update command will succeed nonetheless.

Signed-off-by: tedraykov [email protected]

@brent-hoover
Copy link
Collaborator

If I have a plugin that is not valid for whatever reason (for example, here I made it up) I still get the message:

[brent@ferret: 11:45:30 ~/Projects/merchstack/cli-test-projects/oct-31-2022/myserver  (master #) - [2016]
 »» reaction update
reaction-cli: Getting the local dependencies
reaction-cli: Getting the remote dependencies
reaction-cli: Plugin @reactioncommerce/api-plugin-payments-fake used by the local project has been officially deprecated.
reaction-cli: All plugins are up to date.
[brent@ferret: 11:45:44 ~/Projects/merchstack/cli-test-projects/oct-31-2022/myserver  (master #) - [2016]

We should probably make that message a little more generic like "We were unable to find {plugin-name} to update" so it's not confusing.

Copy link
Collaborator

@brent-hoover brent-hoover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just need to tweak the warning message to be a little more generic

.map(({ name, version }) => {
const remoteDependency = remoteDependencies[name];
if (remoteDependency === undefined) {
Logger.warn(`Plugin ${name} used by the local project has been officially deprecated.`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just kike Brent suggested

Suggested change
Logger.warn(`Plugin ${name} used by the local project has been officially deprecated.`);
Logger.warn(`We were unable to find ${name} to update`);

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.

update command fails when project uses deprecated official plugin

4 participants