@faststore/core 3.11.2 → 3.11.4

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 (185) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +36 -36
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/webpack/client-production/0.pack +0 -0
  6. package/.next/cache/webpack/client-production/index.pack +0 -0
  7. package/.next/cache/webpack/server-production/0.pack +0 -0
  8. package/.next/cache/webpack/server-production/index.pack +0 -0
  9. package/.next/next-minimal-server.js.nft.json +1 -1
  10. package/.next/next-server.js.nft.json +1 -1
  11. package/.next/prerender-manifest.js +1 -1
  12. package/.next/prerender-manifest.json +1 -1
  13. package/.next/react-loadable-manifest.json +13 -13
  14. package/.next/required-server-files.json +1 -1
  15. package/.next/routes-manifest.json +1 -1
  16. package/.next/server/chunks/1163.js +2 -2
  17. package/.next/server/chunks/3157.js +1 -1
  18. package/.next/server/chunks/{1377.js → 3668.js} +1 -1
  19. package/.next/server/chunks/4012.js +1 -1
  20. package/.next/server/chunks/5754.js +2 -2
  21. package/.next/server/chunks/6859.js +1 -1
  22. package/.next/server/chunks/8640.js +1 -1
  23. package/.next/server/chunks/8857.js +1 -1
  24. package/.next/server/middleware-build-manifest.js +1 -1
  25. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  26. package/.next/server/pages/404.js +1 -1
  27. package/.next/server/pages/404.js.nft.json +1 -1
  28. package/.next/server/pages/500.js +1 -1
  29. package/.next/server/pages/500.js.nft.json +1 -1
  30. package/.next/server/pages/[...slug].js +1 -1
  31. package/.next/server/pages/[...slug].js.nft.json +1 -1
  32. package/.next/server/pages/[slug]/p.js +1 -1
  33. package/.next/server/pages/[slug]/p.js.nft.json +1 -1
  34. package/.next/server/pages/_app.js +1 -1
  35. package/.next/server/pages/_app.js.nft.json +1 -1
  36. package/.next/server/pages/_document.js +1 -1
  37. package/.next/server/pages/_document.js.nft.json +1 -1
  38. package/.next/server/pages/_error.js +1 -1
  39. package/.next/server/pages/_error.js.nft.json +1 -1
  40. package/.next/server/pages/account.js +1 -1
  41. package/.next/server/pages/account.js.nft.json +1 -1
  42. package/.next/server/pages/api/graphql.js +1 -1
  43. package/.next/server/pages/api/graphql.js.nft.json +1 -1
  44. package/.next/server/pages/api/health/live.js.nft.json +1 -1
  45. package/.next/server/pages/api/health/ready.js.nft.json +1 -1
  46. package/.next/server/pages/api/preview.js.nft.json +1 -1
  47. package/.next/server/pages/checkout.js +1 -1
  48. package/.next/server/pages/checkout.js.nft.json +1 -1
  49. package/.next/server/pages/en-US/404.html +1 -1
  50. package/.next/server/pages/en-US/500.html +1 -1
  51. package/.next/server/pages/en-US/account.html +1 -1
  52. package/.next/server/pages/en-US/checkout.html +1 -1
  53. package/.next/server/pages/en-US/login.html +1 -1
  54. package/.next/server/pages/en-US/s.html +1 -1
  55. package/.next/server/pages/en-US.html +1 -1
  56. package/.next/server/pages/index.js +1 -1
  57. package/.next/server/pages/index.js.nft.json +1 -1
  58. package/.next/server/pages/login.js +1 -1
  59. package/.next/server/pages/login.js.nft.json +1 -1
  60. package/.next/server/pages/s.js +1 -1
  61. package/.next/server/pages/s.js.nft.json +1 -1
  62. package/.next/server/pages-manifest.json +1 -1
  63. package/.next/static/{bYvT7j3s1L8_ALPlSxNjt → FO1Q-M-kedNdmpX1S3tkc}/_buildManifest.js +1 -1
  64. package/.next/static/chunks/{1153.d7522522b6c917ed.js → 1153.7f616071da309cf5.js} +1 -1
  65. package/.next/static/chunks/1978.8bdcdd4ec5c7ac88.js +1 -0
  66. package/.next/static/chunks/{5156.fe20405ee7a0d2d5.js → 5156.d1a2bac5ee6f64ac.js} +1 -1
  67. package/.next/static/chunks/{5217.350e250227ef3657.js → 5217.2c285832cd2bb950.js} +1 -1
  68. package/.next/static/chunks/{6941-6223429b182b7109.js → 6941-691e0f68baf2036e.js} +2 -2
  69. package/.next/static/chunks/7498-745c09c46899ea49.js +1 -0
  70. package/.next/static/chunks/{8857.0ff8f6604fb061a8.js → 8857.141d2a4640c89f4a.js} +1 -1
  71. package/.next/static/chunks/{main-209ac4974b020af1.js → main-48d1188fa94dad34.js} +1 -1
  72. package/.next/static/chunks/pages/{_app-91d65e1abd88251d.js → _app-e0cf85dd2f4d858c.js} +1 -1
  73. package/.next/static/chunks/pages/{_error-85cabf0d7a5ea2f2.js → _error-6a4b9b22c63bd9d7.js} +1 -1
  74. package/.next/static/chunks/{webpack-a63f842ae0d7bdfd.js → webpack-ed53dd91aa26df33.js} +1 -1
  75. package/.next/trace +102 -102
  76. package/.turbo/turbo-build.log +8 -7
  77. package/.turbo/turbo-test.log +5 -5
  78. package/CHANGELOG.md +8 -0
  79. package/README.md +0 -3
  80. package/codegen.ts +1 -1
  81. package/cypress/integration/a11y.test.js +0 -1
  82. package/cypress/integration/analytics.test.js +0 -1
  83. package/cypress/integration/cart.test.js +0 -1
  84. package/cypress/integration/plp.test.js +0 -1
  85. package/cypress/integration/search.test.js +0 -1
  86. package/cypress/integration/seo.test.js +0 -1
  87. package/cypress/plugins/index.js +0 -3
  88. package/cypress/support/commands.js +0 -1
  89. package/discovery.config.default.js +1 -1
  90. package/next-seo.config.ts +1 -1
  91. package/next.config.js +3 -0
  92. package/package.json +9 -11
  93. package/src/components/auth/ProfileChallenge/ProfileChallenge.tsx +1 -1
  94. package/src/components/cart/CartSidebar/CartSidebar.tsx +1 -1
  95. package/src/components/cart/OrderSummary/OrderSummary.tsx +1 -1
  96. package/src/components/cms/GlobalSections.tsx +2 -2
  97. package/src/components/cms/RenderSections.tsx +4 -4
  98. package/src/components/cms/SectionBoundary.tsx +1 -1
  99. package/src/components/cms/global/Components.ts +1 -1
  100. package/src/components/cms/home/Components.ts +1 -1
  101. package/src/components/cms/plp/Components.ts +1 -1
  102. package/src/components/cms/search/Components.ts +1 -1
  103. package/src/components/common/Alert/Alert.tsx +1 -1
  104. package/src/components/common/Footer/Footer.tsx +1 -1
  105. package/src/components/product/NotAvailableButton/NotAvailableButton.tsx +1 -1
  106. package/src/components/product/ProductCard/ProductCard.tsx +1 -1
  107. package/src/components/product/ProductGrid/ProductGrid.tsx +1 -1
  108. package/src/components/region/RegionModal/RegionModal.tsx +1 -1
  109. package/src/components/search/Filter/FilterDesktop.tsx +1 -1
  110. package/src/components/search/SearchDropdown/SearchDropdown.tsx +2 -2
  111. package/src/components/search/SearchInput/SearchInput.tsx +1 -1
  112. package/src/components/search/SearchTop/SearchTop.tsx +1 -1
  113. package/src/components/sections/BannerText/BannerText.tsx +1 -1
  114. package/src/components/sections/Breadcrumb/Breadcrumb.tsx +4 -4
  115. package/src/components/sections/Hero/Hero.tsx +2 -2
  116. package/src/components/sections/Newsletter/Newsletter.tsx +1 -1
  117. package/src/components/sections/ProductGallery/ProductGallery.tsx +5 -5
  118. package/src/components/sections/ProductShelf/ProductShelf.tsx +1 -1
  119. package/src/components/sections/RegionBar/RegionBar.tsx +3 -1
  120. package/src/components/templates/ProductListingPage/ProductListing.tsx +2 -2
  121. package/src/components/templates/SearchPage/SearchPage.tsx +5 -3
  122. package/src/components/ui/Image/Image.tsx +1 -1
  123. package/src/components/ui/Image/loader.ts +1 -1
  124. package/src/components/ui/Link/Link.tsx +1 -1
  125. package/src/components/ui/ProductGallery/ProductGallery.tsx +5 -5
  126. package/src/components/ui/ProductGallery/ProductGalleryPage.tsx +1 -1
  127. package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +1 -1
  128. package/src/components/ui/SkuSelector/Selectors.tsx +2 -2
  129. package/src/customizations/src/components/index.tsx +0 -1
  130. package/src/customizations/src/components/overrides/Alert.tsx +1 -1
  131. package/src/customizations/src/components/overrides/BannerText.tsx +1 -1
  132. package/src/customizations/src/components/overrides/Breadcrumb.tsx +1 -1
  133. package/src/customizations/src/components/overrides/CrossSellingShelf.tsx +1 -1
  134. package/src/customizations/src/components/overrides/EmptyState.tsx +1 -1
  135. package/src/customizations/src/components/overrides/Hero.tsx +1 -1
  136. package/src/customizations/src/components/overrides/Navbar.tsx +1 -1
  137. package/src/customizations/src/components/overrides/Newsletter.tsx +1 -1
  138. package/src/customizations/src/components/overrides/ProductDetails.tsx +1 -1
  139. package/src/customizations/src/components/overrides/ProductGallery.tsx +1 -1
  140. package/src/customizations/src/components/overrides/ProductShelf.tsx +1 -1
  141. package/src/customizations/src/components/overrides/RegionBar.tsx +1 -1
  142. package/src/experimental/searchServerSideFunctions/getServerSideProps.ts +4 -4
  143. package/src/experimental/searchServerSideFunctions/getStaticProps.ts +4 -4
  144. package/src/fonts/WebFonts.tsx +0 -2
  145. package/src/pages/404.tsx +4 -4
  146. package/src/pages/500.tsx +4 -4
  147. package/src/pages/[...slug].tsx +6 -6
  148. package/src/pages/[slug]/p.tsx +6 -6
  149. package/src/pages/account.tsx +3 -3
  150. package/src/pages/api/preview.ts +12 -6
  151. package/src/pages/checkout.tsx +3 -3
  152. package/src/pages/index.tsx +1 -1
  153. package/src/pages/login.tsx +4 -4
  154. package/src/pages/s.tsx +1 -1
  155. package/src/plugins/index.ts +0 -1
  156. package/src/sdk/analytics/platform/vtex/rc.ts +3 -3
  157. package/src/sdk/analytics/types.ts +2 -2
  158. package/src/sdk/error/ErrorBoundary/ErrorBoundary.tsx +1 -1
  159. package/src/sdk/error/MissingContentError/MissingContentError.ts +1 -1
  160. package/src/sdk/error/MultipleContentError/MultipleContentError.ts +1 -1
  161. package/src/sdk/graphql/request.ts +2 -2
  162. package/src/sdk/overrides/OverrideContext.tsx +3 -3
  163. package/src/sdk/overrides/PageProvider.tsx +3 -4
  164. package/src/sdk/overrides/getOverriddenSection.tsx +2 -2
  165. package/src/sdk/overrides/overrides.ts +1 -1
  166. package/src/sdk/product/useAllVariantProducts.ts +1 -1
  167. package/src/sdk/product/useLocalizedVariables.ts +1 -1
  168. package/src/sdk/product/usePageProductsQuery.ts +1 -1
  169. package/src/sdk/product/useProductGalleryQuery.ts +1 -1
  170. package/src/sdk/product/useProductsPrefetch.ts +1 -1
  171. package/src/sdk/search/useFilter.ts +10 -7
  172. package/src/sdk/shipping/useShippingSimulation.ts +2 -2
  173. package/src/server/cms/index.ts +1 -1
  174. package/src/server/cms/pdp.ts +2 -2
  175. package/src/server/cms/plp.ts +4 -4
  176. package/src/server/index.ts +4 -5
  177. package/src/typings/global.d.ts +6 -6
  178. package/src/typings/overrides.ts +25 -25
  179. package/src/typings/overridesDefinition.ts +4 -4
  180. package/src/utils/multipleTemplates.ts +3 -3
  181. package/test/server/cms/index.test.ts +1 -1
  182. package/.next/cache/eslint/.cache_1gneedd +0 -1
  183. package/.next/static/chunks/1978.b33d8b2c02b89474.js +0 -1
  184. package/.next/static/chunks/7498-304bc236a51fc94c.js +0 -1
  185. /package/.next/static/{bYvT7j3s1L8_ALPlSxNjt → FO1Q-M-kedNdmpX1S3tkc}/_ssgManifest.js +0 -0
@@ -2,7 +2,7 @@ import ProductGrid from 'src/components/product/ProductGrid'
2
2
  import Sentinel from 'src/sdk/search/Sentinel'
3
3
 
4
4
  import { memo } from 'react'
5
- import { ProductCardProps } from 'src/components/product/ProductCard'
5
+ import type { ProductCardProps } from 'src/components/product/ProductCard'
6
6
  import { useGalleryPage } from 'src/sdk/product/usePageProductsQuery'
7
7
 
8
8
  interface Props {
@@ -1,4 +1,4 @@
1
- import { ShippingSimulationProps as UIShippingSimulationProps } from '@faststore/ui'
1
+ import type { ShippingSimulationProps as UIShippingSimulationProps } from '@faststore/ui'
2
2
 
3
3
  import { useShippingSimulation } from 'src/sdk/shipping/useShippingSimulation'
4
4
 
@@ -1,6 +1,6 @@
1
- import { HTMLAttributes } from 'react'
1
+ import type { HTMLAttributes } from 'react'
2
2
 
3
- import { SkuSelectorProps } from '@faststore/ui'
3
+ import type { SkuSelectorProps } from '@faststore/ui'
4
4
  import NextLink from 'next/link'
5
5
  import { Image } from '../Image'
6
6
 
@@ -1,2 +1 @@
1
- // eslint-disable-next-line import/no-anonymous-default-export
2
1
  export default {}
@@ -1,6 +1,6 @@
1
1
  // This is an example of how it can be used on the starter.
2
2
 
3
- import { SectionOverride } from 'src/typings/overrides'
3
+ import type { SectionOverride } from 'src/typings/overrides'
4
4
 
5
5
  const SECTION = 'Alert' as const
6
6
 
@@ -1,6 +1,6 @@
1
1
  // This is an example of how it can be used on the starter.
2
2
 
3
- import { SectionOverride } from 'src/typings/overrides'
3
+ import type { SectionOverride } from 'src/typings/overrides'
4
4
 
5
5
  const SECTION = 'BannerText' as const
6
6
 
@@ -1,6 +1,6 @@
1
1
  // This is an example of how it can be used on the starter.
2
2
 
3
- import { SectionOverride } from 'src/typings/overrides'
3
+ import type { SectionOverride } from 'src/typings/overrides'
4
4
 
5
5
  const SECTION = 'Breadcrumb' as const
6
6
 
@@ -1,6 +1,6 @@
1
1
  // This is an example of how it can be used on the starter.
2
2
 
3
- import { SectionOverride } from 'src/typings/overrides'
3
+ import type { SectionOverride } from 'src/typings/overrides'
4
4
 
5
5
  const SECTION = 'CrossSellingShelf' as const
6
6
 
@@ -1,5 +1,5 @@
1
1
  // This is an example of how it can be used on the starter.
2
- import { SectionOverride } from 'src/typings/overrides'
2
+ import type { SectionOverride } from 'src/typings/overrides'
3
3
 
4
4
  const SECTION = 'EmptyState' as const
5
5
 
@@ -1,6 +1,6 @@
1
1
  // This is an example of how it can be used on the starter.
2
2
 
3
- import { SectionOverride } from 'src/typings/overrides'
3
+ import type { SectionOverride } from 'src/typings/overrides'
4
4
 
5
5
  const SECTION = 'Hero' as const
6
6
 
@@ -1,6 +1,6 @@
1
1
  // This is an example of how it can be used on the starter.
2
2
 
3
- import { SectionOverride } from 'src/typings/overrides'
3
+ import type { SectionOverride } from 'src/typings/overrides'
4
4
 
5
5
  const SECTION = 'Navbar' as const
6
6
 
@@ -1,6 +1,6 @@
1
1
  // This is an example of how it can be used on the starter.
2
2
 
3
- import { SectionOverride } from 'src/typings/overrides'
3
+ import type { SectionOverride } from 'src/typings/overrides'
4
4
 
5
5
  const SECTION = 'Newsletter' as const
6
6
 
@@ -1,6 +1,6 @@
1
1
  // This is an example of how it can be used on the starter.
2
2
 
3
- import { SectionOverride } from 'src/typings/overrides'
3
+ import type { SectionOverride } from 'src/typings/overrides'
4
4
 
5
5
  const SECTION = 'ProductDetails' as const
6
6
 
@@ -1,6 +1,6 @@
1
1
  // This is an example of how it can be used on the starter.
2
2
 
3
- import { SectionOverride } from 'src/typings/overrides'
3
+ import type { SectionOverride } from 'src/typings/overrides'
4
4
 
5
5
  const SECTION = 'ProductGallery' as const
6
6
 
@@ -1,6 +1,6 @@
1
1
  // This is an example of how it can be used on the starter.
2
2
 
3
- import { SectionOverride } from 'src/typings/overrides'
3
+ import type { SectionOverride } from 'src/typings/overrides'
4
4
 
5
5
  const SECTION = 'ProductShelf' as const
6
6
 
@@ -1,6 +1,6 @@
1
1
  // This is an example of how it can be used on the starter.
2
2
 
3
- import { SectionOverride } from 'src/typings/overrides'
3
+ import type { SectionOverride } from 'src/typings/overrides'
4
4
 
5
5
  const SECTION = 'RegionBar' as const
6
6
 
@@ -1,9 +1,9 @@
1
- import { GetServerSideProps } from 'next'
2
- import { SearchPageProps } from './getStaticProps'
1
+ import type { GetServerSideProps } from 'next'
2
+ import type { SearchPageProps } from './getStaticProps'
3
3
 
4
4
  import { getGlobalSectionsData } from 'src/components/cms/GlobalSections'
5
- import { SearchContentType, getPage } from 'src/server/cms'
6
- import { Locator } from '@vtex/client-cms'
5
+ import { type SearchContentType, getPage } from 'src/server/cms'
6
+ import type { Locator } from '@vtex/client-cms'
7
7
  import storeConfig from 'discovery.config'
8
8
 
9
9
  export const getServerSideProps: GetServerSideProps<
@@ -1,10 +1,10 @@
1
- import { GetStaticProps } from 'next'
1
+ import type { GetStaticProps } from 'next'
2
2
  import {
3
3
  getGlobalSectionsData,
4
- GlobalSectionsData,
4
+ type GlobalSectionsData,
5
5
  } from 'src/components/cms/GlobalSections'
6
- import { SearchContentType, getPage } from 'src/server/cms'
7
- import { Locator } from '@vtex/client-cms'
6
+ import { type SearchContentType, getPage } from 'src/server/cms'
7
+ import type { Locator } from '@vtex/client-cms'
8
8
  import storeConfig from 'discovery.config'
9
9
 
10
10
  export type SearchPageProps = {
@@ -1,5 +1,3 @@
1
- /* eslint-disable @next/next/no-page-custom-font */
2
-
3
1
  function WebFonts() {
4
2
  return (
5
3
  <>
package/src/pages/404.tsx CHANGED
@@ -1,9 +1,9 @@
1
- import { Locator } from '@vtex/client-cms'
2
- import { GetStaticProps } from 'next'
1
+ import type { Locator } from '@vtex/client-cms'
2
+ import type { GetStaticProps } from 'next'
3
3
  import { NextSeo } from 'next-seo'
4
4
  import type { ComponentType } from 'react'
5
5
  import {
6
- GlobalSectionsData,
6
+ type GlobalSectionsData,
7
7
  getGlobalSectionsData,
8
8
  } from 'src/components/cms/GlobalSections'
9
9
 
@@ -12,7 +12,7 @@ import RenderSections from 'src/components/cms/RenderSections'
12
12
  import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
13
13
  import PLUGINS_COMPONENTS from 'src/plugins'
14
14
  import CUSTOM_COMPONENTS from 'src/customizations/src/components'
15
- import { PageContentType, getPage } from 'src/server/cms'
15
+ import { type PageContentType, getPage } from 'src/server/cms'
16
16
 
17
17
  /* A list of components that can be used in the CMS. */
18
18
  const COMPONENTS: Record<string, ComponentType<any>> = {
package/src/pages/500.tsx CHANGED
@@ -1,9 +1,9 @@
1
- import { Locator } from '@vtex/client-cms'
2
- import { GetStaticProps } from 'next'
1
+ import type { Locator } from '@vtex/client-cms'
2
+ import type { GetStaticProps } from 'next'
3
3
  import { NextSeo } from 'next-seo'
4
4
  import type { ComponentType } from 'react'
5
5
  import {
6
- GlobalSectionsData,
6
+ type GlobalSectionsData,
7
7
  getGlobalSectionsData,
8
8
  } from 'src/components/cms/GlobalSections'
9
9
 
@@ -12,7 +12,7 @@ import RenderSections from 'src/components/cms/RenderSections'
12
12
  import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
13
13
  import PLUGINS_COMPONENTS from 'src/plugins'
14
14
  import CUSTOM_COMPONENTS from 'src/customizations/src/components'
15
- import { PageContentType, getPage } from 'src/server/cms'
15
+ import { type PageContentType, getPage } from 'src/server/cms'
16
16
 
17
17
  /* A list of components that can be used in the CMS. */
18
18
  const COMPONENTS: Record<string, ComponentType<any>> = {
@@ -9,22 +9,22 @@ import type {
9
9
  } from '@generated/graphql'
10
10
  import { execute } from 'src/server'
11
11
 
12
- import { Locator } from '@vtex/client-cms'
12
+ import type { Locator } from '@vtex/client-cms'
13
13
  import dynamic from 'next/dynamic'
14
14
  import {
15
15
  getGlobalSectionsData,
16
- GlobalSectionsData,
16
+ type GlobalSectionsData,
17
17
  } from 'src/components/cms/GlobalSections'
18
18
  import {
19
19
  getLandingPageBySlug,
20
- LandingPageProps,
20
+ type LandingPageProps,
21
21
  } from 'src/components/templates/LandingPage'
22
22
  import ProductListingPage, {
23
- ProductListingPageProps,
23
+ type ProductListingPageProps,
24
24
  } from 'src/components/templates/ProductListingPage'
25
25
  import { getRedirect } from 'src/sdk/redirects'
26
- import { PageContentType } from 'src/server/cms'
27
- import { getPLP, PLPContentType } from 'src/server/cms/plp'
26
+ import type { PageContentType } from 'src/server/cms'
27
+ import { getPLP, type PLPContentType } from 'src/server/cms/plp'
28
28
  import { getDynamicContent } from 'src/utils/dynamicContent'
29
29
 
30
30
  const LandingPage = dynamic(
@@ -6,9 +6,9 @@ import { BreadcrumbJsonLd, NextSeo, ProductJsonLd } from 'next-seo'
6
6
  import type { ComponentType } from 'react'
7
7
 
8
8
  import { gql } from '@generated'
9
- import {
10
- type ServerProductQueryQuery,
11
- type ServerProductQueryQueryVariables,
9
+ import type {
10
+ ServerProductQueryQuery,
11
+ ServerProductQueryQueryVariables,
12
12
  } from '@generated/graphql'
13
13
  import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
14
14
  import RenderSections from 'src/components/cms/RenderSections'
@@ -28,12 +28,12 @@ import { execute } from 'src/server'
28
28
 
29
29
  import storeConfig from 'discovery.config'
30
30
  import {
31
- GlobalSectionsData,
31
+ type GlobalSectionsData,
32
32
  getGlobalSectionsData,
33
33
  } from 'src/components/cms/GlobalSections'
34
- import PageProvider, { PDPContext } from 'src/sdk/overrides/PageProvider'
34
+ import PageProvider, { type PDPContext } from 'src/sdk/overrides/PageProvider'
35
35
  import { useProductQuery } from 'src/sdk/product/useProductQuery'
36
- import { PDPContentType, getPDP } from 'src/server/cms/pdp'
36
+ import { type PDPContentType, getPDP } from 'src/server/cms/pdp'
37
37
 
38
38
  /**
39
39
  * Sections: Components imported from each store's custom components and '../components/sections' only.
@@ -1,10 +1,10 @@
1
- import { Locator } from '@vtex/client-cms'
2
- import { GetStaticProps } from 'next'
1
+ import type { Locator } from '@vtex/client-cms'
2
+ import type { GetStaticProps } from 'next'
3
3
  import { NextSeo } from 'next-seo'
4
4
  import type { ComponentType } from 'react'
5
5
  import { useEffect } from 'react'
6
6
  import {
7
- GlobalSectionsData,
7
+ type GlobalSectionsData,
8
8
  getGlobalSectionsData,
9
9
  } from 'src/components/cms/GlobalSections'
10
10
  import RenderSections from 'src/components/cms/RenderSections'
@@ -12,7 +12,10 @@ type Settings = {
12
12
  }
13
13
  }
14
14
  class StatusError extends Error {
15
- constructor(message: string, public status: number) {
15
+ constructor(
16
+ message: string,
17
+ public status: number
18
+ ) {
16
19
  super(message)
17
20
  }
18
21
  }
@@ -35,13 +38,16 @@ const handler: NextApiHandler = async (req, res) => {
35
38
  'documentId',
36
39
  'versionId',
37
40
  'releaseId',
38
- ].reduce((acc, param) => {
39
- const value = pickParam(req, param)
41
+ ].reduce(
42
+ (acc, param) => {
43
+ const value = pickParam(req, param)
40
44
 
41
- if (value !== undefined) acc[param] = value
45
+ if (value !== undefined) acc[param] = value
42
46
 
43
- return acc
44
- }, {} as Record<string, string>)
47
+ return acc
48
+ },
49
+ {} as Record<string, string>
50
+ )
45
51
 
46
52
  // Check if required path params are present
47
53
  if (!locator.contentType || !locator.documentId) {
@@ -1,12 +1,12 @@
1
1
  import { NextSeo } from 'next-seo'
2
2
  import { useEffect } from 'react'
3
3
 
4
- import { Locator } from '@vtex/client-cms'
5
- import { GetStaticProps } from 'next'
4
+ import type { Locator } from '@vtex/client-cms'
5
+ import type { GetStaticProps } from 'next'
6
6
  import type { ComponentType } from 'react'
7
7
  import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
8
8
  import {
9
- GlobalSectionsData,
9
+ type GlobalSectionsData,
10
10
  getGlobalSectionsData,
11
11
  } from 'src/components/cms/GlobalSections'
12
12
  import CUSTOM_COMPONENTS from 'src/customizations/src/components'
@@ -7,7 +7,7 @@ import type { PageContentType } from 'src/server/cms'
7
7
  import { getPage } from 'src/server/cms'
8
8
 
9
9
  import {
10
- GlobalSectionsData,
10
+ type GlobalSectionsData,
11
11
  getGlobalSectionsData,
12
12
  } from 'src/components/cms/GlobalSections'
13
13
  import COMPONENTS from 'src/components/cms/home/Components'
@@ -2,18 +2,18 @@ import { NextSeo } from 'next-seo'
2
2
  import type { ComponentType } from 'react'
3
3
  import { useEffect } from 'react'
4
4
 
5
- import { Locator } from '@vtex/client-cms'
6
- import { GetStaticProps } from 'next'
5
+ import type { Locator } from '@vtex/client-cms'
6
+ import type { GetStaticProps } from 'next'
7
7
  import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
8
8
  import {
9
- GlobalSectionsData,
9
+ type GlobalSectionsData,
10
10
  getGlobalSectionsData,
11
11
  } from 'src/components/cms/GlobalSections'
12
12
  import RenderSections from 'src/components/cms/RenderSections'
13
13
  import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
14
14
  import PLUGINS_COMPONENTS from 'src/plugins'
15
15
  import CUSTOM_COMPONENTS from 'src/customizations/src/components'
16
- import { PageContentType, getPage } from 'src/server/cms'
16
+ import { type PageContentType, getPage } from 'src/server/cms'
17
17
  import storeConfig from '../../discovery.config'
18
18
 
19
19
  /* A list of components that can be used in the CMS. */
package/src/pages/s.tsx CHANGED
@@ -18,7 +18,7 @@ import storeConfig from 'discovery.config'
18
18
  import { SearchWrapper } from 'src/components/templates/SearchPage'
19
19
  import {
20
20
  getStaticProps,
21
- SearchPageProps,
21
+ type SearchPageProps,
22
22
  } from 'src/experimental/searchServerSideFunctions'
23
23
 
24
24
  export interface SearchPageContextType {
@@ -1,2 +1 @@
1
- // eslint-disable-next-line import/no-anonymous-default-export
2
1
  export default {}
@@ -1,6 +1,6 @@
1
- import { AnalyticsEvent, PageViewEvent } from '@faststore/sdk'
2
- import { ServerProductQueryQuery } from '@generated/graphql'
3
- import {
1
+ import type { AnalyticsEvent, PageViewEvent } from '@faststore/sdk'
2
+ import type { ServerProductQueryQuery } from '@generated/graphql'
3
+ import type {
4
4
  CategoryView,
5
5
  DepartmentView,
6
6
  HomeView,
@@ -72,7 +72,7 @@ export type SearchEvents =
72
72
  * Types copied from Request Capture App: https://github.com/vtex/request-capture-app/blob/1becac32c002cb03a57bf36c8a7f9400eab8b933/react/typings/rcevents.d.ts
73
73
  */
74
74
 
75
- export interface HomeView {}
75
+ export type HomeView = {}
76
76
 
77
77
  export interface CategoryView {
78
78
  departmentId?: string
@@ -114,4 +114,4 @@ export interface ProductView {
114
114
  sellerIds: string // e.g.: "00443713,04412311,1"
115
115
  }
116
116
 
117
- export interface OtherView {}
117
+ export type OtherView = {}
@@ -20,7 +20,7 @@ interface ErrorBoundaryProps {
20
20
  }
21
21
 
22
22
  interface ErrorBoundaryState {
23
- hasError: Boolean
23
+ hasError: boolean
24
24
  error: Error | null
25
25
  }
26
26
 
@@ -1,4 +1,4 @@
1
- import { Options } from 'src/server/cms'
1
+ import type { Options } from 'src/server/cms'
2
2
 
3
3
  export default class MissingContentError extends Error {
4
4
  constructor(options: Options) {
@@ -1,4 +1,4 @@
1
- import { Options } from 'src/server/cms'
1
+ import type { Options } from 'src/server/cms'
2
2
 
3
3
  export default class MultipleContentError extends Error {
4
4
  constructor(options: Options) {
@@ -51,8 +51,8 @@ const baseRequest = async <V = any, D = any>(
51
51
  fetchOptions?.method !== undefined
52
52
  ? fetchOptions.method.toUpperCase()
53
53
  : operationName.endsWith('Query')
54
- ? 'GET'
55
- : 'POST'
54
+ ? 'GET'
55
+ : 'POST'
56
56
 
57
57
  const params = new URLSearchParams({
58
58
  operationName,
@@ -4,7 +4,7 @@ import type { OverriddenComponents } from '../../typings/overridesDefinition'
4
4
  import type { SectionsOverrides } from '../../typings/overrides'
5
5
 
6
6
  type OverrideContextType<
7
- SectionName extends keyof SectionsOverrides = keyof SectionsOverrides
7
+ SectionName extends keyof SectionsOverrides = keyof SectionsOverrides,
8
8
  > = {
9
9
  className?: string
10
10
  components: OverriddenComponents<SectionName>
@@ -15,11 +15,11 @@ const OverrideContext = createContext<OverrideContextType>(null)
15
15
  export const OverrideProvider = OverrideContext.Provider
16
16
 
17
17
  export const useOverrideContext = <
18
- SectionName extends keyof SectionsOverrides = keyof SectionsOverrides
18
+ SectionName extends keyof SectionsOverrides = keyof SectionsOverrides,
19
19
  >() => useContext(OverrideContext) as OverrideContextType<SectionName>
20
20
 
21
21
  export const useOverrideComponents = <
22
- SectionName extends keyof SectionsOverrides = keyof SectionsOverrides
22
+ SectionName extends keyof SectionsOverrides = keyof SectionsOverrides,
23
23
  >() =>
24
24
  useContext(OverrideContext)
25
25
  .components as OverrideContextType<SectionName>['components']
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  ClientManyProductsQueryQuery,
3
3
  ClientProductGalleryQueryQuery,
4
4
  ClientProductQueryQuery,
@@ -7,7 +7,7 @@ import {
7
7
  } from '@generated/graphql'
8
8
  import type { PropsWithChildren } from 'react'
9
9
  import { createContext, useContext, useMemo } from 'react'
10
- import { SearchPageContextType } from 'src/pages/s'
10
+ import type { SearchPageContextType } from 'src/pages/s'
11
11
 
12
12
  export interface PDPContext {
13
13
  data?: ServerProductQueryQuery &
@@ -87,7 +87,6 @@ export const usePLP = () => usePage<PLPContext>()
87
87
 
88
88
  export const useSearchPage = () => usePage<SearchPageContext>()
89
89
 
90
- export const useDynamicContent = <T extends unknown>() =>
91
- usePage<DynamicContent<T>>()
90
+ export const useDynamicContent = <T,>() => usePage<DynamicContent<T>>()
92
91
 
93
92
  export default PageProvider
@@ -11,7 +11,7 @@ import { OverrideProvider } from './OverrideContext'
11
11
 
12
12
  export function getOverridableSection<
13
13
  Section extends ComponentType,
14
- SectionName extends keyof SectionsOverrides = keyof SectionsOverrides
14
+ SectionName extends keyof SectionsOverrides = keyof SectionsOverrides,
15
15
  >(
16
16
  sectionName: SectionName,
17
17
  Section: Section,
@@ -58,7 +58,7 @@ export function getOverridableSection<
58
58
  * @see https://www.faststore.dev/docs/building-sections/overriding-components-and-props
59
59
  */
60
60
  export function getOverriddenSection<
61
- Section extends SectionsOverrides[keyof SectionsOverrides]['Section']
61
+ Section extends SectionsOverrides[keyof SectionsOverrides]['Section'],
62
62
  >(override: SectionOverrideDefinition<Section>) {
63
63
  const { Section, ...rest } = override
64
64
 
@@ -11,7 +11,7 @@ import type { SectionsOverrides } from '../../typings/overrides'
11
11
  issues of this file. Error lines have been marked with the @ts-ignore comment*/
12
12
 
13
13
  export function getSectionOverrides<
14
- SectionName extends keyof SectionsOverrides
14
+ SectionName extends keyof SectionsOverrides,
15
15
  >(
16
16
  defaultComponents: DefaultSectionComponentsDefinitions<SectionName>,
17
17
  override: SectionOverrideDefinitionV1<SectionName>
@@ -36,7 +36,7 @@ type FormattedVariantProduct = {
36
36
  }
37
37
 
38
38
  export const useAllVariantProducts = <
39
- T extends ClientAllVariantProductsQueryQuery
39
+ T extends ClientAllVariantProductsQueryQuery,
40
40
  >(
41
41
  productID: string,
42
42
  enabled: boolean,
@@ -1,4 +1,4 @@
1
- import { ClientManyProductsQueryQueryVariables } from '@generated/graphql'
1
+ import type { ClientManyProductsQueryQueryVariables } from '@generated/graphql'
2
2
  import { useMemo } from 'react'
3
3
  import { ITEMS_PER_SECTION } from 'src/constants'
4
4
  import { useSession } from '../session'
@@ -1,6 +1,6 @@
1
1
  import { useSearch } from '@faststore/sdk'
2
2
  import { gql } from '@generated'
3
- import {
3
+ import type {
4
4
  ClientManyProductsQueryQuery,
5
5
  ClientManyProductsQueryQueryVariables,
6
6
  } from '@generated/graphql'
@@ -4,7 +4,7 @@ import { useSession } from 'src/sdk/session'
4
4
  import { useLocalizedVariables } from './useLocalizedVariables'
5
5
 
6
6
  import { useSearch } from '@faststore/sdk'
7
- import { Facet } from '@faststore/sdk/dist/types'
7
+ import type { Facet } from '@faststore/sdk/dist/types'
8
8
  import type {
9
9
  ClientManyProductsQueryQueryVariables,
10
10
  ClientProductGalleryQueryQuery as Query,
@@ -1,7 +1,7 @@
1
1
  import { useSearch } from '@faststore/sdk'
2
2
 
3
3
  import { gql } from '@generated'
4
- import { ClientManyProductsQueryQueryVariables } from '@generated/graphql'
4
+ import type { ClientManyProductsQueryQueryVariables } from '@generated/graphql'
5
5
  import { useEffect, useCallback } from 'react'
6
6
 
7
7
  import type { QueryOptions } from '../graphql/useQuery'
@@ -89,15 +89,18 @@ export const useFilter = (allFacets: Filter_FacetsFragment[]) => {
89
89
 
90
90
  const selectedMap = useMemo(
91
91
  () =>
92
- selected.reduce((acc, facet) => {
93
- if (!acc.has(facet.key)) {
94
- acc.set(facet.key, new Map())
95
- }
92
+ selected.reduce(
93
+ (acc, facet) => {
94
+ if (!acc.has(facet.key)) {
95
+ acc.set(facet.key, new Map())
96
+ }
96
97
 
97
- acc.get(facet.key)?.set(facet.value, facet)
98
+ acc.get(facet.key)?.set(facet.value, facet)
98
99
 
99
- return acc
100
- }, new Map() as Map<string, Map<string, IStoreSelectedFacet>>),
100
+ return acc
101
+ },
102
+ new Map() as Map<string, Map<string, IStoreSelectedFacet>>
103
+ ),
101
104
  [selected]
102
105
  )
103
106
 
@@ -1,6 +1,6 @@
1
1
  import type { ChangeEvent } from 'react'
2
2
  import { useCallback, useEffect, useReducer, useRef } from 'react'
3
- import { ClientShippingSimulationQueryQuery } from '@generated/graphql'
3
+ import type { ClientShippingSimulationQueryQuery } from '@generated/graphql'
4
4
  import getShippingSimulation from '.'
5
5
  import { useSession } from '../session'
6
6
 
@@ -46,7 +46,7 @@ const createEmptySimulation = () =>
46
46
  errorMessage: '',
47
47
  },
48
48
  shippingSimulation: undefined,
49
- } as State)
49
+ }) as State
50
50
 
51
51
  const reducer = (state: State, action: Action) => {
52
52
  const { type } = action