@shopify/create-hydrogen 4.3.13 → 5.0.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/bundle/analyzer.html +2045 -0
- package/dist/assets/hydrogen/i18n/domains.ts +28 -0
- package/dist/assets/hydrogen/i18n/mock-i18n-types.ts +3 -0
- package/dist/assets/hydrogen/i18n/subdomains.ts +27 -0
- package/dist/assets/hydrogen/i18n/subfolders.ts +29 -0
- package/dist/assets/hydrogen/routes/locale-check.ts +16 -0
- package/dist/assets/hydrogen/starter/.eslintignore +5 -0
- package/dist/assets/hydrogen/starter/.eslintrc.cjs +19 -0
- package/dist/assets/hydrogen/starter/.graphqlrc.yml +12 -0
- package/dist/assets/hydrogen/starter/CHANGELOG.md +709 -0
- package/dist/assets/hydrogen/starter/README.md +45 -0
- package/dist/assets/hydrogen/starter/app/assets/favicon.svg +28 -0
- package/dist/assets/hydrogen/starter/app/components/AddToCartButton.tsx +37 -0
- package/dist/assets/hydrogen/starter/app/components/Aside.tsx +76 -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/Footer.tsx +129 -0
- package/dist/assets/hydrogen/starter/app/components/Header.tsx +230 -0
- package/dist/assets/hydrogen/starter/app/components/PageLayout.tsx +126 -0
- 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/components/Search.tsx +514 -0
- package/dist/assets/hydrogen/starter/app/entry.client.tsx +12 -0
- package/dist/assets/hydrogen/starter/app/entry.server.tsx +47 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerAddressMutations.ts +61 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerDetailsQuery.ts +40 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerOrderQuery.ts +87 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerOrdersQuery.ts +58 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerUpdateMutation.ts +24 -0
- package/dist/assets/hydrogen/starter/app/lib/fragments.ts +174 -0
- package/dist/assets/hydrogen/starter/app/lib/search.ts +29 -0
- package/dist/assets/hydrogen/starter/app/lib/session.ts +72 -0
- package/dist/assets/hydrogen/starter/app/lib/variants.ts +46 -0
- package/dist/assets/hydrogen/starter/app/root.tsx +191 -0
- package/dist/assets/hydrogen/starter/app/routes/$.tsx +11 -0
- package/dist/assets/hydrogen/starter/app/routes/[robots.txt].tsx +118 -0
- package/dist/assets/hydrogen/starter/app/routes/[sitemap.xml].tsx +177 -0
- package/dist/assets/hydrogen/starter/app/routes/_index.tsx +182 -0
- package/dist/assets/hydrogen/starter/app/routes/account.$.tsx +8 -0
- package/dist/assets/hydrogen/starter/app/routes/account._index.tsx +5 -0
- package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +513 -0
- package/dist/assets/hydrogen/starter/app/routes/account.orders.$id.tsx +195 -0
- package/dist/assets/hydrogen/starter/app/routes/account.orders._index.tsx +107 -0
- package/dist/assets/hydrogen/starter/app/routes/account.profile.tsx +136 -0
- package/dist/assets/hydrogen/starter/app/routes/account.tsx +88 -0
- package/dist/assets/hydrogen/starter/app/routes/account_.authorize.tsx +5 -0
- package/dist/assets/hydrogen/starter/app/routes/account_.login.tsx +5 -0
- package/dist/assets/hydrogen/starter/app/routes/account_.logout.tsx +10 -0
- package/dist/assets/hydrogen/starter/app/routes/api.predictive-search.tsx +318 -0
- package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle.$articleHandle.tsx +113 -0
- package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle._index.tsx +188 -0
- package/dist/assets/hydrogen/starter/app/routes/blogs._index.tsx +119 -0
- package/dist/assets/hydrogen/starter/app/routes/cart.$lines.tsx +69 -0
- package/dist/assets/hydrogen/starter/app/routes/cart.tsx +102 -0
- package/dist/assets/hydrogen/starter/app/routes/collections.$handle.tsx +225 -0
- package/dist/assets/hydrogen/starter/app/routes/collections._index.tsx +146 -0
- package/dist/assets/hydrogen/starter/app/routes/collections.all.tsx +185 -0
- package/dist/assets/hydrogen/starter/app/routes/discount.$code.tsx +47 -0
- package/dist/assets/hydrogen/starter/app/routes/pages.$handle.tsx +84 -0
- package/dist/assets/hydrogen/starter/app/routes/policies.$handle.tsx +93 -0
- package/dist/assets/hydrogen/starter/app/routes/policies._index.tsx +63 -0
- package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +299 -0
- package/dist/assets/hydrogen/starter/app/routes/search.tsx +177 -0
- package/dist/assets/hydrogen/starter/app/styles/app.css +486 -0
- package/dist/assets/hydrogen/starter/app/styles/reset.css +129 -0
- package/dist/assets/hydrogen/starter/customer-accountapi.generated.d.ts +509 -0
- package/dist/assets/hydrogen/starter/env.d.ts +54 -0
- package/dist/assets/hydrogen/starter/package.json +50 -0
- package/dist/assets/hydrogen/starter/public/.gitkeep +0 -0
- package/dist/assets/hydrogen/starter/server.ts +119 -0
- package/dist/assets/hydrogen/starter/storefrontapi.generated.d.ts +1211 -0
- package/dist/assets/hydrogen/starter/tsconfig.json +23 -0
- package/dist/assets/hydrogen/starter/vite.config.ts +41 -0
- package/dist/assets/hydrogen/tailwind/package.json +8 -0
- package/dist/assets/hydrogen/tailwind/tailwind.css +6 -0
- package/dist/assets/hydrogen/vanilla-extract/package.json +8 -0
- package/dist/assets/hydrogen/virtual-routes/assets/debug-network.css +592 -0
- package/dist/assets/hydrogen/virtual-routes/assets/favicon-dark.svg +20 -0
- package/dist/assets/hydrogen/virtual-routes/assets/favicon.svg +28 -0
- package/dist/assets/hydrogen/virtual-routes/assets/inter-variable-font.woff2 +0 -0
- package/dist/assets/hydrogen/virtual-routes/assets/jetbrainsmono-variable-font.woff2 +0 -0
- package/dist/assets/hydrogen/virtual-routes/assets/styles.css +238 -0
- package/dist/assets/hydrogen/virtual-routes/components/FlameChartWrapper.jsx +123 -0
- package/dist/assets/hydrogen/virtual-routes/components/HydrogenLogoBaseBW.jsx +32 -0
- package/dist/assets/hydrogen/virtual-routes/components/HydrogenLogoBaseColor.jsx +47 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconBanner.jsx +292 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconClose.jsx +38 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconDiscard.jsx +44 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconError.jsx +61 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconGithub.jsx +23 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconTwitter.jsx +21 -0
- package/dist/assets/hydrogen/virtual-routes/components/PageLayout.jsx +7 -0
- package/dist/assets/hydrogen/virtual-routes/components/RequestDetails.jsx +178 -0
- package/dist/assets/hydrogen/virtual-routes/components/RequestTable.jsx +91 -0
- package/dist/assets/hydrogen/virtual-routes/components/RequestWaterfall.jsx +151 -0
- package/dist/assets/hydrogen/virtual-routes/lib/useDebugNetworkServer.jsx +178 -0
- package/dist/assets/hydrogen/virtual-routes/routes/graphiql.jsx +5 -0
- package/dist/assets/hydrogen/virtual-routes/routes/index.jsx +265 -0
- package/dist/assets/hydrogen/virtual-routes/routes/subrequest-profiler.jsx +243 -0
- package/dist/assets/hydrogen/virtual-routes/virtual-root.jsx +64 -0
- package/dist/assets/hydrogen/vite/package.json +14 -0
- package/dist/assets/hydrogen/vite/vite.config.js +41 -0
- package/dist/chokidar-2CKIHN27.js +12 -0
- package/dist/chunk-EO6F7WJJ.js +2 -0
- package/dist/chunk-FB327AH7.js +5 -0
- package/dist/chunk-FJPX4XUR.js +2 -0
- package/dist/chunk-JKOXGRAA.js +10 -0
- package/dist/chunk-LNQWGFTB.js +45 -0
- package/dist/chunk-M6JXYI3V.js +23 -0
- package/dist/chunk-MNT4XW23.js +2 -0
- package/dist/chunk-N7HFZHSO.js +1145 -0
- package/dist/chunk-PMDMUCNY.js +2 -0
- package/dist/chunk-QGLB6FFL.js +3 -0
- package/dist/chunk-VMIOG46Y.js +2 -0
- package/dist/create-app.js +1867 -34
- package/dist/del-CZGKV5SQ.js +11 -0
- package/dist/devtools-ZCRGQE64.js +8 -0
- package/dist/error-handler-GEQXZJ25.js +2 -0
- package/dist/lib-NJYCLW6W.js +22 -0
- package/dist/morph-ZJCCGFNC.js +30499 -0
- package/dist/multipart-parser-6HGDQWV7.js +3 -0
- package/dist/open-OD6DRFEG.js +2 -0
- package/dist/out-7KAQXZLP.js +2 -0
- package/dist/yoga.wasm +0 -0
- package/package.json +7 -3
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
/* eslint-disable eslint-comments/disable-enable-pair */
|
|
2
|
+
/* eslint-disable eslint-comments/no-unlimited-disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import type * as CustomerAccountAPI from '@shopify/hydrogen/customer-account-api-types';
|
|
5
|
+
|
|
6
|
+
export type CustomerAddressUpdateMutationVariables = CustomerAccountAPI.Exact<{
|
|
7
|
+
address: CustomerAccountAPI.CustomerAddressInput;
|
|
8
|
+
addressId: CustomerAccountAPI.Scalars['ID']['input'];
|
|
9
|
+
defaultAddress?: CustomerAccountAPI.InputMaybe<
|
|
10
|
+
CustomerAccountAPI.Scalars['Boolean']['input']
|
|
11
|
+
>;
|
|
12
|
+
}>;
|
|
13
|
+
|
|
14
|
+
export type CustomerAddressUpdateMutation = {
|
|
15
|
+
customerAddressUpdate?: CustomerAccountAPI.Maybe<{
|
|
16
|
+
customerAddress?: CustomerAccountAPI.Maybe<
|
|
17
|
+
Pick<CustomerAccountAPI.CustomerAddress, 'id'>
|
|
18
|
+
>;
|
|
19
|
+
userErrors: Array<
|
|
20
|
+
Pick<
|
|
21
|
+
CustomerAccountAPI.UserErrorsCustomerAddressUserErrors,
|
|
22
|
+
'code' | 'field' | 'message'
|
|
23
|
+
>
|
|
24
|
+
>;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type CustomerAddressDeleteMutationVariables = CustomerAccountAPI.Exact<{
|
|
29
|
+
addressId: CustomerAccountAPI.Scalars['ID']['input'];
|
|
30
|
+
}>;
|
|
31
|
+
|
|
32
|
+
export type CustomerAddressDeleteMutation = {
|
|
33
|
+
customerAddressDelete?: CustomerAccountAPI.Maybe<
|
|
34
|
+
Pick<
|
|
35
|
+
CustomerAccountAPI.CustomerAddressDeletePayload,
|
|
36
|
+
'deletedAddressId'
|
|
37
|
+
> & {
|
|
38
|
+
userErrors: Array<
|
|
39
|
+
Pick<
|
|
40
|
+
CustomerAccountAPI.UserErrorsCustomerAddressUserErrors,
|
|
41
|
+
'code' | 'field' | 'message'
|
|
42
|
+
>
|
|
43
|
+
>;
|
|
44
|
+
}
|
|
45
|
+
>;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type CustomerAddressCreateMutationVariables = CustomerAccountAPI.Exact<{
|
|
49
|
+
address: CustomerAccountAPI.CustomerAddressInput;
|
|
50
|
+
defaultAddress?: CustomerAccountAPI.InputMaybe<
|
|
51
|
+
CustomerAccountAPI.Scalars['Boolean']['input']
|
|
52
|
+
>;
|
|
53
|
+
}>;
|
|
54
|
+
|
|
55
|
+
export type CustomerAddressCreateMutation = {
|
|
56
|
+
customerAddressCreate?: CustomerAccountAPI.Maybe<{
|
|
57
|
+
customerAddress?: CustomerAccountAPI.Maybe<
|
|
58
|
+
Pick<CustomerAccountAPI.CustomerAddress, 'id'>
|
|
59
|
+
>;
|
|
60
|
+
userErrors: Array<
|
|
61
|
+
Pick<
|
|
62
|
+
CustomerAccountAPI.UserErrorsCustomerAddressUserErrors,
|
|
63
|
+
'code' | 'field' | 'message'
|
|
64
|
+
>
|
|
65
|
+
>;
|
|
66
|
+
}>;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export type CustomerFragment = Pick<
|
|
70
|
+
CustomerAccountAPI.Customer,
|
|
71
|
+
'id' | 'firstName' | 'lastName'
|
|
72
|
+
> & {
|
|
73
|
+
defaultAddress?: CustomerAccountAPI.Maybe<
|
|
74
|
+
Pick<
|
|
75
|
+
CustomerAccountAPI.CustomerAddress,
|
|
76
|
+
| 'id'
|
|
77
|
+
| 'formatted'
|
|
78
|
+
| 'firstName'
|
|
79
|
+
| 'lastName'
|
|
80
|
+
| 'company'
|
|
81
|
+
| 'address1'
|
|
82
|
+
| 'address2'
|
|
83
|
+
| 'territoryCode'
|
|
84
|
+
| 'zoneCode'
|
|
85
|
+
| 'city'
|
|
86
|
+
| 'zip'
|
|
87
|
+
| 'phoneNumber'
|
|
88
|
+
>
|
|
89
|
+
>;
|
|
90
|
+
addresses: {
|
|
91
|
+
nodes: Array<
|
|
92
|
+
Pick<
|
|
93
|
+
CustomerAccountAPI.CustomerAddress,
|
|
94
|
+
| 'id'
|
|
95
|
+
| 'formatted'
|
|
96
|
+
| 'firstName'
|
|
97
|
+
| 'lastName'
|
|
98
|
+
| 'company'
|
|
99
|
+
| 'address1'
|
|
100
|
+
| 'address2'
|
|
101
|
+
| 'territoryCode'
|
|
102
|
+
| 'zoneCode'
|
|
103
|
+
| 'city'
|
|
104
|
+
| 'zip'
|
|
105
|
+
| 'phoneNumber'
|
|
106
|
+
>
|
|
107
|
+
>;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export type AddressFragment = Pick<
|
|
112
|
+
CustomerAccountAPI.CustomerAddress,
|
|
113
|
+
| 'id'
|
|
114
|
+
| 'formatted'
|
|
115
|
+
| 'firstName'
|
|
116
|
+
| 'lastName'
|
|
117
|
+
| 'company'
|
|
118
|
+
| 'address1'
|
|
119
|
+
| 'address2'
|
|
120
|
+
| 'territoryCode'
|
|
121
|
+
| 'zoneCode'
|
|
122
|
+
| 'city'
|
|
123
|
+
| 'zip'
|
|
124
|
+
| 'phoneNumber'
|
|
125
|
+
>;
|
|
126
|
+
|
|
127
|
+
export type CustomerDetailsQueryVariables = CustomerAccountAPI.Exact<{
|
|
128
|
+
[key: string]: never;
|
|
129
|
+
}>;
|
|
130
|
+
|
|
131
|
+
export type CustomerDetailsQuery = {
|
|
132
|
+
customer: Pick<
|
|
133
|
+
CustomerAccountAPI.Customer,
|
|
134
|
+
'id' | 'firstName' | 'lastName'
|
|
135
|
+
> & {
|
|
136
|
+
defaultAddress?: CustomerAccountAPI.Maybe<
|
|
137
|
+
Pick<
|
|
138
|
+
CustomerAccountAPI.CustomerAddress,
|
|
139
|
+
| 'id'
|
|
140
|
+
| 'formatted'
|
|
141
|
+
| 'firstName'
|
|
142
|
+
| 'lastName'
|
|
143
|
+
| 'company'
|
|
144
|
+
| 'address1'
|
|
145
|
+
| 'address2'
|
|
146
|
+
| 'territoryCode'
|
|
147
|
+
| 'zoneCode'
|
|
148
|
+
| 'city'
|
|
149
|
+
| 'zip'
|
|
150
|
+
| 'phoneNumber'
|
|
151
|
+
>
|
|
152
|
+
>;
|
|
153
|
+
addresses: {
|
|
154
|
+
nodes: Array<
|
|
155
|
+
Pick<
|
|
156
|
+
CustomerAccountAPI.CustomerAddress,
|
|
157
|
+
| 'id'
|
|
158
|
+
| 'formatted'
|
|
159
|
+
| 'firstName'
|
|
160
|
+
| 'lastName'
|
|
161
|
+
| 'company'
|
|
162
|
+
| 'address1'
|
|
163
|
+
| 'address2'
|
|
164
|
+
| 'territoryCode'
|
|
165
|
+
| 'zoneCode'
|
|
166
|
+
| 'city'
|
|
167
|
+
| 'zip'
|
|
168
|
+
| 'phoneNumber'
|
|
169
|
+
>
|
|
170
|
+
>;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export type OrderMoneyFragment = Pick<
|
|
176
|
+
CustomerAccountAPI.MoneyV2,
|
|
177
|
+
'amount' | 'currencyCode'
|
|
178
|
+
>;
|
|
179
|
+
|
|
180
|
+
export type DiscountApplicationFragment = {
|
|
181
|
+
value:
|
|
182
|
+
| ({__typename: 'MoneyV2'} & Pick<
|
|
183
|
+
CustomerAccountAPI.MoneyV2,
|
|
184
|
+
'amount' | 'currencyCode'
|
|
185
|
+
>)
|
|
186
|
+
| ({__typename: 'PricingPercentageValue'} & Pick<
|
|
187
|
+
CustomerAccountAPI.PricingPercentageValue,
|
|
188
|
+
'percentage'
|
|
189
|
+
>);
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export type OrderLineItemFullFragment = Pick<
|
|
193
|
+
CustomerAccountAPI.LineItem,
|
|
194
|
+
'id' | 'title' | 'quantity' | 'variantTitle'
|
|
195
|
+
> & {
|
|
196
|
+
price?: CustomerAccountAPI.Maybe<
|
|
197
|
+
Pick<CustomerAccountAPI.MoneyV2, 'amount' | 'currencyCode'>
|
|
198
|
+
>;
|
|
199
|
+
discountAllocations: Array<{
|
|
200
|
+
allocatedAmount: Pick<
|
|
201
|
+
CustomerAccountAPI.MoneyV2,
|
|
202
|
+
'amount' | 'currencyCode'
|
|
203
|
+
>;
|
|
204
|
+
discountApplication: {
|
|
205
|
+
value:
|
|
206
|
+
| ({__typename: 'MoneyV2'} & Pick<
|
|
207
|
+
CustomerAccountAPI.MoneyV2,
|
|
208
|
+
'amount' | 'currencyCode'
|
|
209
|
+
>)
|
|
210
|
+
| ({__typename: 'PricingPercentageValue'} & Pick<
|
|
211
|
+
CustomerAccountAPI.PricingPercentageValue,
|
|
212
|
+
'percentage'
|
|
213
|
+
>);
|
|
214
|
+
};
|
|
215
|
+
}>;
|
|
216
|
+
totalDiscount: Pick<CustomerAccountAPI.MoneyV2, 'amount' | 'currencyCode'>;
|
|
217
|
+
image?: CustomerAccountAPI.Maybe<
|
|
218
|
+
Pick<
|
|
219
|
+
CustomerAccountAPI.Image,
|
|
220
|
+
'altText' | 'height' | 'url' | 'id' | 'width'
|
|
221
|
+
>
|
|
222
|
+
>;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export type OrderFragment = Pick<
|
|
226
|
+
CustomerAccountAPI.Order,
|
|
227
|
+
'id' | 'name' | 'statusPageUrl' | 'processedAt'
|
|
228
|
+
> & {
|
|
229
|
+
fulfillments: {nodes: Array<Pick<CustomerAccountAPI.Fulfillment, 'status'>>};
|
|
230
|
+
totalTax?: CustomerAccountAPI.Maybe<
|
|
231
|
+
Pick<CustomerAccountAPI.MoneyV2, 'amount' | 'currencyCode'>
|
|
232
|
+
>;
|
|
233
|
+
totalPrice: Pick<CustomerAccountAPI.MoneyV2, 'amount' | 'currencyCode'>;
|
|
234
|
+
subtotal?: CustomerAccountAPI.Maybe<
|
|
235
|
+
Pick<CustomerAccountAPI.MoneyV2, 'amount' | 'currencyCode'>
|
|
236
|
+
>;
|
|
237
|
+
shippingAddress?: CustomerAccountAPI.Maybe<
|
|
238
|
+
Pick<
|
|
239
|
+
CustomerAccountAPI.CustomerAddress,
|
|
240
|
+
'name' | 'formatted' | 'formattedArea'
|
|
241
|
+
>
|
|
242
|
+
>;
|
|
243
|
+
discountApplications: {
|
|
244
|
+
nodes: Array<{
|
|
245
|
+
value:
|
|
246
|
+
| ({__typename: 'MoneyV2'} & Pick<
|
|
247
|
+
CustomerAccountAPI.MoneyV2,
|
|
248
|
+
'amount' | 'currencyCode'
|
|
249
|
+
>)
|
|
250
|
+
| ({__typename: 'PricingPercentageValue'} & Pick<
|
|
251
|
+
CustomerAccountAPI.PricingPercentageValue,
|
|
252
|
+
'percentage'
|
|
253
|
+
>);
|
|
254
|
+
}>;
|
|
255
|
+
};
|
|
256
|
+
lineItems: {
|
|
257
|
+
nodes: Array<
|
|
258
|
+
Pick<
|
|
259
|
+
CustomerAccountAPI.LineItem,
|
|
260
|
+
'id' | 'title' | 'quantity' | 'variantTitle'
|
|
261
|
+
> & {
|
|
262
|
+
price?: CustomerAccountAPI.Maybe<
|
|
263
|
+
Pick<CustomerAccountAPI.MoneyV2, 'amount' | 'currencyCode'>
|
|
264
|
+
>;
|
|
265
|
+
discountAllocations: Array<{
|
|
266
|
+
allocatedAmount: Pick<
|
|
267
|
+
CustomerAccountAPI.MoneyV2,
|
|
268
|
+
'amount' | 'currencyCode'
|
|
269
|
+
>;
|
|
270
|
+
discountApplication: {
|
|
271
|
+
value:
|
|
272
|
+
| ({__typename: 'MoneyV2'} & Pick<
|
|
273
|
+
CustomerAccountAPI.MoneyV2,
|
|
274
|
+
'amount' | 'currencyCode'
|
|
275
|
+
>)
|
|
276
|
+
| ({__typename: 'PricingPercentageValue'} & Pick<
|
|
277
|
+
CustomerAccountAPI.PricingPercentageValue,
|
|
278
|
+
'percentage'
|
|
279
|
+
>);
|
|
280
|
+
};
|
|
281
|
+
}>;
|
|
282
|
+
totalDiscount: Pick<
|
|
283
|
+
CustomerAccountAPI.MoneyV2,
|
|
284
|
+
'amount' | 'currencyCode'
|
|
285
|
+
>;
|
|
286
|
+
image?: CustomerAccountAPI.Maybe<
|
|
287
|
+
Pick<
|
|
288
|
+
CustomerAccountAPI.Image,
|
|
289
|
+
'altText' | 'height' | 'url' | 'id' | 'width'
|
|
290
|
+
>
|
|
291
|
+
>;
|
|
292
|
+
}
|
|
293
|
+
>;
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
export type OrderQueryVariables = CustomerAccountAPI.Exact<{
|
|
298
|
+
orderId: CustomerAccountAPI.Scalars['ID']['input'];
|
|
299
|
+
}>;
|
|
300
|
+
|
|
301
|
+
export type OrderQuery = {
|
|
302
|
+
order?: CustomerAccountAPI.Maybe<
|
|
303
|
+
Pick<
|
|
304
|
+
CustomerAccountAPI.Order,
|
|
305
|
+
'id' | 'name' | 'statusPageUrl' | 'processedAt'
|
|
306
|
+
> & {
|
|
307
|
+
fulfillments: {
|
|
308
|
+
nodes: Array<Pick<CustomerAccountAPI.Fulfillment, 'status'>>;
|
|
309
|
+
};
|
|
310
|
+
totalTax?: CustomerAccountAPI.Maybe<
|
|
311
|
+
Pick<CustomerAccountAPI.MoneyV2, 'amount' | 'currencyCode'>
|
|
312
|
+
>;
|
|
313
|
+
totalPrice: Pick<CustomerAccountAPI.MoneyV2, 'amount' | 'currencyCode'>;
|
|
314
|
+
subtotal?: CustomerAccountAPI.Maybe<
|
|
315
|
+
Pick<CustomerAccountAPI.MoneyV2, 'amount' | 'currencyCode'>
|
|
316
|
+
>;
|
|
317
|
+
shippingAddress?: CustomerAccountAPI.Maybe<
|
|
318
|
+
Pick<
|
|
319
|
+
CustomerAccountAPI.CustomerAddress,
|
|
320
|
+
'name' | 'formatted' | 'formattedArea'
|
|
321
|
+
>
|
|
322
|
+
>;
|
|
323
|
+
discountApplications: {
|
|
324
|
+
nodes: Array<{
|
|
325
|
+
value:
|
|
326
|
+
| ({__typename: 'MoneyV2'} & Pick<
|
|
327
|
+
CustomerAccountAPI.MoneyV2,
|
|
328
|
+
'amount' | 'currencyCode'
|
|
329
|
+
>)
|
|
330
|
+
| ({__typename: 'PricingPercentageValue'} & Pick<
|
|
331
|
+
CustomerAccountAPI.PricingPercentageValue,
|
|
332
|
+
'percentage'
|
|
333
|
+
>);
|
|
334
|
+
}>;
|
|
335
|
+
};
|
|
336
|
+
lineItems: {
|
|
337
|
+
nodes: Array<
|
|
338
|
+
Pick<
|
|
339
|
+
CustomerAccountAPI.LineItem,
|
|
340
|
+
'id' | 'title' | 'quantity' | 'variantTitle'
|
|
341
|
+
> & {
|
|
342
|
+
price?: CustomerAccountAPI.Maybe<
|
|
343
|
+
Pick<CustomerAccountAPI.MoneyV2, 'amount' | 'currencyCode'>
|
|
344
|
+
>;
|
|
345
|
+
discountAllocations: Array<{
|
|
346
|
+
allocatedAmount: Pick<
|
|
347
|
+
CustomerAccountAPI.MoneyV2,
|
|
348
|
+
'amount' | 'currencyCode'
|
|
349
|
+
>;
|
|
350
|
+
discountApplication: {
|
|
351
|
+
value:
|
|
352
|
+
| ({__typename: 'MoneyV2'} & Pick<
|
|
353
|
+
CustomerAccountAPI.MoneyV2,
|
|
354
|
+
'amount' | 'currencyCode'
|
|
355
|
+
>)
|
|
356
|
+
| ({__typename: 'PricingPercentageValue'} & Pick<
|
|
357
|
+
CustomerAccountAPI.PricingPercentageValue,
|
|
358
|
+
'percentage'
|
|
359
|
+
>);
|
|
360
|
+
};
|
|
361
|
+
}>;
|
|
362
|
+
totalDiscount: Pick<
|
|
363
|
+
CustomerAccountAPI.MoneyV2,
|
|
364
|
+
'amount' | 'currencyCode'
|
|
365
|
+
>;
|
|
366
|
+
image?: CustomerAccountAPI.Maybe<
|
|
367
|
+
Pick<
|
|
368
|
+
CustomerAccountAPI.Image,
|
|
369
|
+
'altText' | 'height' | 'url' | 'id' | 'width'
|
|
370
|
+
>
|
|
371
|
+
>;
|
|
372
|
+
}
|
|
373
|
+
>;
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
>;
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
export type OrderItemFragment = Pick<
|
|
380
|
+
CustomerAccountAPI.Order,
|
|
381
|
+
'financialStatus' | 'id' | 'number' | 'processedAt'
|
|
382
|
+
> & {
|
|
383
|
+
totalPrice: Pick<CustomerAccountAPI.MoneyV2, 'amount' | 'currencyCode'>;
|
|
384
|
+
fulfillments: {nodes: Array<Pick<CustomerAccountAPI.Fulfillment, 'status'>>};
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
export type CustomerOrdersFragment = {
|
|
388
|
+
orders: {
|
|
389
|
+
nodes: Array<
|
|
390
|
+
Pick<
|
|
391
|
+
CustomerAccountAPI.Order,
|
|
392
|
+
'financialStatus' | 'id' | 'number' | 'processedAt'
|
|
393
|
+
> & {
|
|
394
|
+
totalPrice: Pick<CustomerAccountAPI.MoneyV2, 'amount' | 'currencyCode'>;
|
|
395
|
+
fulfillments: {
|
|
396
|
+
nodes: Array<Pick<CustomerAccountAPI.Fulfillment, 'status'>>;
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
>;
|
|
400
|
+
pageInfo: Pick<
|
|
401
|
+
CustomerAccountAPI.PageInfo,
|
|
402
|
+
'hasPreviousPage' | 'hasNextPage' | 'endCursor' | 'startCursor'
|
|
403
|
+
>;
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
export type CustomerOrdersQueryVariables = CustomerAccountAPI.Exact<{
|
|
408
|
+
endCursor?: CustomerAccountAPI.InputMaybe<
|
|
409
|
+
CustomerAccountAPI.Scalars['String']['input']
|
|
410
|
+
>;
|
|
411
|
+
first?: CustomerAccountAPI.InputMaybe<
|
|
412
|
+
CustomerAccountAPI.Scalars['Int']['input']
|
|
413
|
+
>;
|
|
414
|
+
last?: CustomerAccountAPI.InputMaybe<
|
|
415
|
+
CustomerAccountAPI.Scalars['Int']['input']
|
|
416
|
+
>;
|
|
417
|
+
startCursor?: CustomerAccountAPI.InputMaybe<
|
|
418
|
+
CustomerAccountAPI.Scalars['String']['input']
|
|
419
|
+
>;
|
|
420
|
+
}>;
|
|
421
|
+
|
|
422
|
+
export type CustomerOrdersQuery = {
|
|
423
|
+
customer: {
|
|
424
|
+
orders: {
|
|
425
|
+
nodes: Array<
|
|
426
|
+
Pick<
|
|
427
|
+
CustomerAccountAPI.Order,
|
|
428
|
+
'financialStatus' | 'id' | 'number' | 'processedAt'
|
|
429
|
+
> & {
|
|
430
|
+
totalPrice: Pick<
|
|
431
|
+
CustomerAccountAPI.MoneyV2,
|
|
432
|
+
'amount' | 'currencyCode'
|
|
433
|
+
>;
|
|
434
|
+
fulfillments: {
|
|
435
|
+
nodes: Array<Pick<CustomerAccountAPI.Fulfillment, 'status'>>;
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
>;
|
|
439
|
+
pageInfo: Pick<
|
|
440
|
+
CustomerAccountAPI.PageInfo,
|
|
441
|
+
'hasPreviousPage' | 'hasNextPage' | 'endCursor' | 'startCursor'
|
|
442
|
+
>;
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
export type CustomerUpdateMutationVariables = CustomerAccountAPI.Exact<{
|
|
448
|
+
customer: CustomerAccountAPI.CustomerUpdateInput;
|
|
449
|
+
}>;
|
|
450
|
+
|
|
451
|
+
export type CustomerUpdateMutation = {
|
|
452
|
+
customerUpdate?: CustomerAccountAPI.Maybe<{
|
|
453
|
+
customer?: CustomerAccountAPI.Maybe<
|
|
454
|
+
Pick<CustomerAccountAPI.Customer, 'firstName' | 'lastName'> & {
|
|
455
|
+
emailAddress?: CustomerAccountAPI.Maybe<
|
|
456
|
+
Pick<CustomerAccountAPI.CustomerEmailAddress, 'emailAddress'>
|
|
457
|
+
>;
|
|
458
|
+
phoneNumber?: CustomerAccountAPI.Maybe<
|
|
459
|
+
Pick<CustomerAccountAPI.CustomerPhoneNumber, 'phoneNumber'>
|
|
460
|
+
>;
|
|
461
|
+
}
|
|
462
|
+
>;
|
|
463
|
+
userErrors: Array<
|
|
464
|
+
Pick<
|
|
465
|
+
CustomerAccountAPI.UserErrorsCustomerUserErrors,
|
|
466
|
+
'code' | 'field' | 'message'
|
|
467
|
+
>
|
|
468
|
+
>;
|
|
469
|
+
}>;
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
interface GeneratedQueryTypes {
|
|
473
|
+
'#graphql\n query CustomerDetails {\n customer {\n ...Customer\n }\n }\n #graphql\n fragment Customer on Customer {\n id\n firstName\n lastName\n defaultAddress {\n ...Address\n }\n addresses(first: 6) {\n nodes {\n ...Address\n }\n }\n }\n fragment Address on CustomerAddress {\n id\n formatted\n firstName\n lastName\n company\n address1\n address2\n territoryCode\n zoneCode\n city\n zip\n phoneNumber\n }\n\n': {
|
|
474
|
+
return: CustomerDetailsQuery;
|
|
475
|
+
variables: CustomerDetailsQueryVariables;
|
|
476
|
+
};
|
|
477
|
+
'#graphql\n fragment OrderMoney on MoneyV2 {\n amount\n currencyCode\n }\n fragment DiscountApplication on DiscountApplication {\n value {\n __typename\n ... on MoneyV2 {\n ...OrderMoney\n }\n ... on PricingPercentageValue {\n percentage\n }\n }\n }\n fragment OrderLineItemFull on LineItem {\n id\n title\n quantity\n price {\n ...OrderMoney\n }\n discountAllocations {\n allocatedAmount {\n ...OrderMoney\n }\n discountApplication {\n ...DiscountApplication\n }\n }\n totalDiscount {\n ...OrderMoney\n }\n image {\n altText\n height\n url\n id\n width\n }\n variantTitle\n }\n fragment Order on Order {\n id\n name\n statusPageUrl\n processedAt\n fulfillments(first: 1) {\n nodes {\n status\n }\n }\n totalTax {\n ...OrderMoney\n }\n totalPrice {\n ...OrderMoney\n }\n subtotal {\n ...OrderMoney\n }\n shippingAddress {\n name\n formatted(withName: true)\n formattedArea\n }\n discountApplications(first: 100) {\n nodes {\n ...DiscountApplication\n }\n }\n lineItems(first: 100) {\n nodes {\n ...OrderLineItemFull\n }\n }\n }\n query Order($orderId: ID!) {\n order(id: $orderId) {\n ... on Order {\n ...Order\n }\n }\n }\n': {
|
|
478
|
+
return: OrderQuery;
|
|
479
|
+
variables: OrderQueryVariables;
|
|
480
|
+
};
|
|
481
|
+
'#graphql\n #graphql\n fragment CustomerOrders on Customer {\n orders(\n sortKey: PROCESSED_AT,\n reverse: true,\n first: $first,\n last: $last,\n before: $startCursor,\n after: $endCursor\n ) {\n nodes {\n ...OrderItem\n }\n pageInfo {\n hasPreviousPage\n hasNextPage\n endCursor\n startCursor\n }\n }\n }\n #graphql\n fragment OrderItem on Order {\n totalPrice {\n amount\n currencyCode\n }\n financialStatus\n fulfillments(first: 1) {\n nodes {\n status\n }\n }\n id\n number\n processedAt\n }\n\n\n query CustomerOrders(\n $endCursor: String\n $first: Int\n $last: Int\n $startCursor: String\n ) {\n customer {\n ...CustomerOrders\n }\n }\n': {
|
|
482
|
+
return: CustomerOrdersQuery;
|
|
483
|
+
variables: CustomerOrdersQueryVariables;
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
interface GeneratedMutationTypes {
|
|
488
|
+
'#graphql\n mutation customerAddressUpdate(\n $address: CustomerAddressInput!\n $addressId: ID!\n $defaultAddress: Boolean\n ) {\n customerAddressUpdate(\n address: $address\n addressId: $addressId\n defaultAddress: $defaultAddress\n ) {\n customerAddress {\n id\n }\n userErrors {\n code\n field\n message\n }\n }\n }\n': {
|
|
489
|
+
return: CustomerAddressUpdateMutation;
|
|
490
|
+
variables: CustomerAddressUpdateMutationVariables;
|
|
491
|
+
};
|
|
492
|
+
'#graphql\n mutation customerAddressDelete(\n $addressId: ID!,\n ) {\n customerAddressDelete(addressId: $addressId) {\n deletedAddressId\n userErrors {\n code\n field\n message\n }\n }\n }\n': {
|
|
493
|
+
return: CustomerAddressDeleteMutation;
|
|
494
|
+
variables: CustomerAddressDeleteMutationVariables;
|
|
495
|
+
};
|
|
496
|
+
'#graphql\n mutation customerAddressCreate(\n $address: CustomerAddressInput!\n $defaultAddress: Boolean\n ) {\n customerAddressCreate(\n address: $address\n defaultAddress: $defaultAddress\n ) {\n customerAddress {\n id\n }\n userErrors {\n code\n field\n message\n }\n }\n }\n': {
|
|
497
|
+
return: CustomerAddressCreateMutation;
|
|
498
|
+
variables: CustomerAddressCreateMutationVariables;
|
|
499
|
+
};
|
|
500
|
+
'#graphql\n # https://shopify.dev/docs/api/customer/latest/mutations/customerUpdate\n mutation customerUpdate(\n $customer: CustomerUpdateInput!\n ){\n customerUpdate(input: $customer) {\n customer {\n firstName\n lastName\n emailAddress {\n emailAddress\n }\n phoneNumber {\n phoneNumber\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }\n': {
|
|
501
|
+
return: CustomerUpdateMutation;
|
|
502
|
+
variables: CustomerUpdateMutationVariables;
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
declare module '@shopify/hydrogen' {
|
|
507
|
+
interface CustomerAccountQueries extends GeneratedQueryTypes {}
|
|
508
|
+
interface CustomerAccountMutations extends GeneratedMutationTypes {}
|
|
509
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
/// <reference types="@shopify/remix-oxygen" />
|
|
3
|
+
/// <reference types="@shopify/oxygen-workers-types" />
|
|
4
|
+
|
|
5
|
+
// Enhance TypeScript's built-in typings.
|
|
6
|
+
import '@total-typescript/ts-reset';
|
|
7
|
+
|
|
8
|
+
import type {
|
|
9
|
+
Storefront,
|
|
10
|
+
CustomerAccount,
|
|
11
|
+
HydrogenCart,
|
|
12
|
+
HydrogenSessionData,
|
|
13
|
+
} from '@shopify/hydrogen';
|
|
14
|
+
import type {AppSession} from '~/lib/session';
|
|
15
|
+
|
|
16
|
+
declare global {
|
|
17
|
+
/**
|
|
18
|
+
* A global `process` object is only available during build to access NODE_ENV.
|
|
19
|
+
*/
|
|
20
|
+
const process: {env: {NODE_ENV: 'production' | 'development'}};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Declare expected Env parameter in fetch handler.
|
|
24
|
+
*/
|
|
25
|
+
interface Env {
|
|
26
|
+
SESSION_SECRET: string;
|
|
27
|
+
PUBLIC_STOREFRONT_API_TOKEN: string;
|
|
28
|
+
PRIVATE_STOREFRONT_API_TOKEN: string;
|
|
29
|
+
PUBLIC_STORE_DOMAIN: string;
|
|
30
|
+
PUBLIC_STOREFRONT_ID: string;
|
|
31
|
+
PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID: string;
|
|
32
|
+
PUBLIC_CUSTOMER_ACCOUNT_API_URL: string;
|
|
33
|
+
PUBLIC_CHECKOUT_DOMAIN: string;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare module '@shopify/remix-oxygen' {
|
|
38
|
+
/**
|
|
39
|
+
* Declare local additions to the Remix loader context.
|
|
40
|
+
*/
|
|
41
|
+
interface AppLoadContext {
|
|
42
|
+
env: Env;
|
|
43
|
+
cart: HydrogenCart;
|
|
44
|
+
storefront: Storefront;
|
|
45
|
+
customerAccount: CustomerAccount;
|
|
46
|
+
session: AppSession;
|
|
47
|
+
waitUntil: ExecutionContext['waitUntil'];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Declare local additions to the Remix session data.
|
|
52
|
+
*/
|
|
53
|
+
interface SessionData extends HydrogenSessionData {}
|
|
54
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "skeleton",
|
|
3
|
+
"private": true,
|
|
4
|
+
"sideEffects": false,
|
|
5
|
+
"version": "2024.7.1",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "shopify hydrogen build --codegen",
|
|
9
|
+
"dev": "shopify hydrogen dev --codegen",
|
|
10
|
+
"preview": "shopify hydrogen preview --build",
|
|
11
|
+
"lint": "eslint --no-error-on-unmatched-pattern --ext .js,.ts,.jsx,.tsx .",
|
|
12
|
+
"typecheck": "tsc --noEmit",
|
|
13
|
+
"codegen": "shopify hydrogen codegen"
|
|
14
|
+
},
|
|
15
|
+
"prettier": "@shopify/prettier-config",
|
|
16
|
+
"dependencies": {
|
|
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",
|
|
21
|
+
"graphql": "^16.6.0",
|
|
22
|
+
"graphql-tag": "^2.12.6",
|
|
23
|
+
"isbot": "^3.8.0",
|
|
24
|
+
"react": "^18.2.0",
|
|
25
|
+
"react-dom": "^18.2.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@graphql-codegen/cli": "5.0.2",
|
|
29
|
+
"@remix-run/dev": "^2.10.1",
|
|
30
|
+
"@remix-run/eslint-config": "^2.10.1",
|
|
31
|
+
"@shopify/cli": "^3.63.2",
|
|
32
|
+
"@shopify/hydrogen-codegen": "^0.3.1",
|
|
33
|
+
"@shopify/mini-oxygen": "^3.0.4",
|
|
34
|
+
"@shopify/oxygen-workers-types": "^4.1.2",
|
|
35
|
+
"@shopify/prettier-config": "^1.1.2",
|
|
36
|
+
"@total-typescript/ts-reset": "^0.4.2",
|
|
37
|
+
"@types/eslint": "^8.4.10",
|
|
38
|
+
"@types/react": "^18.2.22",
|
|
39
|
+
"@types/react-dom": "^18.2.7",
|
|
40
|
+
"eslint": "^8.20.0",
|
|
41
|
+
"eslint-plugin-hydrogen": "0.12.2",
|
|
42
|
+
"prettier": "^2.8.4",
|
|
43
|
+
"typescript": "^5.2.2",
|
|
44
|
+
"vite": "^5.1.0",
|
|
45
|
+
"vite-tsconfig-paths": "^4.3.1"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=18.0.0"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
File without changes
|