@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.
Files changed (237) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +25 -0
  3. package/.next/app-path-routes-manifest.json +1 -0
  4. package/.next/build-manifest.json +95 -90
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/config.json +3 -3
  7. package/.next/cache/eslint/.cache_1gneedd +1 -1
  8. package/.next/cache/webpack/client-production/0.pack +0 -0
  9. package/.next/cache/webpack/client-production/index.pack +0 -0
  10. package/.next/cache/webpack/server-production/0.pack +0 -0
  11. package/.next/cache/webpack/server-production/index.pack +0 -0
  12. package/.next/next-minimal-server.js.nft.json +1 -1
  13. package/.next/next-server.js.nft.json +1 -1
  14. package/.next/prerender-manifest.js +1 -1
  15. package/.next/prerender-manifest.json +1 -1
  16. package/.next/react-loadable-manifest.json +17 -17
  17. package/.next/required-server-files.json +1 -1
  18. package/.next/routes-manifest.json +1 -1
  19. package/.next/server/app/_not-found.html +1 -0
  20. package/.next/server/app/_not-found.js +1 -0
  21. package/.next/server/app/_not-found.js.nft.json +1 -0
  22. package/.next/server/app/_not-found.meta +1 -0
  23. package/.next/server/app/_not-found.rsc +6 -0
  24. package/.next/server/app/_not-found_client-reference-manifest.js +1 -0
  25. package/.next/server/app/fs-next-update/page.js +1 -0
  26. package/.next/server/app/fs-next-update/page.js.nft.json +1 -0
  27. package/.next/server/app/fs-next-update/page_client-reference-manifest.js +1 -0
  28. package/.next/server/app/fs-next-update.html +1 -0
  29. package/.next/server/app/fs-next-update.meta +1 -0
  30. package/.next/server/app/fs-next-update.rsc +6 -0
  31. package/.next/server/app-paths-manifest.json +4 -0
  32. package/.next/server/chunks/1408.js +1 -0
  33. package/.next/server/chunks/1488.js +9 -0
  34. package/.next/server/chunks/2053.js +8 -0
  35. package/.next/server/chunks/3057.js +1 -0
  36. package/.next/server/chunks/3068.js +1 -0
  37. package/.next/server/chunks/3131.js +1 -0
  38. package/.next/server/chunks/3404.js +1 -0
  39. package/.next/server/chunks/3607.js +1 -0
  40. package/.next/server/chunks/368.js +1 -0
  41. package/.next/server/chunks/3779.js +1 -0
  42. package/.next/server/chunks/3992.js +1 -0
  43. package/.next/server/chunks/4222.js +1 -0
  44. package/.next/server/chunks/{247.js → 466.js} +1 -1
  45. package/.next/server/chunks/513.js +1 -0
  46. package/.next/server/chunks/522.js +1 -0
  47. package/.next/server/chunks/5640.js +6 -0
  48. package/.next/server/chunks/5686.js +1 -0
  49. package/.next/server/chunks/6090.js +1 -0
  50. package/.next/server/chunks/6414.js +1 -0
  51. package/.next/server/chunks/647.js +296 -0
  52. package/.next/server/chunks/6535.js +1 -0
  53. package/.next/server/chunks/6693.js +1 -0
  54. package/.next/server/chunks/{859.js → 6859.js} +2 -2
  55. package/.next/server/chunks/692.js +1 -0
  56. package/.next/server/chunks/7143.js +1 -0
  57. package/.next/server/chunks/7982.js +1 -0
  58. package/.next/server/chunks/8352.js +1 -0
  59. package/.next/server/chunks/8609.js +1 -0
  60. package/.next/server/chunks/8653.js +1 -0
  61. package/.next/server/chunks/8811.js +1 -0
  62. package/.next/server/chunks/9134.js +1 -0
  63. package/.next/server/chunks/9239.js +1 -0
  64. package/.next/server/chunks/9740.js +1 -0
  65. package/.next/server/middleware-build-manifest.js +1 -1
  66. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  67. package/.next/server/pages/404.html +1 -0
  68. package/.next/server/pages/404.js +1 -1
  69. package/.next/server/pages/404.js.nft.json +1 -1
  70. package/.next/server/pages/500.js +1 -1
  71. package/.next/server/pages/500.js.nft.json +1 -1
  72. package/.next/server/pages/[...slug].js +1 -1
  73. package/.next/server/pages/[...slug].js.nft.json +1 -1
  74. package/.next/server/pages/[slug]/p.js +1 -1
  75. package/.next/server/pages/[slug]/p.js.nft.json +1 -1
  76. package/.next/server/pages/_app.js +1 -1
  77. package/.next/server/pages/_app.js.nft.json +1 -1
  78. package/.next/server/pages/_document.js +1 -1
  79. package/.next/server/pages/_document.js.nft.json +1 -1
  80. package/.next/server/pages/_error.js +1 -1
  81. package/.next/server/pages/_error.js.nft.json +1 -1
  82. package/.next/server/pages/account.js +1 -1
  83. package/.next/server/pages/account.js.nft.json +1 -1
  84. package/.next/server/pages/api/graphql.js +1 -1
  85. package/.next/server/pages/api/graphql.js.nft.json +1 -1
  86. package/.next/server/pages/api/health/live.js +1 -1
  87. package/.next/server/pages/api/health/live.js.nft.json +1 -1
  88. package/.next/server/pages/api/health/ready.js +1 -1
  89. package/.next/server/pages/api/health/ready.js.nft.json +1 -1
  90. package/.next/server/pages/api/preview.js +1 -1
  91. package/.next/server/pages/api/preview.js.nft.json +1 -1
  92. package/.next/server/pages/checkout.js +1 -1
  93. package/.next/server/pages/checkout.js.nft.json +1 -1
  94. package/.next/server/pages/en-US/404.html +2 -2
  95. package/.next/server/pages/en-US/404.json +1 -1
  96. package/.next/server/pages/en-US/500.html +2 -2
  97. package/.next/server/pages/en-US/500.json +1 -1
  98. package/.next/server/pages/en-US/account.html +2 -2
  99. package/.next/server/pages/en-US/account.json +1 -1
  100. package/.next/server/pages/en-US/checkout.html +2 -2
  101. package/.next/server/pages/en-US/checkout.json +1 -1
  102. package/.next/server/pages/en-US/login.html +2 -2
  103. package/.next/server/pages/en-US/login.json +1 -1
  104. package/.next/server/pages/en-US/s.html +2 -2
  105. package/.next/server/pages/en-US/s.json +1 -1
  106. package/.next/server/pages/en-US.html +3 -3
  107. package/.next/server/pages/en-US.json +1 -1
  108. package/.next/server/pages/index.js +1 -1
  109. package/.next/server/pages/index.js.nft.json +1 -1
  110. package/.next/server/pages/login.js +1 -1
  111. package/.next/server/pages/login.js.nft.json +1 -1
  112. package/.next/server/pages/s.js +1 -1
  113. package/.next/server/pages/s.js.nft.json +1 -1
  114. package/.next/server/pages-manifest.json +1 -1
  115. package/.next/server/server-reference-manifest.js +1 -0
  116. package/.next/server/server-reference-manifest.json +1 -0
  117. package/.next/server/webpack-api-runtime.js +1 -1
  118. package/.next/server/webpack-runtime.js +1 -1
  119. package/.next/static/S-n12r3ICzmxSZIG0sqmF/_buildManifest.js +1 -0
  120. package/.next/static/chunks/{484.b82b73b1d8c37e02.js → 119.e218828b0132b8b2.js} +1 -1
  121. package/.next/static/chunks/{857.d2299cfe995af21d.js → 319.8d30e9ffafb22a7b.js} +1 -1
  122. package/.next/static/chunks/346-94f30a4bb6dafd89.js +1 -0
  123. package/.next/static/chunks/439.db1fe827fd6839bb.js +1 -0
  124. package/.next/static/chunks/461.74f76bc649cb0446.js +1 -0
  125. package/.next/static/chunks/503-e6db8cab6eb3bf60.js +25 -0
  126. package/.next/static/chunks/{540.6c62d2536d42a1e0.js → 515.e66ca5426460f9b5.js} +1 -1
  127. package/.next/static/chunks/551-448d32b3b6393825.js +1 -0
  128. package/.next/static/chunks/{575-853fb8b1ba4ce8c4.js → 575-cdcaf62ab25bbfca.js} +1 -1
  129. package/.next/static/chunks/{202.c7d8a71173edecfb.js → 576.bd044c1cd3af7bbc.js} +1 -1
  130. package/.next/static/chunks/{217.01bc0ad07edd6f1b.js → 641.e663ec37da787600.js} +1 -1
  131. package/.next/static/chunks/{758.3ca049c36b5ddd7d.js → 661.df439acd66dbae34.js} +1 -1
  132. package/.next/static/chunks/680.355e4fc032bd559f.js +1 -0
  133. package/.next/static/chunks/913-4af007b10d50c50f.js +1 -0
  134. package/.next/static/chunks/app/_not-found-3649108cdca52b21.js +1 -0
  135. package/.next/static/chunks/app/fs-next-update/page-9a2debb5dd829908.js +1 -0
  136. package/.next/static/chunks/app/layout-a5723c7cfcca3bdf.js +1 -0
  137. package/.next/static/chunks/fd9d1056-e4950b334bc218cf.js +9 -0
  138. package/.next/static/chunks/main-5e45f8a409e3ce1c.js +1 -0
  139. package/.next/static/chunks/main-app-7b31a9960d0fa675.js +1 -0
  140. package/.next/static/chunks/pages/{404-1334d11ab8467b3d.js → 404-2e174f10fe6712cd.js} +1 -1
  141. package/.next/static/chunks/pages/{500-449c5bd51f98423f.js → 500-52c42b827ed9693b.js} +1 -1
  142. package/.next/static/chunks/pages/[...slug]-91cd643a14638b90.js +1 -0
  143. package/.next/static/chunks/pages/[slug]/p-436d394ddc268573.js +1 -0
  144. package/.next/static/chunks/pages/{_app-ec0d2e833bd9cea0.js → _app-88eac41033b6a613.js} +2 -2
  145. package/.next/static/chunks/pages/{_error-fbf331a03642b495.js → _error-5a3e12f364a20272.js} +1 -1
  146. package/.next/static/chunks/pages/{account-dbc5c028225cd1ac.js → account-9e4bcc3ab5b88353.js} +1 -1
  147. package/.next/static/chunks/pages/{checkout-29ae2c37eaf172e1.js → checkout-7c95e252d2cbfd75.js} +1 -1
  148. package/.next/static/chunks/pages/index-d3008f576cb2fc9d.js +1 -0
  149. package/.next/static/chunks/pages/{login-c4d2c856008df5ac.js → login-7a53f93622c6fded.js} +1 -1
  150. package/.next/static/chunks/pages/s-4d4c0bb22d489fa2.js +1 -0
  151. package/.next/static/chunks/webpack-31f87692f808967d.js +1 -0
  152. package/.next/static/css/173705e880fb4eaf.css +1 -0
  153. package/.next/static/css/17e37eb991935d47.css +1 -0
  154. package/.next/static/css/185f3332f3d0db64.css +1 -0
  155. package/.next/static/css/25261a033e496803.css +1 -0
  156. package/.next/static/css/36f9392d58a1a958.css +1 -0
  157. package/.next/static/css/4ababb851a0d481b.css +1 -0
  158. package/.next/static/css/6ce7302d311d7d68.css +1 -0
  159. package/.next/static/css/d6562b2ce182bbef.css +1 -0
  160. package/.next/static/css/ec44b650be144ada.css +1 -0
  161. package/.next/static/css/ec840ce35f0cf5e0.css +1 -0
  162. package/.next/trace +113 -91
  163. package/.next/types/app/fs-next-update/page.ts +71 -0
  164. package/.next/types/package.json +1 -0
  165. package/.turbo/turbo-build.log +52 -28
  166. package/.turbo/turbo-test.log +9 -9
  167. package/api/index.ts +2 -0
  168. package/app/fs-next-update/page.tsx +3 -0
  169. package/app/layout.tsx +11 -0
  170. package/index.ts +1 -9
  171. package/next-env.d.ts +1 -0
  172. package/next.config.js +11 -0
  173. package/package.json +9 -9
  174. package/src/components/cart/CartItem/CartItem.tsx +1 -1
  175. package/src/components/templates/LandingPage/LandingPage.tsx +10 -1
  176. package/src/customizations/src/dynamicContent/index.ts +16 -0
  177. package/src/experimental/index.ts +4 -0
  178. package/src/pages/[...slug].tsx +5 -0
  179. package/src/pages/index.tsx +18 -4
  180. package/src/sdk/graphql/request.ts +3 -3
  181. package/src/sdk/overrides/PageProvider.tsx +19 -8
  182. package/src/utils/dynamicContent.ts +29 -0
  183. package/tsconfig.json +17 -2
  184. package/.next/server/chunks/119.js +0 -1
  185. package/.next/server/chunks/12.js +0 -1
  186. package/.next/server/chunks/187.js +0 -1
  187. package/.next/server/chunks/202.js +0 -1
  188. package/.next/server/chunks/24.js +0 -1
  189. package/.next/server/chunks/242.js +0 -1
  190. package/.next/server/chunks/344.js +0 -1
  191. package/.next/server/chunks/404.js +0 -1
  192. package/.next/server/chunks/414.js +0 -1
  193. package/.next/server/chunks/484.js +0 -1
  194. package/.next/server/chunks/493.js +0 -1
  195. package/.next/server/chunks/498.js +0 -1
  196. package/.next/server/chunks/540.js +0 -1
  197. package/.next/server/chunks/57.js +0 -1
  198. package/.next/server/chunks/624.js +0 -1
  199. package/.next/server/chunks/640.js +0 -6
  200. package/.next/server/chunks/646.js +0 -296
  201. package/.next/server/chunks/659.js +0 -9
  202. package/.next/server/chunks/679.js +0 -1
  203. package/.next/server/chunks/693.js +0 -1
  204. package/.next/server/chunks/694.js +0 -1
  205. package/.next/server/chunks/779.js +0 -1
  206. package/.next/server/chunks/82.js +0 -8
  207. package/.next/server/chunks/857.js +0 -1
  208. package/.next/server/chunks/881.js +0 -1
  209. package/.next/server/chunks/917.js +0 -1
  210. package/.next/server/chunks/936.js +0 -1
  211. package/.next/server/chunks/96.js +0 -1
  212. package/.next/server/chunks/997.js +0 -1
  213. package/.next/static/J-JEiruC8i9aZksBNyDFc/_buildManifest.js +0 -1
  214. package/.next/static/chunks/104-d968d92fa4902045.js +0 -1
  215. package/.next/static/chunks/161-b39fe2f79ff7bc85.js +0 -1
  216. package/.next/static/chunks/247.6eb0f179401e9e2f.js +0 -1
  217. package/.next/static/chunks/624.455cdc0925956ae5.js +0 -1
  218. package/.next/static/chunks/629-751d31ac7c84f87d.js +0 -1
  219. package/.next/static/chunks/65.da22595d53beae76.js +0 -1
  220. package/.next/static/chunks/main-6f63f6746cc029db.js +0 -1
  221. package/.next/static/chunks/pages/[...slug]-bcaf61b01157d8cb.js +0 -1
  222. package/.next/static/chunks/pages/[slug]/p-ad60103a8ec2abb7.js +0 -1
  223. package/.next/static/chunks/pages/index-cd109119d65df8e3.js +0 -1
  224. package/.next/static/chunks/pages/s-26e475975386c51a.js +0 -1
  225. package/.next/static/chunks/webpack-d993fa4ea18504cc.js +0 -1
  226. package/.next/static/css/0d45c82d8887a269.css +0 -1
  227. package/.next/static/css/211c7542af66d8b4.css +0 -1
  228. package/.next/static/css/2980acad3f8e1028.css +0 -1
  229. package/.next/static/css/4c4d90eb8cb1d2b7.css +0 -1
  230. package/.next/static/css/96e3fddf695d6aa9.css +0 -1
  231. package/.next/static/css/b9d9ba1b04f3160d.css +0 -1
  232. package/.next/static/css/cff9aafa16fccc9c.css +0 -1
  233. package/.next/static/css/d586715f4f707df4.css +0 -1
  234. package/.next/static/css/d8b918e01478a2ed.css +0 -1
  235. package/.next/static/css/e32410b31c666cb2.css +0 -1
  236. /package/.next/static/{J-JEiruC8i9aZksBNyDFc → S-n12r3ICzmxSZIG0sqmF}/_ssgManifest.js +0 -0
  237. /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"}
@@ -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.36 kB 143 kB
45
- ├ └ css/d586715f4f707df4.css 6.56 kB
46
- ├ /_app 0 B 93.4 kB
47
- ├ ● /[...slug] 4.47 kB 156 kB
48
- ├ └ css/4c4d90eb8cb1d2b7.css 7 kB
49
- ├ ● /[slug]/p 11.4 kB 151 kB
50
- ├ └ css/96e3fddf695d6aa9.css 11.3 kB
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 676 B 126 kB
54
- ├ λ /api/graphql 0 B 93.4 kB
55
- ├ λ /api/health/live 0 B 93.4 kB
56
- ├ λ /api/health/ready 0 B 93.4 kB
57
- ├ λ /api/preview 0 B 93.4 kB
58
- ├ ● /checkout 662 B 126 kB
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.66 kB 141 kB
84
+ └ ● /s 4.97 kB 141 kB
61
85
  + First Load JS shared by all 96.5 kB
62
- ├ chunks/framework-8e279965036b6169.js 45.4 kB
63
- ├ chunks/main-6f63f6746cc029db.js 33.1 kB
64
- ├ chunks/pages/_app-ec0d2e833bd9cea0.js 12.6 kB
65
- ├ chunks/webpack-d993fa4ea18504cc.js 2.44 kB
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)
@@ -1,23 +1,23 @@
1
1
  $ jest
2
- PASS test/server/index.test.ts (26.712 s)
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 ms)
7
- ✓ should return a valid GraphQL schema contain all expected queries (2 ms)
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 (9 ms)
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 (46 ms)
14
+ ✓ should return a valid merged GraphQL schema (42 ms)
15
15
  Envelop
16
- ✓ should exist with its plugins (50 ms)
17
- ✓ should handle options and execute (418 ms)
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.891 s
22
+ Time: 26.762 s
23
23
  Ran all test suites.
package/api/index.ts CHANGED
@@ -13,3 +13,5 @@ export type {
13
13
  StoreProductRoot,
14
14
  StoreOrganizationRoot,
15
15
  } from '@faststore/api'
16
+
17
+ export * from '../@generated/graphql'
@@ -0,0 +1,3 @@
1
+ export default function Page() {
2
+ return <div>placeholder</div>
3
+ }
package/app/layout.tsx ADDED
@@ -0,0 +1,11 @@
1
+ export default function RootLayout({
2
+ children,
3
+ }: {
4
+ children: React.ReactNode
5
+ }) {
6
+ return (
7
+ <html lang="en">
8
+ <body>{children}</body>
9
+ </html>
10
+ )
11
+ }
package/index.ts CHANGED
@@ -1,12 +1,4 @@
1
- export {
2
- usePage,
3
- usePDP,
4
- usePLP,
5
- useSearchPage,
6
- isPDP,
7
- isPLP,
8
- isSearchPage,
9
- } from './src/sdk/overrides/PageProvider'
1
+ export * from './src/sdk/overrides/PageProvider'
10
2
 
11
3
  export type {
12
4
  PDPContext,
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.46",
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.46",
43
- "@faststore/components": "^3.0.46",
44
- "@faststore/graphql-utils": "^3.0.43",
45
- "@faststore/sdk": "^3.0.43",
46
- "@faststore/ui": "^3.0.46",
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.43",
86
- "@faststore/eslint-config": "^3.0.43",
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": "5fdfe48f8a4115b3ff83bd70272d83857ce74c4f"
127
+ "gitHead": "b9f3d0a140309be1a31e17a15890403bc6f5ea36"
128
128
  }
@@ -62,7 +62,7 @@ function useCartItemEvent() {
62
62
 
63
63
  interface Props {
64
64
  item: ICartItem
65
- useUnitMultiplier: boolean
65
+ useUnitMultiplier?: boolean
66
66
  }
67
67
 
68
68
  function CartItem({ item, useUnitMultiplier = false }: Props) {
@@ -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
- <RenderSections sections={sections} components={COMPONENTS} />
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'
@@ -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
  }
@@ -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({ page: { sections, settings }, globalSections }: Props) {
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
- <RenderSections sections={sections} components={COMPONENTS} />
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 = Pick<TypedDocumentString<any, any>, '__meta__'>
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": ["*.d.ts", "src/**/*.ts", "src/**/*.tsx", "@generated/**/*.ts"],
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
  }