Skip to content

Conversation

@sujithvn
Copy link

@sujithvn sujithvn commented May 4, 2022

Signed-off-by: Sujith sujith@merchstack.com

Resolves reactioncommerce/cli#25
Impact: minor
Type: feature

Issue

A new property "projectType": "storefront-example" is required by the CLI to autoDetect the projectType when the user has not provided it as an argument.

Solution

Added a new property to package.json which would identify the project type.
"projectType": "storefront-example"
While issuing 'develop' command, we check if the projectType is provided by user as args and use it if present. Else we check for the newly introduced projectType property in package.json. If not found or if invalid, we throw error and exit.

Breaking changes

None.

Testing

Tested both cases of executing develop command with and without projectType argument - pass
Tested case where there is no projectType entry in package.json - pass
Tested case where there is invalid projectType entry in package.json - pass

Signed-off-by: Sujith <sujith@merchstack.com>
@sujithvn sujithvn requested a review from brent-hoover May 4, 2022 05:26
@sujithvn sujithvn changed the title feat-sujith-autoDetect-projectType Adds projectType to package.json (used to auto detect project type in CLI) May 4, 2022
Signed-off-by: Sujith <sujith@merchstack.com>
@brent-hoover brent-hoover merged commit 9226cd2 into trunk May 4, 2022
@brent-hoover brent-hoover deleted the feat-sujith-autoDetect-projectType branch May 4, 2022 06:59
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.

Auto-detect project type so that you can just type "reaction develop" rather than "reaction develop api"

3 participants