liferay-frontend-projects icon indicating copy to clipboard operation
liferay-frontend-projects copied to clipboard

Check target platform version in @liferay/cli

Open izaera opened this issue 2 years ago • 0 comments

👀 Please check the troubleshooting guide before reporting anything. It contains important information on how to fix or diagnose errors.

Issue type (mark with x)

  • [ ] :thinking: Question
  • [ ] :bug: Bug report
  • [X] :gift: Feature request
  • [ ] :woman_shrugging: Other

Version (mark with x)

  • [ ] :two: v2.x
  • [X] :three: v3.x

Description

Currently @liferay/cli delegates its commands in the target platform of the project (portal-base, portal-adapt-base, etc...).

This setup can break if the user runs a newer @liferay/cli version with an older target platform version, because some of the commands offered by @liferay/cli won't be available.

We should introduce some mechanism to:

  1. Check if a newer version of the target platform exists and notify the user accordingly
  2. If the user insists in running a newer @liferay/cli with an older target platform, fail gracefully if a command that is not available is run.

Number 2 can be very difficult to achieve (especially for flags like --configure and such) so we may simply warn the user if he doesn't update the target platform that some of the commands may be unstable. Another option could be delegating the command execution and help to the target platform too and leave @liferay/cli almost empty except for the project generation and upgrade parts.

izaera avatar Sep 20 '22 07:09 izaera