@faststore/core 2.2.0-alpha.1 → 2.2.0-alpha.12

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 (188) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +74 -75
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/eslint/.cache_1gneedd +1 -1
  6. package/.next/cache/next-server.js.nft.json +1 -1
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/index.pack +0 -0
  9. package/.next/cache/webpack/server-production/0.pack +0 -0
  10. package/.next/cache/webpack/server-production/index.pack +0 -0
  11. package/.next/next-server.js.nft.json +1 -1
  12. package/.next/prerender-manifest.json +1 -1
  13. package/.next/react-loadable-manifest.json +11 -8
  14. package/.next/required-server-files.json +1 -1
  15. package/.next/routes-manifest.json +1 -1
  16. package/.next/server/chunks/{647.js → 117.js} +32 -35
  17. package/.next/server/chunks/183.js +1 -0
  18. package/.next/server/chunks/289.js +25 -27
  19. package/.next/server/chunks/312.js +53 -72
  20. package/.next/server/chunks/350.js +8 -8
  21. package/.next/server/chunks/{483.js → 37.js} +121 -162
  22. package/.next/server/chunks/386.js +200 -0
  23. package/.next/server/chunks/{753.js → 387.js} +8 -12
  24. package/.next/server/chunks/574.js +42 -23
  25. package/.next/server/chunks/576.js +1 -0
  26. package/.next/server/chunks/{530.js → 585.js} +65 -51
  27. package/.next/server/chunks/{186.js → 692.js} +6 -8
  28. package/.next/server/chunks/{112.js → 732.js} +282 -457
  29. package/.next/server/chunks/74.js +247 -345
  30. package/.next/server/chunks/825.js +38 -3
  31. package/.next/server/chunks/{71.js → 897.js} +174 -181
  32. package/.next/server/chunks/98.js +42 -23
  33. package/.next/server/middleware-build-manifest.js +1 -1
  34. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  35. package/.next/server/pages/404.js +13 -13
  36. package/.next/server/pages/404.js.nft.json +1 -1
  37. package/.next/server/pages/500.js +14 -14
  38. package/.next/server/pages/500.js.nft.json +1 -1
  39. package/.next/server/pages/[...slug].js +141 -184
  40. package/.next/server/pages/[...slug].js.nft.json +1 -1
  41. package/.next/server/pages/[slug]/p.js +242 -219
  42. package/.next/server/pages/[slug]/p.js.nft.json +1 -1
  43. package/.next/server/pages/_app.js +3 -4
  44. package/.next/server/pages/_app.js.nft.json +1 -1
  45. package/.next/server/pages/_document.js +17 -33
  46. package/.next/server/pages/_document.js.nft.json +1 -1
  47. package/.next/server/pages/account.js +12 -12
  48. package/.next/server/pages/account.js.nft.json +1 -1
  49. package/.next/server/pages/api/graphql.js +15 -8
  50. package/.next/server/pages/api/graphql.js.nft.json +1 -1
  51. package/.next/server/pages/api/preview.js +2 -20
  52. package/.next/server/pages/checkout.js +12 -12
  53. package/.next/server/pages/checkout.js.nft.json +1 -1
  54. package/.next/server/pages/en-US/404.html +2 -2
  55. package/.next/server/pages/en-US/500.html +2 -2
  56. package/.next/server/pages/en-US/account.html +2 -2
  57. package/.next/server/pages/en-US/checkout.html +2 -2
  58. package/.next/server/pages/en-US/login.html +2 -2
  59. package/.next/server/pages/en-US/s.html +2 -2
  60. package/.next/server/pages/en-US.html +11 -2
  61. package/.next/server/pages/index.js +41 -48
  62. package/.next/server/pages/index.js.nft.json +1 -1
  63. package/.next/server/pages/login.js +15 -15
  64. package/.next/server/pages/login.js.nft.json +1 -1
  65. package/.next/server/pages/s.js +52 -52
  66. package/.next/server/pages/s.js.nft.json +1 -1
  67. package/.next/server/pages-manifest.json +2 -2
  68. package/.next/static/6R1hrzilfMwT81RW6cNqt/_buildManifest.js +1 -0
  69. package/.next/static/chunks/251.ffc4f3998ecb915a.js +1 -0
  70. package/.next/static/chunks/383-6217b37bd38ffd07.js +1 -0
  71. package/.next/static/chunks/386.d01e0db26c523f0f.js +1 -0
  72. package/.next/static/chunks/{574.d13dd0afe15cd635.js → 574.70612be06fd1365f.js} +1 -1
  73. package/.next/static/chunks/585.3350efefe61c9461.js +1 -0
  74. package/.next/static/chunks/635-666ee2cad2925bb7.js +1 -0
  75. package/.next/static/chunks/721-f1665b3f1d98b7a9.js +1 -0
  76. package/.next/static/chunks/722-d0cc87aacd616b5d.js +1 -0
  77. package/.next/static/chunks/783-ded9d8cda0d5c8d9.js +1 -0
  78. package/.next/static/chunks/{709.daf1eddebf1e7952.js → 800.851af48fe2ab4a4c.js} +1 -1
  79. package/.next/static/chunks/98.40c7e17d9de4eb8f.js +1 -0
  80. package/.next/static/chunks/988.afda042dd9ba11d1.js +1 -0
  81. package/.next/static/chunks/main-e4e873ee741162eb.js +1 -0
  82. package/.next/static/chunks/pages/{404-af78f7cd1d3c1f60.js → 404-6c674028b2f80cbb.js} +1 -1
  83. package/.next/static/chunks/pages/{500-f6346ca5f9dc4fef.js → 500-ff55de77265a7e43.js} +1 -1
  84. package/.next/static/chunks/pages/[...slug]-7f8dc13cc9542463.js +1 -0
  85. package/.next/static/chunks/pages/[slug]/p-2fb3fd9027f2923b.js +1 -0
  86. package/.next/static/chunks/pages/{_app-6d0e6ab9a4dd8106.js → _app-7db7de3d205714be.js} +1 -1
  87. package/.next/static/chunks/pages/{account-05bd79fb78365e88.js → account-b06035cba2c99604.js} +1 -1
  88. package/.next/static/chunks/pages/{checkout-c973786e68f25a39.js → checkout-f0c3e8d691cb8a54.js} +1 -1
  89. package/.next/static/chunks/pages/index-a141c747fcc197a1.js +1 -0
  90. package/.next/static/chunks/pages/{login-8deb9243376b6aa1.js → login-4e0e6cab7a07f1f3.js} +1 -1
  91. package/.next/static/chunks/pages/s-823f8e1cabbf63b3.js +1 -0
  92. package/.next/static/chunks/webpack-f3d0973d5a781e73.js +1 -0
  93. package/.next/static/css/6a7fdc5a21fbead5.css +1 -0
  94. package/.next/static/css/723835bce380750d.css +1 -0
  95. package/.next/static/css/8f93a4630936c20b.css +1 -0
  96. package/.next/static/css/9f79fa103f49bca1.css +1 -0
  97. package/.next/static/css/fd27ecc37832aa54.css +1 -0
  98. package/.next/trace +77 -80
  99. package/.turbo/turbo-build.log +24 -21
  100. package/.turbo/turbo-lint.log +3 -0
  101. package/.turbo/turbo-test.log +10 -10
  102. package/@generated/graphql/index.ts +38 -14
  103. package/@generated/graphql/persisted.json +6 -6
  104. package/README.md +3 -3
  105. package/cms/faststore/sections.json +24 -0
  106. package/cypress/global.js +8 -0
  107. package/cypress/integration/a11y.test.js +7 -24
  108. package/cypress/integration/analytics.test.js +78 -87
  109. package/cypress/integration/cart.test.js +4 -4
  110. package/cypress/integration/plp.test.js +6 -6
  111. package/cypress/integration/search.test.js +1 -1
  112. package/cypress/integration/seo.test.js +14 -14
  113. package/cypress.config.ts +19 -0
  114. package/faststore.config.js +1 -0
  115. package/index.ts +4 -0
  116. package/next.config.js +4 -0
  117. package/package.json +22 -18
  118. package/src/components/cart/CartSidebar/CartSidebar.tsx +41 -27
  119. package/src/components/product/NotAvailableButton/NotAvailableButton.tsx +13 -0
  120. package/src/components/product/NotAvailableButton/index.ts +1 -0
  121. package/src/components/product/ProductGrid/ProductGrid.tsx +2 -2
  122. package/src/components/search/Filter/Filter.tsx +1 -1
  123. package/src/components/search/Filter/FilterDesktop.tsx +1 -1
  124. package/src/components/search/Filter/FilterSlider.tsx +1 -1
  125. package/src/components/search/SearchInput/SearchInput.tsx +12 -1
  126. package/src/components/search/SearchTop/SearchTop.tsx +7 -1
  127. package/src/components/sections/CrossSellingShelf/CrossSellingShelf.tsx +0 -1
  128. package/src/components/sections/Newsletter/Overrides.tsx +4 -0
  129. package/src/components/sections/ProductDetails/Overrides.tsx +8 -4
  130. package/src/components/sections/ProductDetails/ProductDetails.tsx +26 -15
  131. package/src/components/sections/ProductTiles/ProductTiles.tsx +3 -2
  132. package/src/components/ui/ImageGallery/ImageGallery.tsx +13 -6
  133. package/src/components/ui/Newsletter/Newsletter.tsx +6 -44
  134. package/src/components/ui/Newsletter/NewsletterAddendum.tsx +86 -0
  135. package/src/components/ui/ProductDescription/ProductDescription.tsx +6 -1
  136. package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +97 -58
  137. package/src/components/ui/ProductGallery/ProductGallery.tsx +2 -2
  138. package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +12 -34
  139. package/src/customizations/fragments/{ClientProducts.ts → ClientManyProducts.ts} +1 -1
  140. package/src/customizations/fragments/ClientSearchSuggestions.ts +13 -0
  141. package/src/customizations/fragments/ClientShippingSimulation.ts +11 -0
  142. package/src/customizations/fragments/ClientTopSearchSuggestions.ts +13 -0
  143. package/src/customizations/fragments/{ServerProductPage.ts → ServerProduct.ts} +1 -1
  144. package/src/experimental/index.ts +36 -0
  145. package/src/pages/[...slug].tsx +5 -2
  146. package/src/pages/[slug]/p.tsx +7 -7
  147. package/src/sdk/analytics/index.tsx +1 -1
  148. package/src/sdk/analytics/platform/vtex/search.ts +53 -21
  149. package/src/sdk/analytics/types.ts +14 -0
  150. package/src/sdk/overrides/PageProvider.tsx +9 -5
  151. package/src/sdk/product/useLocalizedVariables.ts +2 -2
  152. package/src/sdk/product/usePageProductsQuery.ts +8 -8
  153. package/src/sdk/product/useProductGalleryQuery.ts +32 -3
  154. package/src/sdk/product/useProductsPrefetch.ts +4 -4
  155. package/src/sdk/product/useProductsQuery.ts +7 -7
  156. package/src/sdk/search/useSuggestions.ts +48 -16
  157. package/src/sdk/search/useTopSearch.ts +7 -12
  158. package/src/sdk/shipping/index.ts +6 -4
  159. package/src/{components/ui/ShippingSimulation → sdk/shipping}/useShippingSimulation.ts +33 -56
  160. package/src/server/generator/schema.ts +2 -1
  161. package/src/typings/overrides.ts +8 -2
  162. package/tsconfig.json +2 -1
  163. package/.next/static/chunks/148.3bb7e05cc5d1c1c4.js +0 -1
  164. package/.next/static/chunks/238-86838f629f3d0aa4.js +0 -1
  165. package/.next/static/chunks/243-ef9e49ef3df579c0.js +0 -1
  166. package/.next/static/chunks/530.848b014622932b93.js +0 -1
  167. package/.next/static/chunks/548-ab84e9e8b49413ab.js +0 -1
  168. package/.next/static/chunks/738-67a288ca3569cdbb.js +0 -1
  169. package/.next/static/chunks/932-33f45603c7d12a4b.js +0 -1
  170. package/.next/static/chunks/98.1632997dfd4d3a52.js +0 -1
  171. package/.next/static/chunks/988.d10040040cdfebbb.js +0 -1
  172. package/.next/static/chunks/main-fd466221927468fd.js +0 -1
  173. package/.next/static/chunks/pages/[...slug]-362204c7e0b533cf.js +0 -1
  174. package/.next/static/chunks/pages/[slug]/p-885042c4b2b4f8ed.js +0 -1
  175. package/.next/static/chunks/pages/index-79b05b0071c02fff.js +0 -1
  176. package/.next/static/chunks/pages/s-e1bb00f8de6a386e.js +0 -1
  177. package/.next/static/chunks/webpack-88d120cefa1c4c09.js +0 -1
  178. package/.next/static/css/20e4a3a45cdd65f4.css +0 -1
  179. package/.next/static/css/4b7138899cd07c63.css +0 -1
  180. package/.next/static/css/e3b039e8f5daf95f.css +0 -1
  181. package/.next/static/css/f0e2d1b8832e935d.css +0 -1
  182. package/.next/static/wPqgZ8bYrPY473PZzuIX_/_buildManifest.js +0 -1
  183. package/cypress.json +0 -9
  184. package/generate.sh +0 -71
  185. /package/.next/static/{wPqgZ8bYrPY473PZzuIX_ → 6R1hrzilfMwT81RW6cNqt}/_ssgManifest.js +0 -0
  186. /package/src/{components/ui/ProductGallery → sdk/search}/useDelayedFacets.ts +0 -0
  187. /package/src/{components/ui/ProductGallery → sdk/search}/useDelayedPagination.ts +0 -0
  188. /package/src/{components/search/Filter → sdk/search}/useFilter.ts +0 -0
@@ -1,8 +1,11 @@
1
1
  $ yarn partytown & yarn generate && next build
2
+ $ faststore generate-graphql -c
2
3
  $ partytown copylib ./public/~partytown
3
- $ ./generate.sh
4
4
  Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
5
- GraphQL schema, types, and optimizations successfully generated 🎉
5
+ success - GraphQL schema, types, and optimizations successfully generated 🎉
6
+ warn - You have enabled experimental feature (scrollRestoration) in next.config.js.
7
+ warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
8
+
6
9
  warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
7
10
  Attention: Next.js now collects completely anonymous telemetry regarding usage.
8
11
  This information is used to shape Next.js' roadmap and prioritize features.
@@ -23,27 +26,27 @@ info - Generating static pages (7/7)
23
26
  info - Finalizing page optimization...
24
27
 
25
28
  Route (pages) Size First Load JS
26
- ┌ ● / 3.19 kB 197 kB
27
- ├ /_app 0 B 77.9 kB
28
- ├ ● /[...slug] 4.83 kB 210 kB
29
+ ┌ ● / 8.27 kB 126 kB
30
+ ├ /_app 0 B 78.1 kB
31
+ ├ ● /[...slug] 4.29 kB 139 kB
29
32
  ├ └ css/527e334fa69cf40a.css 1.85 kB
30
- ├ ● /[slug]/p 11.3 kB 205 kB
31
- ├ └ css/4b7138899cd07c63.css 11.3 kB
32
- ├ ○ /404 1.19 kB 114 kB
33
- ├ ● /500 1.21 kB 114 kB
34
- ├ ● /account 670 B 113 kB
35
- ├ λ /api/graphql 0 B 77.9 kB
36
- ├ λ /api/health/live 0 B 77.9 kB
37
- ├ λ /api/health/ready 0 B 77.9 kB
38
- ├ λ /api/preview 0 B 77.9 kB
39
- ├ ● /checkout 657 B 113 kB
40
- ├ ● /login 1.09 kB 114 kB
41
- └ ● /s 4.55 kB 128 kB
42
- + First Load JS shared by all 81 kB
33
+ ├ ● /[slug]/p 11 kB 135 kB
34
+ ├ └ css/9f79fa103f49bca1.css 11.5 kB
35
+ ├ ○ /404 1.19 kB 110 kB
36
+ ├ ● /500 1.21 kB 110 kB
37
+ ├ ● /account 668 B 110 kB
38
+ ├ λ /api/graphql 0 B 78.1 kB
39
+ ├ λ /api/health/live 0 B 78.1 kB
40
+ ├ λ /api/health/ready 0 B 78.1 kB
41
+ ├ λ /api/preview 0 B 78.1 kB
42
+ ├ ● /checkout 655 B 110 kB
43
+ ├ ● /login 1.09 kB 110 kB
44
+ └ ● /s 4.57 kB 125 kB
45
+ + First Load JS shared by all 81.2 kB
43
46
  ├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
44
- ├ chunks/main-fd466221927468fd.js 23.9 kB
45
- ├ chunks/pages/_app-6d0e6ab9a4dd8106.js 6.45 kB
46
- ├ chunks/webpack-88d120cefa1c4c09.js 2.29 kB
47
+ ├ chunks/main-e4e873ee741162eb.js 24.1 kB
48
+ ├ chunks/pages/_app-7db7de3d205714be.js 6.45 kB
49
+ ├ chunks/webpack-f3d0973d5a781e73.js 2.25 kB
47
50
  └ css/9e76fef1c9ca89af.css 3.06 kB
48
51
 
49
52
  λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
@@ -1,2 +1,5 @@
1
1
  $ next lint
2
+ warn - You have enabled experimental feature (scrollRestoration) in next.config.js.
3
+ warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
4
+
2
5
  ✔ No ESLint warnings or errors
@@ -1,25 +1,25 @@
1
1
  $ tsdx test
2
2
  ts-jest[versions] (WARN) Version 29.1.0 of jest installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=25.0.0 <26.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
3
3
  ts-jest[versions] (WARN) Version 4.9.4 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=3.4.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
4
- PASS test/server/index.test.ts (18.977s)
4
+ PASS test/server/index.test.ts (11.2s)
5
5
  FastStore GraphQL Layer
6
6
  @faststore/api
7
- ✓ should return a valid GraphQL schema (18ms)
8
- ✓ should return a valid GraphQL schema contain all expected types (62ms)
7
+ ✓ should return a valid GraphQL schema (7ms)
8
+ ✓ should return a valid GraphQL schema contain all expected types (14ms)
9
9
  ✓ should return a valid GraphQL schema contain all expected queries (1ms)
10
- ✓ should return a valid GraphQL schema contain all expected mutations
10
+ ✓ should return a valid GraphQL schema contain all expected mutations (1ms)
11
11
  VTEX API Extension
12
- ✓ getTypeDefsFromFolder function should return an Array (13ms)
12
+ ✓ getTypeDefsFromFolder function should return an Array (9ms)
13
13
  Third Party API Extension
14
- ✓ getTypeDefsFromFolder function should return an Array (16ms)
14
+ ✓ getTypeDefsFromFolder function should return an Array (7ms)
15
15
  Final Schema after merging
16
- ✓ should return a valid merged GraphQL schema (87ms)
16
+ ✓ should return a valid merged GraphQL schema (53ms)
17
17
  Envelop
18
- ✓ should exist with its plugins (109ms)
19
- ✓ should handle options and execute (184ms)
18
+ ✓ should exist with its plugins (42ms)
19
+ ✓ should handle options and execute (584ms)
20
20
 
21
21
  Test Suites: 1 passed, 1 total
22
22
  Tests: 9 passed, 9 total
23
23
  Snapshots: 0 total
24
- Time: 20.045s
24
+ Time: 12.211s
25
25
  Ran all test suites.
@@ -1150,19 +1150,31 @@ export type ProductDetailsFragment_ProductFragment = {
1150
1150
  }>
1151
1151
  }
1152
1152
 
1153
+ export type ClientManyProductsFragment = {
1154
+ search: { products: { pageInfo: { totalCount: number } } }
1155
+ }
1156
+
1153
1157
  export type ClientProductFragment = { product: { id: string } }
1154
1158
 
1155
1159
  export type ClientProductGalleryFragment = {
1156
1160
  search: { products: { pageInfo: { totalCount: number } } }
1157
1161
  }
1158
1162
 
1159
- export type ClientProductsFragment = {
1160
- search: { products: { pageInfo: { totalCount: number } } }
1163
+ export type ClientSearchSuggestionsFragment = {
1164
+ search: { suggestions: { terms: Array<{ value: string }> } }
1165
+ }
1166
+
1167
+ export type ClientShippingSimulationFragment = {
1168
+ shipping: { address: { city: string | null } | null } | null
1169
+ }
1170
+
1171
+ export type ClientTopSearchSuggestionsFragment = {
1172
+ search: { suggestions: { terms: Array<{ value: string }> } }
1161
1173
  }
1162
1174
 
1163
1175
  export type ServerCollectionPageFragment = { collection: { id: string } }
1164
1176
 
1165
- export type ServerProductPageFragment = { product: { id: string } }
1177
+ export type ServerProductFragment = { product: { id: string } }
1166
1178
 
1167
1179
  export type ServerCollectionPageQueryQueryVariables = Exact<{
1168
1180
  slug: Scalars['String']
@@ -1179,11 +1191,11 @@ export type ServerCollectionPageQueryQuery = {
1179
1191
  }
1180
1192
  }
1181
1193
 
1182
- export type ServerProductPageQueryQueryVariables = Exact<{
1194
+ export type ServerProductQueryQueryVariables = Exact<{
1183
1195
  locator: Array<IStoreSelectedFacet> | IStoreSelectedFacet
1184
1196
  }>
1185
1197
 
1186
- export type ServerProductPageQueryQuery = {
1198
+ export type ServerProductQueryQuery = {
1187
1199
  product: {
1188
1200
  sku: string
1189
1201
  gtin: string
@@ -1333,7 +1345,7 @@ export type SubscribeToNewsletterMutation = {
1333
1345
  subscribeToNewsletter: { id: string } | null
1334
1346
  }
1335
1347
 
1336
- export type ClientProductsQueryQueryVariables = Exact<{
1348
+ export type ClientManyProductsQueryQueryVariables = Exact<{
1337
1349
  first: Scalars['Int']
1338
1350
  after: InputMaybe<Scalars['String']>
1339
1351
  sort: StoreSort
@@ -1341,7 +1353,7 @@ export type ClientProductsQueryQueryVariables = Exact<{
1341
1353
  selectedFacets: Array<IStoreSelectedFacet> | IStoreSelectedFacet
1342
1354
  }>
1343
1355
 
1344
- export type ClientProductsQueryQuery = {
1356
+ export type ClientManyProductsQueryQuery = {
1345
1357
  search: {
1346
1358
  products: {
1347
1359
  pageInfo: { totalCount: number }
@@ -1371,6 +1383,11 @@ export type ClientProductsQueryQuery = {
1371
1383
  }
1372
1384
  }
1373
1385
 
1386
+ export type SearchEvent_MetadataFragment = {
1387
+ isTermMisspelled: boolean
1388
+ logicalOperator: string
1389
+ }
1390
+
1374
1391
  export type ClientProductGalleryQueryQueryVariables = Exact<{
1375
1392
  first: Scalars['Int']
1376
1393
  after: Scalars['String']
@@ -1402,6 +1419,7 @@ export type ClientProductGalleryQueryQuery = {
1402
1419
  max: { selected: number; absolute: number }
1403
1420
  }
1404
1421
  >
1422
+ metadata: { isTermMisspelled: boolean; logicalOperator: string } | null
1405
1423
  }
1406
1424
  }
1407
1425
 
@@ -1445,12 +1463,12 @@ export type ClientProductQueryQuery = {
1445
1463
  }
1446
1464
  }
1447
1465
 
1448
- export type SearchSuggestionsQueryQueryVariables = Exact<{
1466
+ export type ClientSearchSuggestionsQueryQueryVariables = Exact<{
1449
1467
  term: Scalars['String']
1450
1468
  selectedFacets: InputMaybe<Array<IStoreSelectedFacet> | IStoreSelectedFacet>
1451
1469
  }>
1452
1470
 
1453
- export type SearchSuggestionsQueryQuery = {
1471
+ export type ClientSearchSuggestionsQueryQuery = {
1454
1472
  search: {
1455
1473
  suggestions: {
1456
1474
  terms: Array<{ value: string }>
@@ -1475,15 +1493,17 @@ export type SearchSuggestionsQueryQuery = {
1475
1493
  }
1476
1494
  }>
1477
1495
  }
1496
+ products: { pageInfo: { totalCount: number } }
1497
+ metadata: { isTermMisspelled: boolean; logicalOperator: string } | null
1478
1498
  }
1479
1499
  }
1480
1500
 
1481
- export type TopSearchSuggestionsQueryQueryVariables = Exact<{
1501
+ export type ClientTopSearchSuggestionsQueryQueryVariables = Exact<{
1482
1502
  term: Scalars['String']
1483
1503
  selectedFacets: InputMaybe<Array<IStoreSelectedFacet> | IStoreSelectedFacet>
1484
1504
  }>
1485
1505
 
1486
- export type TopSearchSuggestionsQueryQuery = {
1506
+ export type ClientTopSearchSuggestionsQueryQuery = {
1487
1507
  search: { suggestions: { terms: Array<{ value: string }> } }
1488
1508
  }
1489
1509
 
@@ -1515,13 +1535,13 @@ export type ValidateSessionMutation = {
1515
1535
  } | null
1516
1536
  }
1517
1537
 
1518
- export type ShippingSimulationQueryQueryVariables = Exact<{
1538
+ export type ClientShippingSimulationQueryQueryVariables = Exact<{
1519
1539
  postalCode: Scalars['String']
1520
1540
  country: Scalars['String']
1521
1541
  items: Array<IShippingItem> | IShippingItem
1522
1542
  }>
1523
1543
 
1524
- export type ShippingSimulationQueryQuery = {
1544
+ export type ClientShippingSimulationQueryQuery = {
1525
1545
  shipping: {
1526
1546
  logisticsInfo: Array<{
1527
1547
  slas: Array<{
@@ -1537,6 +1557,10 @@ export type ShippingSimulationQueryQuery = {
1537
1557
  } | null> | null
1538
1558
  } | null> | null
1539
1559
  } | null> | null
1540
- address: { city: string | null; neighborhood: string | null } | null
1560
+ address: {
1561
+ city: string | null
1562
+ neighborhood: string | null
1563
+ state: string | null
1564
+ } | null
1541
1565
  } | null
1542
1566
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "ServerCollectionPageQuery": "query ServerCollectionPageQuery($slug: String!) {\n collection(slug: $slug) {\n id\n seo {\n title\n description\n }\n breadcrumbList {\n itemListElement {\n item\n name\n position\n }\n }\n meta {\n selectedFacets {\n key\n value\n }\n }\n }\n}\n",
3
- "ServerProductPageQuery": "query ServerProductPageQuery($locator: [IStoreSelectedFacet!]!) {\n product(locator: $locator) {\n id: productID\n seo {\n title\n description\n canonical\n }\n brand {\n name\n }\n sku\n gtin\n name\n description\n releaseDate\n breadcrumbList {\n itemListElement {\n item\n name\n position\n }\n }\n image {\n url\n alternateName\n }\n offers {\n lowPrice\n highPrice\n priceCurrency\n offers {\n availability\n price\n priceValidUntil\n priceCurrency\n itemCondition\n seller {\n identifier\n }\n listPrice\n }\n }\n isVariantOf {\n productGroupID\n name\n skuVariants {\n activeVariations\n slugsMap\n availableVariations\n }\n }\n additionalProperty {\n propertyID\n name\n value\n valueReference\n }\n }\n}\n",
3
+ "ServerProductQuery": "query ServerProductQuery($locator: [IStoreSelectedFacet!]!) {\n product(locator: $locator) {\n id: productID\n seo {\n title\n description\n canonical\n }\n brand {\n name\n }\n sku\n gtin\n name\n description\n releaseDate\n breadcrumbList {\n itemListElement {\n item\n name\n position\n }\n }\n image {\n url\n alternateName\n }\n offers {\n lowPrice\n highPrice\n priceCurrency\n offers {\n availability\n price\n priceValidUntil\n priceCurrency\n itemCondition\n seller {\n identifier\n }\n listPrice\n }\n }\n isVariantOf {\n productGroupID\n name\n skuVariants {\n activeVariations\n slugsMap\n availableVariations\n }\n }\n additionalProperty {\n propertyID\n name\n value\n valueReference\n }\n }\n}\n",
4
4
  "ValidateCartMutation": "mutation ValidateCartMutation($cart: IStoreCart!, $session: IStoreSession!) {\n validateCart(cart: $cart, session: $session) {\n order {\n orderNumber\n acceptedOffer {\n seller {\n identifier\n }\n quantity\n price\n listPrice\n itemOffered {\n sku\n name\n image {\n url\n alternateName\n }\n brand {\n name\n }\n isVariantOf {\n productGroupID\n name\n skuVariants {\n activeVariations\n slugsMap\n availableVariations\n }\n }\n gtin\n additionalProperty {\n propertyID\n name\n value\n valueReference\n }\n }\n }\n }\n messages {\n text\n status\n }\n }\n}\n",
5
5
  "SubscribeToNewsletter": "mutation SubscribeToNewsletter($data: IPersonNewsletter!) {\n subscribeToNewsletter(data: $data) {\n id\n }\n}\n",
6
- "ClientProductsQuery": "query ClientProductsQuery($first: Int!, $after: String, $sort: StoreSort!, $term: String!, $selectedFacets: [IStoreSelectedFacet!]!) {\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n edges {\n node {\n id: productID\n slug\n sku\n brand {\n brandName: name\n name\n }\n name\n gtin\n isVariantOf {\n productGroupID\n name\n }\n image {\n url\n alternateName\n }\n offers {\n lowPrice\n offers {\n availability\n price\n listPrice\n quantity\n seller {\n identifier\n }\n }\n }\n }\n }\n }\n }\n}\n",
7
- "ClientProductGalleryQuery": "query ClientProductGalleryQuery($first: Int!, $after: String!, $sort: StoreSort!, $term: String!, $selectedFacets: [IStoreSelectedFacet!]!) {\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n }\n facets {\n ... on StoreFacetRange {\n key\n label\n min {\n selected\n absolute\n }\n max {\n selected\n absolute\n }\n __typename\n }\n ... on StoreFacetBoolean {\n key\n label\n values {\n label\n value\n selected\n quantity\n }\n __typename\n }\n }\n }\n}\n",
6
+ "ClientManyProductsQuery": "query ClientManyProductsQuery($first: Int!, $after: String, $sort: StoreSort!, $term: String!, $selectedFacets: [IStoreSelectedFacet!]!) {\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n edges {\n node {\n id: productID\n slug\n sku\n brand {\n brandName: name\n name\n }\n name\n gtin\n isVariantOf {\n productGroupID\n name\n }\n image {\n url\n alternateName\n }\n offers {\n lowPrice\n offers {\n availability\n price\n listPrice\n quantity\n seller {\n identifier\n }\n }\n }\n }\n }\n }\n }\n}\n",
7
+ "ClientProductGalleryQuery": "query ClientProductGalleryQuery($first: Int!, $after: String!, $sort: StoreSort!, $term: String!, $selectedFacets: [IStoreSelectedFacet!]!) {\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n }\n facets {\n ... on StoreFacetRange {\n key\n label\n min {\n selected\n absolute\n }\n max {\n selected\n absolute\n }\n __typename\n }\n ... on StoreFacetBoolean {\n key\n label\n values {\n label\n value\n selected\n quantity\n }\n __typename\n }\n }\n metadata {\n isTermMisspelled\n logicalOperator\n }\n }\n}\n",
8
8
  "ClientProductQuery": "query ClientProductQuery($locator: [IStoreSelectedFacet!]!) {\n product(locator: $locator) {\n id: productID\n sku\n name\n gtin\n description\n isVariantOf {\n name\n productGroupID\n skuVariants {\n activeVariations\n slugsMap\n availableVariations\n }\n }\n image {\n url\n alternateName\n }\n brand {\n name\n }\n offers {\n lowPrice\n offers {\n availability\n price\n listPrice\n seller {\n identifier\n }\n }\n }\n additionalProperty {\n propertyID\n name\n value\n valueReference\n }\n }\n}\n",
9
- "SearchSuggestionsQuery": "query SearchSuggestionsQuery($term: String!, $selectedFacets: [IStoreSelectedFacet!]) {\n search(first: 5, term: $term, selectedFacets: $selectedFacets) {\n suggestions {\n terms {\n value\n }\n products {\n id: productID\n slug\n sku\n brand {\n brandName: name\n name\n }\n name\n gtin\n isVariantOf {\n productGroupID\n name\n }\n image {\n url\n alternateName\n }\n offers {\n lowPrice\n offers {\n availability\n price\n listPrice\n quantity\n seller {\n identifier\n }\n }\n }\n }\n }\n }\n}\n",
10
- "TopSearchSuggestionsQuery": "query TopSearchSuggestionsQuery($term: String!, $selectedFacets: [IStoreSelectedFacet!]) {\n search(first: 5, term: $term, selectedFacets: $selectedFacets) {\n suggestions {\n terms {\n value\n }\n }\n }\n}\n",
9
+ "ClientSearchSuggestionsQuery": "query ClientSearchSuggestionsQuery($term: String!, $selectedFacets: [IStoreSelectedFacet!]) {\n search(first: 5, term: $term, selectedFacets: $selectedFacets) {\n suggestions {\n terms {\n value\n }\n products {\n id: productID\n slug\n sku\n brand {\n brandName: name\n name\n }\n name\n gtin\n isVariantOf {\n productGroupID\n name\n }\n image {\n url\n alternateName\n }\n offers {\n lowPrice\n offers {\n availability\n price\n listPrice\n quantity\n seller {\n identifier\n }\n }\n }\n }\n }\n products {\n pageInfo {\n totalCount\n }\n }\n metadata {\n isTermMisspelled\n logicalOperator\n }\n }\n}\n",
10
+ "ClientTopSearchSuggestionsQuery": "query ClientTopSearchSuggestionsQuery($term: String!, $selectedFacets: [IStoreSelectedFacet!]) {\n search(first: 5, term: $term, selectedFacets: $selectedFacets) {\n suggestions {\n terms {\n value\n }\n }\n }\n}\n",
11
11
  "ValidateSession": "mutation ValidateSession($session: IStoreSession!, $search: String!) {\n validateSession(session: $session, search: $search) {\n locale\n channel\n country\n addressType\n postalCode\n deliveryMode {\n deliveryChannel\n deliveryMethod\n deliveryWindow {\n startDate\n endDate\n }\n }\n geoCoordinates {\n latitude\n longitude\n }\n currency {\n code\n symbol\n }\n person {\n id\n email\n givenName\n familyName\n }\n }\n}\n",
12
- "ShippingSimulationQuery": "query ShippingSimulationQuery($postalCode: String!, $country: String!, $items: [IShippingItem!]!) {\n shipping(items: $items, postalCode: $postalCode, country: $country) {\n logisticsInfo {\n slas {\n carrier\n price\n availableDeliveryWindows {\n startDateUtc\n endDateUtc\n price\n listPrice\n }\n shippingEstimate\n localizedEstimates\n }\n }\n address {\n city\n neighborhood\n }\n }\n}\n"
12
+ "ClientShippingSimulationQuery": "query ClientShippingSimulationQuery($postalCode: String!, $country: String!, $items: [IShippingItem!]!) {\n shipping(items: $items, postalCode: $postalCode, country: $country) {\n address {\n city\n neighborhood\n state\n }\n logisticsInfo {\n slas {\n carrier\n price\n availableDeliveryWindows {\n startDateUtc\n endDateUtc\n price\n listPrice\n }\n shippingEstimate\n localizedEstimates\n }\n }\n }\n}\n"
13
13
  }
package/README.md CHANGED
@@ -100,7 +100,7 @@ A quick look at the top-level files and directories you'll see in a NextJS proje
100
100
  ├── __generated__
101
101
  ├── babel.config.js
102
102
  ├── cypress
103
- ├── cypress.json
103
+ ├── cypress.config.ts
104
104
  ├── lighthouserc.js
105
105
  ├── public
106
106
  ├── pull_request_template.md
@@ -136,7 +136,7 @@ A quick look at the top-level files and directories you'll see in a NextJS proje
136
136
 
137
137
  15. **`cypress`**: End to End(e2e) tests using Cypress. Most of the scenarios are covered here. Add your custom flows to avoid regressions
138
138
 
139
- 16. **`cypress.json`**: [Cypress configuration file](https://docs.cypress.io/guides/references/configuration)
139
+ 16. **`cypress.config.ts`**: [Cypress configuration file](https://docs.cypress.io/guides/references/configuration)
140
140
 
141
141
  17. **`lighthouserc.js`**: Configures [Google Lighthouse CI](https://github.com/GoogleChrome/lighthouse-ci). This is where you can turn on/off lighthouse assertions to be used by Lighthouse CI Bot/hook
142
142
 
@@ -412,7 +412,7 @@ Looking for more guidance? Full documentation for FastStore lives [on this GitHu
412
412
 
413
413
  ## ⚡ Performance & QA
414
414
 
415
- This project has strict performance budgets. Right out of the box, this project performs around 95 on Google's Page Speed Insights website, which usually is way more strict than your laptop's chrome lighthouse. Every time you commit to the repository, our QA bots will run and evaluate your code quality. We recommend you NEVER put in production a code that breaks any of the bots. If a bot breaks and still you need to put the code into production, change the bot config (`lighthouserc.js`, `cypress.json`) to make it pass and merge. This way you ensure your website will keep performing well during the years to come.
415
+ This project has strict performance budgets. Right out of the box, this project performs around 95 on Google's Page Speed Insights website, which usually is way more strict than your laptop's chrome lighthouse. Every time you commit to the repository, our QA bots will run and evaluate your code quality. We recommend you NEVER put in production a code that breaks any of the bots. If a bot breaks and still you need to put the code into production, change the bot config (`lighthouserc.js`, `cypress.config.ts`) to make it pass and merge. This way you ensure your website will keep performing well during the years to come.
416
416
 
417
417
  ## Adding third party scripts
418
418
 
@@ -1374,6 +1374,18 @@
1374
1374
  }
1375
1375
  }
1376
1376
  },
1377
+ "notAvailableButton": {
1378
+ "title": "Not Available Button",
1379
+ "description": "Shown when a SKU is not available",
1380
+ "type": "object",
1381
+ "properties": {
1382
+ "title": {
1383
+ "title": "Title",
1384
+ "type": "string",
1385
+ "default": "Not Available"
1386
+ }
1387
+ }
1388
+ },
1377
1389
  "shippingSimulator": {
1378
1390
  "title": "Shipping Simulation",
1379
1391
  "type": "object",
@@ -1430,6 +1442,18 @@
1430
1442
  "default": "Description"
1431
1443
  }
1432
1444
  }
1445
+ },
1446
+ "imageGallery": {
1447
+ "title": "Image Gallery",
1448
+ "type": "object",
1449
+ "properties": {
1450
+ "imagePosition": {
1451
+ "type": "string",
1452
+ "title": "Image Position",
1453
+ "enumNames": ["Center", "Top", "Bottom"],
1454
+ "enum": ["center", "top", "bottom"]
1455
+ }
1456
+ }
1433
1457
  }
1434
1458
  }
1435
1459
  }
package/cypress/global.js CHANGED
@@ -13,3 +13,11 @@ export const options = {
13
13
  }
14
14
  },
15
15
  }
16
+
17
+ // TODO: Bring back these rules when the components with missing/wrong role is found.
18
+ export const disabledA11yRules = {
19
+ rules: {
20
+ region: { enabled: false },
21
+ 'aria-allowed-role': { enabled: false },
22
+ },
23
+ }
@@ -4,6 +4,7 @@
4
4
  * Cypress tests for a11y (accessibility)
5
5
  */
6
6
 
7
+ import { disabledA11yRules } from '../global'
7
8
  import { cypress } from '../../faststore.config'
8
9
 
9
10
  const { pages } = cypress
@@ -13,7 +14,7 @@ describe('Accessibility tests', () => {
13
14
  cy.clearIDB()
14
15
  })
15
16
 
16
- it.skip('checks a11y for collection page', () => {
17
+ it('checks a11y for collection page', () => {
17
18
  cy.visit(pages.collection)
18
19
  cy.waitForHydration()
19
20
 
@@ -21,16 +22,10 @@ describe('Accessibility tests', () => {
21
22
  cy.getById('product-link').should('exist')
22
23
 
23
24
  cy.injectAxe()
24
-
25
- // TODO: Bring back the `aria-allowed-role` when the component with the missing/wrong role is found.
26
- cy.checkA11y(null, {
27
- rules: {
28
- 'aria-allowed-role': { enabled: false },
29
- },
30
- })
25
+ cy.checkA11y(null, disabledA11yRules)
31
26
  })
32
27
 
33
- it.skip('checks a11y for product page', () => {
28
+ it('checks a11y for product page', () => {
34
29
  cy.visit(pages.pdp)
35
30
  cy.waitForHydration()
36
31
 
@@ -38,26 +33,14 @@ describe('Accessibility tests', () => {
38
33
  cy.getById('buy-button').should('exist')
39
34
 
40
35
  cy.injectAxe()
41
-
42
- // TODO: Bring back the `aria-allowed-role` when the component with the missing/wrong role is found.
43
- cy.checkA11y(null, {
44
- rules: {
45
- 'aria-allowed-role': { enabled: false },
46
- },
47
- })
36
+ cy.checkA11y(null, disabledA11yRules)
48
37
  })
49
38
 
50
- it.skip('checks a11y for home page', () => {
39
+ it('checks a11y for home page', () => {
51
40
  cy.visit(pages.home)
52
41
  cy.waitForHydration()
53
42
 
54
43
  cy.injectAxe()
55
-
56
- // TODO: Bring back the `aria-allowed-role` when the component with the missing/wrong role is found.
57
- cy.checkA11y(null, {
58
- rules: {
59
- 'aria-allowed-role': { enabled: false },
60
- },
61
- })
44
+ cy.checkA11y(null, disabledA11yRules)
62
45
  })
63
46
  })