@shopify/cli-hydrogen 8.1.0 → 8.2.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.
- package/dist/assets/hydrogen/starter/CHANGELOG.md +166 -0
- 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/lib/session.ts +5 -0
- package/dist/assets/hydrogen/starter/app/root.tsx +23 -36
- package/dist/assets/hydrogen/starter/app/routes/account.$.tsx +1 -5
- package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +12 -70
- package/dist/assets/hydrogen/starter/app/routes/account.orders.$id.tsx +7 -14
- package/dist/assets/hydrogen/starter/app/routes/account.orders._index.tsx +1 -8
- package/dist/assets/hydrogen/starter/app/routes/account.profile.tsx +5 -22
- package/dist/assets/hydrogen/starter/app/routes/account.tsx +0 -1
- package/dist/assets/hydrogen/starter/app/routes/cart.tsx +1 -3
- package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +51 -232
- package/dist/assets/hydrogen/starter/package.json +10 -11
- package/dist/assets/hydrogen/starter/server.ts +4 -0
- 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/components/RequestDetails.jsx +1 -2
- package/dist/assets/hydrogen/virtual-routes/components/RequestTable.jsx +1 -2
- package/dist/assets/hydrogen/virtual-routes/routes/index.jsx +1 -2
- package/dist/assets/hydrogen/virtual-routes/virtual-root.jsx +8 -30
- package/dist/commands/hydrogen/build.js +33 -10
- package/dist/commands/hydrogen/customer-account/push.js +3 -6
- package/dist/commands/hydrogen/debug/cpu.js +3 -3
- package/dist/commands/hydrogen/deploy.js +14 -3
- package/dist/commands/hydrogen/dev.js +3 -6
- package/dist/commands/hydrogen/env/list.js +1 -2
- package/dist/commands/hydrogen/env/pull.js +2 -4
- package/dist/commands/hydrogen/env/push.js +6 -12
- package/dist/commands/hydrogen/init.d.ts +18 -15
- package/dist/commands/hydrogen/init.js +12 -24
- package/dist/commands/hydrogen/link.js +1 -2
- package/dist/commands/hydrogen/preview.js +4 -6
- package/dist/commands/hydrogen/setup/css.js +29 -12
- package/dist/commands/hydrogen/setup/vite.js +3 -6
- package/dist/commands/hydrogen/setup.js +8 -7
- package/dist/commands/hydrogen/upgrade.js +16 -32
- package/dist/hooks/init.js +50 -6
- package/dist/index.d.ts +46 -46
- package/dist/lib/auth.js +1 -2
- package/dist/lib/build.js +1 -2
- package/dist/lib/bundle/analyzer.js +39 -24
- package/dist/lib/bundle/vite-plugin.js +161 -0
- package/dist/lib/check-cli-version.js +61 -0
- package/dist/lib/check-lockfile.js +2 -2
- package/dist/lib/classic-compiler/build.js +3 -3
- package/dist/lib/classic-compiler/dev.js +5 -10
- package/dist/lib/codegen.js +8 -16
- package/dist/lib/defer.js +2 -4
- package/dist/lib/environment-variables.js +2 -4
- package/dist/lib/file.js +15 -7
- package/dist/lib/flags.js +10 -0
- package/dist/lib/get-oxygen-deployment-data.js +1 -2
- package/dist/lib/graphiql-url.js +1 -2
- package/dist/lib/import-utils.js +3 -2
- package/dist/lib/log.js +11 -22
- package/dist/lib/mini-oxygen/common.js +1 -2
- package/dist/lib/mini-oxygen/node.js +1 -2
- package/dist/lib/missing-routes.js +1 -2
- package/dist/lib/onboarding/common.js +60 -15
- package/dist/lib/onboarding/local.js +14 -13
- package/dist/lib/onboarding/remote.js +16 -9
- package/dist/lib/onboarding/setup-template.mocks.js +6 -3
- package/dist/lib/remix-config.js +2 -4
- package/dist/lib/remix-version-check.js +1 -2
- package/dist/lib/request-events.js +3 -6
- package/dist/lib/setups/css/assets.js +1 -1
- package/dist/lib/setups/css/index.js +17 -10
- package/dist/lib/setups/css/replacers.js +74 -76
- package/dist/lib/setups/css/tailwind.js +16 -20
- package/dist/lib/setups/css/vanilla-extract.js +8 -5
- package/dist/lib/setups/i18n/replacers.js +1 -2
- package/dist/lib/setups/routes/generate.js +18 -19
- package/dist/lib/shell.js +5 -10
- package/dist/lib/template-diff.js +83 -104
- package/dist/lib/template-downloader.js +2 -2
- package/dist/lib/transpile/morph/functions.js +3 -6
- package/dist/lib/transpile/morph/index.js +2 -4
- package/dist/lib/transpile/morph/typedefs.js +3 -6
- package/dist/lib/transpile/morph/utils.js +2 -4
- package/dist/lib/transpile/project.js +4 -3
- package/oclif.manifest.json +51 -4
- package/package.json +8 -12
- 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/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/lib/check-version.js +0 -75
- package/dist/lib/setups/css/css-modules.js +0 -23
- package/dist/lib/setups/css/postcss.js +0 -31
|
@@ -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
|
+
}
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
* swap out the cookie-based implementation with something else!
|
|
12
12
|
*/
|
|
13
13
|
export class AppSession implements HydrogenSession {
|
|
14
|
+
public isPending = false;
|
|
15
|
+
|
|
14
16
|
#sessionStorage;
|
|
15
17
|
#session;
|
|
16
18
|
|
|
@@ -50,10 +52,12 @@ export class AppSession implements HydrogenSession {
|
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
get unset() {
|
|
55
|
+
this.isPending = true;
|
|
53
56
|
return this.#session.unset;
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
get set() {
|
|
60
|
+
this.isPending = true;
|
|
57
61
|
return this.#session.set;
|
|
58
62
|
}
|
|
59
63
|
|
|
@@ -62,6 +66,7 @@ export class AppSession implements HydrogenSession {
|
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
commit() {
|
|
69
|
+
this.isPending = false;
|
|
65
70
|
return this.#sessionStorage.commitSession(this.#session);
|
|
66
71
|
}
|
|
67
72
|
}
|
|
@@ -65,26 +65,19 @@ export async function loader(args: LoaderFunctionArgs) {
|
|
|
65
65
|
|
|
66
66
|
const {storefront, env} = args.context;
|
|
67
67
|
|
|
68
|
-
return defer(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
storefrontAccessToken: env.PUBLIC_STOREFRONT_API_TOKEN,
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
headers: {
|
|
84
|
-
'Set-Cookie': await args.context.session.commit(),
|
|
85
|
-
},
|
|
68
|
+
return defer({
|
|
69
|
+
...deferredData,
|
|
70
|
+
...criticalData,
|
|
71
|
+
publicStoreDomain: env.PUBLIC_STORE_DOMAIN,
|
|
72
|
+
shop: getShopAnalytics({
|
|
73
|
+
storefront,
|
|
74
|
+
publicStorefrontId: env.PUBLIC_STOREFRONT_ID,
|
|
75
|
+
}),
|
|
76
|
+
consent: {
|
|
77
|
+
checkoutDomain: env.PUBLIC_CHECKOUT_DOMAIN,
|
|
78
|
+
storefrontAccessToken: env.PUBLIC_STOREFRONT_API_TOKEN,
|
|
86
79
|
},
|
|
87
|
-
);
|
|
80
|
+
});
|
|
88
81
|
}
|
|
89
82
|
|
|
90
83
|
/**
|
|
@@ -137,7 +130,7 @@ function loadDeferredData({context}: LoaderFunctionArgs) {
|
|
|
137
130
|
};
|
|
138
131
|
}
|
|
139
132
|
|
|
140
|
-
function Layout({children}: {children?: React.ReactNode}) {
|
|
133
|
+
export function Layout({children}: {children?: React.ReactNode}) {
|
|
141
134
|
const nonce = useNonce();
|
|
142
135
|
const data = useRouteLoaderData<RootLoader>('root');
|
|
143
136
|
|
|
@@ -169,11 +162,7 @@ function Layout({children}: {children?: React.ReactNode}) {
|
|
|
169
162
|
}
|
|
170
163
|
|
|
171
164
|
export default function App() {
|
|
172
|
-
return
|
|
173
|
-
<Layout>
|
|
174
|
-
<Outlet />
|
|
175
|
-
</Layout>
|
|
176
|
-
);
|
|
165
|
+
return <Outlet />;
|
|
177
166
|
}
|
|
178
167
|
|
|
179
168
|
export function ErrorBoundary() {
|
|
@@ -189,16 +178,14 @@ export function ErrorBoundary() {
|
|
|
189
178
|
}
|
|
190
179
|
|
|
191
180
|
return (
|
|
192
|
-
<
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
</div>
|
|
202
|
-
</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>
|
|
203
190
|
);
|
|
204
191
|
}
|
|
@@ -4,9 +4,5 @@ import {redirect, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
|
|
|
4
4
|
export async function loader({context}: LoaderFunctionArgs) {
|
|
5
5
|
await context.customerAccount.handleAuthStatus();
|
|
6
6
|
|
|
7
|
-
return redirect('/account'
|
|
8
|
-
headers: {
|
|
9
|
-
'Set-Cookie': await context.session.commit(),
|
|
10
|
-
},
|
|
11
|
-
});
|
|
7
|
+
return redirect('/account');
|
|
12
8
|
}
|
|
@@ -37,14 +37,7 @@ export const meta: MetaFunction = () => {
|
|
|
37
37
|
export async function loader({context}: LoaderFunctionArgs) {
|
|
38
38
|
await context.customerAccount.handleAuthStatus();
|
|
39
39
|
|
|
40
|
-
return json(
|
|
41
|
-
{},
|
|
42
|
-
{
|
|
43
|
-
headers: {
|
|
44
|
-
'Set-Cookie': await context.session.commit(),
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
);
|
|
40
|
+
return json({});
|
|
48
41
|
}
|
|
49
42
|
|
|
50
43
|
export async function action({request, context}: ActionFunctionArgs) {
|
|
@@ -67,9 +60,6 @@ export async function action({request, context}: ActionFunctionArgs) {
|
|
|
67
60
|
{error: {[addressId]: 'Unauthorized'}},
|
|
68
61
|
{
|
|
69
62
|
status: 401,
|
|
70
|
-
headers: {
|
|
71
|
-
'Set-Cookie': await context.session.commit(),
|
|
72
|
-
},
|
|
73
63
|
},
|
|
74
64
|
);
|
|
75
65
|
}
|
|
@@ -121,27 +111,17 @@ export async function action({request, context}: ActionFunctionArgs) {
|
|
|
121
111
|
throw new Error('Customer address create failed.');
|
|
122
112
|
}
|
|
123
113
|
|
|
124
|
-
return json(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
headers: {
|
|
132
|
-
'Set-Cookie': await context.session.commit(),
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
);
|
|
114
|
+
return json({
|
|
115
|
+
error: null,
|
|
116
|
+
createdAddress: data?.customerAddressCreate?.customerAddress,
|
|
117
|
+
defaultAddress,
|
|
118
|
+
});
|
|
136
119
|
} catch (error: unknown) {
|
|
137
120
|
if (error instanceof Error) {
|
|
138
121
|
return json(
|
|
139
122
|
{error: {[addressId]: error.message}},
|
|
140
123
|
{
|
|
141
124
|
status: 400,
|
|
142
|
-
headers: {
|
|
143
|
-
'Set-Cookie': await context.session.commit(),
|
|
144
|
-
},
|
|
145
125
|
},
|
|
146
126
|
);
|
|
147
127
|
}
|
|
@@ -149,9 +129,6 @@ export async function action({request, context}: ActionFunctionArgs) {
|
|
|
149
129
|
{error: {[addressId]: error}},
|
|
150
130
|
{
|
|
151
131
|
status: 400,
|
|
152
|
-
headers: {
|
|
153
|
-
'Set-Cookie': await context.session.commit(),
|
|
154
|
-
},
|
|
155
132
|
},
|
|
156
133
|
);
|
|
157
134
|
}
|
|
@@ -183,27 +160,17 @@ export async function action({request, context}: ActionFunctionArgs) {
|
|
|
183
160
|
throw new Error('Customer address update failed.');
|
|
184
161
|
}
|
|
185
162
|
|
|
186
|
-
return json(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
headers: {
|
|
194
|
-
'Set-Cookie': await context.session.commit(),
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
);
|
|
163
|
+
return json({
|
|
164
|
+
error: null,
|
|
165
|
+
updatedAddress: address,
|
|
166
|
+
defaultAddress,
|
|
167
|
+
});
|
|
198
168
|
} catch (error: unknown) {
|
|
199
169
|
if (error instanceof Error) {
|
|
200
170
|
return json(
|
|
201
171
|
{error: {[addressId]: error.message}},
|
|
202
172
|
{
|
|
203
173
|
status: 400,
|
|
204
|
-
headers: {
|
|
205
|
-
'Set-Cookie': await context.session.commit(),
|
|
206
|
-
},
|
|
207
174
|
},
|
|
208
175
|
);
|
|
209
176
|
}
|
|
@@ -211,9 +178,6 @@ export async function action({request, context}: ActionFunctionArgs) {
|
|
|
211
178
|
{error: {[addressId]: error}},
|
|
212
179
|
{
|
|
213
180
|
status: 400,
|
|
214
|
-
headers: {
|
|
215
|
-
'Set-Cookie': await context.session.commit(),
|
|
216
|
-
},
|
|
217
181
|
},
|
|
218
182
|
);
|
|
219
183
|
}
|
|
@@ -241,23 +205,13 @@ export async function action({request, context}: ActionFunctionArgs) {
|
|
|
241
205
|
throw new Error('Customer address delete failed.');
|
|
242
206
|
}
|
|
243
207
|
|
|
244
|
-
return json(
|
|
245
|
-
{error: null, deletedAddress: addressId},
|
|
246
|
-
{
|
|
247
|
-
headers: {
|
|
248
|
-
'Set-Cookie': await context.session.commit(),
|
|
249
|
-
},
|
|
250
|
-
},
|
|
251
|
-
);
|
|
208
|
+
return json({error: null, deletedAddress: addressId});
|
|
252
209
|
} catch (error: unknown) {
|
|
253
210
|
if (error instanceof Error) {
|
|
254
211
|
return json(
|
|
255
212
|
{error: {[addressId]: error.message}},
|
|
256
213
|
{
|
|
257
214
|
status: 400,
|
|
258
|
-
headers: {
|
|
259
|
-
'Set-Cookie': await context.session.commit(),
|
|
260
|
-
},
|
|
261
215
|
},
|
|
262
216
|
);
|
|
263
217
|
}
|
|
@@ -265,9 +219,6 @@ export async function action({request, context}: ActionFunctionArgs) {
|
|
|
265
219
|
{error: {[addressId]: error}},
|
|
266
220
|
{
|
|
267
221
|
status: 400,
|
|
268
|
-
headers: {
|
|
269
|
-
'Set-Cookie': await context.session.commit(),
|
|
270
|
-
},
|
|
271
222
|
},
|
|
272
223
|
);
|
|
273
224
|
}
|
|
@@ -278,9 +229,6 @@ export async function action({request, context}: ActionFunctionArgs) {
|
|
|
278
229
|
{error: {[addressId]: 'Method not allowed'}},
|
|
279
230
|
{
|
|
280
231
|
status: 405,
|
|
281
|
-
headers: {
|
|
282
|
-
'Set-Cookie': await context.session.commit(),
|
|
283
|
-
},
|
|
284
232
|
},
|
|
285
233
|
);
|
|
286
234
|
}
|
|
@@ -291,9 +239,6 @@ export async function action({request, context}: ActionFunctionArgs) {
|
|
|
291
239
|
{error: error.message},
|
|
292
240
|
{
|
|
293
241
|
status: 400,
|
|
294
|
-
headers: {
|
|
295
|
-
'Set-Cookie': await context.session.commit(),
|
|
296
|
-
},
|
|
297
242
|
},
|
|
298
243
|
);
|
|
299
244
|
}
|
|
@@ -301,9 +246,6 @@ export async function action({request, context}: ActionFunctionArgs) {
|
|
|
301
246
|
{error},
|
|
302
247
|
{
|
|
303
248
|
status: 400,
|
|
304
|
-
headers: {
|
|
305
|
-
'Set-Cookie': await context.session.commit(),
|
|
306
|
-
},
|
|
307
249
|
},
|
|
308
250
|
);
|
|
309
251
|
}
|
|
@@ -40,20 +40,13 @@ export async function loader({params, context}: LoaderFunctionArgs) {
|
|
|
40
40
|
firstDiscount?.__typename === 'PricingPercentageValue' &&
|
|
41
41
|
firstDiscount?.percentage;
|
|
42
42
|
|
|
43
|
-
return json(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
headers: {
|
|
53
|
-
'Set-Cookie': await context.session.commit(),
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
);
|
|
43
|
+
return json({
|
|
44
|
+
order,
|
|
45
|
+
lineItems,
|
|
46
|
+
discountValue,
|
|
47
|
+
discountPercentage,
|
|
48
|
+
fulfillmentStatus,
|
|
49
|
+
});
|
|
57
50
|
}
|
|
58
51
|
|
|
59
52
|
export default function OrderRoute() {
|
|
@@ -34,14 +34,7 @@ export async function loader({request, context}: LoaderFunctionArgs) {
|
|
|
34
34
|
throw Error('Customer orders not found');
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
return json(
|
|
38
|
-
{customer: data.customer},
|
|
39
|
-
{
|
|
40
|
-
headers: {
|
|
41
|
-
'Set-Cookie': await context.session.commit(),
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
);
|
|
37
|
+
return json({customer: data.customer});
|
|
45
38
|
}
|
|
46
39
|
|
|
47
40
|
export default function Orders() {
|
|
@@ -26,14 +26,7 @@ export const meta: MetaFunction = () => {
|
|
|
26
26
|
export async function loader({context}: LoaderFunctionArgs) {
|
|
27
27
|
await context.customerAccount.handleAuthStatus();
|
|
28
28
|
|
|
29
|
-
return json(
|
|
30
|
-
{},
|
|
31
|
-
{
|
|
32
|
-
headers: {
|
|
33
|
-
'Set-Cookie': await context.session.commit(),
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
);
|
|
29
|
+
return json({});
|
|
37
30
|
}
|
|
38
31
|
|
|
39
32
|
export async function action({request, context}: ActionFunctionArgs) {
|
|
@@ -75,25 +68,15 @@ export async function action({request, context}: ActionFunctionArgs) {
|
|
|
75
68
|
throw new Error('Customer profile update failed.');
|
|
76
69
|
}
|
|
77
70
|
|
|
78
|
-
return json(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
headers: {
|
|
85
|
-
'Set-Cookie': await context.session.commit(),
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
);
|
|
71
|
+
return json({
|
|
72
|
+
error: null,
|
|
73
|
+
customer: data?.customerUpdate?.customer,
|
|
74
|
+
});
|
|
89
75
|
} catch (error: any) {
|
|
90
76
|
return json(
|
|
91
77
|
{error: error.message, customer: null},
|
|
92
78
|
{
|
|
93
79
|
status: 400,
|
|
94
|
-
headers: {
|
|
95
|
-
'Set-Cookie': await context.session.commit(),
|
|
96
|
-
},
|
|
97
80
|
},
|
|
98
81
|
);
|
|
99
82
|
}
|
|
@@ -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 = () => {
|
|
@@ -68,8 +68,6 @@ export async function action({request, context}: ActionFunctionArgs) {
|
|
|
68
68
|
headers.set('Location', redirectTo);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
headers.append('Set-Cookie', await context.session.commit());
|
|
72
|
-
|
|
73
71
|
return json(
|
|
74
72
|
{
|
|
75
73
|
cart: cartResult,
|