Skip to content

Commit

Permalink
New CLI onboarding (#913)
Browse files Browse the repository at this point in the history
* Refactor: extract format-code utilities

* Add setup-assets

* Add file utils and tests

* Setup Tailwind

* Fix paths and add renderTask

* Install Tailwind deps

* Update package-lock

* Fix asset replacement

* Refactor: extract common build paths

* Copy hello-world template to dist folder

* Make hello-world the default starter

* Fix timezone in CLI tests

* Refactor: extract admin requests

* Cleanup

* Setup local starter

* Refactor: split workflows

* Prompt for package maanger when unknown

* Change shop prompt

* Group tasks

* Remove .env variables when linking to shop

* Make setupTailwind more modular

* Add setup CSS step

* Merge branch '2023-04' into fd-new-onboarding

* Move CSS setup logic around and fix test

* Ensure promises are chained

* Prompt for creating h2 alias

* Ensure promises are chained

* Copilot comments

* Refactor: extract ast replacers

* Improve types and move files around

* Support PostCSS setup

* Prettify css strategy names

* Fix type of flagsToCamelObject

* Add install-deps flag to css-unstable

* Make root links replacer more flexible

* Add support for CSS modules setup

* Prettify output

* Extract css bundling injection

* Add support for vanilla-extract setup

* Update oclif manifest

* Prompt for styling library when no arg is passed

* Adjust prompts

* Add prompts for i18n and routes

* Add i18n setups

* Export I18nLocale type

* Fix TS version of domain and subdomains i18n setups

* Add I18nLocale type to remix.env.d.ts

* Adjust success message

* Force choosing a CSS strategy

* Adjust success message

* Show helpful commands at the end

* Adjust success message spacing

* Fix AST grep for JS

* Fix init test

* Refactor generate route command

* Hoist work to improve perf in route generation; add more tests

* Improve output logs

* Fix generate route

* Allow passing locale prefix

* Figure out locale prefix automatically

* Make the locale variable optional in path

* Scaffold all routes

* Simplify prompts format

* Add option to use mock.shop

* Init git and create initial commit

* Error handling

* Show errors properly in at the end

* Throw errors from replacers

* Fix tests

* Merge branch '2023-04' into fd-new-onboarding

* Feedback update

* Use AbortSignal in prompts

* Minor adjustments

* Align with design updates

* Disable i18n and routes setup for now

* Oclif manifest

* Remove all variables from .env when linking the store

* Update package-lock

* Integrate init with login flow

* Integrate create-storefront with new onboarding (#1058)

* Integrate create storefront in init

* Minor refactoring

* Add tests for create-storefront

* Infer path from storefront title

* Defer create-storefront integration

* Fix changesets

* Make shopName and email required fields in local config

* setUserAccount in init

* New onboarding - extra setup (#1050)

* Improve implementation of i18n templates

* Enable extra setup in init

* Add --styling flag

* Add --mock-shop flag

* Add --i18n flag

* Add --routes flag

* Allow negated flags

* Update summary to latest design

* Throw early when flags have invalid values

* Rename pathname to subfolders

* Show shortcut prompt earlier

* Align with design updates

* Add storefront name to package.json

* Show storefront name in dev command

* Update next steps

* Oclif manifest

* Skip some tests for now

* Add HR as dev dependency for types on CI

* Revert "Add HR as dev dependency for types on CI"

This reverts commit 7ded27f.

* Align with design updates

* Fix race condition

* Fix project overwrite

* Fix detecting TS in i18n setup

* Avoid importing types from HR directly

* Show login banner

* Refactor shortcut code files

* Refactor generate route code files

* Fix shortcut tests

* Refactor: split init command in multiple files

* Extra common prompts

* Rename types

* Refactor route generate input

* Extract renderRoutePrompt

* Disable dts in CLI to avoid Tsup bug copying d.ts files in templates

* Make renderProjectReady more flexible

* Extract flags

* Refactor handleCliShortcut

* Minor refactoring

* Add 'setup' command

* Ensure Remix versions are the same when copying assets

* Fix name added to package.json

* Changesets
  • Loading branch information
frandiox authored Jun 30, 2023
1 parent e11fcff commit ed9782b
Show file tree
Hide file tree
Showing 75 changed files with 4,272 additions and 931 deletions.
11 changes: 11 additions & 0 deletions .changeset/fair-masks-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@shopify/cli-hydrogen': minor
'@shopify/create-hydrogen': minor
---

The onboarding process when creating new Hydrogen apps has been reworked. Now you can:

- Create a new Shopify storefront and connect it to the local project, or use [Mock.shop](https://mock.shop).
- Scaffold CSS strategies: Tailwind, CSS Modules, Vanilla Extract, PostCSS.
- Scaffold i18n strategies: subfolders, domains, subdomains.
- Automatically generate core routes.
Loading

0 comments on commit ed9782b

Please sign in to comment.