@shopify/cli 3.63.2 → 3.64.1
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.
- package/dist/assets/cli-ruby/lib/shopify_cli/reporting_configuration_controller.rb +2 -37
- package/dist/assets/cli-ruby/lib/shopify_cli/theme/file.rb +5 -1
- package/dist/assets/dev-console/extensions/dev-console/assets/index-Cgb-oKsM.css +1 -0
- package/dist/assets/dev-console/extensions/dev-console/assets/{index-Dui3DO9f.js → index-D7F9wNys.js} +12 -12
- package/dist/assets/dev-console/index.html +2 -2
- package/dist/assets/hydrogen/starter/.graphqlrc.ts +27 -0
- package/dist/assets/hydrogen/starter/CHANGELOG.md +108 -6
- package/dist/assets/hydrogen/starter/app/components/AddToCartButton.tsx +37 -0
- package/dist/assets/hydrogen/starter/app/components/CartLineItem.tsx +150 -0
- package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +68 -0
- package/dist/assets/hydrogen/starter/app/components/CartSummary.tsx +101 -0
- package/dist/assets/hydrogen/starter/app/components/Header.tsx +3 -3
- package/dist/assets/hydrogen/starter/app/components/PageLayout.tsx +2 -2
- package/dist/assets/hydrogen/starter/app/components/ProductForm.tsx +80 -0
- package/dist/assets/hydrogen/starter/app/components/ProductImage.tsx +23 -0
- package/dist/assets/hydrogen/starter/app/components/ProductPrice.tsx +27 -0
- package/dist/assets/hydrogen/starter/app/root.tsx +11 -17
- package/dist/assets/hydrogen/starter/app/routes/cart.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +51 -232
- package/dist/assets/hydrogen/starter/package.json +11 -11
- package/dist/assets/hydrogen/tailwind/package.json +1 -6
- package/dist/assets/hydrogen/tailwind/tailwind.css +6 -3
- package/dist/assets/hydrogen/vanilla-extract/package.json +2 -3
- package/dist/assets/hydrogen/virtual-routes/components/{Layout.jsx → PageLayout.jsx} +2 -2
- package/dist/assets/hydrogen/virtual-routes/virtual-root.jsx +8 -30
- package/dist/{chunk-YAYFJITA.js → chunk-2DXCIFDK.js} +3 -3
- package/dist/{chunk-EQR6CWKL.js → chunk-63D4EGTO.js} +3 -3
- package/dist/{chunk-EZYMDZPN.js → chunk-6PJAGL2L.js} +5 -5
- package/dist/{chunk-S4VBXFXP.js → chunk-7PVTYKQI.js} +220 -16
- package/dist/{chunk-IRWSC76I.js → chunk-7TIDA343.js} +3 -3
- package/dist/{chunk-NPLAQVTF.js → chunk-7W6SRTYP.js} +3 -3
- package/dist/{chunk-UJYIV6JP.js → chunk-ARCFCLME.js} +5 -5
- package/dist/{chunk-DIZHFZTJ.js → chunk-ATGUMSCJ.js} +4 -4
- package/dist/chunk-B3D5VLUA.js +12 -0
- package/dist/{chunk-UNPXLODI.js → chunk-B7RN7IRD.js} +3 -4
- package/dist/{chunk-5BLMIE7F.js → chunk-DX43V2L4.js} +4 -4
- package/dist/{chunk-6UDFXWNE.js → chunk-EJITPGUJ.js} +21 -4
- package/dist/chunk-FDLU3RD4.js +29 -0
- package/dist/{chunk-7OCUVNSF.js → chunk-H6AQTECB.js} +1485 -2977
- package/dist/{chunk-T54B5GJP.js → chunk-JNUJZFQL.js} +2 -2
- package/dist/{chunk-XER2L725.js → chunk-KUVX423E.js} +2 -2
- package/dist/{chunk-R5KML52V.js → chunk-KZTALMEV.js} +4 -4
- package/dist/{chunk-CM4H6QMH.js → chunk-M6KGRVDD.js} +3 -3
- package/dist/{chunk-3MDI6LZT.js → chunk-NLE3ZLU6.js} +905 -896
- package/dist/{chunk-WADS2TV5.js → chunk-NO7MYZEO.js} +5 -4
- package/dist/{chunk-LH533WG4.js → chunk-NPH2SXRO.js} +2 -2
- package/dist/{chunk-VZUWS5IH.js → chunk-OVWFZSJT.js} +3 -3
- package/dist/{chunk-UQUO22Q5.js → chunk-OXMHVKM3.js} +5 -5
- package/dist/{chunk-PNFEODLY.js → chunk-QNI6VLVR.js} +3 -3
- package/dist/{chunk-MCT2524Y.js → chunk-QYT42J3T.js} +4 -4
- package/dist/{chunk-VQTHQBEC.js → chunk-S3HWVIGJ.js} +9 -14
- package/dist/{chunk-23OKKZ5V.js → chunk-S7A7BHNA.js} +4 -4
- package/dist/{chunk-3TGMDPDI.js → chunk-SSAUIEBT.js} +2 -2
- package/dist/{chunk-YMPGWFWU.js → chunk-UQQI7TQG.js} +3 -3
- package/dist/{chunk-UZUD5DRI.js → chunk-UXA5YROL.js} +2 -2
- package/dist/{chunk-K3CVGV3F.js → chunk-V7NH4SZB.js} +3 -3
- package/dist/{chunk-7AVKIH7O.js → chunk-WVY52EEZ.js} +5 -5
- package/dist/{chunk-QEOBHRRQ.js → chunk-X3OUSYUQ.js} +17912 -17444
- package/dist/{chunk-EARPFFS7.js → chunk-XNCQBHNR.js} +241 -4
- package/dist/{chunk-EQPYUHNM.js → chunk-ZIGJPI5N.js} +1497 -112
- package/dist/{chunk-A2UVOX6O.js → chunk-ZKWHKX2C.js} +7066 -6051
- package/dist/{chunk-GPMHDCWK.js → chunk-ZRGD2HUL.js} +3 -3
- package/dist/{chunk-PQKGBYDC.js → chunk-ZVT2WZZF.js} +3 -3
- package/dist/cli/commands/auth/logout.js +14 -19
- package/dist/cli/commands/auth/logout.test.js +17 -21
- package/dist/cli/commands/debug/command-flags.js +11 -15
- package/dist/cli/commands/demo/catalog.js +13 -18
- package/dist/cli/commands/demo/generate-file.js +13 -18
- package/dist/cli/commands/demo/index.js +13 -18
- package/dist/cli/commands/demo/print-ai-prompt.js +13 -18
- package/dist/cli/commands/docs/generate.js +11 -15
- package/dist/cli/commands/docs/generate.test.js +11 -15
- package/dist/cli/commands/help.js +11 -15
- package/dist/cli/commands/kitchen-sink/async.js +12 -16
- package/dist/cli/commands/kitchen-sink/async.test.js +12 -16
- package/dist/cli/commands/kitchen-sink/index.js +14 -18
- package/dist/cli/commands/kitchen-sink/index.test.js +14 -18
- package/dist/cli/commands/kitchen-sink/prompts.js +12 -16
- package/dist/cli/commands/kitchen-sink/prompts.test.js +12 -16
- package/dist/cli/commands/kitchen-sink/static.js +12 -16
- package/dist/cli/commands/kitchen-sink/static.test.js +12 -16
- package/dist/cli/commands/search.js +12 -16
- package/dist/cli/commands/upgrade.js +11 -15
- package/dist/cli/commands/version.js +12 -16
- package/dist/cli/commands/version.test.js +12 -16
- package/dist/cli/services/commands/search.js +4 -4
- package/dist/cli/services/commands/search.test.js +4 -4
- package/dist/cli/services/commands/version.js +6 -7
- package/dist/cli/services/commands/version.test.js +7 -8
- package/dist/cli/services/demo.js +5 -6
- package/dist/cli/services/demo.test.js +5 -6
- package/dist/cli/services/kitchen-sink/async.js +4 -4
- package/dist/cli/services/kitchen-sink/prompts.js +4 -4
- package/dist/cli/services/kitchen-sink/static.js +4 -4
- package/dist/cli/services/upgrade.js +5 -6
- package/dist/cli/services/upgrade.test.js +7 -8
- package/dist/{constants-3CLHB4LQ.js → constants-EVER32LA.js} +3 -3
- package/dist/{custom-oclif-loader-D4H5EJW6.js → custom-oclif-loader-BQAFOUNG.js} +13 -6
- package/dist/{error-handler-HUI4HW3X.js → error-handler-S56KHSGD.js} +10 -8
- package/dist/hooks/postrun.js +12 -14
- package/dist/hooks/prerun.js +8 -11
- package/dist/index.js +7811 -7490
- package/dist/{local-7IRDZWLW.js → local-UQAQKOVL.js} +4 -4
- package/dist/{morph-6NYGHGNT.js → morph-DN4AZJZW.js} +9 -9
- package/dist/{node-UIH7JP3D.js → node-GZYZUMBW.js} +21 -19
- package/dist/{node-package-manager-2LWT2MNN.js → node-package-manager-AOVZD6TP.js} +5 -6
- package/dist/{path-JVVXOELJ.js → path-KUSF6CYC.js} +2 -2
- package/dist/{system-4HHX42JS.js → system-G7DVECOP.js} +4 -4
- package/dist/templates/ui-extensions/projects/web_pixel_extension/package.json.liquid +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-NFBKMC4P.js → ui-2AOZFYFM.js} +4 -4
- package/dist/{workerd-4HFD3PS4.js → workerd-2MO23YDQ.js} +22 -19
- package/oclif.manifest.json +265 -4
- package/package.json +7 -10
- package/dist/assets/dev-console/extensions/dev-console/assets/index-Bi7y6lI5.css +0 -1
- package/dist/assets/hydrogen/css-modules/package.json +0 -6
- package/dist/assets/hydrogen/postcss/package.json +0 -10
- package/dist/assets/hydrogen/postcss/postcss.config.js +0 -8
- package/dist/assets/hydrogen/starter/.graphqlrc.yml +0 -12
- package/dist/assets/hydrogen/starter/app/components/Cart.tsx +0 -364
- package/dist/assets/hydrogen/tailwind/postcss.config.js +0 -10
- package/dist/assets/hydrogen/tailwind/tailwind.config.js +0 -8
- package/dist/chunk-4WBV3WP3.js +0 -221
- package/dist/chunk-OWICSMFV.js +0 -12
- package/dist/chunk-QCDYZY46.js +0 -1070
- package/dist/chunk-QEKTVN5A.js +0 -4385
- package/dist/chunk-QOUOFEGO.js +0 -35
- package/dist/chunk-WP234IUO.js +0 -265
- package/dist/chunk-XLPMGRR3.js +0 -496
- package/dist/chunk-XSKJYEAZ.js +0 -1453
- package/dist/error-handler-QDDLQDOJ.js +0 -43
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {Money} from '@shopify/hydrogen';
|
|
2
|
+
import type {MoneyV2} from '@shopify/hydrogen/storefront-api-types';
|
|
3
|
+
|
|
4
|
+
export function ProductPrice({
|
|
5
|
+
price,
|
|
6
|
+
compareAtPrice,
|
|
7
|
+
}: {
|
|
8
|
+
price?: MoneyV2;
|
|
9
|
+
compareAtPrice?: MoneyV2 | null;
|
|
10
|
+
}) {
|
|
11
|
+
return (
|
|
12
|
+
<div className="product-price">
|
|
13
|
+
{compareAtPrice ? (
|
|
14
|
+
<div className="product-price-on-sale">
|
|
15
|
+
{price ? <Money data={price} /> : null}
|
|
16
|
+
<s>
|
|
17
|
+
<Money data={compareAtPrice} />
|
|
18
|
+
</s>
|
|
19
|
+
</div>
|
|
20
|
+
) : price ? (
|
|
21
|
+
<Money data={price} />
|
|
22
|
+
) : (
|
|
23
|
+
<span> </span>
|
|
24
|
+
)}
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -130,7 +130,7 @@ function loadDeferredData({context}: LoaderFunctionArgs) {
|
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
function Layout({children}: {children?: React.ReactNode}) {
|
|
133
|
+
export function Layout({children}: {children?: React.ReactNode}) {
|
|
134
134
|
const nonce = useNonce();
|
|
135
135
|
const data = useRouteLoaderData<RootLoader>('root');
|
|
136
136
|
|
|
@@ -162,11 +162,7 @@ function Layout({children}: {children?: React.ReactNode}) {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
export default function App() {
|
|
165
|
-
return
|
|
166
|
-
<Layout>
|
|
167
|
-
<Outlet />
|
|
168
|
-
</Layout>
|
|
169
|
-
);
|
|
165
|
+
return <Outlet />;
|
|
170
166
|
}
|
|
171
167
|
|
|
172
168
|
export function ErrorBoundary() {
|
|
@@ -182,16 +178,14 @@ export function ErrorBoundary() {
|
|
|
182
178
|
}
|
|
183
179
|
|
|
184
180
|
return (
|
|
185
|
-
<
|
|
186
|
-
<
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
<
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
</div>
|
|
195
|
-
</Layout>
|
|
181
|
+
<div className="route-error">
|
|
182
|
+
<h1>Oops</h1>
|
|
183
|
+
<h2>{errorStatus}</h2>
|
|
184
|
+
{errorMessage && (
|
|
185
|
+
<fieldset>
|
|
186
|
+
<pre>{errorMessage}</pre>
|
|
187
|
+
</fieldset>
|
|
188
|
+
)}
|
|
189
|
+
</div>
|
|
196
190
|
);
|
|
197
191
|
}
|
|
@@ -3,7 +3,7 @@ import {Suspense} from 'react';
|
|
|
3
3
|
import type {CartQueryDataReturn} from '@shopify/hydrogen';
|
|
4
4
|
import {CartForm} from '@shopify/hydrogen';
|
|
5
5
|
import {json, type ActionFunctionArgs} from '@shopify/remix-oxygen';
|
|
6
|
-
import {CartMain} from '~/components/
|
|
6
|
+
import {CartMain} from '~/components/CartMain';
|
|
7
7
|
import type {RootLoader} from '~/root';
|
|
8
8
|
|
|
9
9
|
export const meta: MetaFunction = () => {
|
|
@@ -1,32 +1,17 @@
|
|
|
1
1
|
import {Suspense} from 'react';
|
|
2
2
|
import {defer, redirect, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
|
|
3
|
+
import {Await, useLoaderData, type MetaFunction} from '@remix-run/react';
|
|
4
|
+
import type {ProductFragment} from 'storefrontapi.generated';
|
|
3
5
|
import {
|
|
4
|
-
Await,
|
|
5
|
-
Link,
|
|
6
|
-
useLoaderData,
|
|
7
|
-
type MetaFunction,
|
|
8
|
-
type FetcherWithComponents,
|
|
9
|
-
} from '@remix-run/react';
|
|
10
|
-
import type {
|
|
11
|
-
ProductFragment,
|
|
12
|
-
ProductVariantsQuery,
|
|
13
|
-
ProductVariantFragment,
|
|
14
|
-
} from 'storefrontapi.generated';
|
|
15
|
-
import {
|
|
16
|
-
Image,
|
|
17
|
-
Money,
|
|
18
|
-
VariantSelector,
|
|
19
|
-
type VariantOption,
|
|
20
6
|
getSelectedProductOptions,
|
|
21
|
-
CartForm,
|
|
22
|
-
type OptimisticCartLine,
|
|
23
7
|
Analytics,
|
|
24
|
-
|
|
25
|
-
useAnalytics,
|
|
8
|
+
useOptimisticVariant,
|
|
26
9
|
} from '@shopify/hydrogen';
|
|
27
10
|
import type {SelectedOption} from '@shopify/hydrogen/storefront-api-types';
|
|
28
11
|
import {getVariantUrl} from '~/lib/variants';
|
|
29
|
-
import {
|
|
12
|
+
import {ProductPrice} from '~/components/ProductPrice';
|
|
13
|
+
import {ProductImage} from '~/components/ProductImage';
|
|
14
|
+
import {ProductForm} from '~/components/ProductForm';
|
|
30
15
|
|
|
31
16
|
export const meta: MetaFunction<typeof loader> = ({data}) => {
|
|
32
17
|
return [{title: `Hydrogen | ${data?.product.title ?? ''}`}];
|
|
@@ -143,15 +128,54 @@ function redirectToFirstVariant({
|
|
|
143
128
|
|
|
144
129
|
export default function Product() {
|
|
145
130
|
const {product, variants} = useLoaderData<typeof loader>();
|
|
146
|
-
const
|
|
131
|
+
const selectedVariant = useOptimisticVariant(
|
|
132
|
+
product.selectedVariant,
|
|
133
|
+
variants,
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
const {title, descriptionHtml} = product;
|
|
137
|
+
|
|
147
138
|
return (
|
|
148
139
|
<div className="product">
|
|
149
140
|
<ProductImage image={selectedVariant?.image} />
|
|
150
|
-
<
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
141
|
+
<div className="product-main">
|
|
142
|
+
<h1>{title}</h1>
|
|
143
|
+
<ProductPrice
|
|
144
|
+
price={selectedVariant?.price}
|
|
145
|
+
compareAtPrice={selectedVariant?.compareAtPrice}
|
|
146
|
+
/>
|
|
147
|
+
<br />
|
|
148
|
+
<Suspense
|
|
149
|
+
fallback={
|
|
150
|
+
<ProductForm
|
|
151
|
+
product={product}
|
|
152
|
+
selectedVariant={selectedVariant}
|
|
153
|
+
variants={[]}
|
|
154
|
+
/>
|
|
155
|
+
}
|
|
156
|
+
>
|
|
157
|
+
<Await
|
|
158
|
+
errorElement="There was a problem loading product variants"
|
|
159
|
+
resolve={variants}
|
|
160
|
+
>
|
|
161
|
+
{(data) => (
|
|
162
|
+
<ProductForm
|
|
163
|
+
product={product}
|
|
164
|
+
selectedVariant={selectedVariant}
|
|
165
|
+
variants={data?.product?.variants.nodes || []}
|
|
166
|
+
/>
|
|
167
|
+
)}
|
|
168
|
+
</Await>
|
|
169
|
+
</Suspense>
|
|
170
|
+
<br />
|
|
171
|
+
<br />
|
|
172
|
+
<p>
|
|
173
|
+
<strong>Description</strong>
|
|
174
|
+
</p>
|
|
175
|
+
<br />
|
|
176
|
+
<div dangerouslySetInnerHTML={{__html: descriptionHtml}} />
|
|
177
|
+
<br />
|
|
178
|
+
</div>
|
|
155
179
|
<Analytics.ProductView
|
|
156
180
|
data={{
|
|
157
181
|
products: [
|
|
@@ -171,211 +195,6 @@ export default function Product() {
|
|
|
171
195
|
);
|
|
172
196
|
}
|
|
173
197
|
|
|
174
|
-
function ProductImage({image}: {image: ProductVariantFragment['image']}) {
|
|
175
|
-
if (!image) {
|
|
176
|
-
return <div className="product-image" />;
|
|
177
|
-
}
|
|
178
|
-
return (
|
|
179
|
-
<div className="product-image">
|
|
180
|
-
<Image
|
|
181
|
-
alt={image.altText || 'Product Image'}
|
|
182
|
-
aspectRatio="1/1"
|
|
183
|
-
data={image}
|
|
184
|
-
key={image.id}
|
|
185
|
-
sizes="(min-width: 45em) 50vw, 100vw"
|
|
186
|
-
/>
|
|
187
|
-
</div>
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function ProductMain({
|
|
192
|
-
selectedVariant,
|
|
193
|
-
product,
|
|
194
|
-
variants,
|
|
195
|
-
}: {
|
|
196
|
-
product: ProductFragment;
|
|
197
|
-
selectedVariant: ProductFragment['selectedVariant'];
|
|
198
|
-
variants: Promise<ProductVariantsQuery | null>;
|
|
199
|
-
}) {
|
|
200
|
-
const {title, descriptionHtml} = product;
|
|
201
|
-
return (
|
|
202
|
-
<div className="product-main">
|
|
203
|
-
<h1>{title}</h1>
|
|
204
|
-
<ProductPrice selectedVariant={selectedVariant} />
|
|
205
|
-
<br />
|
|
206
|
-
<Suspense
|
|
207
|
-
fallback={
|
|
208
|
-
<ProductForm
|
|
209
|
-
product={product}
|
|
210
|
-
selectedVariant={selectedVariant}
|
|
211
|
-
variants={[]}
|
|
212
|
-
/>
|
|
213
|
-
}
|
|
214
|
-
>
|
|
215
|
-
<Await
|
|
216
|
-
errorElement="There was a problem loading product variants"
|
|
217
|
-
resolve={variants}
|
|
218
|
-
>
|
|
219
|
-
{(data) => (
|
|
220
|
-
<ProductForm
|
|
221
|
-
product={product}
|
|
222
|
-
selectedVariant={selectedVariant}
|
|
223
|
-
variants={data?.product?.variants.nodes || []}
|
|
224
|
-
/>
|
|
225
|
-
)}
|
|
226
|
-
</Await>
|
|
227
|
-
</Suspense>
|
|
228
|
-
<br />
|
|
229
|
-
<br />
|
|
230
|
-
<p>
|
|
231
|
-
<strong>Description</strong>
|
|
232
|
-
</p>
|
|
233
|
-
<br />
|
|
234
|
-
<div dangerouslySetInnerHTML={{__html: descriptionHtml}} />
|
|
235
|
-
<br />
|
|
236
|
-
</div>
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
function ProductPrice({
|
|
241
|
-
selectedVariant,
|
|
242
|
-
}: {
|
|
243
|
-
selectedVariant: ProductFragment['selectedVariant'];
|
|
244
|
-
}) {
|
|
245
|
-
return (
|
|
246
|
-
<div className="product-price">
|
|
247
|
-
{selectedVariant?.compareAtPrice ? (
|
|
248
|
-
<>
|
|
249
|
-
<p>Sale</p>
|
|
250
|
-
<br />
|
|
251
|
-
<div className="product-price-on-sale">
|
|
252
|
-
{selectedVariant ? <Money data={selectedVariant.price} /> : null}
|
|
253
|
-
<s>
|
|
254
|
-
<Money data={selectedVariant.compareAtPrice} />
|
|
255
|
-
</s>
|
|
256
|
-
</div>
|
|
257
|
-
</>
|
|
258
|
-
) : (
|
|
259
|
-
selectedVariant?.price && <Money data={selectedVariant?.price} />
|
|
260
|
-
)}
|
|
261
|
-
</div>
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
function ProductForm({
|
|
266
|
-
product,
|
|
267
|
-
selectedVariant,
|
|
268
|
-
variants,
|
|
269
|
-
}: {
|
|
270
|
-
product: ProductFragment;
|
|
271
|
-
selectedVariant: ProductFragment['selectedVariant'];
|
|
272
|
-
variants: Array<ProductVariantFragment>;
|
|
273
|
-
}) {
|
|
274
|
-
const {open} = useAside();
|
|
275
|
-
const {publish, shop, cart, prevCart} = useAnalytics();
|
|
276
|
-
return (
|
|
277
|
-
<div className="product-form">
|
|
278
|
-
<VariantSelector
|
|
279
|
-
handle={product.handle}
|
|
280
|
-
options={product.options}
|
|
281
|
-
variants={variants}
|
|
282
|
-
>
|
|
283
|
-
{({option}) => <ProductOptions key={option.name} option={option} />}
|
|
284
|
-
</VariantSelector>
|
|
285
|
-
<br />
|
|
286
|
-
<AddToCartButton
|
|
287
|
-
disabled={!selectedVariant || !selectedVariant.availableForSale}
|
|
288
|
-
onClick={() => {
|
|
289
|
-
open('cart');
|
|
290
|
-
publish('cart_viewed', {
|
|
291
|
-
cart,
|
|
292
|
-
prevCart,
|
|
293
|
-
shop,
|
|
294
|
-
url: window.location.href || '',
|
|
295
|
-
} as CartViewPayload);
|
|
296
|
-
}}
|
|
297
|
-
lines={
|
|
298
|
-
selectedVariant
|
|
299
|
-
? [
|
|
300
|
-
{
|
|
301
|
-
merchandiseId: selectedVariant.id,
|
|
302
|
-
quantity: 1,
|
|
303
|
-
selectedVariant,
|
|
304
|
-
},
|
|
305
|
-
]
|
|
306
|
-
: []
|
|
307
|
-
}
|
|
308
|
-
>
|
|
309
|
-
{selectedVariant?.availableForSale ? 'Add to cart' : 'Sold out'}
|
|
310
|
-
</AddToCartButton>
|
|
311
|
-
</div>
|
|
312
|
-
);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
function ProductOptions({option}: {option: VariantOption}) {
|
|
316
|
-
return (
|
|
317
|
-
<div className="product-options" key={option.name}>
|
|
318
|
-
<h5>{option.name}</h5>
|
|
319
|
-
<div className="product-options-grid">
|
|
320
|
-
{option.values.map(({value, isAvailable, isActive, to}) => {
|
|
321
|
-
return (
|
|
322
|
-
<Link
|
|
323
|
-
className="product-options-item"
|
|
324
|
-
key={option.name + value}
|
|
325
|
-
prefetch="intent"
|
|
326
|
-
preventScrollReset
|
|
327
|
-
replace
|
|
328
|
-
to={to}
|
|
329
|
-
style={{
|
|
330
|
-
border: isActive ? '1px solid black' : '1px solid transparent',
|
|
331
|
-
opacity: isAvailable ? 1 : 0.3,
|
|
332
|
-
}}
|
|
333
|
-
>
|
|
334
|
-
{value}
|
|
335
|
-
</Link>
|
|
336
|
-
);
|
|
337
|
-
})}
|
|
338
|
-
</div>
|
|
339
|
-
<br />
|
|
340
|
-
</div>
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
function AddToCartButton({
|
|
345
|
-
analytics,
|
|
346
|
-
children,
|
|
347
|
-
disabled,
|
|
348
|
-
lines,
|
|
349
|
-
onClick,
|
|
350
|
-
}: {
|
|
351
|
-
analytics?: unknown;
|
|
352
|
-
children: React.ReactNode;
|
|
353
|
-
disabled?: boolean;
|
|
354
|
-
lines: Array<OptimisticCartLine>;
|
|
355
|
-
onClick?: () => void;
|
|
356
|
-
}) {
|
|
357
|
-
return (
|
|
358
|
-
<CartForm route="/cart" inputs={{lines}} action={CartForm.ACTIONS.LinesAdd}>
|
|
359
|
-
{(fetcher: FetcherWithComponents<any>) => (
|
|
360
|
-
<>
|
|
361
|
-
<input
|
|
362
|
-
name="analytics"
|
|
363
|
-
type="hidden"
|
|
364
|
-
value={JSON.stringify(analytics)}
|
|
365
|
-
/>
|
|
366
|
-
<button
|
|
367
|
-
type="submit"
|
|
368
|
-
onClick={onClick}
|
|
369
|
-
disabled={disabled ?? fetcher.state !== 'idle'}
|
|
370
|
-
>
|
|
371
|
-
{children}
|
|
372
|
-
</button>
|
|
373
|
-
</>
|
|
374
|
-
)}
|
|
375
|
-
</CartForm>
|
|
376
|
-
);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
198
|
const PRODUCT_VARIANT_FRAGMENT = `#graphql
|
|
380
199
|
fragment ProductVariant on ProductVariant {
|
|
381
200
|
availableForSale
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "skeleton",
|
|
3
3
|
"private": true,
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "2024.7.2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "shopify hydrogen build --codegen",
|
|
@@ -14,11 +14,10 @@
|
|
|
14
14
|
},
|
|
15
15
|
"prettier": "@shopify/prettier-config",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@remix-run/react": "^2.
|
|
18
|
-
"@remix-run/server-runtime": "^2.
|
|
19
|
-
"@shopify/
|
|
20
|
-
"@shopify/
|
|
21
|
-
"@shopify/remix-oxygen": "0.0.0-next-9eb60d7-20240607102913",
|
|
17
|
+
"@remix-run/react": "^2.10.1",
|
|
18
|
+
"@remix-run/server-runtime": "^2.10.1",
|
|
19
|
+
"@shopify/hydrogen": "2024.7.1",
|
|
20
|
+
"@shopify/remix-oxygen": "^2.0.5",
|
|
22
21
|
"graphql": "^16.6.0",
|
|
23
22
|
"graphql-tag": "^2.12.6",
|
|
24
23
|
"isbot": "^3.8.0",
|
|
@@ -27,11 +26,12 @@
|
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
28
|
"@graphql-codegen/cli": "5.0.2",
|
|
30
|
-
"@remix-run/dev": "^2.
|
|
31
|
-
"@remix-run/eslint-config": "^2.
|
|
32
|
-
"@shopify/
|
|
33
|
-
"@shopify/
|
|
34
|
-
"@shopify/oxygen
|
|
29
|
+
"@remix-run/dev": "^2.10.1",
|
|
30
|
+
"@remix-run/eslint-config": "^2.10.1",
|
|
31
|
+
"@shopify/cli": "^3.64.0",
|
|
32
|
+
"@shopify/hydrogen-codegen": "^0.3.1",
|
|
33
|
+
"@shopify/mini-oxygen": "^3.0.4",
|
|
34
|
+
"@shopify/oxygen-workers-types": "^4.1.2",
|
|
35
35
|
"@shopify/prettier-config": "^1.1.2",
|
|
36
36
|
"@total-typescript/ts-reset": "^0.4.2",
|
|
37
37
|
"@types/eslint": "^8.4.10",
|
|
@@ -3,11 +3,6 @@
|
|
|
3
3
|
"defaults"
|
|
4
4
|
],
|
|
5
5
|
"devDependencies": {
|
|
6
|
-
"@tailwindcss/
|
|
7
|
-
"@tailwindcss/typography": "^0.5.9",
|
|
8
|
-
"postcss": "^8.4.21",
|
|
9
|
-
"postcss-import": "^15.1.0",
|
|
10
|
-
"postcss-preset-env": "^8.2.0",
|
|
11
|
-
"tailwindcss": "^3.3.0"
|
|
6
|
+
"@tailwindcss/vite": "4.0.0-alpha.17"
|
|
12
7
|
}
|
|
13
8
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"comment": "Remix version is automatically updated by the CLI",
|
|
3
2
|
"dependencies": {
|
|
4
|
-
"@
|
|
3
|
+
"@vanilla-extract/css": "^1.15.2"
|
|
5
4
|
},
|
|
6
5
|
"devDependencies": {
|
|
7
|
-
"@vanilla-extract/
|
|
6
|
+
"@vanilla-extract/vite-plugin": "^4.0.10"
|
|
8
7
|
}
|
|
9
8
|
}
|
|
@@ -2,14 +2,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import {
|
|
3
3
|
Links,
|
|
4
4
|
Meta,
|
|
5
|
-
Outlet,
|
|
6
5
|
Scripts,
|
|
7
6
|
ScrollRestoration,
|
|
8
7
|
isRouteErrorResponse,
|
|
9
8
|
useRouteError
|
|
10
9
|
} from "@remix-run/react";
|
|
11
10
|
import favicon from "./assets/favicon.svg";
|
|
12
|
-
import {
|
|
11
|
+
import { PageLayout } from "./components/PageLayout.jsx";
|
|
13
12
|
import { useNonce } from "@shopify/hydrogen";
|
|
14
13
|
import styles from "./assets/styles.css?url";
|
|
15
14
|
const links = () => {
|
|
@@ -18,7 +17,7 @@ const links = () => {
|
|
|
18
17
|
{ rel: "icon", type: "image/svg+xml", href: favicon }
|
|
19
18
|
];
|
|
20
19
|
};
|
|
21
|
-
function
|
|
20
|
+
function Layout({ children }) {
|
|
22
21
|
const nonce = useNonce();
|
|
23
22
|
return /* @__PURE__ */ jsxs("html", { lang: "en", children: [
|
|
24
23
|
/* @__PURE__ */ jsxs("head", { children: [
|
|
@@ -36,14 +35,13 @@ function App() {
|
|
|
36
35
|
/* @__PURE__ */ jsx(Links, {})
|
|
37
36
|
] }),
|
|
38
37
|
/* @__PURE__ */ jsxs("body", { children: [
|
|
39
|
-
/* @__PURE__ */ jsx(
|
|
38
|
+
/* @__PURE__ */ jsx(PageLayout, { children }),
|
|
40
39
|
/* @__PURE__ */ jsx(ScrollRestoration, { nonce }),
|
|
41
40
|
/* @__PURE__ */ jsx(Scripts, { nonce })
|
|
42
41
|
] })
|
|
43
42
|
] });
|
|
44
43
|
}
|
|
45
44
|
function ErrorBoundary() {
|
|
46
|
-
const nonce = useNonce();
|
|
47
45
|
const error = useRouteError();
|
|
48
46
|
let errorMessage = "Unknown error";
|
|
49
47
|
let errorStatus = 500;
|
|
@@ -53,34 +51,14 @@ function ErrorBoundary() {
|
|
|
53
51
|
} else if (error instanceof Error) {
|
|
54
52
|
errorMessage = error.message;
|
|
55
53
|
}
|
|
56
|
-
return /* @__PURE__ */ jsxs("
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/* @__PURE__ */ jsx("title", { children: "Hydrogen" }),
|
|
61
|
-
/* @__PURE__ */ jsx(
|
|
62
|
-
"meta",
|
|
63
|
-
{
|
|
64
|
-
name: "description",
|
|
65
|
-
content: "A custom storefront powered by Hydrogen"
|
|
66
|
-
}
|
|
67
|
-
),
|
|
68
|
-
/* @__PURE__ */ jsx(Meta, {}),
|
|
69
|
-
/* @__PURE__ */ jsx(Links, {})
|
|
70
|
-
] }),
|
|
71
|
-
/* @__PURE__ */ jsxs("body", { children: [
|
|
72
|
-
/* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsxs("div", { className: "route-error", children: [
|
|
73
|
-
/* @__PURE__ */ jsx("h1", { children: "Please report this error" }),
|
|
74
|
-
/* @__PURE__ */ jsx("h2", { children: errorStatus }),
|
|
75
|
-
errorMessage && /* @__PURE__ */ jsx("fieldset", { children: /* @__PURE__ */ jsx("pre", { children: errorMessage }) })
|
|
76
|
-
] }) }),
|
|
77
|
-
/* @__PURE__ */ jsx(ScrollRestoration, { nonce }),
|
|
78
|
-
/* @__PURE__ */ jsx(Scripts, { nonce })
|
|
79
|
-
] })
|
|
54
|
+
return /* @__PURE__ */ jsxs("div", { className: "route-error", children: [
|
|
55
|
+
/* @__PURE__ */ jsx("h1", { children: "Please report this error" }),
|
|
56
|
+
/* @__PURE__ */ jsx("h2", { children: errorStatus }),
|
|
57
|
+
errorMessage && /* @__PURE__ */ jsx("fieldset", { children: /* @__PURE__ */ jsx("pre", { children: errorMessage }) })
|
|
80
58
|
] });
|
|
81
59
|
}
|
|
82
60
|
export {
|
|
83
61
|
ErrorBoundary,
|
|
84
|
-
|
|
62
|
+
Layout,
|
|
85
63
|
links
|
|
86
64
|
};
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
execa,
|
|
3
3
|
outputContent,
|
|
4
4
|
outputDebug
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NLE3ZLU6.js";
|
|
6
6
|
import {
|
|
7
7
|
init_cjs_shims
|
|
8
8
|
} from "./chunk-ZPL24Y2D.js";
|
|
9
9
|
|
|
10
|
-
// ../cli-kit/
|
|
10
|
+
// ../cli-kit/dist/public/node/os.js
|
|
11
11
|
init_cjs_shims();
|
|
12
12
|
import { userInfo as osUserInfo } from "os";
|
|
13
13
|
async function username(platform = process.platform) {
|
|
@@ -70,4 +70,4 @@ export {
|
|
|
70
70
|
username,
|
|
71
71
|
platformAndArch
|
|
72
72
|
};
|
|
73
|
-
//# sourceMappingURL=chunk-
|
|
73
|
+
//# sourceMappingURL=chunk-2DXCIFDK.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
asyncTasks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JNUJZFQL.js";
|
|
4
4
|
import {
|
|
5
5
|
base_command_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XNCQBHNR.js";
|
|
7
7
|
import {
|
|
8
8
|
init_cjs_shims
|
|
9
9
|
} from "./chunk-ZPL24Y2D.js";
|
|
@@ -25,4 +25,4 @@ var KitchenSinkAsync = class extends base_command_default {
|
|
|
25
25
|
export {
|
|
26
26
|
KitchenSinkAsync
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-63D4EGTO.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
demo
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OVWFZSJT.js";
|
|
4
4
|
import {
|
|
5
5
|
base_command_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XNCQBHNR.js";
|
|
7
7
|
import {
|
|
8
8
|
readFile
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NLE3ZLU6.js";
|
|
10
10
|
import {
|
|
11
11
|
require_lib
|
|
12
12
|
} from "./chunk-GEN4RXTD.js";
|
|
13
13
|
import {
|
|
14
14
|
cwd,
|
|
15
15
|
resolvePath
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-B7RN7IRD.js";
|
|
17
17
|
import {
|
|
18
18
|
__toESM,
|
|
19
19
|
init_cjs_shims
|
|
@@ -58,4 +58,4 @@ var Demo = class _Demo extends base_command_default {
|
|
|
58
58
|
export {
|
|
59
59
|
Demo
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-6PJAGL2L.js.map
|