GoogleChromeLabs/ps-analysis-tool

PSAT CLI: Version Check and Update Prompt for PSAT CLI

Closed this issue · 1 comments

Feature Request

Description:

Implement a version check mechanism in the PSAT CLI that prompts users to update if they are running an outdated version. Additionally, include the CLI version information in all generated reports.

Motivation:

Users running outdated CLI versions may encounter issues or bugs that have been fixed in newer releases. This leads to unnecessary support requests and a frustrating user experience. Prompting users to update and providing version information in reports will help mitigate this problem.

User Story:

As a PSAT CLI user, I want to be notified if I'm running an outdated version so that I can avoid encountering known issues and get the most accurate results.

Acceptance Criteria:

  • When the PSAT CLI is executed, it checks for the latest version.
  • If a newer version is available, the CLI displays a message to the user, prompting them to update. The message should include clear instructions on how to update (e.g., the npm i -g @google-psat/cli command).
  • The PSAT CLI version used for analysis is included in the metadata of all generated reports (HTML, JSON).

Additional Information:

  • The version check could be performed using NPM's API or by comparing the local version with a version string fetched from a remote source (e.g., package.json file in the GitHub repository for the CLI package).
  • The update prompt message should be clear, concise, and easily noticeable by the user.

Example

You are currently using PSAT CLI version [current_version]. 
A newer version ([latest_version]) is available.

To get the latest features and bug fixes, please update:
npm i -g @google-psat/cli 

Released as a part of v0.11.0