Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[legacy-framework] Allow user to select a recipe with blitz install command #2828

Merged
merged 38 commits into from
Oct 18, 2021

Conversation

mochi-sann
Copy link

@mochi-sann mochi-sann commented Oct 9, 2021

Closes: blitz-js/legacy-framework#233

What are the changes and their implications?

If a user doesn't provide a recipe name, the command will show a prompt to choose a recipe from a list of available recipes.

Screenshot 2021-10-18 at 12 22 32

Bug Checklist

  • Integration test added (see test docs if needed)

Feature Checklist

@mochi-sann mochi-sann marked this pull request as ready for review October 9, 2021 07:57
@mochi-sann mochi-sann changed the title blitz cli add import list Add a list of recipes to the Blitz CLI command Oct 9, 2021
@mochi-sann
Copy link
Author

Oops, the list of recipes contains tsconfig.json which is not a recipe, I'll fix it.

@mochi-sann
Copy link
Author

Oops, the list of recipes contains tsconfig.json which is not a recipe, I'll fix it.

I fixed it
screenshot 2021-10-11 11 54 10

packages/cli/src/commands/install.ts Outdated Show resolved Hide resolved
packages/cli/src/commands/install.ts Outdated Show resolved Hide resolved
@beerose
Copy link
Contributor

beerose commented Oct 11, 2021

Thanks for your contribution, @mochi-sann!

And thanks for the review, @piotrski!

@mochi-sann
Copy link
Author

Fixed to use table helper from @blitzjs/display. Please review.

Copy link
Contributor

@beerose beerose left a comment

Choose a reason for hiding this comment

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

Great job! Left minor comments.

Do you think, we could have some tests for that here: https://github.com/blitz-js/blitz/blob/canary/packages/cli/test/commands/install.test.ts#L4?

packages/cli/src/commands/install.ts Outdated Show resolved Hide resolved
packages/cli/src/commands/install.ts Outdated Show resolved Hide resolved
packages/cli/src/commands/install.ts Outdated Show resolved Hide resolved
@beerose
Copy link
Contributor

beerose commented Oct 16, 2021

I made it so that the prompt to select Recipe appears as in the video.

Wow! So cool! I'll take a look on Monday and review.

@abuuzayr
Copy link
Collaborator

this looks awesome @mochi-sann thank you!

@s-r-x
Copy link

s-r-x commented Oct 17, 2021

👍 good stuff

Comment on lines 275 to 277
if (flags.list || !args.recipe) {
const officialRecipeList = await this.getOfficialRecipeList()
recipeInfo = this.normalizeRecipePath(await this.officialRecipeListTable(officialRecipeList))
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering do we still need the --list flag if it's handled in the same way as not passing the arg? What do you think?

Copy link
Author

@mochi-sann mochi-sann Oct 18, 2021

Choose a reason for hiding this comment

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

The Gatsby.js cli, which also implements Recipe, works in a similar way, but without the list flag, so we think the Blitz cli should be able to do the same without the list flag
screenshot 2021-10-18 12 04 38

Copy link
Author

Choose a reason for hiding this comment

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

9661bf3
I removed list flag

beerose
beerose previously approved these changes Oct 18, 2021
Copy link
Contributor

@beerose beerose left a comment

Choose a reason for hiding this comment

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

Works amazing! Thank you a lot for your contribution and sorry for a lot of back and forth with review


I pushed a small change to fix Cloning GitHub repository for undefined recipe message when selecting a recipe via prompt

@beerose
Copy link
Contributor

beerose commented Oct 18, 2021

You can go ahead and update the docs PR according to the latest changes :)

@beerose beerose changed the title Add a list of recipes to the Blitz CLI command Add recipes prompt to blitz install command Oct 18, 2021
@beerose beerose changed the title Add recipes prompt to blitz install command Allow user to select a recipe with blitz install command Oct 18, 2021
@beerose beerose merged commit 3c62425 into blitz-js:canary Oct 18, 2021
@blitzjs-bot
Copy link
Contributor

Added @mochi-sann contributions for code and test

@itsdillon itsdillon changed the title Allow user to select a recipe with blitz install command [legacy-framework] Allow user to select a recipe with blitz install command Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I want to see Blitz of recipe list on the blitz cli command
7 participants