From 390242af1a5a9f019f8a7b9e05850f2dac07ac86 Mon Sep 17 00:00:00 2001 From: Matt Seccafien Date: Fri, 27 May 2022 16:35:01 +0200 Subject: [PATCH] Drop prefixes from template names --- .changeset/config.json | 4 ++-- .changeset/sour-walls-work.md | 2 +- .github/contributing.md | 10 ++++----- .github/migration_guide.md | 6 +++--- .github/workflows/deployments.yml | 12 +++++------ .github/workflows/oxygen-deployment.yml | 6 +++--- .github/workflows/publish_stackblitz.yml | 8 +++---- .github/workflows/tests_and_lint.yml | 4 ++-- docs/framework/index.md | 4 ++-- docs/framework/routes.md | 2 +- docs/framework/seo.md | 20 +++++++++--------- packages/cli/README.md | 2 +- packages/create-hydrogen-app/CHANGELOG.md | 2 +- .../scripts/tmp-copy-template-from-dev.js | 6 +++--- .../eslint-plugin/.github/CONTRIBUTING.md | 6 +++--- .../.devcontainer/devcontainer.json | 0 .../.eslintrc.js | 0 .../.gitignore | 0 .../.stackblitzrc | 0 .../.vscode/extensions.json | 0 .../README.md | 2 +- .../_gitignore | 0 .../hydrogen.config.js | 0 .../index.html | 0 .../package.json | 2 +- .../postcss.config.js | 0 .../public/favicon.ico | Bin .../server.js | 0 .../src/App.server.jsx | 0 .../src/components/Button.client.jsx | 0 .../src/components/Cart.client.jsx | 0 .../src/components/CartIcon.jsx | 0 .../components/CartIconWithItems.client.jsx | 0 .../src/components/CartToggle.client.jsx | 0 .../src/components/CartUIProvider.client.jsx | 0 .../src/components/CountrySelector.client.jsx | 0 .../src/components/DefaultSeo.server.jsx | 0 .../src/components/FeaturedCollection.jsx | 0 .../src/components/Footer.server.jsx | 0 .../src/components/Gallery.client.jsx | 0 .../src/components/Header.client.jsx | 0 .../src/components/Layout.server.jsx | 0 .../components/LoadMoreProducts.client.jsx | 0 .../src/components/LoadingFallback.jsx | 0 .../components/LocalCartProvider.client.jsx | 0 .../MobileCountrySelector.client.jsx | 0 .../components/MobileNavigation.client.jsx | 0 .../components/MoneyCompareAtPrice.client.jsx | 0 .../src/components/MoneyPrice.client.jsx | 0 .../src/components/Navigation.client.jsx | 0 .../src/components/NotFound.server.jsx | 0 .../src/components/OpenIcon.jsx | 0 .../src/components/ProductCard.jsx | 0 .../src/components/ProductDetails.client.jsx | 0 .../src/components/ProductOptions.client.jsx | 0 .../components/ServerCartProvider.server.jsx | 0 .../src/components/SpinnerIcon.client.jsx | 0 .../src/components/Welcome.server.jsx | 0 .../account/AccountActivateForm.client.jsx | 0 .../account/AccountCreateForm.client.jsx | 0 .../account/AccountDetails.server.jsx | 0 .../src/components/account/AccountIcon.jsx | 0 .../account/AccountRecoverForm.client.jsx | 0 .../components/account/LoginForm.client.jsx | 0 .../account/LogoutButton.client.jsx | 0 .../account/PasswordResetForm.client.jsx | 0 .../src/index.css | 0 .../src/routes/account/activate.server.jsx | 0 .../[id]/[activationToken].server.jsx | 0 .../src/routes/account/index.server.jsx | 0 .../src/routes/account/login.server.jsx | 0 .../src/routes/account/logout.server.js | 0 .../src/routes/account/recover.server.jsx | 0 .../src/routes/account/register.server.jsx | 0 .../src/routes/account/reset.server.jsx | 0 .../reset/[id]/[resetToken].server.jsx | 0 .../routes/collections/[handle].server.jsx | 0 .../src/routes/countries.server.jsx | 0 .../src/routes/index.server.jsx | 7 ++++-- .../src/routes/pages/[handle].server.jsx | 0 .../src/routes/products/[handle].server.jsx | 0 .../src/routes/redirect.server.jsx | 0 .../src/routes/robots.txt.server.js | 0 .../src/routes/sitemap.xml.server.js | 0 .../tailwind.config.js | 0 .../tests/e2e/collections.test.js | 0 .../tests/e2e/index.test.js | 0 .../tests/e2e/performance-metrics.test.js | 0 .../tests/e2e/products.test.js | 0 .../tests/utils.ts | 0 .../vite.config.js | 0 .../README.md | 2 +- .../_gitignore | 0 .../hydrogen.config.js | 0 .../index.html | 0 .../package.json | 2 +- .../public/favicon.ico | Bin .../src/App.server.jsx | 0 .../src/index.css | 0 .../src/routes/index.server.jsx | 0 .../vite.config.js | 0 101 files changed, 56 insertions(+), 53 deletions(-) rename templates/{template-hydrogen-default => demo-store}/.devcontainer/devcontainer.json (100%) rename templates/{template-hydrogen-default => demo-store}/.eslintrc.js (100%) rename templates/{template-hydrogen-default => demo-store}/.gitignore (100%) rename templates/{template-hydrogen-default => demo-store}/.stackblitzrc (100%) rename templates/{template-hydrogen-default => demo-store}/.vscode/extensions.json (100%) rename templates/{template-hydrogen-default => demo-store}/README.md (95%) rename templates/{template-hydrogen-default => demo-store}/_gitignore (100%) rename templates/{template-hydrogen-default => demo-store}/hydrogen.config.js (100%) rename templates/{template-hydrogen-default => demo-store}/index.html (100%) rename templates/{template-hydrogen-default => demo-store}/package.json (96%) rename templates/{template-hydrogen-default => demo-store}/postcss.config.js (100%) rename templates/{template-hydrogen-default => demo-store}/public/favicon.ico (100%) rename templates/{template-hydrogen-default => demo-store}/server.js (100%) rename templates/{template-hydrogen-default => demo-store}/src/App.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/Button.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/Cart.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/CartIcon.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/CartIconWithItems.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/CartToggle.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/CartUIProvider.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/CountrySelector.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/DefaultSeo.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/FeaturedCollection.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/Footer.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/Gallery.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/Header.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/Layout.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/LoadMoreProducts.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/LoadingFallback.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/LocalCartProvider.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/MobileCountrySelector.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/MobileNavigation.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/MoneyCompareAtPrice.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/MoneyPrice.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/Navigation.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/NotFound.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/OpenIcon.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/ProductCard.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/ProductDetails.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/ProductOptions.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/ServerCartProvider.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/SpinnerIcon.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/Welcome.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/account/AccountActivateForm.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/account/AccountCreateForm.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/account/AccountDetails.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/account/AccountIcon.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/account/AccountRecoverForm.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/account/LoginForm.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/account/LogoutButton.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/components/account/PasswordResetForm.client.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/index.css (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/account/activate.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/account/activate/[id]/[activationToken].server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/account/index.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/account/login.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/account/logout.server.js (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/account/recover.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/account/register.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/account/reset.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/account/reset/[id]/[resetToken].server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/collections/[handle].server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/countries.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/index.server.jsx (97%) rename templates/{template-hydrogen-default => demo-store}/src/routes/pages/[handle].server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/products/[handle].server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/redirect.server.jsx (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/robots.txt.server.js (100%) rename templates/{template-hydrogen-default => demo-store}/src/routes/sitemap.xml.server.js (100%) rename templates/{template-hydrogen-default => demo-store}/tailwind.config.js (100%) rename templates/{template-hydrogen-default => demo-store}/tests/e2e/collections.test.js (100%) rename templates/{template-hydrogen-default => demo-store}/tests/e2e/index.test.js (100%) rename templates/{template-hydrogen-default => demo-store}/tests/e2e/performance-metrics.test.js (100%) rename templates/{template-hydrogen-default => demo-store}/tests/e2e/products.test.js (100%) rename templates/{template-hydrogen-default => demo-store}/tests/utils.ts (100%) rename templates/{template-hydrogen-default => demo-store}/vite.config.js (100%) rename templates/{template-hydrogen-hello-world => hello-world}/README.md (90%) rename templates/{template-hydrogen-hello-world => hello-world}/_gitignore (100%) rename templates/{template-hydrogen-hello-world => hello-world}/hydrogen.config.js (100%) rename templates/{template-hydrogen-hello-world => hello-world}/index.html (100%) rename templates/{template-hydrogen-hello-world => hello-world}/package.json (92%) rename templates/{template-hydrogen-hello-world => hello-world}/public/favicon.ico (100%) rename templates/{template-hydrogen-hello-world => hello-world}/src/App.server.jsx (100%) rename templates/{template-hydrogen-hello-world => hello-world}/src/index.css (100%) rename templates/{template-hydrogen-hello-world => hello-world}/src/routes/index.server.jsx (100%) rename templates/{template-hydrogen-hello-world => hello-world}/vite.config.js (100%) diff --git a/.changeset/config.json b/.changeset/config.json index 1eb3ff770e..3101f2d01d 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -8,8 +8,8 @@ "baseBranch": "v1.x-2022-07", "updateInternalDependencies": "patch", "ignore": [ - "template-hydrogen-default", - "template-hydrogen-hello-world", + "demo-store", + "hello-world", "test-server-components", "test-async-config", "hydrogen-playground", diff --git a/.changeset/sour-walls-work.md b/.changeset/sour-walls-work.md index ebdce9094c..dd85a5109c 100644 --- a/.changeset/sour-walls-work.md +++ b/.changeset/sour-walls-work.md @@ -1,5 +1,5 @@ --- -'template-hydrogen-default': minor +'demo-store': minor --- Removes Stylelint from default template diff --git a/.github/contributing.md b/.github/contributing.md index 72ffafbbb9..29e1cd5cc8 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -17,17 +17,17 @@ yarn dev To develop against a template, open a new terminal window or tab and choose from the available templates: -- templates/template-hydrogen-default -- templates/template-hydrogen-hello-world +- templates/demo-store +- templates/hello-world ```bash -cd templates/template-hydrogen-default +cd templates/demo-store yarn dev ``` Visit the dev environment at http://localhost:3000. -To make changes to the Demo Store template, edit the files in `templates/template-hydrogen-default`. +To make changes to the Demo Store template, edit the files in `templates/demo-store`. To modify Hydrogen framework, components, and hooks, edit the files in `packages/hydrogen`. @@ -189,7 +189,7 @@ Next, choose an option below. ### Option 1: `localdev` package -This option creates a new Hydrogen app similar to `templates/template-hydrogen-default` directly in the monorepo under `packages/localdev`. This directory is ignored in git, so your changes will not be tracked. +This option creates a new Hydrogen app similar to `templates/demo-store` directly in the monorepo under `packages/localdev`. This directory is ignored in git, so your changes will not be tracked. ```terminal create-hydrogen packages/localdev diff --git a/.github/migration_guide.md b/.github/migration_guide.md index c0845aa053..63cac8262a 100644 --- a/.github/migration_guide.md +++ b/.github/migration_guide.md @@ -253,9 +253,9 @@ return ( Additionally, consider adding the `Seo` component to the following places using the current demo store as a reference: -- **Home page**: [`src/pages/index.server.jsx`](https://github.com/Shopify/hydrogen/blob/8ea40b5e119883ca380406edc123d9cb10ca8650/examples/template-hydrogen-default/src/pages/index.server.jsx#L22) -- **Collections route**: [`/src/pages/collections/[handle].server.jsx`](https://github.com/Shopify/hydrogen/blob/8ea40b5e119883ca380406edc123d9cb10ca8650/examples/template-hydrogen-default/src/pages/collections/[handle].server.jsx#L42) -- **Pages route**: [`/src/pages/pages/[handle].server.jsx`](https://github.com/Shopify/hydrogen/blob/8ea40b5e119883ca380406edc123d9cb10ca8650/examples/template-hydrogen-default/src/pages/pages/[handle].server.jsx#L19) +- **Home page**: [`src/pages/index.server.jsx`](https://github.com/Shopify/hydrogen/blob/8ea40b5e119883ca380406edc123d9cb10ca8650/examples/demo-store/src/pages/index.server.jsx#L22) +- **Collections route**: [`/src/pages/collections/[handle].server.jsx`](https://github.com/Shopify/hydrogen/blob/8ea40b5e119883ca380406edc123d9cb10ca8650/examples/demo-store/src/pages/collections/[handle].server.jsx#L42) +- **Pages route**: [`/src/pages/pages/[handle].server.jsx`](https://github.com/Shopify/hydrogen/blob/8ea40b5e119883ca380406edc123d9cb10ca8650/examples/demo-store/src/pages/pages/[handle].server.jsx#L19) Learn more about [how SEO works in Hydrogen](https://shopify.dev/custom-storefronts/hydrogen/framework/seo). diff --git a/.github/workflows/deployments.yml b/.github/workflows/deployments.yml index 007a51e649..5ffbe03421 100644 --- a/.github/workflows/deployments.yml +++ b/.github/workflows/deployments.yml @@ -33,13 +33,13 @@ jobs: run: yarn workspace @shopify/hydrogen build - name: Make updates for Cloudflare Workers runtime - working-directory: ./templates/template-hydrogen-default + working-directory: ./templates/demo-store run: | cp ../../.github/deployments/cloudflare/* . yarn add @cloudflare/kv-asset-handler - name: Build for workers - working-directory: ./templates/template-hydrogen-default + working-directory: ./templates/demo-store run: | yarn shopify hydrogen build --entry worker @@ -49,7 +49,7 @@ jobs: CF_ACCOUNT_ID: ${{ secrets.DEPLOYMENT_CF_ACCOUNT_ID }} with: apiToken: ${{ secrets.DEPLOYMENT_CF_API_TOKEN }} - workingDirectory: ./templates/template-hydrogen-default + workingDirectory: ./templates/demo-store - name: Run health check run: | @@ -75,13 +75,13 @@ jobs: run: yarn workspace @shopify/hydrogen build - name: Make updates for Netlify Edge Functions runtime - working-directory: ./templates/template-hydrogen-default + working-directory: ./templates/demo-store run: | cp ../../.github/deployments/netlify/* . yarn add @netlify/hydrogen-platform - name: Build for Netlify Functions - working-directory: ./templates/template-hydrogen-default + working-directory: ./templates/demo-store run: | yarn vite build --outDir dist/client --manifest WORKER=true yarn vite build --ssr @netlify/hydrogen-platform/handler @@ -94,7 +94,7 @@ jobs: - name: Deploy to Netlify id: netlify-deploy - working-directory: ./templates/template-hydrogen-default + working-directory: ./templates/demo-store run: | netlify deploy --build --prod --json | jq -r '.deploy_url' > deploy.txt echo "::set-output name=deploy-url::$(cat deploy.txt)" diff --git a/.github/workflows/oxygen-deployment.yml b/.github/workflows/oxygen-deployment.yml index 86b6bd7b67..bc57249af5 100644 --- a/.github/workflows/oxygen-deployment.yml +++ b/.github/workflows/oxygen-deployment.yml @@ -30,7 +30,7 @@ jobs: - name: Generate deployment ID id: deployment-id - working-directory: ./templates/template-hydrogen-default + working-directory: ./templates/demo-store run: | yarn add ulid echo "::set-output name=ID::$(LC_ALL=C Tip: -> Explore an [example implementation in GitHub](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/src/routes/countries.server.jsx) that lazy loads [available countries](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/src/components/CountrySelector.client.jsx) by an API route (`/api/countries`). +> Explore an [example implementation in GitHub](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/src/routes/countries.server.jsx) that lazy loads [available countries](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/src/components/CountrySelector.client.jsx) by an API route (`/api/countries`). ### Concatenating requests diff --git a/docs/framework/seo.md b/docs/framework/seo.md index b8a0a9bca6..69a6187799 100644 --- a/docs/framework/seo.md +++ b/docs/framework/seo.md @@ -10,11 +10,11 @@ Hydrogen detects when a search engine crawls your shop and defaults to server-si Hydrogen includes an [`Seo`](https://shopify.dev/api/hydrogen/components/primitive/seo) client component that renders SEO information on a webpage. It also provides the following example SEO-related files in the [Demo Store template](https://shopify.dev/custom-storefronts/hydrogen/templates): -- [`DefaultSeo`](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/src/components/DefaultSeo.server.jsx): A server component that fetches the shop name and description and sets default values and templates for every page on a website +- [`DefaultSeo`](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/src/components/DefaultSeo.server.jsx): A server component that fetches the shop name and description and sets default values and templates for every page on a website -- [`Sitemap.xml.server.js`](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/src/routes/sitemap.xml.server.js): A file that generates all products, collections, and pages URLs using the Storefront API +- [`Sitemap.xml.server.js`](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/src/routes/sitemap.xml.server.js): A file that generates all products, collections, and pages URLs using the Storefront API -- [`Robots.txt.server.js`](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/src/routes/robots.txt.server.js): A file that sets default rules for which URLs can be crawled by search engines +- [`Robots.txt.server.js`](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/src/routes/robots.txt.server.js): A file that sets default rules for which URLs can be crawled by search engines ### `Seo` client component @@ -22,15 +22,15 @@ The [`Seo`](https://shopify.dev/api/hydrogen/components/primitive/seo) client co You can customize the `` tags at the route level: -- [Default page](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/src/components/DefaultSeo.server.jsx) -- [Home page](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/src/routes/index.server.jsx) -- [Pages page](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/src/routes/pages/[handle].server.jsx) -- [Product page](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/src/routes/products/[handle].server.jsx) -- [Collection page](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/src/routes/collections/[handle].server.jsx) +- [Default page](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/src/components/DefaultSeo.server.jsx) +- [Home page](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/src/routes/index.server.jsx) +- [Pages page](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/src/routes/pages/[handle].server.jsx) +- [Product page](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/src/routes/products/[handle].server.jsx) +- [Collection page](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/src/routes/collections/[handle].server.jsx) ### `DefaultSeo` server component -The [`DefaultSeo`](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/src/components/DefaultSeo.server.jsx) server component fetches your shop name (`shop.name`) and description (`shop.description`). This component provides the default SEO values for every page on your website. +The [`DefaultSeo`](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/src/components/DefaultSeo.server.jsx) server component fetches your shop name (`shop.name`) and description (`shop.description`). This component provides the default SEO values for every page on your website. You can override the default SEO values by passing in custom props: @@ -168,7 +168,7 @@ Pages that require authentication shouldn't be indexed by bots. For example, bot ## Limitations and considerations -The following limitations and considerations apply to the [XML sitemap](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/src/routes/sitemap.xml.server.js) that's included in the Demo Store template: +The following limitations and considerations apply to the [XML sitemap](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/src/routes/sitemap.xml.server.js) that's included in the Demo Store template: - The sitemap has a limit of 250 products, 250 collections, and 250 pages. You need to [paginate results](https://shopify.dev/api/usage/pagination-graphql) if your store has more than 250 resources. diff --git a/packages/cli/README.md b/packages/cli/README.md index 360880117a..428bdf4f81 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -5,7 +5,7 @@ The `hydrogen/cli` package provides interactive project scaffolding for Hydrogen apps and other useful commands to help you build on `@shopify/hydrogen`. > Note: -> The CLI doesn't currently generate the [Demo Store template](https://shopify.dev/custom-storefronts/hydrogen/templates). Run `npx create-hydrogen-app` to scaffold a new project with the Demo Store template. To contribute to the Demo Store template, update the [template files](https://github.com/Shopify/hydrogen/tree/main/templates/template-hydrogen-default). +> The CLI doesn't currently generate the [Demo Store template](https://shopify.dev/custom-storefronts/hydrogen/templates). Run `npx create-hydrogen-app` to scaffold a new project with the Demo Store template. To contribute to the Demo Store template, update the [template files](https://github.com/Shopify/hydrogen/tree/main/templates/demo-store). ## Installation diff --git a/packages/create-hydrogen-app/CHANGELOG.md b/packages/create-hydrogen-app/CHANGELOG.md index 0cc89a6d33..3d9030f769 100644 --- a/packages/create-hydrogen-app/CHANGELOG.md +++ b/packages/create-hydrogen-app/CHANGELOG.md @@ -288,7 +288,7 @@ }, []); ``` - See an example on how this could be done inside the Demo Store template [country selector](https://github.com/Shopify/hydrogen/blob/v1.x-2022-07/templates/template-hydrogen-default/src/components/CountrySelector.client.jsx) + See an example on how this could be done inside the Demo Store template [country selector](https://github.com/Shopify/hydrogen/blob/v1.x-2022-07/templates/demo-store/src/components/CountrySelector.client.jsx) * [#698](https://github.com/Shopify/hydrogen/pull/698) [`6f30b9a1`](https://github.com/Shopify/hydrogen/commit/6f30b9a1327f06d648a01dd94d539c7dcb3061e0) Thanks [@jplhomer](https://github.com/jplhomer)! - Basic end-to-end tests have been added to the default Hydrogen template. You can run tests in development: diff --git a/packages/create-hydrogen-app/scripts/tmp-copy-template-from-dev.js b/packages/create-hydrogen-app/scripts/tmp-copy-template-from-dev.js index f7606f97ee..3371b7b004 100644 --- a/packages/create-hydrogen-app/scripts/tmp-copy-template-from-dev.js +++ b/packages/create-hydrogen-app/scripts/tmp-copy-template-from-dev.js @@ -1,8 +1,8 @@ // @ts-check /** - * This is a temporary script meant to copy `templates/template-hydrogen-default` to `./template-hydrogen` - * while we are actively developing H2 in `templates/template-hydrogen-default`. Eventually, something else might happen. + * This is a temporary script meant to copy `templates/demo-store` to `./template-hydrogen` + * while we are actively developing H2 in `templates/demo-store`. Eventually, something else might happen. */ const path = require('path'); @@ -15,7 +15,7 @@ const devPath = path.resolve( '..', '..', 'templates', - 'template-hydrogen-default' + 'demo-store' ); const templatePath = path.resolve(__dirname, '..', './template-hydrogen'); const skipFiles = ['node_modules', 'dist', '.stackblitzrc']; diff --git a/packages/eslint-plugin/.github/CONTRIBUTING.md b/packages/eslint-plugin/.github/CONTRIBUTING.md index d9d48c4399..b7433f9f3a 100644 --- a/packages/eslint-plugin/.github/CONTRIBUTING.md +++ b/packages/eslint-plugin/.github/CONTRIBUTING.md @@ -17,17 +17,17 @@ Before submitting a PR please test your changes in one of the hydrogen templates To do this you must first run `yarn link` from within the `packages/eslint-plugin` folder. -Then make sure the ESLint configuration (`.eslintrc.js`) inside the template is extending from this plugin. For example, to test in the `template-hydrogen-default`, the `/examples/template-hydrogen-default/.eslintrc.js` should look something like this: +Then make sure the ESLint configuration (`.eslintrc.js`) inside the template is extending from this plugin. For example, to test in the `demo-store`, the `/examples/demo-store/.eslintrc.js` should look something like this: ```js -// example: /examples/template-hydrogen-default/.eslintrc.js` +// example: /examples/demo-store/.eslintrc.js` module.exports = { extends: ['plugin:hydrogen/recommended'], }; ``` -Then run `yarn link eslint-plugin-hydrogen` and `yarn lint:js` from within the Demo Store template (example: `/examples/template-hydrogen-default`). +Then run `yarn link eslint-plugin-hydrogen` and `yarn lint:js` from within the Demo Store template (example: `/examples/demo-store`). ## Resources diff --git a/templates/template-hydrogen-default/.devcontainer/devcontainer.json b/templates/demo-store/.devcontainer/devcontainer.json similarity index 100% rename from templates/template-hydrogen-default/.devcontainer/devcontainer.json rename to templates/demo-store/.devcontainer/devcontainer.json diff --git a/templates/template-hydrogen-default/.eslintrc.js b/templates/demo-store/.eslintrc.js similarity index 100% rename from templates/template-hydrogen-default/.eslintrc.js rename to templates/demo-store/.eslintrc.js diff --git a/templates/template-hydrogen-default/.gitignore b/templates/demo-store/.gitignore similarity index 100% rename from templates/template-hydrogen-default/.gitignore rename to templates/demo-store/.gitignore diff --git a/templates/template-hydrogen-default/.stackblitzrc b/templates/demo-store/.stackblitzrc similarity index 100% rename from templates/template-hydrogen-default/.stackblitzrc rename to templates/demo-store/.stackblitzrc diff --git a/templates/template-hydrogen-default/.vscode/extensions.json b/templates/demo-store/.vscode/extensions.json similarity index 100% rename from templates/template-hydrogen-default/.vscode/extensions.json rename to templates/demo-store/.vscode/extensions.json diff --git a/templates/template-hydrogen-default/README.md b/templates/demo-store/README.md similarity index 95% rename from templates/template-hydrogen-default/README.md rename to templates/demo-store/README.md index 653f8f1708..8747de9417 100644 --- a/templates/template-hydrogen-default/README.md +++ b/templates/demo-store/README.md @@ -4,7 +4,7 @@ Hydrogen is a React framework and SDK that you can use to build fast and dynamic [Check out the docs](https://shopify.dev/custom-storefronts/hydrogen) -[Run this template on StackBlitz](https://stackblitz.com/github/Shopify/hydrogen/tree/stackblitz/templates/template-hydrogen-default) +[Run this template on StackBlitz](https://stackblitz.com/github/Shopify/hydrogen/tree/stackblitz/templates/demo-store) ## What's in this template diff --git a/templates/template-hydrogen-default/_gitignore b/templates/demo-store/_gitignore similarity index 100% rename from templates/template-hydrogen-default/_gitignore rename to templates/demo-store/_gitignore diff --git a/templates/template-hydrogen-default/hydrogen.config.js b/templates/demo-store/hydrogen.config.js similarity index 100% rename from templates/template-hydrogen-default/hydrogen.config.js rename to templates/demo-store/hydrogen.config.js diff --git a/templates/template-hydrogen-default/index.html b/templates/demo-store/index.html similarity index 100% rename from templates/template-hydrogen-default/index.html rename to templates/demo-store/index.html diff --git a/templates/template-hydrogen-default/package.json b/templates/demo-store/package.json similarity index 96% rename from templates/template-hydrogen-default/package.json rename to templates/demo-store/package.json index fd08cf488b..b62e525c5f 100644 --- a/templates/template-hydrogen-default/package.json +++ b/templates/demo-store/package.json @@ -1,5 +1,5 @@ { - "name": "template-hydrogen-default", + "name": "demo-store", "description": "This the default template for Hydrogen", "version": "0.0.0", "license": "MIT", diff --git a/templates/template-hydrogen-default/postcss.config.js b/templates/demo-store/postcss.config.js similarity index 100% rename from templates/template-hydrogen-default/postcss.config.js rename to templates/demo-store/postcss.config.js diff --git a/templates/template-hydrogen-default/public/favicon.ico b/templates/demo-store/public/favicon.ico similarity index 100% rename from templates/template-hydrogen-default/public/favicon.ico rename to templates/demo-store/public/favicon.ico diff --git a/templates/template-hydrogen-default/server.js b/templates/demo-store/server.js similarity index 100% rename from templates/template-hydrogen-default/server.js rename to templates/demo-store/server.js diff --git a/templates/template-hydrogen-default/src/App.server.jsx b/templates/demo-store/src/App.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/App.server.jsx rename to templates/demo-store/src/App.server.jsx diff --git a/templates/template-hydrogen-default/src/components/Button.client.jsx b/templates/demo-store/src/components/Button.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/Button.client.jsx rename to templates/demo-store/src/components/Button.client.jsx diff --git a/templates/template-hydrogen-default/src/components/Cart.client.jsx b/templates/demo-store/src/components/Cart.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/Cart.client.jsx rename to templates/demo-store/src/components/Cart.client.jsx diff --git a/templates/template-hydrogen-default/src/components/CartIcon.jsx b/templates/demo-store/src/components/CartIcon.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/CartIcon.jsx rename to templates/demo-store/src/components/CartIcon.jsx diff --git a/templates/template-hydrogen-default/src/components/CartIconWithItems.client.jsx b/templates/demo-store/src/components/CartIconWithItems.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/CartIconWithItems.client.jsx rename to templates/demo-store/src/components/CartIconWithItems.client.jsx diff --git a/templates/template-hydrogen-default/src/components/CartToggle.client.jsx b/templates/demo-store/src/components/CartToggle.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/CartToggle.client.jsx rename to templates/demo-store/src/components/CartToggle.client.jsx diff --git a/templates/template-hydrogen-default/src/components/CartUIProvider.client.jsx b/templates/demo-store/src/components/CartUIProvider.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/CartUIProvider.client.jsx rename to templates/demo-store/src/components/CartUIProvider.client.jsx diff --git a/templates/template-hydrogen-default/src/components/CountrySelector.client.jsx b/templates/demo-store/src/components/CountrySelector.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/CountrySelector.client.jsx rename to templates/demo-store/src/components/CountrySelector.client.jsx diff --git a/templates/template-hydrogen-default/src/components/DefaultSeo.server.jsx b/templates/demo-store/src/components/DefaultSeo.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/DefaultSeo.server.jsx rename to templates/demo-store/src/components/DefaultSeo.server.jsx diff --git a/templates/template-hydrogen-default/src/components/FeaturedCollection.jsx b/templates/demo-store/src/components/FeaturedCollection.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/FeaturedCollection.jsx rename to templates/demo-store/src/components/FeaturedCollection.jsx diff --git a/templates/template-hydrogen-default/src/components/Footer.server.jsx b/templates/demo-store/src/components/Footer.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/Footer.server.jsx rename to templates/demo-store/src/components/Footer.server.jsx diff --git a/templates/template-hydrogen-default/src/components/Gallery.client.jsx b/templates/demo-store/src/components/Gallery.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/Gallery.client.jsx rename to templates/demo-store/src/components/Gallery.client.jsx diff --git a/templates/template-hydrogen-default/src/components/Header.client.jsx b/templates/demo-store/src/components/Header.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/Header.client.jsx rename to templates/demo-store/src/components/Header.client.jsx diff --git a/templates/template-hydrogen-default/src/components/Layout.server.jsx b/templates/demo-store/src/components/Layout.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/Layout.server.jsx rename to templates/demo-store/src/components/Layout.server.jsx diff --git a/templates/template-hydrogen-default/src/components/LoadMoreProducts.client.jsx b/templates/demo-store/src/components/LoadMoreProducts.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/LoadMoreProducts.client.jsx rename to templates/demo-store/src/components/LoadMoreProducts.client.jsx diff --git a/templates/template-hydrogen-default/src/components/LoadingFallback.jsx b/templates/demo-store/src/components/LoadingFallback.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/LoadingFallback.jsx rename to templates/demo-store/src/components/LoadingFallback.jsx diff --git a/templates/template-hydrogen-default/src/components/LocalCartProvider.client.jsx b/templates/demo-store/src/components/LocalCartProvider.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/LocalCartProvider.client.jsx rename to templates/demo-store/src/components/LocalCartProvider.client.jsx diff --git a/templates/template-hydrogen-default/src/components/MobileCountrySelector.client.jsx b/templates/demo-store/src/components/MobileCountrySelector.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/MobileCountrySelector.client.jsx rename to templates/demo-store/src/components/MobileCountrySelector.client.jsx diff --git a/templates/template-hydrogen-default/src/components/MobileNavigation.client.jsx b/templates/demo-store/src/components/MobileNavigation.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/MobileNavigation.client.jsx rename to templates/demo-store/src/components/MobileNavigation.client.jsx diff --git a/templates/template-hydrogen-default/src/components/MoneyCompareAtPrice.client.jsx b/templates/demo-store/src/components/MoneyCompareAtPrice.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/MoneyCompareAtPrice.client.jsx rename to templates/demo-store/src/components/MoneyCompareAtPrice.client.jsx diff --git a/templates/template-hydrogen-default/src/components/MoneyPrice.client.jsx b/templates/demo-store/src/components/MoneyPrice.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/MoneyPrice.client.jsx rename to templates/demo-store/src/components/MoneyPrice.client.jsx diff --git a/templates/template-hydrogen-default/src/components/Navigation.client.jsx b/templates/demo-store/src/components/Navigation.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/Navigation.client.jsx rename to templates/demo-store/src/components/Navigation.client.jsx diff --git a/templates/template-hydrogen-default/src/components/NotFound.server.jsx b/templates/demo-store/src/components/NotFound.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/NotFound.server.jsx rename to templates/demo-store/src/components/NotFound.server.jsx diff --git a/templates/template-hydrogen-default/src/components/OpenIcon.jsx b/templates/demo-store/src/components/OpenIcon.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/OpenIcon.jsx rename to templates/demo-store/src/components/OpenIcon.jsx diff --git a/templates/template-hydrogen-default/src/components/ProductCard.jsx b/templates/demo-store/src/components/ProductCard.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/ProductCard.jsx rename to templates/demo-store/src/components/ProductCard.jsx diff --git a/templates/template-hydrogen-default/src/components/ProductDetails.client.jsx b/templates/demo-store/src/components/ProductDetails.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/ProductDetails.client.jsx rename to templates/demo-store/src/components/ProductDetails.client.jsx diff --git a/templates/template-hydrogen-default/src/components/ProductOptions.client.jsx b/templates/demo-store/src/components/ProductOptions.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/ProductOptions.client.jsx rename to templates/demo-store/src/components/ProductOptions.client.jsx diff --git a/templates/template-hydrogen-default/src/components/ServerCartProvider.server.jsx b/templates/demo-store/src/components/ServerCartProvider.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/ServerCartProvider.server.jsx rename to templates/demo-store/src/components/ServerCartProvider.server.jsx diff --git a/templates/template-hydrogen-default/src/components/SpinnerIcon.client.jsx b/templates/demo-store/src/components/SpinnerIcon.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/SpinnerIcon.client.jsx rename to templates/demo-store/src/components/SpinnerIcon.client.jsx diff --git a/templates/template-hydrogen-default/src/components/Welcome.server.jsx b/templates/demo-store/src/components/Welcome.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/Welcome.server.jsx rename to templates/demo-store/src/components/Welcome.server.jsx diff --git a/templates/template-hydrogen-default/src/components/account/AccountActivateForm.client.jsx b/templates/demo-store/src/components/account/AccountActivateForm.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/account/AccountActivateForm.client.jsx rename to templates/demo-store/src/components/account/AccountActivateForm.client.jsx diff --git a/templates/template-hydrogen-default/src/components/account/AccountCreateForm.client.jsx b/templates/demo-store/src/components/account/AccountCreateForm.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/account/AccountCreateForm.client.jsx rename to templates/demo-store/src/components/account/AccountCreateForm.client.jsx diff --git a/templates/template-hydrogen-default/src/components/account/AccountDetails.server.jsx b/templates/demo-store/src/components/account/AccountDetails.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/account/AccountDetails.server.jsx rename to templates/demo-store/src/components/account/AccountDetails.server.jsx diff --git a/templates/template-hydrogen-default/src/components/account/AccountIcon.jsx b/templates/demo-store/src/components/account/AccountIcon.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/account/AccountIcon.jsx rename to templates/demo-store/src/components/account/AccountIcon.jsx diff --git a/templates/template-hydrogen-default/src/components/account/AccountRecoverForm.client.jsx b/templates/demo-store/src/components/account/AccountRecoverForm.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/account/AccountRecoverForm.client.jsx rename to templates/demo-store/src/components/account/AccountRecoverForm.client.jsx diff --git a/templates/template-hydrogen-default/src/components/account/LoginForm.client.jsx b/templates/demo-store/src/components/account/LoginForm.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/account/LoginForm.client.jsx rename to templates/demo-store/src/components/account/LoginForm.client.jsx diff --git a/templates/template-hydrogen-default/src/components/account/LogoutButton.client.jsx b/templates/demo-store/src/components/account/LogoutButton.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/account/LogoutButton.client.jsx rename to templates/demo-store/src/components/account/LogoutButton.client.jsx diff --git a/templates/template-hydrogen-default/src/components/account/PasswordResetForm.client.jsx b/templates/demo-store/src/components/account/PasswordResetForm.client.jsx similarity index 100% rename from templates/template-hydrogen-default/src/components/account/PasswordResetForm.client.jsx rename to templates/demo-store/src/components/account/PasswordResetForm.client.jsx diff --git a/templates/template-hydrogen-default/src/index.css b/templates/demo-store/src/index.css similarity index 100% rename from templates/template-hydrogen-default/src/index.css rename to templates/demo-store/src/index.css diff --git a/templates/template-hydrogen-default/src/routes/account/activate.server.jsx b/templates/demo-store/src/routes/account/activate.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/routes/account/activate.server.jsx rename to templates/demo-store/src/routes/account/activate.server.jsx diff --git a/templates/template-hydrogen-default/src/routes/account/activate/[id]/[activationToken].server.jsx b/templates/demo-store/src/routes/account/activate/[id]/[activationToken].server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/routes/account/activate/[id]/[activationToken].server.jsx rename to templates/demo-store/src/routes/account/activate/[id]/[activationToken].server.jsx diff --git a/templates/template-hydrogen-default/src/routes/account/index.server.jsx b/templates/demo-store/src/routes/account/index.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/routes/account/index.server.jsx rename to templates/demo-store/src/routes/account/index.server.jsx diff --git a/templates/template-hydrogen-default/src/routes/account/login.server.jsx b/templates/demo-store/src/routes/account/login.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/routes/account/login.server.jsx rename to templates/demo-store/src/routes/account/login.server.jsx diff --git a/templates/template-hydrogen-default/src/routes/account/logout.server.js b/templates/demo-store/src/routes/account/logout.server.js similarity index 100% rename from templates/template-hydrogen-default/src/routes/account/logout.server.js rename to templates/demo-store/src/routes/account/logout.server.js diff --git a/templates/template-hydrogen-default/src/routes/account/recover.server.jsx b/templates/demo-store/src/routes/account/recover.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/routes/account/recover.server.jsx rename to templates/demo-store/src/routes/account/recover.server.jsx diff --git a/templates/template-hydrogen-default/src/routes/account/register.server.jsx b/templates/demo-store/src/routes/account/register.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/routes/account/register.server.jsx rename to templates/demo-store/src/routes/account/register.server.jsx diff --git a/templates/template-hydrogen-default/src/routes/account/reset.server.jsx b/templates/demo-store/src/routes/account/reset.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/routes/account/reset.server.jsx rename to templates/demo-store/src/routes/account/reset.server.jsx diff --git a/templates/template-hydrogen-default/src/routes/account/reset/[id]/[resetToken].server.jsx b/templates/demo-store/src/routes/account/reset/[id]/[resetToken].server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/routes/account/reset/[id]/[resetToken].server.jsx rename to templates/demo-store/src/routes/account/reset/[id]/[resetToken].server.jsx diff --git a/templates/template-hydrogen-default/src/routes/collections/[handle].server.jsx b/templates/demo-store/src/routes/collections/[handle].server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/routes/collections/[handle].server.jsx rename to templates/demo-store/src/routes/collections/[handle].server.jsx diff --git a/templates/template-hydrogen-default/src/routes/countries.server.jsx b/templates/demo-store/src/routes/countries.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/routes/countries.server.jsx rename to templates/demo-store/src/routes/countries.server.jsx diff --git a/templates/template-hydrogen-default/src/routes/index.server.jsx b/templates/demo-store/src/routes/index.server.jsx similarity index 97% rename from templates/template-hydrogen-default/src/routes/index.server.jsx rename to templates/demo-store/src/routes/index.server.jsx index 951ee6ccb3..a0ccc22cf0 100644 --- a/templates/template-hydrogen-default/src/routes/index.server.jsx +++ b/templates/demo-store/src/routes/index.server.jsx @@ -13,10 +13,13 @@ import Layout from '../components/Layout.server'; import FeaturedCollection from '../components/FeaturedCollection'; import ProductCard from '../components/ProductCard'; import Welcome from '../components/Welcome.server'; -import {Suspense} from 'react'; +import {Suspense, useState} from 'react'; export default function Index() { - const {countryCode = 'US'} = useSession(); + if (true) { + const [count, setCount] = useState(0); + const {countryCode = 'US'} = useSession(); + } return ( }> diff --git a/templates/template-hydrogen-default/src/routes/pages/[handle].server.jsx b/templates/demo-store/src/routes/pages/[handle].server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/routes/pages/[handle].server.jsx rename to templates/demo-store/src/routes/pages/[handle].server.jsx diff --git a/templates/template-hydrogen-default/src/routes/products/[handle].server.jsx b/templates/demo-store/src/routes/products/[handle].server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/routes/products/[handle].server.jsx rename to templates/demo-store/src/routes/products/[handle].server.jsx diff --git a/templates/template-hydrogen-default/src/routes/redirect.server.jsx b/templates/demo-store/src/routes/redirect.server.jsx similarity index 100% rename from templates/template-hydrogen-default/src/routes/redirect.server.jsx rename to templates/demo-store/src/routes/redirect.server.jsx diff --git a/templates/template-hydrogen-default/src/routes/robots.txt.server.js b/templates/demo-store/src/routes/robots.txt.server.js similarity index 100% rename from templates/template-hydrogen-default/src/routes/robots.txt.server.js rename to templates/demo-store/src/routes/robots.txt.server.js diff --git a/templates/template-hydrogen-default/src/routes/sitemap.xml.server.js b/templates/demo-store/src/routes/sitemap.xml.server.js similarity index 100% rename from templates/template-hydrogen-default/src/routes/sitemap.xml.server.js rename to templates/demo-store/src/routes/sitemap.xml.server.js diff --git a/templates/template-hydrogen-default/tailwind.config.js b/templates/demo-store/tailwind.config.js similarity index 100% rename from templates/template-hydrogen-default/tailwind.config.js rename to templates/demo-store/tailwind.config.js diff --git a/templates/template-hydrogen-default/tests/e2e/collections.test.js b/templates/demo-store/tests/e2e/collections.test.js similarity index 100% rename from templates/template-hydrogen-default/tests/e2e/collections.test.js rename to templates/demo-store/tests/e2e/collections.test.js diff --git a/templates/template-hydrogen-default/tests/e2e/index.test.js b/templates/demo-store/tests/e2e/index.test.js similarity index 100% rename from templates/template-hydrogen-default/tests/e2e/index.test.js rename to templates/demo-store/tests/e2e/index.test.js diff --git a/templates/template-hydrogen-default/tests/e2e/performance-metrics.test.js b/templates/demo-store/tests/e2e/performance-metrics.test.js similarity index 100% rename from templates/template-hydrogen-default/tests/e2e/performance-metrics.test.js rename to templates/demo-store/tests/e2e/performance-metrics.test.js diff --git a/templates/template-hydrogen-default/tests/e2e/products.test.js b/templates/demo-store/tests/e2e/products.test.js similarity index 100% rename from templates/template-hydrogen-default/tests/e2e/products.test.js rename to templates/demo-store/tests/e2e/products.test.js diff --git a/templates/template-hydrogen-default/tests/utils.ts b/templates/demo-store/tests/utils.ts similarity index 100% rename from templates/template-hydrogen-default/tests/utils.ts rename to templates/demo-store/tests/utils.ts diff --git a/templates/template-hydrogen-default/vite.config.js b/templates/demo-store/vite.config.js similarity index 100% rename from templates/template-hydrogen-default/vite.config.js rename to templates/demo-store/vite.config.js diff --git a/templates/template-hydrogen-hello-world/README.md b/templates/hello-world/README.md similarity index 90% rename from templates/template-hydrogen-hello-world/README.md rename to templates/hello-world/README.md index f5b8cd19e4..9e892ebc72 100644 --- a/templates/template-hydrogen-hello-world/README.md +++ b/templates/hello-world/README.md @@ -4,7 +4,7 @@ Hydrogen is a React framework and SDK that you can use to build fast and dynamic [Check out the docs](https://shopify.dev/custom-storefronts/hydrogen) -[Run this template on StackBlitz](https://stackblitz.com/github/Shopify/hydrogen/tree/stackblitz/templates/template-hydrogen-hello-world) +[Run this template on StackBlitz](https://stackblitz.com/github/Shopify/hydrogen/tree/stackblitz/templates/hello-world) ## Getting started diff --git a/templates/template-hydrogen-hello-world/_gitignore b/templates/hello-world/_gitignore similarity index 100% rename from templates/template-hydrogen-hello-world/_gitignore rename to templates/hello-world/_gitignore diff --git a/templates/template-hydrogen-hello-world/hydrogen.config.js b/templates/hello-world/hydrogen.config.js similarity index 100% rename from templates/template-hydrogen-hello-world/hydrogen.config.js rename to templates/hello-world/hydrogen.config.js diff --git a/templates/template-hydrogen-hello-world/index.html b/templates/hello-world/index.html similarity index 100% rename from templates/template-hydrogen-hello-world/index.html rename to templates/hello-world/index.html diff --git a/templates/template-hydrogen-hello-world/package.json b/templates/hello-world/package.json similarity index 92% rename from templates/template-hydrogen-hello-world/package.json rename to templates/hello-world/package.json index 8d125aa866..5918e69bc6 100644 --- a/templates/template-hydrogen-hello-world/package.json +++ b/templates/hello-world/package.json @@ -1,5 +1,5 @@ { - "name": "template-hydrogen-hello-world", + "name": "hello-world", "description": "Hello world template for @shopify/hydrogen", "version": "0.0.0", "license": "MIT", diff --git a/templates/template-hydrogen-hello-world/public/favicon.ico b/templates/hello-world/public/favicon.ico similarity index 100% rename from templates/template-hydrogen-hello-world/public/favicon.ico rename to templates/hello-world/public/favicon.ico diff --git a/templates/template-hydrogen-hello-world/src/App.server.jsx b/templates/hello-world/src/App.server.jsx similarity index 100% rename from templates/template-hydrogen-hello-world/src/App.server.jsx rename to templates/hello-world/src/App.server.jsx diff --git a/templates/template-hydrogen-hello-world/src/index.css b/templates/hello-world/src/index.css similarity index 100% rename from templates/template-hydrogen-hello-world/src/index.css rename to templates/hello-world/src/index.css diff --git a/templates/template-hydrogen-hello-world/src/routes/index.server.jsx b/templates/hello-world/src/routes/index.server.jsx similarity index 100% rename from templates/template-hydrogen-hello-world/src/routes/index.server.jsx rename to templates/hello-world/src/routes/index.server.jsx diff --git a/templates/template-hydrogen-hello-world/vite.config.js b/templates/hello-world/vite.config.js similarity index 100% rename from templates/template-hydrogen-hello-world/vite.config.js rename to templates/hello-world/vite.config.js