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

Add --quickstart flag to init command #1822

Merged
merged 3 commits into from Mar 13, 2024
Merged

Add --quickstart flag to init command #1822

merged 3 commits into from Mar 13, 2024

Conversation

gfscott
Copy link
Contributor

@gfscott gfscott commented Mar 6, 2024

Why are these changes introduced?

We want to make it fast to set up a Hydrogen app with a set of sensible defaults. This is helpful for users who are just kicking the tires and want to see what it's about. It also helps to streamline documentation, eliminating forks in the critical path and reducing decision fatigue.

What is this pull request doing?

This PR adds a new --quickstart flag to the init command. With no further user input required, it scaffolds a new Hydrogen project with the following defaults (which are the same ones we currently recommend, but which need to be selected manually by the user):

Option Value
Storefront/data source Mock.shop
Project name and path ./hydrogen-quickstart
Language JavaScript
CSS library Tailwind
Install dependencies? Yes
Install h2 alias? Yes
Scaffold standard routes? Yes
Enable Markets support? No

While these are the defaults, you can still override each option if you pass their respective flags with the quickstart flag.

How to test your changes? 🎩

  1. Checkout the branch
  2. In the monorepo, run npx shopify hydrogen init --quickstart
  3. Validate that a new Hydrogen project is scaffolded at ./hydrogen-quickstart.
  4. Also try overrides with individual flags. For example, TypeScript: npx shopify hydrogen init --quickstart --language ts

🎬

quickstart.mp4

Update: Also resolved the double-success-banner issue, and removed extraneous help links from the final succcess message:
image

Todos

  • Tests — probably need an assist here
  • Documentation updates should ship in parallel

@gfscott gfscott requested a review from frandiox March 6, 2024 23:28
@gfscott gfscott self-assigned this Mar 6, 2024

This comment has been minimized.

Copy link
Contributor

shopify bot commented Mar 6, 2024

Oxygen deployed a preview of your gfscott-quickstart branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
custom-cart-method ✅ Successful (Logs) Preview deployment Inspect deployment March 13, 2024 1:57 PM
subscriptions ✅ Successful (Logs) Preview deployment Inspect deployment March 13, 2024 1:57 PM
third-party-queries-caching ✅ Successful (Logs) Preview deployment Inspect deployment March 13, 2024 1:57 PM
vite ✅ Successful (Logs) Preview deployment Inspect deployment March 13, 2024 1:57 PM
skeleton ✅ Successful (Logs) Preview deployment Inspect deployment March 13, 2024 1:57 PM
optimistic-cart-ui ✅ Successful (Logs) Preview deployment Inspect deployment March 13, 2024 1:57 PM

Learn more about Hydrogen's GitHub integration.

Copy link
Contributor

@frandiox frandiox left a comment

Choose a reason for hiding this comment

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

Looks good! ✅
Remember to add a changeset 🙏

@gfscott gfscott force-pushed the gfscott-quickstart branch 3 times, most recently from d3db2b2 to 8a98eb0 Compare March 12, 2024 21:00
Remove extraneous help links in success message

prettier
Build with updated Oclif manifest

Changeset
@gfscott gfscott merged commit 5bb4330 into main Mar 13, 2024
13 checks passed
@gfscott gfscott deleted the gfscott-quickstart branch March 13, 2024 14:29
This was referenced Mar 13, 2024
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.

None yet

2 participants