Skip to content

update command fails when project uses deprecated official plugin #156

@tedraykov

Description

@tedraykov

Issue Description

When an API project uses a deprecated reactioncommerce plugin, the reaction update command fails. When the CLI checks for version mismatch between the local plugin version and the latest remote plugin versions it compares the version of all local plugins to the remote ones. The problem arises when a project uses a deprecated plugin that's not present in the latest reactioncommerce API. Example of the that is the @reactioncommerce/api-plugin-payments-stripe.

If a the local project uses the @reactioncommerce/api-plugin-payments-stripe, when we check for the version of the plugin on the remote project here:

outdated: compareVersions.compare(cleanVersion(remoteDependencies[name]), cleanVersion(version), ">")

We get the following error:

Error: Invalid argument not valid semver ('' received)

This happens because the version of @reactioncommerce/api-plugin-payments-stripe on the remote project resolves to an empty string.

Instead of failing, the update command should display a warning message that the local project depends on a deprecated official plugin.

Steps to Reproduce

  1. Create a local project that uses the @reactioncommerce/api-plugin-payments-stripe plugin
  2. Run the reaction update command for this project
  3. The command fails with the error message mentioned previously in the issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions