-
Notifications
You must be signed in to change notification settings - Fork 294
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
New CLI onboarding #913
Merged
Merged
New CLI onboarding #913
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blittle
reviewed
Jun 30, 2023
blittle
approved these changes
Jun 30, 2023
Closed
juanpprieto
pushed a commit
that referenced
this pull request
Jul 10, 2023
* 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
Merged
FrcPpe
pushed a commit
to FrcPpe/hydrogen
that referenced
this pull request
Aug 13, 2023
* 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 (Shopify#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 (Shopify#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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Working here on the new CLI onboarding. Design here.
Todos
h2 setup css-unstable <strategy>
command to setuptailwind
,postcss
,css-modules
orvanilla-extract
.h2 setup i18n-unstable <strategy>
command to setup internationalization withsubfolders
,domains
orsubdomains
strategy.init
command:init
flow:storeDomain
#986h2
alias.--i18n subfolders --css tailwind
)generate route
respects i18n subfolders setuph2 setup
command to continue setup laterDefault Tailwind classes / better raw routes=> in another PR🎩 Tophat/feedback
Would like to ensure it all works since this is 80% done and will be ready to merge soon.
npm run build:pkg
.cd templates
, then runh2 init
and try the flow with different options. This command will prompt to choose a package manager for installing deps. This is automatically inferred if you usenpm|yarn|pnpm create @shopify/hydrogen@latest
once the new version is published.Checklist