@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.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +36 -36
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +13 -13
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/1163.js +2 -2
- package/.next/server/chunks/3157.js +1 -1
- package/.next/server/chunks/{1377.js → 3668.js} +1 -1
- package/.next/server/chunks/4012.js +1 -1
- package/.next/server/chunks/5754.js +2 -2
- package/.next/server/chunks/6859.js +1 -1
- package/.next/server/chunks/8640.js +1 -1
- package/.next/server/chunks/8857.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.js +1 -1
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.js +1 -1
- package/.next/server/pages/500.js.nft.json +1 -1
- package/.next/server/pages/[...slug].js +1 -1
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +1 -1
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js +1 -1
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/_error.js +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/pages/account.js +1 -1
- package/.next/server/pages/account.js.nft.json +1 -1
- package/.next/server/pages/api/graphql.js +1 -1
- package/.next/server/pages/api/graphql.js.nft.json +1 -1
- package/.next/server/pages/api/health/live.js.nft.json +1 -1
- package/.next/server/pages/api/health/ready.js.nft.json +1 -1
- package/.next/server/pages/api/preview.js.nft.json +1 -1
- package/.next/server/pages/checkout.js +1 -1
- package/.next/server/pages/checkout.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +1 -1
- package/.next/server/pages/en-US/500.html +1 -1
- package/.next/server/pages/en-US/account.html +1 -1
- package/.next/server/pages/en-US/checkout.html +1 -1
- package/.next/server/pages/en-US/login.html +1 -1
- package/.next/server/pages/en-US/s.html +1 -1
- package/.next/server/pages/en-US.html +1 -1
- package/.next/server/pages/index.js +1 -1
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/login.js +1 -1
- package/.next/server/pages/login.js.nft.json +1 -1
- package/.next/server/pages/s.js +1 -1
- package/.next/server/pages/s.js.nft.json +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/{bYvT7j3s1L8_ALPlSxNjt → FO1Q-M-kedNdmpX1S3tkc}/_buildManifest.js +1 -1
- package/.next/static/chunks/{1153.d7522522b6c917ed.js → 1153.7f616071da309cf5.js} +1 -1
- package/.next/static/chunks/1978.8bdcdd4ec5c7ac88.js +1 -0
- package/.next/static/chunks/{5156.fe20405ee7a0d2d5.js → 5156.d1a2bac5ee6f64ac.js} +1 -1
- package/.next/static/chunks/{5217.350e250227ef3657.js → 5217.2c285832cd2bb950.js} +1 -1
- package/.next/static/chunks/{6941-6223429b182b7109.js → 6941-691e0f68baf2036e.js} +2 -2
- package/.next/static/chunks/7498-745c09c46899ea49.js +1 -0
- package/.next/static/chunks/{8857.0ff8f6604fb061a8.js → 8857.141d2a4640c89f4a.js} +1 -1
- package/.next/static/chunks/{main-209ac4974b020af1.js → main-48d1188fa94dad34.js} +1 -1
- package/.next/static/chunks/pages/{_app-91d65e1abd88251d.js → _app-e0cf85dd2f4d858c.js} +1 -1
- package/.next/static/chunks/pages/{_error-85cabf0d7a5ea2f2.js → _error-6a4b9b22c63bd9d7.js} +1 -1
- package/.next/static/chunks/{webpack-a63f842ae0d7bdfd.js → webpack-ed53dd91aa26df33.js} +1 -1
- package/.next/trace +102 -102
- package/.turbo/turbo-build.log +8 -7
- package/.turbo/turbo-test.log +5 -5
- package/CHANGELOG.md +8 -0
- package/README.md +0 -3
- package/codegen.ts +1 -1
- package/cypress/integration/a11y.test.js +0 -1
- package/cypress/integration/analytics.test.js +0 -1
- package/cypress/integration/cart.test.js +0 -1
- package/cypress/integration/plp.test.js +0 -1
- package/cypress/integration/search.test.js +0 -1
- package/cypress/integration/seo.test.js +0 -1
- package/cypress/plugins/index.js +0 -3
- package/cypress/support/commands.js +0 -1
- package/discovery.config.default.js +1 -1
- package/next-seo.config.ts +1 -1
- package/next.config.js +3 -0
- package/package.json +9 -11
- package/src/components/auth/ProfileChallenge/ProfileChallenge.tsx +1 -1
- package/src/components/cart/CartSidebar/CartSidebar.tsx +1 -1
- package/src/components/cart/OrderSummary/OrderSummary.tsx +1 -1
- package/src/components/cms/GlobalSections.tsx +2 -2
- package/src/components/cms/RenderSections.tsx +4 -4
- package/src/components/cms/SectionBoundary.tsx +1 -1
- package/src/components/cms/global/Components.ts +1 -1
- package/src/components/cms/home/Components.ts +1 -1
- package/src/components/cms/plp/Components.ts +1 -1
- package/src/components/cms/search/Components.ts +1 -1
- package/src/components/common/Alert/Alert.tsx +1 -1
- package/src/components/common/Footer/Footer.tsx +1 -1
- package/src/components/product/NotAvailableButton/NotAvailableButton.tsx +1 -1
- package/src/components/product/ProductCard/ProductCard.tsx +1 -1
- package/src/components/product/ProductGrid/ProductGrid.tsx +1 -1
- package/src/components/region/RegionModal/RegionModal.tsx +1 -1
- package/src/components/search/Filter/FilterDesktop.tsx +1 -1
- package/src/components/search/SearchDropdown/SearchDropdown.tsx +2 -2
- package/src/components/search/SearchInput/SearchInput.tsx +1 -1
- package/src/components/search/SearchTop/SearchTop.tsx +1 -1
- package/src/components/sections/BannerText/BannerText.tsx +1 -1
- package/src/components/sections/Breadcrumb/Breadcrumb.tsx +4 -4
- package/src/components/sections/Hero/Hero.tsx +2 -2
- package/src/components/sections/Newsletter/Newsletter.tsx +1 -1
- package/src/components/sections/ProductGallery/ProductGallery.tsx +5 -5
- package/src/components/sections/ProductShelf/ProductShelf.tsx +1 -1
- package/src/components/sections/RegionBar/RegionBar.tsx +3 -1
- package/src/components/templates/ProductListingPage/ProductListing.tsx +2 -2
- package/src/components/templates/SearchPage/SearchPage.tsx +5 -3
- package/src/components/ui/Image/Image.tsx +1 -1
- package/src/components/ui/Image/loader.ts +1 -1
- package/src/components/ui/Link/Link.tsx +1 -1
- package/src/components/ui/ProductGallery/ProductGallery.tsx +5 -5
- package/src/components/ui/ProductGallery/ProductGalleryPage.tsx +1 -1
- package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +1 -1
- package/src/components/ui/SkuSelector/Selectors.tsx +2 -2
- package/src/customizations/src/components/index.tsx +0 -1
- package/src/customizations/src/components/overrides/Alert.tsx +1 -1
- package/src/customizations/src/components/overrides/BannerText.tsx +1 -1
- package/src/customizations/src/components/overrides/Breadcrumb.tsx +1 -1
- package/src/customizations/src/components/overrides/CrossSellingShelf.tsx +1 -1
- package/src/customizations/src/components/overrides/EmptyState.tsx +1 -1
- package/src/customizations/src/components/overrides/Hero.tsx +1 -1
- package/src/customizations/src/components/overrides/Navbar.tsx +1 -1
- package/src/customizations/src/components/overrides/Newsletter.tsx +1 -1
- package/src/customizations/src/components/overrides/ProductDetails.tsx +1 -1
- package/src/customizations/src/components/overrides/ProductGallery.tsx +1 -1
- package/src/customizations/src/components/overrides/ProductShelf.tsx +1 -1
- package/src/customizations/src/components/overrides/RegionBar.tsx +1 -1
- package/src/experimental/searchServerSideFunctions/getServerSideProps.ts +4 -4
- package/src/experimental/searchServerSideFunctions/getStaticProps.ts +4 -4
- package/src/fonts/WebFonts.tsx +0 -2
- package/src/pages/404.tsx +4 -4
- package/src/pages/500.tsx +4 -4
- package/src/pages/[...slug].tsx +6 -6
- package/src/pages/[slug]/p.tsx +6 -6
- package/src/pages/account.tsx +3 -3
- package/src/pages/api/preview.ts +12 -6
- package/src/pages/checkout.tsx +3 -3
- package/src/pages/index.tsx +1 -1
- package/src/pages/login.tsx +4 -4
- package/src/pages/s.tsx +1 -1
- package/src/plugins/index.ts +0 -1
- package/src/sdk/analytics/platform/vtex/rc.ts +3 -3
- package/src/sdk/analytics/types.ts +2 -2
- package/src/sdk/error/ErrorBoundary/ErrorBoundary.tsx +1 -1
- package/src/sdk/error/MissingContentError/MissingContentError.ts +1 -1
- package/src/sdk/error/MultipleContentError/MultipleContentError.ts +1 -1
- package/src/sdk/graphql/request.ts +2 -2
- package/src/sdk/overrides/OverrideContext.tsx +3 -3
- package/src/sdk/overrides/PageProvider.tsx +3 -4
- package/src/sdk/overrides/getOverriddenSection.tsx +2 -2
- package/src/sdk/overrides/overrides.ts +1 -1
- package/src/sdk/product/useAllVariantProducts.ts +1 -1
- package/src/sdk/product/useLocalizedVariables.ts +1 -1
- package/src/sdk/product/usePageProductsQuery.ts +1 -1
- package/src/sdk/product/useProductGalleryQuery.ts +1 -1
- package/src/sdk/product/useProductsPrefetch.ts +1 -1
- package/src/sdk/search/useFilter.ts +10 -7
- package/src/sdk/shipping/useShippingSimulation.ts +2 -2
- package/src/server/cms/index.ts +1 -1
- package/src/server/cms/pdp.ts +2 -2
- package/src/server/cms/plp.ts +4 -4
- package/src/server/index.ts +4 -5
- package/src/typings/global.d.ts +6 -6
- package/src/typings/overrides.ts +25 -25
- package/src/typings/overridesDefinition.ts +4 -4
- package/src/utils/multipleTemplates.ts +3 -3
- package/test/server/cms/index.test.ts +1 -1
- package/.next/cache/eslint/.cache_1gneedd +0 -1
- package/.next/static/chunks/1978.b33d8b2c02b89474.js +0 -1
- package/.next/static/chunks/7498-304bc236a51fc94c.js +0 -1
- /package/.next/static/{bYvT7j3s1L8_ALPlSxNjt → FO1Q-M-kedNdmpX1S3tkc}/_ssgManifest.js +0 -0
package/src/server/cms/index.ts
CHANGED
package/src/server/cms/pdp.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ServerProductQueryQuery } from '@generated/graphql'
|
|
1
|
+
import type { ServerProductQueryQuery } from '@generated/graphql'
|
|
2
2
|
import type { ContentData, Locator } from '@vtex/client-cms'
|
|
3
3
|
import MissingContentError from 'src/sdk/error/MissingContentError'
|
|
4
4
|
import { findBestPDPTemplate } from 'src/utils/multipleTemplates'
|
|
5
|
-
import { Options, getCMSPage, getPage } from '.'
|
|
5
|
+
import { type Options, getCMSPage, getPage } from '.'
|
|
6
6
|
import config from '../../../discovery.config'
|
|
7
7
|
|
|
8
8
|
type PDPSettings = {
|
package/src/server/cms/plp.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ContentData, Locator } from '@vtex/client-cms'
|
|
1
|
+
import type { ContentData, Locator } from '@vtex/client-cms'
|
|
2
2
|
import MissingContentError from 'src/sdk/error/MissingContentError'
|
|
3
3
|
import {
|
|
4
|
-
Rewrite,
|
|
5
|
-
RewritesConfig,
|
|
4
|
+
type Rewrite,
|
|
5
|
+
type RewritesConfig,
|
|
6
6
|
findBestPLPTemplate,
|
|
7
7
|
} from 'src/utils/multipleTemplates'
|
|
8
8
|
import config from '../../../discovery.config'
|
|
9
|
-
import { Options, getCMSPage, getPage } from '../cms'
|
|
9
|
+
import { type Options, getCMSPage, getPage } from '../cms'
|
|
10
10
|
|
|
11
11
|
type PLPSettings = {
|
|
12
12
|
settings: {
|
package/src/server/index.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
1
|
import {
|
|
3
2
|
envelop,
|
|
4
|
-
MaskError,
|
|
3
|
+
type MaskError,
|
|
5
4
|
useEngine,
|
|
6
5
|
useExtendContext,
|
|
7
6
|
useMaskedErrors,
|
|
8
|
-
useSchema
|
|
7
|
+
useSchema,
|
|
9
8
|
} from '@envelop/core'
|
|
10
9
|
import { useGraphQlJit } from '@envelop/graphql-jit'
|
|
11
10
|
import { useParserCache } from '@envelop/parser-cache'
|
|
@@ -14,7 +13,7 @@ import type { CacheControl, Maybe } from '@faststore/api'
|
|
|
14
13
|
import {
|
|
15
14
|
getContextFactory,
|
|
16
15
|
getResolvers,
|
|
17
|
-
isFastStoreError
|
|
16
|
+
isFastStoreError,
|
|
18
17
|
} from '@faststore/api'
|
|
19
18
|
import { loadFilesSync } from '@graphql-tools/load-files'
|
|
20
19
|
import { makeExecutableSchema } from '@graphql-tools/schema'
|
|
@@ -28,7 +27,7 @@ import persisted from '@generated/persisted-documents.json'
|
|
|
28
27
|
import thirdPartyResolvers from '../customizations/src/graphql/thirdParty/resolvers'
|
|
29
28
|
import vtexExtensionsResolvers from '../customizations/src/graphql/vtex/resolvers'
|
|
30
29
|
|
|
31
|
-
import { Operation } from '../sdk/graphql/request'
|
|
30
|
+
import type { Operation } from '../sdk/graphql/request'
|
|
32
31
|
import { apiOptions } from './options'
|
|
33
32
|
|
|
34
33
|
interface ExecuteOptions<V = Record<string, unknown>> {
|
package/src/typings/global.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
declare module '*.scss'
|
|
2
|
-
declare module '*.png'
|
|
1
|
+
declare module '*.scss'
|
|
2
|
+
declare module '*.png'
|
|
3
3
|
|
|
4
4
|
interface Window extends Window {
|
|
5
|
-
dataLayer: any[]
|
|
5
|
+
dataLayer: any[]
|
|
6
6
|
VTEX_METADATA: {
|
|
7
|
-
account: string
|
|
8
|
-
renderer:
|
|
9
|
-
}
|
|
7
|
+
account: string
|
|
8
|
+
renderer: 'faststore'
|
|
9
|
+
}
|
|
10
10
|
sendrc: (eventName: string, eventValues?: any) => void
|
|
11
11
|
}
|
package/src/typings/overrides.ts
CHANGED
|
@@ -48,18 +48,18 @@ import type {
|
|
|
48
48
|
ComponentOverrideDefinition,
|
|
49
49
|
SectionOverrideDefinitionV1,
|
|
50
50
|
} from './overridesDefinition'
|
|
51
|
-
import Alert from '../components/sections/Alert'
|
|
52
|
-
import Breadcrumb from '../components/sections/Breadcrumb'
|
|
53
|
-
import BannerText from '../components/sections/BannerText'
|
|
54
|
-
import CrossSellingShelf from '../components/sections/CrossSellingShelf'
|
|
55
|
-
import EmptyState from '../components/sections/EmptyState'
|
|
56
|
-
import Hero from '../components/sections/Hero'
|
|
57
|
-
import ProductShelf from '../components/sections/ProductShelf'
|
|
58
|
-
import ProductDetails from '../components/sections/ProductDetails'
|
|
59
|
-
import Navbar from '../components/sections/Navbar'
|
|
60
|
-
import Newsletter from '../components/sections/Newsletter'
|
|
61
|
-
import ProductGallery from '../components/sections/ProductGallery'
|
|
62
|
-
import RegionBar from '../components/sections/RegionBar'
|
|
51
|
+
import type Alert from '../components/sections/Alert'
|
|
52
|
+
import type Breadcrumb from '../components/sections/Breadcrumb'
|
|
53
|
+
import type BannerText from '../components/sections/BannerText'
|
|
54
|
+
import type CrossSellingShelf from '../components/sections/CrossSellingShelf'
|
|
55
|
+
import type EmptyState from '../components/sections/EmptyState'
|
|
56
|
+
import type Hero from '../components/sections/Hero'
|
|
57
|
+
import type ProductShelf from '../components/sections/ProductShelf'
|
|
58
|
+
import type ProductDetails from '../components/sections/ProductDetails'
|
|
59
|
+
import type Navbar from '../components/sections/Navbar'
|
|
60
|
+
import type Newsletter from '../components/sections/Newsletter'
|
|
61
|
+
import type ProductGallery from '../components/sections/ProductGallery'
|
|
62
|
+
import type RegionBar from '../components/sections/RegionBar'
|
|
63
63
|
|
|
64
64
|
export type SectionOverride = {
|
|
65
65
|
[K in keyof SectionsOverrides]: SectionOverrideDefinitionV1<K>
|
|
@@ -82,25 +82,25 @@ export type SectionOverride = {
|
|
|
82
82
|
* We then use ComponentsFromSection to extract the list of components
|
|
83
83
|
*/
|
|
84
84
|
export type OverrideComponentsForSection<
|
|
85
|
-
Section extends SectionsOverrides[keyof SectionsOverrides]['Section']
|
|
85
|
+
Section extends SectionsOverrides[keyof SectionsOverrides]['Section'],
|
|
86
86
|
> = {
|
|
87
|
-
// The first 'extends' condition is used to filter out sections that don't have overrides (typed 'never')
|
|
88
|
-
[K in keyof SectionsOverrides as SectionsOverrides[K] extends {
|
|
89
|
-
|
|
90
|
-
}
|
|
87
|
+
// The first 'extends' condition is used to filter out sections that don't have overrides (typed 'never')
|
|
88
|
+
[K in keyof SectionsOverrides as SectionsOverrides[K] extends {
|
|
89
|
+
Section: never
|
|
90
|
+
}
|
|
91
91
|
? never
|
|
92
92
|
: // In the second 'extends' condition, we check if the section matches the one we're looking for
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
SectionsOverrides[K] extends {
|
|
94
|
+
Section: Section
|
|
95
|
+
}
|
|
96
|
+
? // If it does, we return the components. Otherwise, we return 'never', which is filtered out
|
|
97
|
+
K
|
|
98
|
+
: never]: SectionsOverrides[K]['components']
|
|
99
|
+
}
|
|
100
100
|
|
|
101
101
|
// This type is used to extract only the list of components from the section override
|
|
102
102
|
export type ComponentsFromSection<
|
|
103
|
-
Section extends SectionsOverrides[keyof SectionsOverrides]['Section']
|
|
103
|
+
Section extends SectionsOverrides[keyof SectionsOverrides]['Section'],
|
|
104
104
|
> =
|
|
105
105
|
OverrideComponentsForSection<Section>[keyof OverrideComponentsForSection<Section>]
|
|
106
106
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ComponentsFromSection, SectionsOverrides } from './overrides'
|
|
1
|
+
import type { ComponentsFromSection, SectionsOverrides } from './overrides'
|
|
2
2
|
|
|
3
3
|
export type SectionOverrideDefinitionV1<
|
|
4
|
-
SectionName extends keyof SectionsOverrides
|
|
4
|
+
SectionName extends keyof SectionsOverrides,
|
|
5
5
|
> = {
|
|
6
6
|
/**
|
|
7
7
|
* CSS class to be appended to the \<section\> element. Behaves similarly to React's className.
|
|
@@ -15,7 +15,7 @@ export type SectionOverrideDefinitionV1<
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export type SectionOverrideDefinition<
|
|
18
|
-
Section extends SectionsOverrides[keyof SectionsOverrides]['Section']
|
|
18
|
+
Section extends SectionsOverrides[keyof SectionsOverrides]['Section'],
|
|
19
19
|
> = {
|
|
20
20
|
/**
|
|
21
21
|
* CSS class to be appended to the \<section\> element. Behaves similarly to React's className.
|
|
@@ -36,7 +36,7 @@ export type OverriddenComponents<SectionName extends keyof SectionsOverrides> =
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export type DefaultSectionComponentsDefinitions<
|
|
39
|
-
K extends keyof SectionsOverrides
|
|
39
|
+
K extends keyof SectionsOverrides,
|
|
40
40
|
> = Record<keyof SectionsOverrides[K]['components'], React.ComponentType>
|
|
41
41
|
|
|
42
42
|
export type ComponentOverrideDefinition<ComponentProps, Props> =
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ServerProductQueryQuery } from '@generated/graphql'
|
|
2
|
-
import { PDPContentType } from 'src/server/cms/pdp'
|
|
3
|
-
import { PLPContentType } from 'src/server/cms/plp'
|
|
1
|
+
import type { ServerProductQueryQuery } from '@generated/graphql'
|
|
2
|
+
import type { PDPContentType } from 'src/server/cms/pdp'
|
|
3
|
+
import type { PLPContentType } from 'src/server/cms/plp'
|
|
4
4
|
|
|
5
5
|
export type Rewrite = {
|
|
6
6
|
source: string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clientCMS, getCMSPage } from '../../../src/server/cms'
|
|
2
2
|
import { jest } from '@jest/globals'
|
|
3
|
-
import { ContentData } from '@vtex/client-cms'
|
|
3
|
+
import type { ContentData } from '@vtex/client-cms'
|
|
4
4
|
|
|
5
5
|
describe('CMS Integration', () => {
|
|
6
6
|
const mockData = (count = 1) => {
|