Skip to content

Commit

Permalink
Drop prefixes from template names
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Seccafien committed May 27, 2022
1 parent 53d95bd commit 390242a
Show file tree
Hide file tree
Showing 101 changed files with 56 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion .changeset/sour-walls-work.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'template-hydrogen-default': minor
'demo-store': minor
---

Removes Stylelint from default template
10 changes: 5 additions & 5 deletions .github/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/migration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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)"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/oxygen-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 </dev/urandom tr -dc "0123456789abcdefghjkmnpqrstvwxyz" | head -c 9)"
Expand All @@ -42,15 +42,15 @@ jobs:

- name: Production build
id: storefront-build
working-directory: ./templates/template-hydrogen-default
working-directory: ./templates/demo-store
run: |
HYDROGEN_ASSET_BASE_URL=${{ steps.base-url.outputs.URL }} yarn build
- name: Publish to Oxygen
id: deploy
uses: shopify/oxygenctl-action@v2
with:
path: ./templates/template-hydrogen-default
path: ./templates/demo-store
deployment_id: ${{ steps.deployment-id.outputs.ID }}
oxygen_deployment_token: ${{ secrets.OXYGEN_DEPLOYMENT_TOKEN }}
# Hardcode message and timestamp if manual dispatch
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish_stackblitz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
with:
ref: 'v1.x-2022-07'
- run: |
mv templates/template-hydrogen-default/_gitignore templates/template-hydrogen-default/.gitignore
mv templates/template-hydrogen-hello-world/_gitignore templates/template-hydrogen-hello-world/.gitignore
mv templates/default/_gitignore templates/default/.gitignore
mv templates/hello-world/_gitignore templates/hello-world/.gitignore
- run: |
sed -i.bak 's/cross-env LOCAL_DEV=true //' templates/template-hydrogen-default/package.json
sed -i.bak 's/cross-env LOCAL_DEV=true //' templates/template-hydrogen-hello-world/package.json
sed -i.bak 's/cross-env LOCAL_DEV=true //' templates/default/package.json
sed -i.bak 's/cross-env LOCAL_DEV=true //' templates/hello-world/package.json
- run: |
git show-ref
git config user.email "[email protected]"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_and_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Lint the template code
run: yarn lint
working-directory: ./templates/template-hydrogen-default
working-directory: ./templates/demo-store

- name: Type check hydrogen-ui
run: yarn typecheck
Expand All @@ -66,4 +66,4 @@ jobs:

- name: Run the template code tests
run: yarn test:ci
working-directory: ./templates/template-hydrogen-default
working-directory: ./templates/demo-store
4 changes: 2 additions & 2 deletions docs/framework/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ By default, Hydrogen includes a [`@shopify/hydrogen/platforms/worker`](https://g

Hydrogen includes the following default entry points for your app:

- **Client entry point**: [`@shopify/hydrogen/entry-client`](https://github.com/Shopify/hydrogen/blob/main/packages/hydrogen/src/entry-client.tsx), which is included in [`index.html`](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/index.html) and used for hydration purposes
- **Server entry point**: [`App.server.jsx`](https://github.com/Shopify/hydrogen/blob/main/templates/template-hydrogen-default/src/App.server.jsx)
- **Client entry point**: [`@shopify/hydrogen/entry-client`](https://github.com/Shopify/hydrogen/blob/main/packages/hydrogen/src/entry-client.tsx), which is included in [`index.html`](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/index.html) and used for hydration purposes
- **Server entry point**: [`App.server.jsx`](https://github.com/Shopify/hydrogen/blob/main/templates/demo-store/src/App.server.jsx)

### Change the client entry point

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export async function api(request, {params}) {
{% endcodeblock %}

> 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

Expand Down
20 changes: 10 additions & 10 deletions docs/framework/seo.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ 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

The [`Seo`](https://shopify.dev/api/hydrogen/components/primitive/seo) client component uses the data from Storefront API to generate the `<head>` tags that search engines look for. For example, [`Product.Seo`](https://shopify.dev/api/storefront/latest/objects/Product) is used to generate the `<head>` tags for the products page.

You can customize the `<head>` 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:

Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/create-hydrogen-app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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'];
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-plugin/.github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "template-hydrogen-default",
"name": "demo-store",
"description": "This the default template for Hydrogen",
"version": "0.0.0",
"license": "MIT",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Layout hero={<GradientBackground />}>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 390242a

Please sign in to comment.