@shopify/create-hydrogen 0.3.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/bin/run.cmd +3 -0
  3. package/bin/run.js +5 -0
  4. package/dist/commands/init.js +76390 -0
  5. package/dist/commands/init.js.map +1 -0
  6. package/dist/index.js +21 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +56 -14
  9. package/templates/template-hydrogen/.devcontainer/devcontainer.json +18 -0
  10. package/templates/template-hydrogen/.eslintrc.js +3 -0
  11. package/templates/template-hydrogen/.gitignore +7 -0
  12. package/templates/template-hydrogen/.stackblitzrc +4 -0
  13. package/{template-hydrogen → templates/template-hydrogen}/.stylelintrc.js +1 -1
  14. package/templates/template-hydrogen/.vscode/extensions.json +8 -0
  15. package/templates/template-hydrogen/Dockerfile +15 -0
  16. package/{template-hydrogen → templates/template-hydrogen}/README.md +11 -2
  17. package/{template-hydrogen → templates/template-hydrogen}/_gitignore +0 -0
  18. package/templates/template-hydrogen/index.html +20 -0
  19. package/{template-hydrogen → templates/template-hydrogen}/package.json +20 -16
  20. package/{template-hydrogen → templates/template-hydrogen}/postcss.config.js +0 -0
  21. package/{template-hydrogen/src → templates/template-hydrogen/public}/favicon.svg +0 -0
  22. package/{template-hydrogen → templates/template-hydrogen}/server.js +4 -2
  23. package/{template-hydrogen → templates/template-hydrogen}/shopify.config.js +1 -2
  24. package/templates/template-hydrogen/src/App.client.jsx +8 -0
  25. package/templates/template-hydrogen/src/App.server.jsx +27 -0
  26. package/templates/template-hydrogen/src/components/Button.client.jsx +65 -0
  27. package/templates/template-hydrogen/src/components/Cart.client.jsx +265 -0
  28. package/templates/template-hydrogen/src/components/CartIcon.jsx +33 -0
  29. package/templates/template-hydrogen/src/components/CartIconWithItems.client.jsx +28 -0
  30. package/{template-hydrogen → templates/template-hydrogen}/src/components/CartProvider.client.jsx +4 -10
  31. package/templates/template-hydrogen/src/components/CartToggle.client.jsx +30 -0
  32. package/{template-hydrogen → templates/template-hydrogen}/src/components/CartUIProvider.client.jsx +3 -0
  33. package/templates/template-hydrogen/src/components/CountrySelector.client.jsx +116 -0
  34. package/templates/template-hydrogen/src/components/DefaultSeo.server.jsx +35 -0
  35. package/templates/template-hydrogen/src/components/FeaturedCollection.jsx +26 -0
  36. package/templates/template-hydrogen/src/components/Footer.server.jsx +103 -0
  37. package/templates/template-hydrogen/src/components/Gallery.client.jsx +65 -0
  38. package/templates/template-hydrogen/src/components/Header.client.jsx +62 -0
  39. package/templates/template-hydrogen/src/components/Layout.server.jsx +87 -0
  40. package/templates/template-hydrogen/src/components/LoadMoreProducts.client.jsx +56 -0
  41. package/templates/template-hydrogen/src/components/LoadingFallback.jsx +26 -0
  42. package/templates/template-hydrogen/src/components/MobileCountrySelector.client.jsx +64 -0
  43. package/templates/template-hydrogen/src/components/MobileNavigation.client.jsx +98 -0
  44. package/templates/template-hydrogen/src/components/MoneyCompareAtPrice.client.jsx +14 -0
  45. package/templates/template-hydrogen/src/components/MoneyPrice.client.jsx +15 -0
  46. package/templates/template-hydrogen/src/components/Navigation.client.jsx +23 -0
  47. package/templates/template-hydrogen/src/components/NotFound.server.jsx +93 -0
  48. package/templates/template-hydrogen/src/components/OpenIcon.jsx +33 -0
  49. package/templates/template-hydrogen/src/components/ProductCard.jsx +50 -0
  50. package/templates/template-hydrogen/src/components/ProductDetails.client.jsx +242 -0
  51. package/{template-hydrogen → templates/template-hydrogen}/src/components/ProductOptions.client.jsx +7 -4
  52. package/templates/template-hydrogen/src/components/Welcome.server.jsx +188 -0
  53. package/templates/template-hydrogen/src/entry-client.jsx +7 -0
  54. package/templates/template-hydrogen/src/entry-server.jsx +6 -0
  55. package/{template-hydrogen → templates/template-hydrogen}/src/index.css +31 -0
  56. package/templates/template-hydrogen/src/pages/collections/[handle].server.jsx +105 -0
  57. package/templates/template-hydrogen/src/pages/index.server.jsx +237 -0
  58. package/{template-hydrogen → templates/template-hydrogen}/src/pages/pages/[handle].server.jsx +14 -5
  59. package/templates/template-hydrogen/src/pages/products/[handle].server.jsx +69 -0
  60. package/templates/template-hydrogen/src/pages/redirect.server.jsx +4 -0
  61. package/templates/template-hydrogen/src/pages/robots.txt.server.js +10 -0
  62. package/{template-hydrogen → templates/template-hydrogen}/src/pages/sitemap.xml.server.jsx +2 -2
  63. package/templates/template-hydrogen/tailwind.config.js +26 -0
  64. package/{template-hydrogen → templates/template-hydrogen}/vite.config.js +1 -0
  65. package/{template-hydrogen → templates/template-hydrogen}/worker.js +1 -0
  66. package/README.md +0 -3
  67. package/index.js +0 -205
  68. package/scripts/tmp-copy-template-from-dev.js +0 -21
  69. package/scripts/utils.js +0 -29
  70. package/template-hydrogen/.eslintrc.js +0 -41
  71. package/template-hydrogen/.vscode/extensions.json +0 -3
  72. package/template-hydrogen/Dockerfile +0 -15
  73. package/template-hydrogen/index.html +0 -14
  74. package/template-hydrogen/src/App.server.jsx +0 -42
  75. package/template-hydrogen/src/components/Cart.client.jsx +0 -296
  76. package/template-hydrogen/src/components/DefaultSeo.server.jsx +0 -22
  77. package/template-hydrogen/src/components/Footer.jsx +0 -12
  78. package/template-hydrogen/src/components/Gallery.client.jsx +0 -36
  79. package/template-hydrogen/src/components/Header.client.jsx +0 -103
  80. package/template-hydrogen/src/components/HighlightedProduct.client.jsx +0 -54
  81. package/template-hydrogen/src/components/Layout.client.jsx +0 -41
  82. package/template-hydrogen/src/components/MediaPlaceholder.jsx +0 -21
  83. package/template-hydrogen/src/components/NotFound.server.jsx +0 -104
  84. package/template-hydrogen/src/components/ProductCard.client.jsx +0 -39
  85. package/template-hydrogen/src/components/ProductDetails.client.jsx +0 -181
  86. package/template-hydrogen/src/components/Seo.client.jsx +0 -75
  87. package/template-hydrogen/src/entry-client.jsx +0 -12
  88. package/template-hydrogen/src/entry-server.jsx +0 -7
  89. package/template-hydrogen/src/pages/Index.server.jsx +0 -199
  90. package/template-hydrogen/src/pages/blogs/[handle]/[articleHandle].server.jsx +0 -49
  91. package/template-hydrogen/src/pages/blogs/[handle].server.jsx +0 -76
  92. package/template-hydrogen/src/pages/collections/[handle].server.jsx +0 -69
  93. package/template-hydrogen/src/pages/products/[handle].server.jsx +0 -67
  94. package/template-hydrogen/src/pages/search.server.jsx +0 -107
  95. package/template-hydrogen/tailwind.config.js +0 -9
@@ -2,6 +2,37 @@
2
2
  @tailwind components;
3
3
  @tailwind utilities;
4
4
 
5
+ @layer utilities {
6
+ .scroll-snap-x {
7
+ scroll-snap-type: x mandatory;
8
+ }
9
+ .snap-start {
10
+ scroll-snap-align: start;
11
+ }
12
+ .snap-smooth {
13
+ scroll-behavior: smooth;
14
+ }
15
+ .snap-px-4 {
16
+ scroll-padding-left: 1rem;
17
+ scroll-padding-right: 1rem;
18
+ }
19
+ .no-scrollbar::-webkit-scrollbar {
20
+ display: none;
21
+ }
22
+ .no-scrollbar {
23
+ -ms-overflow-style: none; /* IE and Edge */
24
+ scrollbar-width: none; /* Firefox */
25
+ }
26
+ }
27
+
28
+ * {
29
+ font-variant-ligatures: none;
30
+ }
31
+
32
+ html {
33
+ scroll-padding-top: 10rem;
34
+ }
35
+
5
36
  model-viewer::part(default-progress-mask) {
6
37
  display: none;
7
38
  }
@@ -0,0 +1,105 @@
1
+ import {
2
+ MediaFileFragment,
3
+ ProductProviderFragment,
4
+ useShopQuery,
5
+ flattenConnection,
6
+ RawHtml,
7
+ Seo,
8
+ } from '@shopify/hydrogen';
9
+ import gql from 'graphql-tag';
10
+
11
+ import LoadMoreProducts from '../../components/LoadMoreProducts.client';
12
+ import Layout from '../../components/Layout.server';
13
+ import ProductCard from '../../components/ProductCard';
14
+ import NotFound from '../../components/NotFound.server';
15
+
16
+ export default function Collection({
17
+ country = {isoCode: 'US'},
18
+ collectionProductCount = 24,
19
+ params,
20
+ }) {
21
+ const {handle} = params;
22
+ const {data} = useShopQuery({
23
+ query: QUERY,
24
+ variables: {
25
+ handle,
26
+ country: country.isoCode,
27
+ numProducts: collectionProductCount,
28
+ },
29
+ });
30
+
31
+ if (data?.collection == null) {
32
+ return <NotFound />;
33
+ }
34
+
35
+ const collection = data.collection;
36
+ const products = flattenConnection(collection.products);
37
+ const hasNextPage = data.collection.products.pageInfo.hasNextPage;
38
+
39
+ return (
40
+ <Layout>
41
+ <Seo type="collection" data={collection} />
42
+ <h1 className="font-bold text-4xl md:text-5xl text-gray-900 mb-6 mt-6">
43
+ {collection.title}
44
+ </h1>
45
+ <RawHtml string={collection.descriptionHtml} className="text-lg" />
46
+ <p className="text-sm text-gray-500 mt-5 mb-5">
47
+ {products.length} {products.length > 1 ? 'products' : 'product'}
48
+ </p>
49
+
50
+ <ul className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-16">
51
+ {products.map((product) => (
52
+ <li key={product.id}>
53
+ <ProductCard product={product} />
54
+ </li>
55
+ ))}
56
+ </ul>
57
+
58
+ {hasNextPage && (
59
+ <LoadMoreProducts startingCount={collectionProductCount} />
60
+ )}
61
+ </Layout>
62
+ );
63
+ }
64
+
65
+ const QUERY = gql`
66
+ query CollectionDetails(
67
+ $handle: String!
68
+ $country: CountryCode
69
+ $numProducts: Int!
70
+ $includeReferenceMetafieldDetails: Boolean = false
71
+ $numProductMetafields: Int = 0
72
+ $numProductVariants: Int = 250
73
+ $numProductMedia: Int = 6
74
+ $numProductVariantMetafields: Int = 0
75
+ $numProductVariantSellingPlanAllocations: Int = 0
76
+ $numProductSellingPlanGroups: Int = 0
77
+ $numProductSellingPlans: Int = 0
78
+ ) @inContext(country: $country) {
79
+ collection(handle: $handle) {
80
+ id
81
+ title
82
+ description
83
+ descriptionHtml
84
+ image {
85
+ url
86
+ width
87
+ height
88
+ }
89
+ products(first: $numProducts) {
90
+ edges {
91
+ node {
92
+ vendor
93
+ ...ProductProviderFragment
94
+ }
95
+ }
96
+ pageInfo {
97
+ hasNextPage
98
+ }
99
+ }
100
+ }
101
+ }
102
+
103
+ ${MediaFileFragment}
104
+ ${ProductProviderFragment}
105
+ `;
@@ -0,0 +1,237 @@
1
+ import {
2
+ useShopQuery,
3
+ flattenConnection,
4
+ ProductProviderFragment,
5
+ Image,
6
+ Link,
7
+ Seo,
8
+ } from '@shopify/hydrogen';
9
+ import gql from 'graphql-tag';
10
+
11
+ import Layout from '../components/Layout.server';
12
+ import FeaturedCollection from '../components/FeaturedCollection';
13
+ import ProductCard from '../components/ProductCard';
14
+ import Welcome from '../components/Welcome.server';
15
+ import {Suspense} from 'react';
16
+
17
+ export default function Index({country = {isoCode: 'US'}}) {
18
+ return (
19
+ <Layout hero={<GradientBackground />}>
20
+ <Suspense fallback={null}>
21
+ <SeoForHomepage />
22
+ </Suspense>
23
+ <div className="relative mb-12">
24
+ <Welcome />
25
+ <Suspense fallback={<BoxFallback />}>
26
+ <FeaturedProductsBox country={country} />
27
+ </Suspense>
28
+ <Suspense fallback={<BoxFallback />}>
29
+ <FeaturedCollectionBox country={country} />
30
+ </Suspense>
31
+ </div>
32
+ </Layout>
33
+ );
34
+ }
35
+
36
+ function SeoForHomepage() {
37
+ const {
38
+ data: {
39
+ shop: {
40
+ name: shopName,
41
+ primaryDomain: {url: shopUrl},
42
+ },
43
+ },
44
+ } = useShopQuery({
45
+ query: SEO_QUERY,
46
+ cache: {maxAge: 60 * 60 * 12, staleWhileRevalidate: 60 * 60 * 12},
47
+ });
48
+
49
+ return (
50
+ <Seo
51
+ type="homepage"
52
+ data={{
53
+ title: shopName,
54
+ url: shopUrl,
55
+ }}
56
+ />
57
+ );
58
+ }
59
+
60
+ function BoxFallback() {
61
+ return <div className="bg-white p-12 shadow-xl rounded-xl mb-10 h-40"></div>;
62
+ }
63
+
64
+ function FeaturedProductsBox({country}) {
65
+ const {data} = useShopQuery({
66
+ query: QUERY,
67
+ variables: {
68
+ country: country.isoCode,
69
+ },
70
+ });
71
+
72
+ const collections = data ? flattenConnection(data.collections) : [];
73
+ const featuredProductsCollection = collections[0];
74
+ const featuredProducts = featuredProductsCollection
75
+ ? flattenConnection(featuredProductsCollection.products)
76
+ : null;
77
+
78
+ return (
79
+ <div className="bg-white p-12 shadow-xl rounded-xl mb-10">
80
+ {featuredProductsCollection ? (
81
+ <>
82
+ <div className="flex justify-between items-center mb-8 text-md font-medium">
83
+ <span className="text-black uppercase">
84
+ {featuredProductsCollection.title}
85
+ </span>
86
+ <span className="hidden md:inline-flex">
87
+ <Link
88
+ to={`/collections/${featuredProductsCollection.handle}`}
89
+ className="text-blue-600 hover:underline"
90
+ >
91
+ Shop all
92
+ </Link>
93
+ </span>
94
+ </div>
95
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-8">
96
+ {featuredProducts.map((product) => (
97
+ <div key={product.id}>
98
+ <ProductCard product={product} />
99
+ </div>
100
+ ))}
101
+ </div>
102
+ <div className="md:hidden text-center">
103
+ <Link
104
+ to={`/collections/${featuredProductsCollection.handle}`}
105
+ className="text-blue-600"
106
+ >
107
+ Shop all
108
+ </Link>
109
+ </div>
110
+ </>
111
+ ) : null}
112
+ </div>
113
+ );
114
+ }
115
+
116
+ function FeaturedCollectionBox({country}) {
117
+ const {data} = useShopQuery({
118
+ query: QUERY,
119
+ variables: {
120
+ country: country.isoCode,
121
+ },
122
+ });
123
+
124
+ const collections = data ? flattenConnection(data.collections) : [];
125
+ const featuredCollection =
126
+ collections && collections.length > 1 ? collections[1] : collections[0];
127
+
128
+ return <FeaturedCollection collection={featuredCollection} />;
129
+ }
130
+
131
+ function GradientBackground() {
132
+ return (
133
+ <div className="fixed top-0 w-full h-3/5 overflow-hidden">
134
+ <div className="absolute w-full h-full bg-gradient-to-t from-gray-50 z-10" />
135
+
136
+ <svg
137
+ viewBox="0 0 960 743"
138
+ fill="none"
139
+ xmlns="http://www.w3.org/2000/svg"
140
+ xmlnsXlink="http://www.w3.org/1999/xlink"
141
+ className="filter blur-[30px]"
142
+ aria-hidden="true"
143
+ >
144
+ <defs>
145
+ <path fill="#fff" d="M0 0h960v540H0z" id="reuse-0" />
146
+ </defs>
147
+ <g clipPath="url(#a)">
148
+ <use xlinkHref="#reuse-0" />
149
+ <path d="M960 0H0v743h960V0Z" fill="#7CFBEE" />
150
+ <path
151
+ d="M831 380c200.48 0 363-162.521 363-363s-162.52-363-363-363c-200.479 0-363 162.521-363 363s162.521 363 363 363Z"
152
+ fill="#4F98D0"
153
+ />
154
+ <path
155
+ d="M579 759c200.479 0 363-162.521 363-363S779.479 33 579 33 216 195.521 216 396s162.521 363 363 363Z"
156
+ fill="#7CFBEE"
157
+ />
158
+ <path
159
+ d="M178 691c200.479 0 363-162.521 363-363S378.479-35 178-35c-200.4794 0-363 162.521-363 363s162.5206 363 363 363Z"
160
+ fill="#4F98D0"
161
+ />
162
+ <path
163
+ d="M490 414c200.479 0 363-162.521 363-363S690.479-312 490-312 127-149.479 127 51s162.521 363 363 363Z"
164
+ fill="#4F98D0"
165
+ />
166
+ <path
167
+ d="M354 569c200.479 0 363-162.521 363-363 0-200.47937-162.521-363-363-363S-9 5.52063-9 206c0 200.479 162.521 363 363 363Z"
168
+ fill="#7CFBEE"
169
+ />
170
+ <path
171
+ d="M630 532c200.479 0 363-162.521 363-363 0-200.4794-162.521-363-363-363S267-31.4794 267 169c0 200.479 162.521 363 363 363Z"
172
+ fill="#4F98D0"
173
+ />
174
+ </g>
175
+ <path fill="#fff" d="M0 540h960v203H0z" />
176
+ <defs>
177
+ <clipPath id="a">
178
+ <use xlinkHref="#reuse-0" />
179
+ </clipPath>
180
+ </defs>
181
+ </svg>
182
+ </div>
183
+ );
184
+ }
185
+
186
+ const SEO_QUERY = gql`
187
+ query shopInfo {
188
+ shop {
189
+ name
190
+ description
191
+ primaryDomain {
192
+ url
193
+ }
194
+ }
195
+ }
196
+ `;
197
+
198
+ const QUERY = gql`
199
+ query indexContent(
200
+ $country: CountryCode
201
+ $numCollections: Int = 2
202
+ $numProducts: Int = 3
203
+ $includeReferenceMetafieldDetails: Boolean = false
204
+ $numProductMetafields: Int = 0
205
+ $numProductVariants: Int = 250
206
+ $numProductMedia: Int = 1
207
+ $numProductVariantMetafields: Int = 10
208
+ $numProductVariantSellingPlanAllocations: Int = 0
209
+ $numProductSellingPlanGroups: Int = 0
210
+ $numProductSellingPlans: Int = 0
211
+ ) @inContext(country: $country) {
212
+ collections(first: $numCollections) {
213
+ edges {
214
+ node {
215
+ descriptionHtml
216
+ description
217
+ handle
218
+ id
219
+ title
220
+ image {
221
+ ...ImageFragment
222
+ }
223
+ products(first: $numProducts) {
224
+ edges {
225
+ node {
226
+ ...ProductProviderFragment
227
+ }
228
+ }
229
+ }
230
+ }
231
+ }
232
+ }
233
+ }
234
+
235
+ ${ProductProviderFragment}
236
+ ${Image.Fragment}
237
+ `;
@@ -1,17 +1,22 @@
1
- import {useParams} from 'react-router-dom';
2
- import {useShopQuery, RawHtml} from '@shopify/hydrogen';
1
+ import {useShopQuery, RawHtml, Seo} from '@shopify/hydrogen';
3
2
  import gql from 'graphql-tag';
4
3
 
5
- import Layout from '../../components/Layout.client';
4
+ import Layout from '../../components/Layout.server';
5
+ import NotFound from '../../components/NotFound.server';
6
6
 
7
- export default function Page() {
8
- const {handle} = useParams();
7
+ export default function Page({params}) {
8
+ const {handle} = params;
9
9
  const {data} = useShopQuery({query: QUERY, variables: {handle}});
10
10
 
11
+ if (!data.pageByHandle) {
12
+ return <NotFound />;
13
+ }
14
+
11
15
  const page = data.pageByHandle;
12
16
 
13
17
  return (
14
18
  <Layout>
19
+ <Seo type="page" data={page} />
15
20
  <h1 className="text-2xl font-bold">{page.title}</h1>
16
21
  <RawHtml string={page.body} className="prose mt-8" />
17
22
  </Layout>
@@ -23,6 +28,10 @@ const QUERY = gql`
23
28
  pageByHandle(handle: $handle) {
24
29
  title
25
30
  body
31
+ seo {
32
+ title
33
+ description
34
+ }
26
35
  }
27
36
  }
28
37
  `;
@@ -0,0 +1,69 @@
1
+ import {useShopQuery, ProductProviderFragment, Seo} from '@shopify/hydrogen';
2
+ import gql from 'graphql-tag';
3
+
4
+ import ProductDetails from '../../components/ProductDetails.client';
5
+ import NotFound from '../../components/NotFound.server';
6
+ import Layout from '../../components/Layout.server';
7
+
8
+ export default function Product({country = {isoCode: 'US'}, params}) {
9
+ const {handle} = params;
10
+
11
+ const {
12
+ data: {product},
13
+ } = useShopQuery({
14
+ query: QUERY,
15
+ variables: {
16
+ country: country.isoCode,
17
+ handle,
18
+ },
19
+ });
20
+
21
+ if (!product) {
22
+ return <NotFound />;
23
+ }
24
+
25
+ return (
26
+ <Layout>
27
+ <Seo type="product" data={product} />
28
+ <ProductDetails product={product} />
29
+ </Layout>
30
+ );
31
+ }
32
+
33
+ const QUERY = gql`
34
+ query product(
35
+ $country: CountryCode
36
+ $handle: String!
37
+ $includeReferenceMetafieldDetails: Boolean = true
38
+ $numProductMetafields: Int = 20
39
+ $numProductVariants: Int = 250
40
+ $numProductMedia: Int = 6
41
+ $numProductVariantMetafields: Int = 10
42
+ $numProductVariantSellingPlanAllocations: Int = 0
43
+ $numProductSellingPlanGroups: Int = 0
44
+ $numProductSellingPlans: Int = 0
45
+ ) @inContext(country: $country) {
46
+ product: product(handle: $handle) {
47
+ id
48
+ description
49
+ vendor
50
+ seo {
51
+ title
52
+ description
53
+ }
54
+ images(first: 1) {
55
+ edges {
56
+ node {
57
+ url
58
+ height
59
+ width
60
+ altText
61
+ }
62
+ }
63
+ }
64
+ ...ProductProviderFragment
65
+ }
66
+ }
67
+
68
+ ${ProductProviderFragment}
69
+ `;
@@ -0,0 +1,4 @@
1
+ export default function Redirect({response}) {
2
+ response.redirect('/products/snowboard');
3
+ return <div>This page is redirected</div>;
4
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This API endpoint generates a robots.txt file. Use this to control
3
+ * access to your resources from SEO crawlers.
4
+ * Learn more: https://developers.google.com/search/docs/advanced/robots/create-robots-txt
5
+ */
6
+ const ROBOTS_TXT = `
7
+ User-agent: *
8
+ Allow: /`;
9
+
10
+ export const api = () => ROBOTS_TXT.trim();
@@ -28,7 +28,7 @@ function shopSitemap(data) {
28
28
  <changefreq>daily</changefreq>
29
29
  <image:image>
30
30
  <image:loc>
31
- ${product?.images?.edges?.[0]?.node?.originalSrc}
31
+ ${product?.images?.edges?.[0]?.node?.url}
32
32
  </image:loc>
33
33
  <image:title>
34
34
  ${product?.images?.edges?.[0]?.node?.altText ?? ''}
@@ -52,7 +52,7 @@ const QUERY = gql`
52
52
  images(first: 1) {
53
53
  edges {
54
54
  node {
55
- originalSrc
55
+ url
56
56
  altText
57
57
  }
58
58
  }
@@ -0,0 +1,26 @@
1
+ module.exports = {
2
+ content: ['./index.html', './src/**/*.{js,jsx,ts,tsx}'],
3
+ theme: {
4
+ extend: {
5
+ typography: (theme) => ({
6
+ DEFAULT: {
7
+ css: {
8
+ hr: {
9
+ borderColor: theme('colors.gray.200'),
10
+ borderTopWidth: '1px',
11
+ marginTop: '2rem',
12
+ marginBottom: '2rem',
13
+ },
14
+ 'ol > li::before': {
15
+ color: theme('colors.gray.900'),
16
+ },
17
+ 'ul > li::before': {
18
+ backgroundColor: theme('colors.gray.900'),
19
+ },
20
+ },
21
+ },
22
+ }),
23
+ },
24
+ },
25
+ plugins: [require('@tailwindcss/typography')],
26
+ };
@@ -6,4 +6,5 @@ import shopifyConfig from './shopify.config';
6
6
  // https://vitejs.dev/config/
7
7
  export default defineConfig({
8
8
  plugins: [hydrogen(shopifyConfig)],
9
+ optimizeDeps: {include: ['@headlessui/react']},
9
10
  });
@@ -10,6 +10,7 @@ addEventListener('fetch', (event) => {
10
10
  entrypoint,
11
11
  indexTemplate: indexHtml,
12
12
  cache: caches.default,
13
+ context: event,
13
14
  }),
14
15
  );
15
16
  } catch (error) {
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Deprecated
2
-
3
- Please use `create-hydrogen-app` via `npm init hydrogen-app@latest` instead.