@faststore/core 3.0.46 → 3.0.48
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/app-build-manifest.json +25 -0
- package/.next/app-path-routes-manifest.json +1 -0
- package/.next/build-manifest.json +95 -90
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- 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 +17 -17
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/app/_not-found.html +1 -0
- package/.next/server/app/_not-found.js +1 -0
- package/.next/server/app/_not-found.js.nft.json +1 -0
- package/.next/server/app/_not-found.meta +1 -0
- package/.next/server/app/_not-found.rsc +6 -0
- package/.next/server/app/_not-found_client-reference-manifest.js +1 -0
- package/.next/server/app/fs-next-update/page.js +1 -0
- package/.next/server/app/fs-next-update/page.js.nft.json +1 -0
- package/.next/server/app/fs-next-update/page_client-reference-manifest.js +1 -0
- package/.next/server/app/fs-next-update.html +1 -0
- package/.next/server/app/fs-next-update.meta +1 -0
- package/.next/server/app/fs-next-update.rsc +6 -0
- package/.next/server/app-paths-manifest.json +4 -0
- package/.next/server/chunks/1408.js +1 -0
- package/.next/server/chunks/1488.js +9 -0
- package/.next/server/chunks/2053.js +8 -0
- package/.next/server/chunks/3057.js +1 -0
- package/.next/server/chunks/3068.js +1 -0
- package/.next/server/chunks/3131.js +1 -0
- package/.next/server/chunks/3404.js +1 -0
- package/.next/server/chunks/3607.js +1 -0
- package/.next/server/chunks/368.js +1 -0
- package/.next/server/chunks/3779.js +1 -0
- package/.next/server/chunks/3992.js +1 -0
- package/.next/server/chunks/4222.js +1 -0
- package/.next/server/chunks/{247.js → 466.js} +1 -1
- package/.next/server/chunks/513.js +1 -0
- package/.next/server/chunks/522.js +1 -0
- package/.next/server/chunks/5640.js +6 -0
- package/.next/server/chunks/5686.js +1 -0
- package/.next/server/chunks/6090.js +1 -0
- package/.next/server/chunks/6414.js +1 -0
- package/.next/server/chunks/647.js +296 -0
- package/.next/server/chunks/6535.js +1 -0
- package/.next/server/chunks/6693.js +1 -0
- package/.next/server/chunks/{859.js → 6859.js} +2 -2
- package/.next/server/chunks/692.js +1 -0
- package/.next/server/chunks/7143.js +1 -0
- package/.next/server/chunks/7982.js +1 -0
- package/.next/server/chunks/8352.js +1 -0
- package/.next/server/chunks/8609.js +1 -0
- package/.next/server/chunks/8653.js +1 -0
- package/.next/server/chunks/8811.js +1 -0
- package/.next/server/chunks/9134.js +1 -0
- package/.next/server/chunks/9239.js +1 -0
- package/.next/server/chunks/9740.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -0
- 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 +1 -1
- package/.next/server/pages/api/health/live.js.nft.json +1 -1
- package/.next/server/pages/api/health/ready.js +1 -1
- package/.next/server/pages/api/health/ready.js.nft.json +1 -1
- package/.next/server/pages/api/preview.js +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 +2 -2
- package/.next/server/pages/en-US/404.json +1 -1
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/500.json +1 -1
- package/.next/server/pages/en-US/account.html +2 -2
- package/.next/server/pages/en-US/account.json +1 -1
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/checkout.json +1 -1
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/login.json +1 -1
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US/s.json +1 -1
- package/.next/server/pages/en-US.html +3 -3
- package/.next/server/pages/en-US.json +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/server/server-reference-manifest.js +1 -0
- package/.next/server/server-reference-manifest.json +1 -0
- package/.next/server/webpack-api-runtime.js +1 -1
- package/.next/server/webpack-runtime.js +1 -1
- package/.next/static/S-n12r3ICzmxSZIG0sqmF/_buildManifest.js +1 -0
- package/.next/static/chunks/{484.b82b73b1d8c37e02.js → 119.e218828b0132b8b2.js} +1 -1
- package/.next/static/chunks/{857.d2299cfe995af21d.js → 319.8d30e9ffafb22a7b.js} +1 -1
- package/.next/static/chunks/346-94f30a4bb6dafd89.js +1 -0
- package/.next/static/chunks/439.db1fe827fd6839bb.js +1 -0
- package/.next/static/chunks/461.74f76bc649cb0446.js +1 -0
- package/.next/static/chunks/503-e6db8cab6eb3bf60.js +25 -0
- package/.next/static/chunks/{540.6c62d2536d42a1e0.js → 515.e66ca5426460f9b5.js} +1 -1
- package/.next/static/chunks/551-448d32b3b6393825.js +1 -0
- package/.next/static/chunks/{575-853fb8b1ba4ce8c4.js → 575-cdcaf62ab25bbfca.js} +1 -1
- package/.next/static/chunks/{202.c7d8a71173edecfb.js → 576.bd044c1cd3af7bbc.js} +1 -1
- package/.next/static/chunks/{217.01bc0ad07edd6f1b.js → 641.e663ec37da787600.js} +1 -1
- package/.next/static/chunks/{758.3ca049c36b5ddd7d.js → 661.df439acd66dbae34.js} +1 -1
- package/.next/static/chunks/680.355e4fc032bd559f.js +1 -0
- package/.next/static/chunks/913-4af007b10d50c50f.js +1 -0
- package/.next/static/chunks/app/_not-found-3649108cdca52b21.js +1 -0
- package/.next/static/chunks/app/fs-next-update/page-9a2debb5dd829908.js +1 -0
- package/.next/static/chunks/app/layout-a5723c7cfcca3bdf.js +1 -0
- package/.next/static/chunks/fd9d1056-e4950b334bc218cf.js +9 -0
- package/.next/static/chunks/main-5e45f8a409e3ce1c.js +1 -0
- package/.next/static/chunks/main-app-7b31a9960d0fa675.js +1 -0
- package/.next/static/chunks/pages/{404-1334d11ab8467b3d.js → 404-2e174f10fe6712cd.js} +1 -1
- package/.next/static/chunks/pages/{500-449c5bd51f98423f.js → 500-52c42b827ed9693b.js} +1 -1
- package/.next/static/chunks/pages/[...slug]-91cd643a14638b90.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-436d394ddc268573.js +1 -0
- package/.next/static/chunks/pages/{_app-ec0d2e833bd9cea0.js → _app-88eac41033b6a613.js} +2 -2
- package/.next/static/chunks/pages/{_error-fbf331a03642b495.js → _error-5a3e12f364a20272.js} +1 -1
- package/.next/static/chunks/pages/{account-dbc5c028225cd1ac.js → account-9e4bcc3ab5b88353.js} +1 -1
- package/.next/static/chunks/pages/{checkout-29ae2c37eaf172e1.js → checkout-7c95e252d2cbfd75.js} +1 -1
- package/.next/static/chunks/pages/index-d3008f576cb2fc9d.js +1 -0
- package/.next/static/chunks/pages/{login-c4d2c856008df5ac.js → login-7a53f93622c6fded.js} +1 -1
- package/.next/static/chunks/pages/s-4d4c0bb22d489fa2.js +1 -0
- package/.next/static/chunks/webpack-31f87692f808967d.js +1 -0
- package/.next/static/css/173705e880fb4eaf.css +1 -0
- package/.next/static/css/17e37eb991935d47.css +1 -0
- package/.next/static/css/185f3332f3d0db64.css +1 -0
- package/.next/static/css/25261a033e496803.css +1 -0
- package/.next/static/css/36f9392d58a1a958.css +1 -0
- package/.next/static/css/4ababb851a0d481b.css +1 -0
- package/.next/static/css/6ce7302d311d7d68.css +1 -0
- package/.next/static/css/d6562b2ce182bbef.css +1 -0
- package/.next/static/css/ec44b650be144ada.css +1 -0
- package/.next/static/css/ec840ce35f0cf5e0.css +1 -0
- package/.next/trace +113 -91
- package/.next/types/app/fs-next-update/page.ts +71 -0
- package/.next/types/package.json +1 -0
- package/.turbo/turbo-build.log +52 -28
- package/.turbo/turbo-test.log +9 -9
- package/api/index.ts +2 -0
- package/app/fs-next-update/page.tsx +3 -0
- package/app/layout.tsx +11 -0
- package/index.ts +1 -9
- package/next-env.d.ts +1 -0
- package/next.config.js +11 -0
- package/package.json +9 -9
- package/src/components/cart/CartItem/CartItem.tsx +1 -1
- package/src/components/templates/LandingPage/LandingPage.tsx +10 -1
- package/src/customizations/src/dynamicContent/index.ts +16 -0
- package/src/experimental/index.ts +4 -0
- package/src/pages/[...slug].tsx +5 -0
- package/src/pages/index.tsx +18 -4
- package/src/sdk/graphql/request.ts +3 -3
- package/src/sdk/overrides/PageProvider.tsx +19 -8
- package/src/utils/dynamicContent.ts +29 -0
- package/tsconfig.json +17 -2
- package/.next/server/chunks/119.js +0 -1
- package/.next/server/chunks/12.js +0 -1
- package/.next/server/chunks/187.js +0 -1
- package/.next/server/chunks/202.js +0 -1
- package/.next/server/chunks/24.js +0 -1
- package/.next/server/chunks/242.js +0 -1
- package/.next/server/chunks/344.js +0 -1
- package/.next/server/chunks/404.js +0 -1
- package/.next/server/chunks/414.js +0 -1
- package/.next/server/chunks/484.js +0 -1
- package/.next/server/chunks/493.js +0 -1
- package/.next/server/chunks/498.js +0 -1
- package/.next/server/chunks/540.js +0 -1
- package/.next/server/chunks/57.js +0 -1
- package/.next/server/chunks/624.js +0 -1
- package/.next/server/chunks/640.js +0 -6
- package/.next/server/chunks/646.js +0 -296
- package/.next/server/chunks/659.js +0 -9
- package/.next/server/chunks/679.js +0 -1
- package/.next/server/chunks/693.js +0 -1
- package/.next/server/chunks/694.js +0 -1
- package/.next/server/chunks/779.js +0 -1
- package/.next/server/chunks/82.js +0 -8
- package/.next/server/chunks/857.js +0 -1
- package/.next/server/chunks/881.js +0 -1
- package/.next/server/chunks/917.js +0 -1
- package/.next/server/chunks/936.js +0 -1
- package/.next/server/chunks/96.js +0 -1
- package/.next/server/chunks/997.js +0 -1
- package/.next/static/J-JEiruC8i9aZksBNyDFc/_buildManifest.js +0 -1
- package/.next/static/chunks/104-d968d92fa4902045.js +0 -1
- package/.next/static/chunks/161-b39fe2f79ff7bc85.js +0 -1
- package/.next/static/chunks/247.6eb0f179401e9e2f.js +0 -1
- package/.next/static/chunks/624.455cdc0925956ae5.js +0 -1
- package/.next/static/chunks/629-751d31ac7c84f87d.js +0 -1
- package/.next/static/chunks/65.da22595d53beae76.js +0 -1
- package/.next/static/chunks/main-6f63f6746cc029db.js +0 -1
- package/.next/static/chunks/pages/[...slug]-bcaf61b01157d8cb.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-ad60103a8ec2abb7.js +0 -1
- package/.next/static/chunks/pages/index-cd109119d65df8e3.js +0 -1
- package/.next/static/chunks/pages/s-26e475975386c51a.js +0 -1
- package/.next/static/chunks/webpack-d993fa4ea18504cc.js +0 -1
- package/.next/static/css/0d45c82d8887a269.css +0 -1
- package/.next/static/css/211c7542af66d8b4.css +0 -1
- package/.next/static/css/2980acad3f8e1028.css +0 -1
- package/.next/static/css/4c4d90eb8cb1d2b7.css +0 -1
- package/.next/static/css/96e3fddf695d6aa9.css +0 -1
- package/.next/static/css/b9d9ba1b04f3160d.css +0 -1
- package/.next/static/css/cff9aafa16fccc9c.css +0 -1
- package/.next/static/css/d586715f4f707df4.css +0 -1
- package/.next/static/css/d8b918e01478a2ed.css +0 -1
- package/.next/static/css/e32410b31c666cb2.css +0 -1
- /package/.next/static/{J-JEiruC8i9aZksBNyDFc → S-n12r3ICzmxSZIG0sqmF}/_ssgManifest.js +0 -0
- /package/.next/static/chunks/{framework-8e279965036b6169.js → framework-21e9365486ba23a6.js} +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// File: /home/runner/work/faststore/faststore/packages/core/app/fs-next-update/page.tsx
|
|
2
|
+
import * as entry from '../../../../app/fs-next-update/page.js'
|
|
3
|
+
import type { ResolvingMetadata } from 'next/dist/lib/metadata/types/metadata-interface.js'
|
|
4
|
+
|
|
5
|
+
type TEntry = typeof import('../../../../app/fs-next-update/page.js')
|
|
6
|
+
|
|
7
|
+
// Check that the entry is a valid entry
|
|
8
|
+
checkFields<Diff<{
|
|
9
|
+
default: Function
|
|
10
|
+
config?: {}
|
|
11
|
+
generateStaticParams?: Function
|
|
12
|
+
revalidate?: RevalidateRange<TEntry> | false
|
|
13
|
+
dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
|
|
14
|
+
dynamicParams?: boolean
|
|
15
|
+
fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
|
|
16
|
+
preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
|
|
17
|
+
runtime?: 'nodejs' | 'experimental-edge' | 'edge'
|
|
18
|
+
maxDuration?: number
|
|
19
|
+
|
|
20
|
+
metadata?: any
|
|
21
|
+
generateMetadata?: Function
|
|
22
|
+
|
|
23
|
+
}, TEntry, ''>>()
|
|
24
|
+
|
|
25
|
+
// Check the prop type of the entry function
|
|
26
|
+
checkFields<Diff<PageProps, FirstArg<TEntry['default']>, 'default'>>()
|
|
27
|
+
|
|
28
|
+
// Check the arguments and return type of the generateMetadata function
|
|
29
|
+
if ('generateMetadata' in entry) {
|
|
30
|
+
checkFields<Diff<PageProps, FirstArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
|
|
31
|
+
checkFields<Diff<ResolvingMetadata, SecondArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Check the arguments and return type of the generateStaticParams function
|
|
35
|
+
if ('generateStaticParams' in entry) {
|
|
36
|
+
checkFields<Diff<{ params: PageParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
|
|
37
|
+
checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type PageParams = any
|
|
41
|
+
export interface PageProps {
|
|
42
|
+
params?: any
|
|
43
|
+
searchParams?: any
|
|
44
|
+
}
|
|
45
|
+
export interface LayoutProps {
|
|
46
|
+
children?: React.ReactNode
|
|
47
|
+
|
|
48
|
+
params?: any
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// =============
|
|
52
|
+
// Utility types
|
|
53
|
+
type RevalidateRange<T> = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
|
|
54
|
+
|
|
55
|
+
// If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
|
|
56
|
+
type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
|
|
57
|
+
type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
|
|
58
|
+
|
|
59
|
+
type FirstArg<T extends Function> = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
|
|
60
|
+
type SecondArg<T extends Function> = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
|
|
61
|
+
type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
function checkFields<_ extends { [k in keyof any]: never }>() {}
|
|
66
|
+
|
|
67
|
+
// https://github.com/sindresorhus/type-fest
|
|
68
|
+
type Numeric = number | bigint
|
|
69
|
+
type Zero = 0 | 0n
|
|
70
|
+
type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never
|
|
71
|
+
type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : '__invalid_negative_number__'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type": "module"}
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
$ yarn partytown & yarn generate && next build
|
|
2
|
-
$ partytown copylib ./public/~partytown
|
|
3
2
|
$ faststore generate-graphql -c
|
|
3
|
+
$ partytown copylib ./public/~partytown
|
|
4
4
|
Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
|
|
5
5
|
success - GraphQL schema, types, and optimizations successfully generated 🎉
|
|
6
6
|
⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
|
|
@@ -9,10 +9,6 @@ This information is used to shape Next.js' roadmap and prioritize features.
|
|
|
9
9
|
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
|
|
10
10
|
https://nextjs.org/telemetry
|
|
11
11
|
|
|
12
|
-
Browserslist: caniuse-lite is outdated. Please run:
|
|
13
|
-
npx browserslist@latest --update-db
|
|
14
|
-
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
|
|
15
|
-
Linting and checking validity of types ...
|
|
16
12
|
Browserslist: caniuse-lite is outdated. Please run:
|
|
17
13
|
npx browserslist@latest --update-db
|
|
18
14
|
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
|
|
@@ -23,38 +19,66 @@ Browserslist: caniuse-lite is outdated. Please run:
|
|
|
23
19
|
npx update-browserslist-db@latest
|
|
24
20
|
Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
25
21
|
✓ Compiled successfully
|
|
22
|
+
Linting and checking validity of types ...
|
|
23
|
+
Browserslist: caniuse-lite is outdated. Please run:
|
|
24
|
+
npx browserslist@latest --update-db
|
|
25
|
+
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
|
|
26
26
|
Collecting page data ...
|
|
27
|
-
Generating static pages (0/7) ...
|
|
28
|
-
|
|
29
27
|
Generating static pages (1/7)
|
|
30
|
-
|
|
31
28
|
Generating static pages (3/7)
|
|
32
|
-
|
|
33
29
|
Generating static pages (5/7)
|
|
34
|
-
|
|
35
30
|
✓ Generating static pages (7/7)
|
|
31
|
+
Generating static pages (0/9) ...
|
|
32
|
+
|
|
36
33
|
Generating static pages (2/9)
|
|
34
|
+
warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
|
|
35
|
+
warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
|
|
36
|
+
warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
|
|
37
|
+
warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
|
|
38
|
+
warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
|
|
39
|
+
warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
|
|
40
|
+
|
|
37
41
|
Generating static pages (4/9)
|
|
42
|
+
warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
|
|
43
|
+
warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
|
|
44
|
+
Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview for mapping the page and the corresponding data-fetching function.
|
|
45
|
+
warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
|
|
46
|
+
warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
|
|
47
|
+
|
|
38
48
|
Generating static pages (6/9)
|
|
49
|
+
warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
|
|
50
|
+
warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
|
|
51
|
+
warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
|
|
52
|
+
warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
|
|
53
|
+
|
|
39
54
|
✓ Generating static pages (9/9)
|
|
40
55
|
Finalizing page optimization ...
|
|
41
56
|
Collecting build traces ...
|
|
42
57
|
|
|
58
|
+
Route (app) Size First Load JS
|
|
59
|
+
┌ ○ /_not-found 875 B 83 kB
|
|
60
|
+
└ ○ /fs-next-update 142 B 82.3 kB
|
|
61
|
+
+ First Load JS shared by all 82.1 kB
|
|
62
|
+
├ chunks/503-e6db8cab6eb3bf60.js 28.4 kB
|
|
63
|
+
├ chunks/fd9d1056-e4950b334bc218cf.js 51.1 kB
|
|
64
|
+
├ chunks/main-app-7b31a9960d0fa675.js 232 B
|
|
65
|
+
└ chunks/webpack-31f87692f808967d.js 2.45 kB
|
|
66
|
+
|
|
43
67
|
Route (pages) Size First Load JS
|
|
44
|
-
┌ ● / 3.
|
|
45
|
-
├ └ css/
|
|
46
|
-
├ /_app 0 B 93.
|
|
47
|
-
├ ● /[...slug] 4.
|
|
48
|
-
├ └ css/
|
|
49
|
-
├ ● /[slug]/p 11.
|
|
50
|
-
├ └ css/
|
|
68
|
+
┌ ● / 3.39 kB 144 kB
|
|
69
|
+
├ └ css/6ce7302d311d7d68.css 6.57 kB
|
|
70
|
+
├ /_app 0 B 93.5 kB
|
|
71
|
+
├ ● /[...slug] 4.5 kB 156 kB
|
|
72
|
+
├ └ css/ec840ce35f0cf5e0.css 7.02 kB
|
|
73
|
+
├ ● /[slug]/p 11.1 kB 151 kB
|
|
74
|
+
├ └ css/36f9392d58a1a958.css 11.4 kB
|
|
51
75
|
├ ○ /404 1.47 kB 127 kB
|
|
52
76
|
├ ● /500 1.47 kB 127 kB
|
|
53
|
-
├ ● /account
|
|
54
|
-
├ λ /api/graphql 0 B 93.
|
|
55
|
-
├ λ /api/health/live 0 B 93.
|
|
56
|
-
├ λ /api/health/ready 0 B 93.
|
|
57
|
-
├ λ /api/preview 0 B 93.
|
|
58
|
-
├ ● /checkout
|
|
77
|
+
├ ● /account 675 B 126 kB
|
|
78
|
+
├ λ /api/graphql 0 B 93.5 kB
|
|
79
|
+
├ λ /api/health/live 0 B 93.5 kB
|
|
80
|
+
├ λ /api/health/ready 0 B 93.5 kB
|
|
81
|
+
├ λ /api/preview 0 B 93.5 kB
|
|
82
|
+
├ ● /checkout 660 B 126 kB
|
|
59
83
|
├ ● /login 1.58 kB 127 kB
|
|
60
|
-
└ ● /s 4.
|
|
84
|
+
└ ● /s 4.97 kB 141 kB
|
|
61
85
|
+ First Load JS shared by all 96.5 kB
|
|
62
|
-
├ chunks/framework-
|
|
63
|
-
├ chunks/main-
|
|
64
|
-
├ chunks/pages/_app-
|
|
65
|
-
├ chunks/webpack-
|
|
86
|
+
├ chunks/framework-21e9365486ba23a6.js 45.4 kB
|
|
87
|
+
├ chunks/main-5e45f8a409e3ce1c.js 33.1 kB
|
|
88
|
+
├ chunks/pages/_app-88eac41033b6a613.js 12.6 kB
|
|
89
|
+
├ chunks/webpack-31f87692f808967d.js 2.45 kB
|
|
66
90
|
└ css/5d1f64b61ea581f4.css 3.05 kB
|
|
67
91
|
|
|
68
92
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
$ jest
|
|
2
|
-
PASS test/server/index.test.ts (26.
|
|
2
|
+
PASS test/server/index.test.ts (26.656 s)
|
|
3
3
|
FastStore GraphQL Layer
|
|
4
4
|
@faststore/api
|
|
5
5
|
✓ should return a valid GraphQL schema (9 ms)
|
|
6
|
-
✓ should return a valid GraphQL schema contain all expected types (
|
|
7
|
-
✓ should return a valid GraphQL schema contain all expected queries (
|
|
8
|
-
✓ should return a valid GraphQL schema contain all expected mutations
|
|
6
|
+
✓ should return a valid GraphQL schema contain all expected types (27 ms)
|
|
7
|
+
✓ should return a valid GraphQL schema contain all expected queries (1 ms)
|
|
8
|
+
✓ should return a valid GraphQL schema contain all expected mutations (1 ms)
|
|
9
9
|
VTEX API Extension
|
|
10
|
-
✓ getTypeDefsFromFolder function should return an Array (
|
|
10
|
+
✓ getTypeDefsFromFolder function should return an Array (12 ms)
|
|
11
11
|
Third Party API Extension
|
|
12
12
|
✓ getTypeDefsFromFolder function should return an Array (9 ms)
|
|
13
13
|
Final Schema after merging
|
|
14
|
-
✓ should return a valid merged GraphQL schema (
|
|
14
|
+
✓ should return a valid merged GraphQL schema (42 ms)
|
|
15
15
|
Envelop
|
|
16
|
-
✓ should exist with its plugins (
|
|
17
|
-
✓ should handle options and execute (
|
|
16
|
+
✓ should exist with its plugins (60 ms)
|
|
17
|
+
✓ should handle options and execute (207 ms)
|
|
18
18
|
|
|
19
19
|
Test Suites: 1 passed, 1 total
|
|
20
20
|
Tests: 9 passed, 9 total
|
|
21
21
|
Snapshots: 0 total
|
|
22
|
-
Time: 26.
|
|
22
|
+
Time: 26.762 s
|
|
23
23
|
Ran all test suites.
|
package/api/index.ts
CHANGED
package/app/layout.tsx
ADDED
package/index.ts
CHANGED
package/next-env.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="next" />
|
|
2
2
|
/// <reference types="next/image-types/global" />
|
|
3
|
+
/// <reference types="next/navigation-types/compat/navigation" />
|
|
3
4
|
|
|
4
5
|
// NOTE: This file should not be edited
|
|
5
6
|
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
package/next.config.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
const path = require('path')
|
|
3
3
|
const storeConfig = require('./faststore.config')
|
|
4
|
+
const webpack = require('webpack')
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @type {import('next').NextConfig}
|
|
@@ -40,6 +41,16 @@ const nextConfig = {
|
|
|
40
41
|
}
|
|
41
42
|
})
|
|
42
43
|
|
|
44
|
+
// Make css order works as expected in Next 13. See https://github.com/vercel/next.js/issues/51030#issuecomment-2005254907
|
|
45
|
+
config.plugins.push(
|
|
46
|
+
new webpack.BannerPlugin({
|
|
47
|
+
banner: '@layer base, components, theme;',
|
|
48
|
+
test: /\.css$/,
|
|
49
|
+
raw: true,
|
|
50
|
+
entryOnly: false,
|
|
51
|
+
})
|
|
52
|
+
)
|
|
53
|
+
|
|
43
54
|
// Reduce the number of chunks so we ship a smaller first bundle.
|
|
44
55
|
// This should help reducing TBT
|
|
45
56
|
if (!isServer && !dev && config.optimization?.splitChunks) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.48",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"@envelop/graphql-jit": "^1.1.1",
|
|
40
40
|
"@envelop/parser-cache": "^2.2.0",
|
|
41
41
|
"@envelop/validation-cache": "^2.2.0",
|
|
42
|
-
"@faststore/api": "^3.0.
|
|
43
|
-
"@faststore/components": "^3.0.
|
|
44
|
-
"@faststore/graphql-utils": "^3.0.
|
|
45
|
-
"@faststore/sdk": "^3.0.
|
|
46
|
-
"@faststore/ui": "^3.0.
|
|
42
|
+
"@faststore/api": "^3.0.47",
|
|
43
|
+
"@faststore/components": "^3.0.47",
|
|
44
|
+
"@faststore/graphql-utils": "^3.0.47",
|
|
45
|
+
"@faststore/sdk": "^3.0.47",
|
|
46
|
+
"@faststore/ui": "^3.0.47",
|
|
47
47
|
"@graphql-codegen/cli": "^3.3.1",
|
|
48
48
|
"@graphql-codegen/client-preset": "^4.1.0",
|
|
49
49
|
"@graphql-codegen/typescript": "^3.0.4",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@cypress/code-coverage": "^3.12.1",
|
|
84
84
|
"@envelop/testing": "^6.0.0",
|
|
85
|
-
"@faststore/cli": "^3.0.
|
|
86
|
-
"@faststore/eslint-config": "^3.0.
|
|
85
|
+
"@faststore/cli": "^3.0.47",
|
|
86
|
+
"@faststore/eslint-config": "^3.0.47",
|
|
87
87
|
"@faststore/lighthouse": "^1.12.32",
|
|
88
88
|
"@lhci/cli": "^0.9.0",
|
|
89
89
|
"@testing-library/cypress": "^10.0.1",
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
"node": "18.19.0",
|
|
125
125
|
"yarn": "1.19.1"
|
|
126
126
|
},
|
|
127
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "b9f3d0a140309be1a31e17a15890403bc6f5ea36"
|
|
128
128
|
}
|
|
@@ -11,6 +11,7 @@ import { OverriddenDefaultProductShelf as ProductShelf } from 'src/components/se
|
|
|
11
11
|
import ProductTiles from 'src/components/sections/ProductTiles'
|
|
12
12
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
13
13
|
import MissingContentError from 'src/sdk/error/MissingContentError/MissingContentError'
|
|
14
|
+
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
14
15
|
import type { PageContentType } from 'src/server/cms'
|
|
15
16
|
import { getPage } from 'src/server/cms'
|
|
16
17
|
|
|
@@ -30,12 +31,18 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
|
30
31
|
export type LandingPageProps = {
|
|
31
32
|
page: PageContentType
|
|
32
33
|
slug?: string
|
|
34
|
+
serverData?: unknown
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
export default function LandingPage({
|
|
36
38
|
page: { sections, settings },
|
|
37
39
|
slug,
|
|
40
|
+
serverData,
|
|
38
41
|
}: LandingPageProps) {
|
|
42
|
+
const context = {
|
|
43
|
+
data: serverData,
|
|
44
|
+
}
|
|
45
|
+
|
|
39
46
|
return (
|
|
40
47
|
<>
|
|
41
48
|
{/* SEO */}
|
|
@@ -75,7 +82,9 @@ export default function LandingPage({
|
|
|
75
82
|
If needed, wrap your component in a <Section /> component
|
|
76
83
|
(not the HTML tag) before rendering it here.
|
|
77
84
|
*/}
|
|
78
|
-
<
|
|
85
|
+
<PageProvider context={context}>
|
|
86
|
+
<RenderSections sections={sections} components={COMPONENTS} />
|
|
87
|
+
</PageProvider>
|
|
79
88
|
</>
|
|
80
89
|
)
|
|
81
90
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// starter.store code that will be copied to .faststore (core) dynamicContent/index.ts
|
|
2
|
+
|
|
3
|
+
// Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview
|
|
4
|
+
// for mapping the page and the corresponding data-fetching function.
|
|
5
|
+
|
|
6
|
+
// Example:
|
|
7
|
+
// const dynamicContent = {
|
|
8
|
+
// home: fetchDataHomepage,
|
|
9
|
+
// "my-landing-page": fetchDataMyLandingPage,
|
|
10
|
+
// };
|
|
11
|
+
|
|
12
|
+
// export default dynamicContent;
|
|
13
|
+
|
|
14
|
+
const dynamicContent = {}
|
|
15
|
+
|
|
16
|
+
export default dynamicContent
|
|
@@ -30,9 +30,13 @@ export { default as useTopSearch_unstable } from '../../src/sdk/search/useTopSea
|
|
|
30
30
|
export { useFilter as useFilter_unstable } from '../../src/sdk/search/useFilter'
|
|
31
31
|
export { useDelayedFacets as useDelayedFacets_unstable } from '../../src/sdk/search/useDelayedFacets'
|
|
32
32
|
export { useDelayedPagination as useDelayedPagination_unstable } from '../../src/sdk/search/useDelayedPagination'
|
|
33
|
+
|
|
33
34
|
export { getShippingSimulation as getShippingSimulation_unstable } from '../../src/sdk/shipping'
|
|
34
35
|
export { useShippingSimulation as useShippingSimulation_unstable } from '../../src/sdk/shipping/useShippingSimulation'
|
|
35
36
|
|
|
36
37
|
// Components
|
|
37
38
|
export { Image as Image_unstable } from '../../src/components/ui/Image'
|
|
38
39
|
export { ProfileChallenge as ProfileChallenge_unstable } from '../../src/components/auth/ProfileChallenge'
|
|
40
|
+
|
|
41
|
+
// Server GraphQL
|
|
42
|
+
export { execute as execute_unstable } from '../../src/server'
|
package/src/pages/[...slug].tsx
CHANGED
|
@@ -23,6 +23,7 @@ import ProductListingPage, {
|
|
|
23
23
|
} from 'src/components/templates/ProductListingPage'
|
|
24
24
|
import { PageContentType } from 'src/server/cms'
|
|
25
25
|
import { getPLP, PLPContentType } from 'src/server/cms/plp'
|
|
26
|
+
import { getDynamicContent } from 'src/utils/dynamicContent'
|
|
26
27
|
|
|
27
28
|
type BaseProps = {
|
|
28
29
|
globalSections: GlobalSectionsData
|
|
@@ -39,6 +40,7 @@ type Props = BaseProps &
|
|
|
39
40
|
type: 'page'
|
|
40
41
|
slug: string
|
|
41
42
|
page: PageContentType
|
|
43
|
+
serverData?: unknown
|
|
42
44
|
}
|
|
43
45
|
)
|
|
44
46
|
|
|
@@ -91,12 +93,15 @@ export const getStaticProps: GetStaticProps<
|
|
|
91
93
|
]
|
|
92
94
|
|
|
93
95
|
if (await landingPagePromise) {
|
|
96
|
+
const serverData = await getDynamicContent({ pageType: slug })
|
|
97
|
+
|
|
94
98
|
return {
|
|
95
99
|
props: {
|
|
96
100
|
page: await landingPagePromise,
|
|
97
101
|
globalSections: await globalSectionsPromise,
|
|
98
102
|
type: 'page',
|
|
99
103
|
slug,
|
|
104
|
+
serverData,
|
|
100
105
|
},
|
|
101
106
|
}
|
|
102
107
|
}
|
package/src/pages/index.tsx
CHANGED
|
@@ -19,6 +19,8 @@ import GlobalSections, {
|
|
|
19
19
|
GlobalSectionsData,
|
|
20
20
|
getGlobalSectionsData,
|
|
21
21
|
} from 'src/components/cms/GlobalSections'
|
|
22
|
+
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
23
|
+
import { getDynamicContent } from 'src/utils/dynamicContent'
|
|
22
24
|
import storeConfig from '../../faststore.config'
|
|
23
25
|
|
|
24
26
|
/* A list of components that can be used in the CMS. */
|
|
@@ -35,9 +37,18 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
|
35
37
|
type Props = {
|
|
36
38
|
page: PageContentType
|
|
37
39
|
globalSections: GlobalSectionsData
|
|
40
|
+
serverData?: unknown
|
|
38
41
|
}
|
|
39
42
|
|
|
40
|
-
function Page({
|
|
43
|
+
function Page({
|
|
44
|
+
page: { sections, settings },
|
|
45
|
+
globalSections,
|
|
46
|
+
serverData,
|
|
47
|
+
}: Props) {
|
|
48
|
+
const context = {
|
|
49
|
+
data: serverData,
|
|
50
|
+
}
|
|
51
|
+
|
|
41
52
|
return (
|
|
42
53
|
<GlobalSections {...globalSections}>
|
|
43
54
|
{/* SEO */}
|
|
@@ -75,7 +86,9 @@ function Page({ page: { sections, settings }, globalSections }: Props) {
|
|
|
75
86
|
If needed, wrap your component in a <Section /> component
|
|
76
87
|
(not the HTML tag) before rendering it here.
|
|
77
88
|
*/}
|
|
78
|
-
<
|
|
89
|
+
<PageProvider context={context}>
|
|
90
|
+
<RenderSections sections={sections} components={COMPONENTS} />
|
|
91
|
+
</PageProvider>
|
|
79
92
|
</GlobalSections>
|
|
80
93
|
)
|
|
81
94
|
}
|
|
@@ -85,6 +98,7 @@ export const getStaticProps: GetStaticProps<
|
|
|
85
98
|
Record<string, string>,
|
|
86
99
|
Locator
|
|
87
100
|
> = async ({ previewData }) => {
|
|
101
|
+
const serverData = await getDynamicContent({ pageType: 'home' })
|
|
88
102
|
const globalSections = await getGlobalSectionsData(previewData)
|
|
89
103
|
|
|
90
104
|
if (storeConfig.cms.data) {
|
|
@@ -99,7 +113,7 @@ export const getStaticProps: GetStaticProps<
|
|
|
99
113
|
})
|
|
100
114
|
|
|
101
115
|
return {
|
|
102
|
-
props: { page: pageData, globalSections },
|
|
116
|
+
props: { page: pageData, globalSections, serverData },
|
|
103
117
|
}
|
|
104
118
|
}
|
|
105
119
|
}
|
|
@@ -110,7 +124,7 @@ export const getStaticProps: GetStaticProps<
|
|
|
110
124
|
})
|
|
111
125
|
|
|
112
126
|
return {
|
|
113
|
-
props: { page, globalSections },
|
|
127
|
+
props: { page, globalSections, serverData },
|
|
114
128
|
}
|
|
115
129
|
}
|
|
116
130
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TypedDocumentString } from '@generated/graphql'
|
|
2
|
-
|
|
3
1
|
export type RequestOptions = Omit<BaseRequestOptions, 'operation' | 'variables'>
|
|
4
|
-
export type Operation =
|
|
2
|
+
export type Operation = {
|
|
3
|
+
__meta__?: Record<string, any>
|
|
4
|
+
}
|
|
5
5
|
|
|
6
6
|
export interface GraphQLResponse<D = any> {
|
|
7
7
|
data: D
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ClientManyProductsQueryQuery,
|
|
2
3
|
ClientProductGalleryQueryQuery,
|
|
3
4
|
ClientProductQueryQuery,
|
|
4
|
-
ClientManyProductsQueryQuery,
|
|
5
5
|
ServerCollectionPageQueryQuery,
|
|
6
6
|
ServerProductQueryQuery,
|
|
7
7
|
} from '@generated/graphql'
|
|
@@ -28,6 +28,20 @@ export interface SearchPageContext {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
export interface DynamicContent<T> {
|
|
32
|
+
data?: T
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface PageProviderContextValue {
|
|
36
|
+
context?: PageProviderContext
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
type PageProviderContext =
|
|
40
|
+
| PDPContext
|
|
41
|
+
| PLPContext
|
|
42
|
+
| SearchPageContext
|
|
43
|
+
| DynamicContent<unknown>
|
|
44
|
+
|
|
31
45
|
export const isPDP = (x: any): x is PDPContext =>
|
|
32
46
|
x?.data?.product?.sku != undefined && x?.data?.product?.sku != null
|
|
33
47
|
|
|
@@ -41,10 +55,6 @@ export const isSearchPage = (x: any): x is SearchPageContext =>
|
|
|
41
55
|
x?.data?.title != undefined ||
|
|
42
56
|
x?.data?.searchTerm != undefined
|
|
43
57
|
|
|
44
|
-
export interface PageProviderContextValue {
|
|
45
|
-
context?: PDPContext | PLPContext | SearchPageContext
|
|
46
|
-
}
|
|
47
|
-
|
|
48
58
|
const PageContext = createContext<PageProviderContextValue | null>(null)
|
|
49
59
|
|
|
50
60
|
function PageProvider({
|
|
@@ -61,9 +71,7 @@ function PageProvider({
|
|
|
61
71
|
return <PageContext.Provider value={value}>{children}</PageContext.Provider>
|
|
62
72
|
}
|
|
63
73
|
|
|
64
|
-
export function usePage<
|
|
65
|
-
T extends PLPContext | SearchPageContext | PDPContext
|
|
66
|
-
>(): T {
|
|
74
|
+
export function usePage<T extends PageProviderContext>(): T {
|
|
67
75
|
const { context } = useContext(PageContext)
|
|
68
76
|
|
|
69
77
|
if (context == null) {
|
|
@@ -79,4 +87,7 @@ export const usePLP = () => usePage<PLPContext>()
|
|
|
79
87
|
|
|
80
88
|
export const useSearchPage = () => usePage<SearchPageContext>()
|
|
81
89
|
|
|
90
|
+
export const useDynamicContent = <T extends unknown>() =>
|
|
91
|
+
usePage<DynamicContent<T>>()
|
|
92
|
+
|
|
82
93
|
export default PageProvider
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import dynamicContent from 'src/customizations/src/dynamicContent'
|
|
2
|
+
|
|
3
|
+
export async function getDynamicContent({ pageType }: { pageType: string }) {
|
|
4
|
+
try {
|
|
5
|
+
// Checking if the fetch function corresponding to the type of page exists (home or LP slug)
|
|
6
|
+
const fetchFunction = dynamicContent[pageType]
|
|
7
|
+
|
|
8
|
+
if (!fetchFunction) {
|
|
9
|
+
console.warn(
|
|
10
|
+
`Warning: Dynamic Content not found for the page: ${pageType}. Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview for mapping the page and the corresponding data-fetching function.`
|
|
11
|
+
)
|
|
12
|
+
return null
|
|
13
|
+
}
|
|
14
|
+
// Calling the fetch function corresponding to the page
|
|
15
|
+
const { data, errors = [] } = await fetchFunction()
|
|
16
|
+
|
|
17
|
+
if (errors.length > 0) {
|
|
18
|
+
console.error(...errors)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return data
|
|
22
|
+
} catch (error) {
|
|
23
|
+
console.error('Error while fetching Dynamic Content:', error)
|
|
24
|
+
console.warn(
|
|
25
|
+
`Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview for mapping the page and the corresponding data-fetching function.`
|
|
26
|
+
)
|
|
27
|
+
return null
|
|
28
|
+
}
|
|
29
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"allowJs": true,
|
|
14
14
|
"paths": {
|
|
15
15
|
"src/*": ["src/*"],
|
|
16
|
+
"app/*": ["app/*"],
|
|
16
17
|
"@generated/*": ["@generated/*"],
|
|
17
18
|
"@faststore/core": ["index.ts"],
|
|
18
19
|
"@faststore/core/api": ["api/index.ts"],
|
|
@@ -25,8 +26,22 @@
|
|
|
25
26
|
"target": "es5",
|
|
26
27
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
27
28
|
"skipLibCheck": true,
|
|
28
|
-
"esModuleInterop": true
|
|
29
|
+
"esModuleInterop": true,
|
|
30
|
+
"plugins": [
|
|
31
|
+
{
|
|
32
|
+
"name": "next"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"strictNullChecks": false
|
|
29
36
|
},
|
|
30
|
-
"include": [
|
|
37
|
+
"include": [
|
|
38
|
+
"*.d.ts",
|
|
39
|
+
"src/**/*.ts",
|
|
40
|
+
"src/**/*.tsx",
|
|
41
|
+
"@generated/**/*.ts",
|
|
42
|
+
"app/**/*.ts",
|
|
43
|
+
"app/**/*.tsx",
|
|
44
|
+
".next/types/**/*.ts"
|
|
45
|
+
],
|
|
31
46
|
"exclude": ["node_modules", "public"]
|
|
32
47
|
}
|