@payloadcms/next 3.68.0-internal-debug.dafc24d → 3.68.0-internal-debug.591ab42

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 (386) hide show
  1. package/dist/auth/login.js +52 -58
  2. package/dist/auth/login.js.map +1 -1
  3. package/dist/auth/logout.js +39 -44
  4. package/dist/auth/logout.js.map +1 -1
  5. package/dist/auth/refresh.js +45 -47
  6. package/dist/auth/refresh.js.map +1 -1
  7. package/dist/config.js +1 -0
  8. package/dist/config.js.map +1 -1
  9. package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js +9 -15
  10. package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js.map +1 -1
  11. package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js +40 -71
  12. package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -1
  13. package/dist/elements/DocumentHeader/Tabs/Tab/index.js +65 -59
  14. package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -1
  15. package/dist/elements/DocumentHeader/Tabs/index.js +80 -70
  16. package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -1
  17. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js +16 -23
  18. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -1
  19. package/dist/elements/DocumentHeader/Tabs/tabs/index.js +61 -69
  20. package/dist/elements/DocumentHeader/Tabs/tabs/index.js.map +1 -1
  21. package/dist/elements/DocumentHeader/index.js +48 -28
  22. package/dist/elements/DocumentHeader/index.js.map +1 -1
  23. package/dist/elements/FormHeader/index.js +30 -16
  24. package/dist/elements/FormHeader/index.js.map +1 -1
  25. package/dist/elements/Logo/index.js +19 -34
  26. package/dist/elements/Logo/index.js.map +1 -1
  27. package/dist/elements/Nav/NavHamburger/index.js +23 -44
  28. package/dist/elements/Nav/NavHamburger/index.js.map +1 -1
  29. package/dist/elements/Nav/NavWrapper/index.js +28 -54
  30. package/dist/elements/Nav/NavWrapper/index.js.map +1 -1
  31. package/dist/elements/Nav/SettingsMenuButton/index.js +33 -39
  32. package/dist/elements/Nav/SettingsMenuButton/index.js.map +1 -1
  33. package/dist/elements/Nav/getNavPrefs.js +27 -22
  34. package/dist/elements/Nav/getNavPrefs.js.map +1 -1
  35. package/dist/elements/Nav/index.client.js +97 -118
  36. package/dist/elements/Nav/index.client.js.map +1 -1
  37. package/dist/elements/Nav/index.js +148 -127
  38. package/dist/elements/Nav/index.js.map +1 -1
  39. package/dist/esbuildEntry.d.ts +5 -0
  40. package/dist/esbuildEntry.d.ts.map +1 -0
  41. package/dist/esbuildEntry.js +6 -0
  42. package/dist/esbuildEntry.js.map +1 -0
  43. package/dist/exports/auth.js +1 -0
  44. package/dist/exports/auth.js.map +1 -1
  45. package/dist/exports/client.js +1 -1
  46. package/dist/exports/client.js.map +1 -1
  47. package/dist/exports/layouts.js +1 -0
  48. package/dist/exports/layouts.js.map +1 -1
  49. package/dist/exports/routes.js +1 -0
  50. package/dist/exports/routes.js.map +1 -1
  51. package/dist/exports/rsc.js +1 -0
  52. package/dist/exports/rsc.js.map +1 -1
  53. package/dist/exports/templates.js +1 -0
  54. package/dist/exports/templates.js.map +1 -1
  55. package/dist/exports/utilities.js +7 -12
  56. package/dist/exports/utilities.js.map +1 -1
  57. package/dist/exports/views.js +1 -0
  58. package/dist/exports/views.js.map +1 -1
  59. package/dist/index.js +1 -0
  60. package/dist/index.js.map +1 -1
  61. package/dist/layouts/Root/NestProviders.js +21 -20
  62. package/dist/layouts/Root/NestProviders.js.map +1 -1
  63. package/dist/layouts/Root/checkDependencies.js +49 -41
  64. package/dist/layouts/Root/checkDependencies.js.map +1 -1
  65. package/dist/layouts/Root/index.js +128 -103
  66. package/dist/layouts/Root/index.js.map +1 -1
  67. package/dist/routes/graphql/handler.js +114 -122
  68. package/dist/routes/graphql/handler.js.map +1 -1
  69. package/dist/routes/graphql/index.js +1 -0
  70. package/dist/routes/graphql/index.js.map +1 -1
  71. package/dist/routes/graphql/playground.js +24 -23
  72. package/dist/routes/graphql/playground.js.map +1 -1
  73. package/dist/routes/index.js +1 -0
  74. package/dist/routes/index.js.map +1 -1
  75. package/dist/routes/rest/index.js +20 -19
  76. package/dist/routes/rest/index.js.map +1 -1
  77. package/dist/routes/rest/og/image.js +103 -79
  78. package/dist/routes/rest/og/image.js.map +1 -1
  79. package/dist/routes/rest/og/index.js +59 -54
  80. package/dist/routes/rest/og/index.js.map +1 -1
  81. package/dist/templates/Default/NavHamburger/index.js +12 -20
  82. package/dist/templates/Default/NavHamburger/index.js.map +1 -1
  83. package/dist/templates/Default/Wrapper/index.js +20 -44
  84. package/dist/templates/Default/Wrapper/index.js.map +1 -1
  85. package/dist/templates/Default/index.js +183 -133
  86. package/dist/templates/Default/index.js.map +1 -1
  87. package/dist/templates/Minimal/index.js +26 -17
  88. package/dist/templates/Minimal/index.js.map +1 -1
  89. package/dist/utilities/getExistingAuthToken.js +3 -2
  90. package/dist/utilities/getExistingAuthToken.js.map +1 -1
  91. package/dist/utilities/getNextRequestI18n.js +12 -13
  92. package/dist/utilities/getNextRequestI18n.js.map +1 -1
  93. package/dist/utilities/getPayloadHMR.js +5 -5
  94. package/dist/utilities/getPayloadHMR.js.map +1 -1
  95. package/dist/utilities/getPreferences.js +27 -22
  96. package/dist/utilities/getPreferences.js.map +1 -1
  97. package/dist/utilities/getRequestLocale.js +13 -14
  98. package/dist/utilities/getRequestLocale.js.map +1 -1
  99. package/dist/utilities/getRequestTheme.js +19 -19
  100. package/dist/utilities/getRequestTheme.js.map +1 -1
  101. package/dist/utilities/getRouteWithoutAdmin.js +3 -5
  102. package/dist/utilities/getRouteWithoutAdmin.js.map +1 -1
  103. package/dist/utilities/getVisibleEntities.js +12 -23
  104. package/dist/utilities/getVisibleEntities.js.map +1 -1
  105. package/dist/utilities/handleAuthRedirect.js +22 -36
  106. package/dist/utilities/handleAuthRedirect.js.map +1 -1
  107. package/dist/utilities/handleServerFunctions.js +32 -39
  108. package/dist/utilities/handleServerFunctions.js.map +1 -1
  109. package/dist/utilities/initReq.js +78 -96
  110. package/dist/utilities/initReq.js.map +1 -1
  111. package/dist/utilities/isCustomAdminView.js +22 -26
  112. package/dist/utilities/isCustomAdminView.js.map +1 -1
  113. package/dist/utilities/isPublicAdminRoute.js +26 -20
  114. package/dist/utilities/isPublicAdminRoute.js.map +1 -1
  115. package/dist/utilities/meta.js +68 -63
  116. package/dist/utilities/meta.js.map +1 -1
  117. package/dist/utilities/selectiveCache.js +25 -26
  118. package/dist/utilities/selectiveCache.js.map +1 -1
  119. package/dist/utilities/setPayloadAuthCookie.js +19 -22
  120. package/dist/utilities/setPayloadAuthCookie.js.map +1 -1
  121. package/dist/utilities/slugify.js +24 -33
  122. package/dist/utilities/slugify.js.map +1 -1
  123. package/dist/utilities/timestamp.js +7 -6
  124. package/dist/utilities/timestamp.js.map +1 -1
  125. package/dist/views/API/LocaleSelector/index.js +17 -39
  126. package/dist/views/API/LocaleSelector/index.js.map +1 -1
  127. package/dist/views/API/RenderJSON/index.js +171 -126
  128. package/dist/views/API/RenderJSON/index.js.map +1 -1
  129. package/dist/views/API/index.client.js +287 -197
  130. package/dist/views/API/index.client.js.map +1 -1
  131. package/dist/views/API/index.js +7 -2
  132. package/dist/views/API/index.js.map +1 -1
  133. package/dist/views/API/metadata.js +18 -23
  134. package/dist/views/API/metadata.js.map +1 -1
  135. package/dist/views/Account/ResetPreferences/index.js +74 -91
  136. package/dist/views/Account/ResetPreferences/index.js.map +1 -1
  137. package/dist/views/Account/Settings/LanguageSelector.js +18 -47
  138. package/dist/views/Account/Settings/LanguageSelector.js.map +1 -1
  139. package/dist/views/Account/Settings/index.js +62 -28
  140. package/dist/views/Account/Settings/index.js.map +1 -1
  141. package/dist/views/Account/ToggleTheme/index.js +38 -55
  142. package/dist/views/Account/ToggleTheme/index.js.map +1 -1
  143. package/dist/views/Account/index.client.js +16 -32
  144. package/dist/views/Account/index.client.js.map +1 -1
  145. package/dist/views/Account/index.js +144 -155
  146. package/dist/views/Account/index.js.map +1 -1
  147. package/dist/views/Account/metadata.js +8 -12
  148. package/dist/views/Account/metadata.js.map +1 -1
  149. package/dist/views/BrowseByFolder/buildView.js +139 -158
  150. package/dist/views/BrowseByFolder/buildView.js.map +1 -1
  151. package/dist/views/BrowseByFolder/index.js +16 -17
  152. package/dist/views/BrowseByFolder/index.js.map +1 -1
  153. package/dist/views/BrowseByFolder/metadata.js +13 -15
  154. package/dist/views/BrowseByFolder/metadata.js.map +1 -1
  155. package/dist/views/CollectionFolders/buildView.js +123 -143
  156. package/dist/views/CollectionFolders/buildView.js.map +1 -1
  157. package/dist/views/CollectionFolders/index.js +16 -17
  158. package/dist/views/CollectionFolders/index.js.map +1 -1
  159. package/dist/views/CollectionFolders/metadata.js +18 -21
  160. package/dist/views/CollectionFolders/metadata.js.map +1 -1
  161. package/dist/views/CollectionFolders/renderFolderViewSlots.js +58 -61
  162. package/dist/views/CollectionFolders/renderFolderViewSlots.js.map +1 -1
  163. package/dist/views/CollectionTrash/index.js +17 -18
  164. package/dist/views/CollectionTrash/index.js.map +1 -1
  165. package/dist/views/CollectionTrash/metadata.js +18 -21
  166. package/dist/views/CollectionTrash/metadata.js.map +1 -1
  167. package/dist/views/CreateFirstUser/index.client.js +114 -101
  168. package/dist/views/CreateFirstUser/index.client.js.map +1 -1
  169. package/dist/views/CreateFirstUser/index.js +87 -81
  170. package/dist/views/CreateFirstUser/index.js.map +1 -1
  171. package/dist/views/CreateFirstUser/metadata.js +8 -12
  172. package/dist/views/CreateFirstUser/metadata.js.map +1 -1
  173. package/dist/views/Dashboard/Default/index.js +176 -152
  174. package/dist/views/Dashboard/Default/index.js.map +1 -1
  175. package/dist/views/Dashboard/index.js +97 -90
  176. package/dist/views/Dashboard/index.js.map +1 -1
  177. package/dist/views/Dashboard/metadata.js +10 -14
  178. package/dist/views/Dashboard/metadata.js.map +1 -1
  179. package/dist/views/Document/getCustomDocumentViewByKey.js +3 -2
  180. package/dist/views/Document/getCustomDocumentViewByKey.js.map +1 -1
  181. package/dist/views/Document/getCustomViewByRoute.js +27 -30
  182. package/dist/views/Document/getCustomViewByRoute.js.map +1 -1
  183. package/dist/views/Document/getDocPreferences.js +40 -41
  184. package/dist/views/Document/getDocPreferences.js.map +1 -1
  185. package/dist/views/Document/getDocumentData.js +44 -55
  186. package/dist/views/Document/getDocumentData.js.map +1 -1
  187. package/dist/views/Document/getDocumentPermissions.js +77 -80
  188. package/dist/views/Document/getDocumentPermissions.js.map +1 -1
  189. package/dist/views/Document/getDocumentView.js +313 -283
  190. package/dist/views/Document/getDocumentView.js.map +1 -1
  191. package/dist/views/Document/getIsLocked.js +66 -66
  192. package/dist/views/Document/getIsLocked.js.map +1 -1
  193. package/dist/views/Document/getMetaBySegment.js +130 -136
  194. package/dist/views/Document/getMetaBySegment.js.map +1 -1
  195. package/dist/views/Document/getVersions.js +204 -194
  196. package/dist/views/Document/getVersions.js.map +1 -1
  197. package/dist/views/Document/handleServerFunction.js +103 -128
  198. package/dist/views/Document/handleServerFunction.js.map +1 -1
  199. package/dist/views/Document/index.js +315 -354
  200. package/dist/views/Document/index.js.map +1 -1
  201. package/dist/views/Document/metadata.js +2 -1
  202. package/dist/views/Document/metadata.js.map +1 -1
  203. package/dist/views/Document/renderDocumentSlots.js +121 -132
  204. package/dist/views/Document/renderDocumentSlots.js.map +1 -1
  205. package/dist/views/Edit/index.js +10 -6
  206. package/dist/views/Edit/index.js.map +1 -1
  207. package/dist/views/Edit/metadata.js +36 -46
  208. package/dist/views/Edit/metadata.js.map +1 -1
  209. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +130 -164
  210. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
  211. package/dist/views/ForgotPassword/index.js +79 -62
  212. package/dist/views/ForgotPassword/index.js.map +1 -1
  213. package/dist/views/ForgotPassword/metadata.js +8 -12
  214. package/dist/views/ForgotPassword/metadata.js.map +1 -1
  215. package/dist/views/List/createSerializableValue.js +12 -11
  216. package/dist/views/List/createSerializableValue.js.map +1 -1
  217. package/dist/views/List/enrichDocsWithVersionStatus.js +86 -86
  218. package/dist/views/List/enrichDocsWithVersionStatus.js.map +1 -1
  219. package/dist/views/List/extractRelationshipDisplayValue.js +15 -14
  220. package/dist/views/List/extractRelationshipDisplayValue.js.map +1 -1
  221. package/dist/views/List/extractValueOrRelationshipID.js +16 -15
  222. package/dist/views/List/extractValueOrRelationshipID.js.map +1 -1
  223. package/dist/views/List/handleGroupBy.js +133 -150
  224. package/dist/views/List/handleGroupBy.js.map +1 -1
  225. package/dist/views/List/handleServerFunction.js +96 -119
  226. package/dist/views/List/handleServerFunction.js.map +1 -1
  227. package/dist/views/List/index.js +305 -324
  228. package/dist/views/List/index.js.map +1 -1
  229. package/dist/views/List/metadata.js +17 -20
  230. package/dist/views/List/metadata.js.map +1 -1
  231. package/dist/views/List/renderListViewSlots.js +82 -75
  232. package/dist/views/List/renderListViewSlots.js.map +1 -1
  233. package/dist/views/List/resolveAllFilterOptions.js +43 -45
  234. package/dist/views/List/resolveAllFilterOptions.js.map +1 -1
  235. package/dist/views/List/transformColumnsToSelect.js +9 -8
  236. package/dist/views/List/transformColumnsToSelect.js.map +1 -1
  237. package/dist/views/Login/LoginField/index.js +57 -89
  238. package/dist/views/Login/LoginField/index.js.map +1 -1
  239. package/dist/views/Login/LoginForm/index.js +104 -157
  240. package/dist/views/Login/LoginForm/index.js.map +1 -1
  241. package/dist/views/Login/index.js +82 -85
  242. package/dist/views/Login/index.js.map +1 -1
  243. package/dist/views/Login/metadata.js +8 -12
  244. package/dist/views/Login/metadata.js.map +1 -1
  245. package/dist/views/Logout/LogoutClient.js +83 -119
  246. package/dist/views/Logout/LogoutClient.js.map +1 -1
  247. package/dist/views/Logout/index.js +29 -29
  248. package/dist/views/Logout/index.js.map +1 -1
  249. package/dist/views/Logout/metadata.js +7 -11
  250. package/dist/views/Logout/metadata.js.map +1 -1
  251. package/dist/views/NotFound/index.client.js +71 -82
  252. package/dist/views/NotFound/index.client.js.map +1 -1
  253. package/dist/views/NotFound/index.js +71 -72
  254. package/dist/views/NotFound/index.js.map +1 -1
  255. package/dist/views/NotFound/metadata.js +7 -9
  256. package/dist/views/NotFound/metadata.js.map +1 -1
  257. package/dist/views/ResetPassword/ResetPasswordForm/index.js +94 -107
  258. package/dist/views/ResetPassword/ResetPasswordForm/index.js.map +1 -1
  259. package/dist/views/ResetPassword/index.js +93 -73
  260. package/dist/views/ResetPassword/index.js.map +1 -1
  261. package/dist/views/ResetPassword/metadata.js +8 -12
  262. package/dist/views/ResetPassword/metadata.js.map +1 -1
  263. package/dist/views/Root/attachViewActions.js +18 -23
  264. package/dist/views/Root/attachViewActions.js.map +1 -1
  265. package/dist/views/Root/generateCustomViewMetadata.js +19 -21
  266. package/dist/views/Root/generateCustomViewMetadata.js.map +1 -1
  267. package/dist/views/Root/getCustomViewByKey.js +12 -14
  268. package/dist/views/Root/getCustomViewByKey.js.map +1 -1
  269. package/dist/views/Root/getCustomViewByRoute.js +31 -42
  270. package/dist/views/Root/getCustomViewByRoute.js.map +1 -1
  271. package/dist/views/Root/getDocumentViewInfo.js +24 -23
  272. package/dist/views/Root/getDocumentViewInfo.js.map +1 -1
  273. package/dist/views/Root/getRouteData.js +333 -325
  274. package/dist/views/Root/getRouteData.js.map +1 -1
  275. package/dist/views/Root/index.js +247 -269
  276. package/dist/views/Root/index.js.map +1 -1
  277. package/dist/views/Root/isPathMatchingRoute.js +21 -26
  278. package/dist/views/Root/isPathMatchingRoute.js.map +1 -1
  279. package/dist/views/Root/metadata.js +176 -181
  280. package/dist/views/Root/metadata.js.map +1 -1
  281. package/dist/views/Unauthorized/index.js +54 -46
  282. package/dist/views/Unauthorized/index.js.map +1 -1
  283. package/dist/views/Unauthorized/metadata.js +8 -12
  284. package/dist/views/Unauthorized/metadata.js.map +1 -1
  285. package/dist/views/Verify/index.client.js +25 -43
  286. package/dist/views/Verify/index.client.js.map +1 -1
  287. package/dist/views/Verify/index.js +68 -62
  288. package/dist/views/Verify/index.js.map +1 -1
  289. package/dist/views/Verify/metadata.js +8 -12
  290. package/dist/views/Verify/metadata.js.map +1 -1
  291. package/dist/views/Version/Default/SelectedLocalesContext.js +4 -4
  292. package/dist/views/Version/Default/SelectedLocalesContext.js.map +1 -1
  293. package/dist/views/Version/Default/SetStepNav.js +86 -127
  294. package/dist/views/Version/Default/SetStepNav.js.map +1 -1
  295. package/dist/views/Version/Default/index.js +380 -236
  296. package/dist/views/Version/Default/index.js.map +1 -1
  297. package/dist/views/Version/Default/types.js +2 -1
  298. package/dist/views/Version/Default/types.js.map +1 -1
  299. package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js +102 -119
  300. package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js.map +1 -1
  301. package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js +78 -73
  302. package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js.map +1 -1
  303. package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js +363 -408
  304. package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js.map +1 -1
  305. package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js +40 -51
  306. package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js.map +1 -1
  307. package/dist/views/Version/RenderFieldsToDiff/fields/Date/index.js +35 -67
  308. package/dist/views/Version/RenderFieldsToDiff/fields/Date/index.js.map +1 -1
  309. package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js +59 -56
  310. package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js.map +1 -1
  311. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +139 -117
  312. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
  313. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.js +36 -41
  314. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.js.map +1 -1
  315. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +192 -178
  316. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
  317. package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js +17 -11
  318. package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js.map +1 -1
  319. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +48 -73
  320. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
  321. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +132 -143
  322. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
  323. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +56 -81
  324. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
  325. package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.js +251 -210
  326. package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.js.map +1 -1
  327. package/dist/views/Version/RenderFieldsToDiff/fields/index.js +23 -22
  328. package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
  329. package/dist/views/Version/RenderFieldsToDiff/index.js +12 -9
  330. package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
  331. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js +213 -228
  332. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js.map +1 -1
  333. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js +1005 -826
  334. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js.map +1 -1
  335. package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.js +2 -1
  336. package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.js.map +1 -1
  337. package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js +44 -43
  338. package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js.map +1 -1
  339. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldPathsModified.js +25 -22
  340. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldPathsModified.js.map +1 -1
  341. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js +32 -36
  342. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js.map +1 -1
  343. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js +145 -129
  344. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js.map +1 -1
  345. package/dist/views/Version/Restore/index.js +116 -91
  346. package/dist/views/Version/Restore/index.js.map +1 -1
  347. package/dist/views/Version/SelectComparison/VersionDrawer/CreatedAtCell.js +33 -50
  348. package/dist/views/Version/SelectComparison/VersionDrawer/CreatedAtCell.js.map +1 -1
  349. package/dist/views/Version/SelectComparison/VersionDrawer/index.js +170 -226
  350. package/dist/views/Version/SelectComparison/VersionDrawer/index.js.map +1 -1
  351. package/dist/views/Version/SelectComparison/index.js +73 -50
  352. package/dist/views/Version/SelectComparison/index.js.map +1 -1
  353. package/dist/views/Version/SelectComparison/types.js +2 -1
  354. package/dist/views/Version/SelectComparison/types.js.map +1 -1
  355. package/dist/views/Version/SelectLocales/index.js +34 -32
  356. package/dist/views/Version/SelectLocales/index.js.map +1 -1
  357. package/dist/views/Version/VersionPillLabel/VersionPillLabel.js +104 -95
  358. package/dist/views/Version/VersionPillLabel/VersionPillLabel.js.map +1 -1
  359. package/dist/views/Version/VersionPillLabel/getVersionLabel.js +23 -27
  360. package/dist/views/Version/VersionPillLabel/getVersionLabel.js.map +1 -1
  361. package/dist/views/Version/fetchVersions.js +113 -138
  362. package/dist/views/Version/fetchVersions.js.map +1 -1
  363. package/dist/views/Version/index.js +325 -323
  364. package/dist/views/Version/index.js.map +1 -1
  365. package/dist/views/Version/metadata.js +43 -50
  366. package/dist/views/Version/metadata.js.map +1 -1
  367. package/dist/views/Versions/buildColumns.js +95 -79
  368. package/dist/views/Versions/buildColumns.js.map +1 -1
  369. package/dist/views/Versions/cells/AutosaveCell/index.js +34 -38
  370. package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
  371. package/dist/views/Versions/cells/CreatedAt/index.js +32 -53
  372. package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
  373. package/dist/views/Versions/cells/ID/index.js +10 -8
  374. package/dist/views/Versions/cells/ID/index.js.map +1 -1
  375. package/dist/views/Versions/index.client.js +106 -83
  376. package/dist/views/Versions/index.client.js.map +1 -1
  377. package/dist/views/Versions/index.js +140 -140
  378. package/dist/views/Versions/index.js.map +1 -1
  379. package/dist/views/Versions/metadata.js +37 -44
  380. package/dist/views/Versions/metadata.js.map +1 -1
  381. package/dist/views/Versions/types.js +2 -1
  382. package/dist/views/Versions/types.js.map +1 -1
  383. package/dist/withPayload.js +216 -169
  384. package/dist/withPayload.js.map +1 -1
  385. package/package.json +8 -7
  386. package/dist/prod/styles.css +0 -1
@@ -4,179 +4,226 @@
4
4
  * @param {boolean} [options.devBundleServerPackages] - Whether to bundle server packages in development mode. @default false
5
5
  *
6
6
  * @returns {import('next').NextConfig}
7
- * */export const withPayload = (nextConfig = {}, options = {}) => {
8
- const env = nextConfig.env || {};
9
- if (nextConfig.experimental?.staleTimes?.dynamic) {
10
- console.warn('Payload detected a non-zero value for the `staleTimes.dynamic` option in your Next.js config. This will slow down page transitions and may cause stale data to load within the Admin panel. To clear this warning, remove the `staleTimes.dynamic` option from your Next.js config or set it to 0. In the future, Next.js may support scoping this option to specific routes.');
11
- env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH = 'true';
12
- }
13
- if (process.env.PAYLOAD_PATCH_TURBOPACK_WARNINGS !== 'false') {
14
- // TODO: This warning is thrown because we cannot externalize the entry-point package for client-s3, so we patch the warning to not show it.
15
- // We can remove this once Next.js implements https://github.com/vercel/next.js/discussions/76991
16
- const turbopackWarningText = 'Packages that should be external need to be installed in the project directory, so they can be resolved from the output files.\nTry to install it into the project directory by running';
17
- // TODO 4.0: Remove this once we drop support for Next.js 15.2.x
18
- const turbopackConfigWarningText = "Unrecognized key(s) in object: 'turbopack'";
19
- const consoleWarn = console.warn;
20
- console.warn = (...args) => {
21
- // Force to disable serverExternalPackages warnings: https://github.com/vercel/next.js/issues/68805
22
- if (typeof args[1] === 'string' && args[1].includes(turbopackWarningText) || typeof args[0] === 'string' && args[0].includes(turbopackWarningText)) {
23
- return;
24
- }
25
- // Add Payload-specific message after turbopack config warning in Next.js 15.2.x or lower.
26
- // TODO 4.0: Remove this once we drop support for Next.js 15.2.x
27
- const hasTurbopackConfigWarning = typeof args[1] === 'string' && args[1].includes(turbopackConfigWarningText) || typeof args[0] === 'string' && args[0].includes(turbopackConfigWarningText);
28
- if (hasTurbopackConfigWarning) {
29
- consoleWarn(...args);
30
- consoleWarn('Payload: You can safely ignore the "Invalid next.config" warning above. This only occurs on Next.js 15.2.x or lower. We recommend upgrading to Next.js 15.4.7 to resolve this warning.');
31
- return;
32
- }
33
- consoleWarn(...args);
7
+ * */ export const withPayload = (nextConfig = {}, options = {})=>{
8
+ const env = nextConfig.env || {};
9
+ if (nextConfig.experimental?.staleTimes?.dynamic) {
10
+ console.warn('Payload detected a non-zero value for the `staleTimes.dynamic` option in your Next.js config. This will slow down page transitions and may cause stale data to load within the Admin panel. To clear this warning, remove the `staleTimes.dynamic` option from your Next.js config or set it to 0. In the future, Next.js may support scoping this option to specific routes.');
11
+ env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH = 'true';
12
+ }
13
+ if (process.env.PAYLOAD_PATCH_TURBOPACK_WARNINGS !== 'false') {
14
+ // TODO: This warning is thrown because we cannot externalize the entry-point package for client-s3, so we patch the warning to not show it.
15
+ // We can remove this once Next.js implements https://github.com/vercel/next.js/discussions/76991
16
+ const turbopackWarningText = 'Packages that should be external need to be installed in the project directory, so they can be resolved from the output files.\nTry to install it into the project directory by running';
17
+ // TODO 4.0: Remove this once we drop support for Next.js 15.2.x
18
+ const turbopackConfigWarningText = "Unrecognized key(s) in object: 'turbopack'";
19
+ const consoleWarn = console.warn;
20
+ console.warn = (...args)=>{
21
+ // Force to disable serverExternalPackages warnings: https://github.com/vercel/next.js/issues/68805
22
+ if (typeof args[1] === 'string' && args[1].includes(turbopackWarningText) || typeof args[0] === 'string' && args[0].includes(turbopackWarningText)) {
23
+ return;
24
+ }
25
+ // Add Payload-specific message after turbopack config warning in Next.js 15.2.x or lower.
26
+ // TODO 4.0: Remove this once we drop support for Next.js 15.2.x
27
+ const hasTurbopackConfigWarning = typeof args[1] === 'string' && args[1].includes(turbopackConfigWarningText) || typeof args[0] === 'string' && args[0].includes(turbopackConfigWarningText);
28
+ if (hasTurbopackConfigWarning) {
29
+ consoleWarn(...args);
30
+ consoleWarn('Payload: You can safely ignore the "Invalid next.config" warning above. This only occurs on Next.js 15.2.x or lower. We recommend upgrading to Next.js 15.4.7 to resolve this warning.');
31
+ return;
32
+ }
33
+ consoleWarn(...args);
34
+ };
35
+ }
36
+ const isBuild = process.env.NODE_ENV === 'production';
37
+ const isTurbopackNextjs15 = process.env.TURBOPACK === '1';
38
+ const isTurbopackNextjs16 = process.env.TURBOPACK === 'auto';
39
+ if (isBuild && (isTurbopackNextjs15 || isTurbopackNextjs16)) {
40
+ throw new Error('Payload does not support using Turbopack for production builds. If you are using Next.js 16, please use `next build --webpack` instead.');
41
+ }
42
+ const poweredByHeader = {
43
+ key: 'X-Powered-By',
44
+ value: 'Next.js, Payload'
34
45
  };
35
- }
36
- const isBuild = process.env.NODE_ENV === 'production';
37
- const isTurbopackNextjs15 = process.env.TURBOPACK === '1';
38
- const isTurbopackNextjs16 = process.env.TURBOPACK === 'auto';
39
- if (isBuild && (isTurbopackNextjs15 || isTurbopackNextjs16)) {
40
- throw new Error('Payload does not support using Turbopack for production builds. If you are using Next.js 16, please use `next build --webpack` instead.');
41
- }
42
- const poweredByHeader = {
43
- key: 'X-Powered-By',
44
- value: 'Next.js, Payload'
45
- };
46
- /**
47
- * @type {import('next').NextConfig}
48
- */
49
- const toReturn = {
50
- ...nextConfig,
51
- env,
52
- turbopack: {
53
- ...(nextConfig.turbopack || {})
54
- },
55
- outputFileTracingExcludes: {
56
- ...(nextConfig.outputFileTracingExcludes || {}),
57
- '**/*': [...(nextConfig.outputFileTracingExcludes?.['**/*'] || []), 'drizzle-kit', 'drizzle-kit/api']
58
- },
59
- outputFileTracingIncludes: {
60
- ...(nextConfig.outputFileTracingIncludes || {}),
61
- '**/*': [...(nextConfig.outputFileTracingIncludes?.['**/*'] || []), '@libsql/client']
62
- },
63
- // We disable the poweredByHeader here because we add it manually in the headers function below
64
- ...(nextConfig.poweredByHeader !== false ? {
65
- poweredByHeader: false
66
- } : {}),
67
- headers: async () => {
68
- const headersFromConfig = 'headers' in nextConfig ? await nextConfig.headers() : [];
69
- return [...(headersFromConfig || []), {
70
- source: '/:path*',
71
- headers: [{
72
- key: 'Accept-CH',
73
- value: 'Sec-CH-Prefers-Color-Scheme'
74
- }, {
75
- key: 'Vary',
76
- value: 'Sec-CH-Prefers-Color-Scheme'
77
- }, {
78
- key: 'Critical-CH',
79
- value: 'Sec-CH-Prefers-Color-Scheme'
80
- }, ...(nextConfig.poweredByHeader !== false ? [poweredByHeader] : [])]
81
- }];
82
- },
83
- serverExternalPackages: [
84
- // serverExternalPackages = webpack.externals, but with turbopack support and an additional check
85
- // for whether the package is resolvable from the project root
86
- ...(nextConfig.serverExternalPackages || []),
87
- // Can be externalized, because we require users to install graphql themselves - we only rely on it as a peer dependency => resolvable from the project root.
88
- //
89
- // WHY: without externalizing graphql, a graphql version error will be thrown
90
- // during runtime ("Ensure that there is only one instance of \"graphql\" in the node_modules\ndirectory.")
91
- 'graphql',
92
- // External, because it installs import-in-the-middle and require-in-the-middle - both in the default serverExternalPackages list.
93
- '@sentry/nextjs', ...(process.env.NODE_ENV === 'development' && options.devBundleServerPackages !== true ?
94
46
  /**
95
- * Unless explicitly disabled by the user, by passing `devBundleServerPackages: true` to withPayload, we
96
- * do not bundle server-only packages during dev for two reasons:
97
- *
98
- * 1. Performance: Fewer files to compile means faster compilation speeds.
99
- * 2. Turbopack support: Webpack's externals are not supported by Turbopack.
100
- *
101
- * Regarding Turbopack support: Unlike webpack.externals, we cannot use serverExternalPackages to
102
- * externalized packages that are not resolvable from the project root. So including a package like
103
- * "drizzle-kit" in here would do nothing - Next.js will ignore the rule and still bundle the package -
104
- * because it detects that the package is not resolvable from the project root (= not directly installed
105
- * by the user in their own package.json).
106
- *
107
- * Instead, we can use serverExternalPackages for the entry-point packages that *are* installed directly
108
- * by the user (e.g. db-postgres, which then installs drizzle-kit as a dependency).
109
- *
110
- *
111
- *
112
- * We should only do this during development, not build, because externalizing these packages can hurt
113
- * the bundle size. Not only does it disable tree-shaking, it also risks installing duplicate copies of the
114
- * same package.
115
- *
116
- * Example:
117
- * - @payloadcms/richtext-lexical (in bundle) -> installs qs-esm (bundled because of importer)
118
- * - payload (not in bundle, external) -> installs qs-esm (external because of importer)
119
- * Result: we have two copies of qs-esm installed - one in the bundle, and one in node_modules.
120
- *
121
- * During development, these bundle size difference do not matter much, and development speed /
122
- * turbopack support are more important.
123
- */
124
- ['payload', '@payloadcms/db-mongodb', '@payloadcms/db-postgres', '@payloadcms/db-sqlite', '@payloadcms/db-vercel-postgres', '@payloadcms/db-d1-sqlite', '@payloadcms/drizzle', '@payloadcms/email-nodemailer', '@payloadcms/email-resend', '@payloadcms/graphql', '@payloadcms/payload-cloud', '@payloadcms/plugin-redirects'] : [])],
125
- webpack: (webpackConfig, webpackOptions) => {
126
- const incomingWebpackConfig = typeof nextConfig.webpack === 'function' ? nextConfig.webpack(webpackConfig, webpackOptions) : webpackConfig;
127
- return {
128
- ...incomingWebpackConfig,
129
- externals: [...(incomingWebpackConfig?.externals || []),
130
- /**
131
- * See the explanation in the serverExternalPackages section above.
132
- * We need to force Webpack to emit require() calls for these packages, even though they are not
133
- * resolvable from the project root. You would expect this to error during runtime, but Next.js seems to be able to require these just fine.
134
- *
135
- * This is the only way to get Webpack Build to work, without the bundle size caveats of externalizing the
136
- * entry point packages, as explained in the serverExternalPackages section above.
137
- */
138
- 'drizzle-kit', 'drizzle-kit/api', 'sharp', 'libsql', 'require-in-the-middle'],
139
- resolve: {
140
- ...(incomingWebpackConfig?.resolve || {}),
141
- alias: {
142
- ...(incomingWebpackConfig?.resolve?.alias || {})
143
- },
144
- fallback: {
145
- ...(incomingWebpackConfig?.resolve?.fallback || {}),
146
- /*
147
- * This fixes the following warning when running next build with webpack (tested on Next.js 16.0.3 with Payload 3.64.0):
148
- *
149
- * ⚠ Compiled with warnings in 8.7s
150
- *
151
- * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js
152
- * Module not found: Can't resolve 'aws4' in '/Users/alessio/Documents/temp/next16p/node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib'
153
- *
154
- * Import trace for requested module:
155
- * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js
156
- * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js
157
- * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/index.js
158
- * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/lib/index.js
159
- * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/index.js
160
- * ./node_modules/.pnpm/@payloadcms+db-mongodb@3.64.0_payload@3.64.0_graphql@16.12.0_typescript@5.7.3_/node_modules/@payloadcms/db-mongodb/dist/index.js
161
- * ./src/payload.config.ts
162
- * ./src/app/my-route/route.ts
163
- *
164
- **/
165
- aws4: false
166
- }
47
+ * @type {import('next').NextConfig}
48
+ */ const toReturn = {
49
+ ...nextConfig,
50
+ env,
51
+ turbopack: {
52
+ ...nextConfig.turbopack || {}
53
+ },
54
+ outputFileTracingExcludes: {
55
+ ...nextConfig.outputFileTracingExcludes || {},
56
+ '**/*': [
57
+ ...nextConfig.outputFileTracingExcludes?.['**/*'] || [],
58
+ 'drizzle-kit',
59
+ 'drizzle-kit/api'
60
+ ]
167
61
  },
168
- plugins: [...(incomingWebpackConfig?.plugins || []),
169
- // Fix cloudflare:sockets error: https://github.com/vercel/next.js/discussions/50177
170
- new webpackOptions.webpack.IgnorePlugin({
171
- resourceRegExp: /^pg-native$|^cloudflare:sockets$/
172
- })]
173
- };
62
+ outputFileTracingIncludes: {
63
+ ...nextConfig.outputFileTracingIncludes || {},
64
+ '**/*': [
65
+ ...nextConfig.outputFileTracingIncludes?.['**/*'] || [],
66
+ '@libsql/client'
67
+ ]
68
+ },
69
+ // We disable the poweredByHeader here because we add it manually in the headers function below
70
+ ...nextConfig.poweredByHeader !== false ? {
71
+ poweredByHeader: false
72
+ } : {},
73
+ headers: async ()=>{
74
+ const headersFromConfig = 'headers' in nextConfig ? await nextConfig.headers() : [];
75
+ return [
76
+ ...headersFromConfig || [],
77
+ {
78
+ source: '/:path*',
79
+ headers: [
80
+ {
81
+ key: 'Accept-CH',
82
+ value: 'Sec-CH-Prefers-Color-Scheme'
83
+ },
84
+ {
85
+ key: 'Vary',
86
+ value: 'Sec-CH-Prefers-Color-Scheme'
87
+ },
88
+ {
89
+ key: 'Critical-CH',
90
+ value: 'Sec-CH-Prefers-Color-Scheme'
91
+ },
92
+ ...nextConfig.poweredByHeader !== false ? [
93
+ poweredByHeader
94
+ ] : []
95
+ ]
96
+ }
97
+ ];
98
+ },
99
+ serverExternalPackages: [
100
+ // serverExternalPackages = webpack.externals, but with turbopack support and an additional check
101
+ // for whether the package is resolvable from the project root
102
+ ...nextConfig.serverExternalPackages || [],
103
+ // Can be externalized, because we require users to install graphql themselves - we only rely on it as a peer dependency => resolvable from the project root.
104
+ //
105
+ // WHY: without externalizing graphql, a graphql version error will be thrown
106
+ // during runtime ("Ensure that there is only one instance of \"graphql\" in the node_modules\ndirectory.")
107
+ 'graphql',
108
+ // External, because it installs import-in-the-middle and require-in-the-middle - both in the default serverExternalPackages list.
109
+ '@sentry/nextjs',
110
+ ...process.env.NODE_ENV === 'development' && options.devBundleServerPackages !== true ? /**
111
+ * Unless explicitly disabled by the user, by passing `devBundleServerPackages: true` to withPayload, we
112
+ * do not bundle server-only packages during dev for two reasons:
113
+ *
114
+ * 1. Performance: Fewer files to compile means faster compilation speeds.
115
+ * 2. Turbopack support: Webpack's externals are not supported by Turbopack.
116
+ *
117
+ * Regarding Turbopack support: Unlike webpack.externals, we cannot use serverExternalPackages to
118
+ * externalized packages that are not resolvable from the project root. So including a package like
119
+ * "drizzle-kit" in here would do nothing - Next.js will ignore the rule and still bundle the package -
120
+ * because it detects that the package is not resolvable from the project root (= not directly installed
121
+ * by the user in their own package.json).
122
+ *
123
+ * Instead, we can use serverExternalPackages for the entry-point packages that *are* installed directly
124
+ * by the user (e.g. db-postgres, which then installs drizzle-kit as a dependency).
125
+ *
126
+ *
127
+ *
128
+ * We should only do this during development, not build, because externalizing these packages can hurt
129
+ * the bundle size. Not only does it disable tree-shaking, it also risks installing duplicate copies of the
130
+ * same package.
131
+ *
132
+ * Example:
133
+ * - @payloadcms/richtext-lexical (in bundle) -> installs qs-esm (bundled because of importer)
134
+ * - payload (not in bundle, external) -> installs qs-esm (external because of importer)
135
+ * Result: we have two copies of qs-esm installed - one in the bundle, and one in node_modules.
136
+ *
137
+ * During development, these bundle size difference do not matter much, and development speed /
138
+ * turbopack support are more important.
139
+ */ [
140
+ 'payload',
141
+ '@payloadcms/db-mongodb',
142
+ '@payloadcms/db-postgres',
143
+ '@payloadcms/db-sqlite',
144
+ '@payloadcms/db-vercel-postgres',
145
+ '@payloadcms/db-d1-sqlite',
146
+ '@payloadcms/drizzle',
147
+ '@payloadcms/email-nodemailer',
148
+ '@payloadcms/email-resend',
149
+ '@payloadcms/graphql',
150
+ '@payloadcms/payload-cloud',
151
+ '@payloadcms/plugin-redirects'
152
+ ] : // TODO: Add the following packages, excluding their /client subpath exports, once Next.js supports it
153
+ // see: https://github.com/vercel/next.js/discussions/76991
154
+ //'@payloadcms/plugin-cloud-storage',
155
+ //'@payloadcms/plugin-sentry',
156
+ //'@payloadcms/plugin-stripe',
157
+ // @payloadcms/richtext-lexical
158
+ //'@payloadcms/storage-azure',
159
+ //'@payloadcms/storage-gcs',
160
+ //'@payloadcms/storage-s3',
161
+ //'@payloadcms/storage-uploadthing',
162
+ //'@payloadcms/storage-vercel-blob',
163
+ []
164
+ ],
165
+ webpack: (webpackConfig, webpackOptions)=>{
166
+ const incomingWebpackConfig = typeof nextConfig.webpack === 'function' ? nextConfig.webpack(webpackConfig, webpackOptions) : webpackConfig;
167
+ return {
168
+ ...incomingWebpackConfig,
169
+ externals: [
170
+ ...incomingWebpackConfig?.externals || [],
171
+ /**
172
+ * See the explanation in the serverExternalPackages section above.
173
+ * We need to force Webpack to emit require() calls for these packages, even though they are not
174
+ * resolvable from the project root. You would expect this to error during runtime, but Next.js seems to be able to require these just fine.
175
+ *
176
+ * This is the only way to get Webpack Build to work, without the bundle size caveats of externalizing the
177
+ * entry point packages, as explained in the serverExternalPackages section above.
178
+ */ 'drizzle-kit',
179
+ 'drizzle-kit/api',
180
+ 'sharp',
181
+ 'libsql',
182
+ 'require-in-the-middle'
183
+ ],
184
+ resolve: {
185
+ ...incomingWebpackConfig?.resolve || {},
186
+ alias: {
187
+ ...incomingWebpackConfig?.resolve?.alias || {}
188
+ },
189
+ fallback: {
190
+ ...incomingWebpackConfig?.resolve?.fallback || {},
191
+ /*
192
+ * This fixes the following warning when running next build with webpack (tested on Next.js 16.0.3 with Payload 3.64.0):
193
+ *
194
+ * ⚠ Compiled with warnings in 8.7s
195
+ *
196
+ * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js
197
+ * Module not found: Can't resolve 'aws4' in '/Users/alessio/Documents/temp/next16p/node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib'
198
+ *
199
+ * Import trace for requested module:
200
+ * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js
201
+ * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js
202
+ * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/index.js
203
+ * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/lib/index.js
204
+ * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/index.js
205
+ * ./node_modules/.pnpm/@payloadcms+db-mongodb@3.64.0_payload@3.64.0_graphql@16.12.0_typescript@5.7.3_/node_modules/@payloadcms/db-mongodb/dist/index.js
206
+ * ./src/payload.config.ts
207
+ * ./src/app/my-route/route.ts
208
+ *
209
+ **/ aws4: false
210
+ }
211
+ },
212
+ plugins: [
213
+ ...incomingWebpackConfig?.plugins || [],
214
+ // Fix cloudflare:sockets error: https://github.com/vercel/next.js/discussions/50177
215
+ new webpackOptions.webpack.IgnorePlugin({
216
+ resourceRegExp: /^pg-native$|^cloudflare:sockets$/
217
+ })
218
+ ]
219
+ };
220
+ }
221
+ };
222
+ if (nextConfig.basePath) {
223
+ toReturn.env.NEXT_BASE_PATH = nextConfig.basePath;
174
224
  }
175
- };
176
- if (nextConfig.basePath) {
177
- toReturn.env.NEXT_BASE_PATH = nextConfig.basePath;
178
- }
179
- return toReturn;
225
+ return toReturn;
180
226
  };
181
227
  export default withPayload;
228
+
182
229
  //# sourceMappingURL=withPayload.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withPayload.js","names":["withPayload","nextConfig","options","env","experimental","staleTimes","dynamic","console","warn","NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH","process","PAYLOAD_PATCH_TURBOPACK_WARNINGS","turbopackWarningText","turbopackConfigWarningText","consoleWarn","args","includes","hasTurbopackConfigWarning","isBuild","NODE_ENV","isTurbopackNextjs15","TURBOPACK","isTurbopackNextjs16","Error","poweredByHeader","key","value","toReturn","turbopack","outputFileTracingExcludes","outputFileTracingIncludes","headers","headersFromConfig","source","serverExternalPackages","devBundleServerPackages","webpack","webpackConfig","webpackOptions","incomingWebpackConfig","externals","resolve","alias","fallback","aws4","plugins","IgnorePlugin","resourceRegExp","basePath","NEXT_BASE_PATH"],"sources":["../src/withPayload.js"],"sourcesContent":["/**\n * @param {import('next').NextConfig} nextConfig\n * @param {Object} [options] - Optional configuration options\n * @param {boolean} [options.devBundleServerPackages] - Whether to bundle server packages in development mode. @default false\n *\n * @returns {import('next').NextConfig}\n * */\nexport const withPayload = (nextConfig = {}, options = {}) => {\n const env = nextConfig.env || {}\n\n if (nextConfig.experimental?.staleTimes?.dynamic) {\n console.warn(\n 'Payload detected a non-zero value for the `staleTimes.dynamic` option in your Next.js config. This will slow down page transitions and may cause stale data to load within the Admin panel. To clear this warning, remove the `staleTimes.dynamic` option from your Next.js config or set it to 0. In the future, Next.js may support scoping this option to specific routes.',\n )\n env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH = 'true'\n }\n\n if (process.env.PAYLOAD_PATCH_TURBOPACK_WARNINGS !== 'false') {\n // TODO: This warning is thrown because we cannot externalize the entry-point package for client-s3, so we patch the warning to not show it.\n // We can remove this once Next.js implements https://github.com/vercel/next.js/discussions/76991\n const turbopackWarningText =\n 'Packages that should be external need to be installed in the project directory, so they can be resolved from the output files.\\nTry to install it into the project directory by running'\n\n // TODO 4.0: Remove this once we drop support for Next.js 15.2.x\n const turbopackConfigWarningText = \"Unrecognized key(s) in object: 'turbopack'\"\n\n const consoleWarn = console.warn\n console.warn = (...args) => {\n // Force to disable serverExternalPackages warnings: https://github.com/vercel/next.js/issues/68805\n if (\n (typeof args[1] === 'string' && args[1].includes(turbopackWarningText)) ||\n (typeof args[0] === 'string' && args[0].includes(turbopackWarningText))\n ) {\n return\n }\n\n // Add Payload-specific message after turbopack config warning in Next.js 15.2.x or lower.\n // TODO 4.0: Remove this once we drop support for Next.js 15.2.x\n const hasTurbopackConfigWarning =\n (typeof args[1] === 'string' && args[1].includes(turbopackConfigWarningText)) ||\n (typeof args[0] === 'string' && args[0].includes(turbopackConfigWarningText))\n\n if (hasTurbopackConfigWarning) {\n consoleWarn(...args)\n consoleWarn(\n 'Payload: You can safely ignore the \"Invalid next.config\" warning above. This only occurs on Next.js 15.2.x or lower. We recommend upgrading to Next.js 15.4.7 to resolve this warning.',\n )\n return\n }\n\n consoleWarn(...args)\n }\n }\n\n const isBuild = process.env.NODE_ENV === 'production'\n const isTurbopackNextjs15 = process.env.TURBOPACK === '1'\n const isTurbopackNextjs16 = process.env.TURBOPACK === 'auto'\n\n if (isBuild && (isTurbopackNextjs15 || isTurbopackNextjs16)) {\n throw new Error(\n 'Payload does not support using Turbopack for production builds. If you are using Next.js 16, please use `next build --webpack` instead.',\n )\n }\n\n const poweredByHeader = {\n key: 'X-Powered-By',\n value: 'Next.js, Payload',\n }\n\n /**\n * @type {import('next').NextConfig}\n */\n const toReturn = {\n ...nextConfig,\n env,\n turbopack: {\n ...(nextConfig.turbopack || {}),\n },\n outputFileTracingExcludes: {\n ...(nextConfig.outputFileTracingExcludes || {}),\n '**/*': [\n ...(nextConfig.outputFileTracingExcludes?.['**/*'] || []),\n 'drizzle-kit',\n 'drizzle-kit/api',\n ],\n },\n outputFileTracingIncludes: {\n ...(nextConfig.outputFileTracingIncludes || {}),\n '**/*': [...(nextConfig.outputFileTracingIncludes?.['**/*'] || []), '@libsql/client'],\n },\n // We disable the poweredByHeader here because we add it manually in the headers function below\n ...(nextConfig.poweredByHeader !== false ? { poweredByHeader: false } : {}),\n headers: async () => {\n const headersFromConfig = 'headers' in nextConfig ? await nextConfig.headers() : []\n\n return [\n ...(headersFromConfig || []),\n {\n source: '/:path*',\n headers: [\n {\n key: 'Accept-CH',\n value: 'Sec-CH-Prefers-Color-Scheme',\n },\n {\n key: 'Vary',\n value: 'Sec-CH-Prefers-Color-Scheme',\n },\n {\n key: 'Critical-CH',\n value: 'Sec-CH-Prefers-Color-Scheme',\n },\n ...(nextConfig.poweredByHeader !== false ? [poweredByHeader] : []),\n ],\n },\n ]\n },\n serverExternalPackages: [\n // serverExternalPackages = webpack.externals, but with turbopack support and an additional check\n // for whether the package is resolvable from the project root\n ...(nextConfig.serverExternalPackages || []),\n // Can be externalized, because we require users to install graphql themselves - we only rely on it as a peer dependency => resolvable from the project root.\n //\n // WHY: without externalizing graphql, a graphql version error will be thrown\n // during runtime (\"Ensure that there is only one instance of \\\"graphql\\\" in the node_modules\\ndirectory.\")\n 'graphql',\n // External, because it installs import-in-the-middle and require-in-the-middle - both in the default serverExternalPackages list.\n '@sentry/nextjs',\n ...(process.env.NODE_ENV === 'development' && options.devBundleServerPackages !== true\n ? /**\n * Unless explicitly disabled by the user, by passing `devBundleServerPackages: true` to withPayload, we\n * do not bundle server-only packages during dev for two reasons:\n *\n * 1. Performance: Fewer files to compile means faster compilation speeds.\n * 2. Turbopack support: Webpack's externals are not supported by Turbopack.\n *\n * Regarding Turbopack support: Unlike webpack.externals, we cannot use serverExternalPackages to\n * externalized packages that are not resolvable from the project root. So including a package like\n * \"drizzle-kit\" in here would do nothing - Next.js will ignore the rule and still bundle the package -\n * because it detects that the package is not resolvable from the project root (= not directly installed\n * by the user in their own package.json).\n *\n * Instead, we can use serverExternalPackages for the entry-point packages that *are* installed directly\n * by the user (e.g. db-postgres, which then installs drizzle-kit as a dependency).\n *\n *\n *\n * We should only do this during development, not build, because externalizing these packages can hurt\n * the bundle size. Not only does it disable tree-shaking, it also risks installing duplicate copies of the\n * same package.\n *\n * Example:\n * - @payloadcms/richtext-lexical (in bundle) -> installs qs-esm (bundled because of importer)\n * - payload (not in bundle, external) -> installs qs-esm (external because of importer)\n * Result: we have two copies of qs-esm installed - one in the bundle, and one in node_modules.\n *\n * During development, these bundle size difference do not matter much, and development speed /\n * turbopack support are more important.\n */\n [\n 'payload',\n '@payloadcms/db-mongodb',\n '@payloadcms/db-postgres',\n '@payloadcms/db-sqlite',\n '@payloadcms/db-vercel-postgres',\n '@payloadcms/db-d1-sqlite',\n '@payloadcms/drizzle',\n '@payloadcms/email-nodemailer',\n '@payloadcms/email-resend',\n '@payloadcms/graphql',\n '@payloadcms/payload-cloud',\n '@payloadcms/plugin-redirects',\n // TODO: Add the following packages, excluding their /client subpath exports, once Next.js supports it\n // see: https://github.com/vercel/next.js/discussions/76991\n //'@payloadcms/plugin-cloud-storage',\n //'@payloadcms/plugin-sentry',\n //'@payloadcms/plugin-stripe',\n // @payloadcms/richtext-lexical\n //'@payloadcms/storage-azure',\n //'@payloadcms/storage-gcs',\n //'@payloadcms/storage-s3',\n //'@payloadcms/storage-uploadthing',\n //'@payloadcms/storage-vercel-blob',\n ]\n : []),\n ],\n webpack: (webpackConfig, webpackOptions) => {\n const incomingWebpackConfig =\n typeof nextConfig.webpack === 'function'\n ? nextConfig.webpack(webpackConfig, webpackOptions)\n : webpackConfig\n\n return {\n ...incomingWebpackConfig,\n externals: [\n ...(incomingWebpackConfig?.externals || []),\n /**\n * See the explanation in the serverExternalPackages section above.\n * We need to force Webpack to emit require() calls for these packages, even though they are not\n * resolvable from the project root. You would expect this to error during runtime, but Next.js seems to be able to require these just fine.\n *\n * This is the only way to get Webpack Build to work, without the bundle size caveats of externalizing the\n * entry point packages, as explained in the serverExternalPackages section above.\n */\n 'drizzle-kit',\n 'drizzle-kit/api',\n 'sharp',\n 'libsql',\n 'require-in-the-middle',\n ],\n resolve: {\n ...(incomingWebpackConfig?.resolve || {}),\n alias: {\n ...(incomingWebpackConfig?.resolve?.alias || {}),\n },\n fallback: {\n ...(incomingWebpackConfig?.resolve?.fallback || {}),\n /*\n * This fixes the following warning when running next build with webpack (tested on Next.js 16.0.3 with Payload 3.64.0):\n *\n * ⚠ Compiled with warnings in 8.7s\n *\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js\n * Module not found: Can't resolve 'aws4' in '/Users/alessio/Documents/temp/next16p/node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib'\n *\n * Import trace for requested module:\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/index.js\n * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/lib/index.js\n * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/index.js\n * ./node_modules/.pnpm/@payloadcms+db-mongodb@3.64.0_payload@3.64.0_graphql@16.12.0_typescript@5.7.3_/node_modules/@payloadcms/db-mongodb/dist/index.js\n * ./src/payload.config.ts\n * ./src/app/my-route/route.ts\n *\n **/\n aws4: false,\n },\n },\n plugins: [\n ...(incomingWebpackConfig?.plugins || []),\n // Fix cloudflare:sockets error: https://github.com/vercel/next.js/discussions/50177\n new webpackOptions.webpack.IgnorePlugin({\n resourceRegExp: /^pg-native$|^cloudflare:sockets$/,\n }),\n ],\n }\n },\n }\n\n if (nextConfig.basePath) {\n toReturn.env.NEXT_BASE_PATH = nextConfig.basePath\n }\n\n return toReturn\n}\n\nexport default withPayload\n"],"mappings":"AAAA;;;;;;KAOA,OAAO,MAAMA,WAAA,GAAcA,CAACC,UAAA,GAAa,CAAC,CAAC,EAAEC,OAAA,GAAU,CAAC,CAAC;EACvD,MAAMC,GAAA,GAAMF,UAAA,CAAWE,GAAG,IAAI,CAAC;EAE/B,IAAIF,UAAA,CAAWG,YAAY,EAAEC,UAAA,EAAYC,OAAA,EAAS;IAChDC,OAAA,CAAQC,IAAI,CACV;IAEFL,GAAA,CAAIM,uCAAuC,GAAG;EAChD;EAEA,IAAIC,OAAA,CAAQP,GAAG,CAACQ,gCAAgC,KAAK,SAAS;IAC5D;IACA;IACA,MAAMC,oBAAA,GACJ;IAEF;IACA,MAAMC,0BAAA,GAA6B;IAEnC,MAAMC,WAAA,GAAcP,OAAA,CAAQC,IAAI;IAChCD,OAAA,CAAQC,IAAI,GAAG,CAAC,GAAGO,IAAA;MACjB;MACA,IACE,OAAQA,IAAI,CAAC,EAAE,KAAK,YAAYA,IAAI,CAAC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A,mBACA,SACA,UACA,wBACD;QACDC,OAAA,EAAS;UACP,IAAIF,qBAAA,EAAuBE,OAAA,IAAW,CAAC,CAAC;UACxCC,KAAA,EAAO;YACL,IAAIH,qBAAA,EAAuBE,OAAA,EAASC,KAAA,IAAS,CAAC,CAAC;UACjD;UACAC,QAAA,EAAU;YACR,IAAIJ,qBAAA,EAAuBE,OAAA,EAASE,QAAA,IAAY,CAAC,CAAC;YAClD;;;;;;;;;;;;;;;;;;;YAmBAC,IAAA,EAAM;UACR;QACF;QACAC,OAAA,EAAS,C,IACHN,qBAAA,EAAuBM,OAAA,IAAW,EAAE;QACxC;QACA,IAAIP,cAAA,CAAeF,OAAO,CAACU,YAAY,CAAC;UACtCC,cAAA,EAAgB;QAClB;MAEJ;IACF;EACF;EAEA,IAAI9C,UAAA,CAAW+C,QAAQ,EAAE;IACvBrB,QAAA,CAASxB,GAAG,CAAC8C,cAAc,GAAGhD,UAAA,CAAW+C,QAAQ;EACnD;EAEA,OAAOrB,QAAA;AACT;AAEA,eAAe3B,WAAA","ignoreList":[]}
1
+ {"version":3,"sources":["../src/withPayload.js"],"sourcesContent":["/**\n * @param {import('next').NextConfig} nextConfig\n * @param {Object} [options] - Optional configuration options\n * @param {boolean} [options.devBundleServerPackages] - Whether to bundle server packages in development mode. @default false\n *\n * @returns {import('next').NextConfig}\n * */\nexport const withPayload = (nextConfig = {}, options = {}) => {\n const env = nextConfig.env || {}\n\n if (nextConfig.experimental?.staleTimes?.dynamic) {\n console.warn(\n 'Payload detected a non-zero value for the `staleTimes.dynamic` option in your Next.js config. This will slow down page transitions and may cause stale data to load within the Admin panel. To clear this warning, remove the `staleTimes.dynamic` option from your Next.js config or set it to 0. In the future, Next.js may support scoping this option to specific routes.',\n )\n env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH = 'true'\n }\n\n if (process.env.PAYLOAD_PATCH_TURBOPACK_WARNINGS !== 'false') {\n // TODO: This warning is thrown because we cannot externalize the entry-point package for client-s3, so we patch the warning to not show it.\n // We can remove this once Next.js implements https://github.com/vercel/next.js/discussions/76991\n const turbopackWarningText =\n 'Packages that should be external need to be installed in the project directory, so they can be resolved from the output files.\\nTry to install it into the project directory by running'\n\n // TODO 4.0: Remove this once we drop support for Next.js 15.2.x\n const turbopackConfigWarningText = \"Unrecognized key(s) in object: 'turbopack'\"\n\n const consoleWarn = console.warn\n console.warn = (...args) => {\n // Force to disable serverExternalPackages warnings: https://github.com/vercel/next.js/issues/68805\n if (\n (typeof args[1] === 'string' && args[1].includes(turbopackWarningText)) ||\n (typeof args[0] === 'string' && args[0].includes(turbopackWarningText))\n ) {\n return\n }\n\n // Add Payload-specific message after turbopack config warning in Next.js 15.2.x or lower.\n // TODO 4.0: Remove this once we drop support for Next.js 15.2.x\n const hasTurbopackConfigWarning =\n (typeof args[1] === 'string' && args[1].includes(turbopackConfigWarningText)) ||\n (typeof args[0] === 'string' && args[0].includes(turbopackConfigWarningText))\n\n if (hasTurbopackConfigWarning) {\n consoleWarn(...args)\n consoleWarn(\n 'Payload: You can safely ignore the \"Invalid next.config\" warning above. This only occurs on Next.js 15.2.x or lower. We recommend upgrading to Next.js 15.4.7 to resolve this warning.',\n )\n return\n }\n\n consoleWarn(...args)\n }\n }\n\n const isBuild = process.env.NODE_ENV === 'production'\n const isTurbopackNextjs15 = process.env.TURBOPACK === '1'\n const isTurbopackNextjs16 = process.env.TURBOPACK === 'auto'\n\n if (isBuild && (isTurbopackNextjs15 || isTurbopackNextjs16)) {\n throw new Error(\n 'Payload does not support using Turbopack for production builds. If you are using Next.js 16, please use `next build --webpack` instead.',\n )\n }\n\n const poweredByHeader = {\n key: 'X-Powered-By',\n value: 'Next.js, Payload',\n }\n\n /**\n * @type {import('next').NextConfig}\n */\n const toReturn = {\n ...nextConfig,\n env,\n turbopack: {\n ...(nextConfig.turbopack || {}),\n },\n outputFileTracingExcludes: {\n ...(nextConfig.outputFileTracingExcludes || {}),\n '**/*': [\n ...(nextConfig.outputFileTracingExcludes?.['**/*'] || []),\n 'drizzle-kit',\n 'drizzle-kit/api',\n ],\n },\n outputFileTracingIncludes: {\n ...(nextConfig.outputFileTracingIncludes || {}),\n '**/*': [...(nextConfig.outputFileTracingIncludes?.['**/*'] || []), '@libsql/client'],\n },\n // We disable the poweredByHeader here because we add it manually in the headers function below\n ...(nextConfig.poweredByHeader !== false ? { poweredByHeader: false } : {}),\n headers: async () => {\n const headersFromConfig = 'headers' in nextConfig ? await nextConfig.headers() : []\n\n return [\n ...(headersFromConfig || []),\n {\n source: '/:path*',\n headers: [\n {\n key: 'Accept-CH',\n value: 'Sec-CH-Prefers-Color-Scheme',\n },\n {\n key: 'Vary',\n value: 'Sec-CH-Prefers-Color-Scheme',\n },\n {\n key: 'Critical-CH',\n value: 'Sec-CH-Prefers-Color-Scheme',\n },\n ...(nextConfig.poweredByHeader !== false ? [poweredByHeader] : []),\n ],\n },\n ]\n },\n serverExternalPackages: [\n // serverExternalPackages = webpack.externals, but with turbopack support and an additional check\n // for whether the package is resolvable from the project root\n ...(nextConfig.serverExternalPackages || []),\n // Can be externalized, because we require users to install graphql themselves - we only rely on it as a peer dependency => resolvable from the project root.\n //\n // WHY: without externalizing graphql, a graphql version error will be thrown\n // during runtime (\"Ensure that there is only one instance of \\\"graphql\\\" in the node_modules\\ndirectory.\")\n 'graphql',\n // External, because it installs import-in-the-middle and require-in-the-middle - both in the default serverExternalPackages list.\n '@sentry/nextjs',\n ...(process.env.NODE_ENV === 'development' && options.devBundleServerPackages !== true\n ? /**\n * Unless explicitly disabled by the user, by passing `devBundleServerPackages: true` to withPayload, we\n * do not bundle server-only packages during dev for two reasons:\n *\n * 1. Performance: Fewer files to compile means faster compilation speeds.\n * 2. Turbopack support: Webpack's externals are not supported by Turbopack.\n *\n * Regarding Turbopack support: Unlike webpack.externals, we cannot use serverExternalPackages to\n * externalized packages that are not resolvable from the project root. So including a package like\n * \"drizzle-kit\" in here would do nothing - Next.js will ignore the rule and still bundle the package -\n * because it detects that the package is not resolvable from the project root (= not directly installed\n * by the user in their own package.json).\n *\n * Instead, we can use serverExternalPackages for the entry-point packages that *are* installed directly\n * by the user (e.g. db-postgres, which then installs drizzle-kit as a dependency).\n *\n *\n *\n * We should only do this during development, not build, because externalizing these packages can hurt\n * the bundle size. Not only does it disable tree-shaking, it also risks installing duplicate copies of the\n * same package.\n *\n * Example:\n * - @payloadcms/richtext-lexical (in bundle) -> installs qs-esm (bundled because of importer)\n * - payload (not in bundle, external) -> installs qs-esm (external because of importer)\n * Result: we have two copies of qs-esm installed - one in the bundle, and one in node_modules.\n *\n * During development, these bundle size difference do not matter much, and development speed /\n * turbopack support are more important.\n */\n [\n 'payload',\n '@payloadcms/db-mongodb',\n '@payloadcms/db-postgres',\n '@payloadcms/db-sqlite',\n '@payloadcms/db-vercel-postgres',\n '@payloadcms/db-d1-sqlite',\n '@payloadcms/drizzle',\n '@payloadcms/email-nodemailer',\n '@payloadcms/email-resend',\n '@payloadcms/graphql',\n '@payloadcms/payload-cloud',\n '@payloadcms/plugin-redirects',\n // TODO: Add the following packages, excluding their /client subpath exports, once Next.js supports it\n // see: https://github.com/vercel/next.js/discussions/76991\n //'@payloadcms/plugin-cloud-storage',\n //'@payloadcms/plugin-sentry',\n //'@payloadcms/plugin-stripe',\n // @payloadcms/richtext-lexical\n //'@payloadcms/storage-azure',\n //'@payloadcms/storage-gcs',\n //'@payloadcms/storage-s3',\n //'@payloadcms/storage-uploadthing',\n //'@payloadcms/storage-vercel-blob',\n ]\n : []),\n ],\n webpack: (webpackConfig, webpackOptions) => {\n const incomingWebpackConfig =\n typeof nextConfig.webpack === 'function'\n ? nextConfig.webpack(webpackConfig, webpackOptions)\n : webpackConfig\n\n return {\n ...incomingWebpackConfig,\n externals: [\n ...(incomingWebpackConfig?.externals || []),\n /**\n * See the explanation in the serverExternalPackages section above.\n * We need to force Webpack to emit require() calls for these packages, even though they are not\n * resolvable from the project root. You would expect this to error during runtime, but Next.js seems to be able to require these just fine.\n *\n * This is the only way to get Webpack Build to work, without the bundle size caveats of externalizing the\n * entry point packages, as explained in the serverExternalPackages section above.\n */\n 'drizzle-kit',\n 'drizzle-kit/api',\n 'sharp',\n 'libsql',\n 'require-in-the-middle',\n ],\n resolve: {\n ...(incomingWebpackConfig?.resolve || {}),\n alias: {\n ...(incomingWebpackConfig?.resolve?.alias || {}),\n },\n fallback: {\n ...(incomingWebpackConfig?.resolve?.fallback || {}),\n /*\n * This fixes the following warning when running next build with webpack (tested on Next.js 16.0.3 with Payload 3.64.0):\n *\n * ⚠ Compiled with warnings in 8.7s\n *\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js\n * Module not found: Can't resolve 'aws4' in '/Users/alessio/Documents/temp/next16p/node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib'\n *\n * Import trace for requested module:\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/index.js\n * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/lib/index.js\n * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/index.js\n * ./node_modules/.pnpm/@payloadcms+db-mongodb@3.64.0_payload@3.64.0_graphql@16.12.0_typescript@5.7.3_/node_modules/@payloadcms/db-mongodb/dist/index.js\n * ./src/payload.config.ts\n * ./src/app/my-route/route.ts\n *\n **/\n aws4: false,\n },\n },\n plugins: [\n ...(incomingWebpackConfig?.plugins || []),\n // Fix cloudflare:sockets error: https://github.com/vercel/next.js/discussions/50177\n new webpackOptions.webpack.IgnorePlugin({\n resourceRegExp: /^pg-native$|^cloudflare:sockets$/,\n }),\n ],\n }\n },\n }\n\n if (nextConfig.basePath) {\n toReturn.env.NEXT_BASE_PATH = nextConfig.basePath\n }\n\n return toReturn\n}\n\nexport default withPayload\n"],"names":["withPayload","nextConfig","options","env","experimental","staleTimes","dynamic","console","warn","NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH","process","PAYLOAD_PATCH_TURBOPACK_WARNINGS","turbopackWarningText","turbopackConfigWarningText","consoleWarn","args","includes","hasTurbopackConfigWarning","isBuild","NODE_ENV","isTurbopackNextjs15","TURBOPACK","isTurbopackNextjs16","Error","poweredByHeader","key","value","toReturn","turbopack","outputFileTracingExcludes","outputFileTracingIncludes","headers","headersFromConfig","source","serverExternalPackages","devBundleServerPackages","webpack","webpackConfig","webpackOptions","incomingWebpackConfig","externals","resolve","alias","fallback","aws4","plugins","IgnorePlugin","resourceRegExp","basePath","NEXT_BASE_PATH"],"mappings":"AAAA;;;;;;GAMG,GACH,OAAO,MAAMA,cAAc,CAACC,aAAa,CAAC,CAAC,EAAEC,UAAU,CAAC,CAAC;IACvD,MAAMC,MAAMF,WAAWE,GAAG,IAAI,CAAC;IAE/B,IAAIF,WAAWG,YAAY,EAAEC,YAAYC,SAAS;QAChDC,QAAQC,IAAI,CACV;QAEFL,IAAIM,uCAAuC,GAAG;IAChD;IAEA,IAAIC,QAAQP,GAAG,CAACQ,gCAAgC,KAAK,SAAS;QAC5D,4IAA4I;QAC5I,iGAAiG;QACjG,MAAMC,uBACJ;QAEF,gEAAgE;QAChE,MAAMC,6BAA6B;QAEnC,MAAMC,cAAcP,QAAQC,IAAI;QAChCD,QAAQC,IAAI,GAAG,CAAC,GAAGO;YACjB,mGAAmG;YACnG,IACE,AAAC,OAAOA,IAAI,CAAC,EAAE,KAAK,YAAYA,IAAI,CAAC,EAAE,CAACC,QAAQ,CAACJ,yBAChD,OAAOG,IAAI,CAAC,EAAE,KAAK,YAAYA,IAAI,CAAC,EAAE,CAACC,QAAQ,CAACJ,uBACjD;gBACA;YACF;YAEA,0FAA0F;YAC1F,gEAAgE;YAChE,MAAMK,4BACJ,AAAC,OAAOF,IAAI,CAAC,EAAE,KAAK,YAAYA,IAAI,CAAC,EAAE,CAACC,QAAQ,CAACH,+BACh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oBACpF,IAAIP,eAAeF,OAAO,CAACU,YAAY,CAAC;wBACtCC,gBAAgB;oBAClB;iBACD;YACH;QACF;IACF;IAEA,IAAI9C,WAAW+C,QAAQ,EAAE;QACvBrB,SAASxB,GAAG,CAAC8C,cAAc,GAAGhD,WAAW+C,QAAQ;IACnD;IAEA,OAAOrB;AACT,EAAC;AAED,eAAe3B,YAAW"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/next",
3
- "version": "3.68.0-internal-debug.dafc24d",
3
+ "version": "3.68.0-internal-debug.591ab42",
4
4
  "homepage": "https://payloadcms.com",
5
5
  "repository": {
6
6
  "type": "git",
@@ -97,9 +97,9 @@
97
97
  "qs-esm": "7.0.2",
98
98
  "sass": "1.77.4",
99
99
  "uuid": "10.0.0",
100
- "@payloadcms/translations": "3.68.0-internal-debug.dafc24d",
101
- "@payloadcms/graphql": "3.68.0-internal-debug.dafc24d",
102
- "@payloadcms/ui": "3.68.0-internal-debug.dafc24d"
100
+ "@payloadcms/graphql": "3.68.0-internal-debug.591ab42",
101
+ "@payloadcms/ui": "3.68.0-internal-debug.591ab42",
102
+ "@payloadcms/translations": "3.68.0-internal-debug.591ab42"
103
103
  },
104
104
  "devDependencies": {
105
105
  "@babel/cli": "7.27.2",
@@ -117,12 +117,12 @@
117
117
  "esbuild-sass-plugin": "3.3.1",
118
118
  "swc-plugin-transform-remove-imports": "4.0.4",
119
119
  "@payloadcms/eslint-config": "3.28.0",
120
- "payload": "3.68.0-internal-debug.dafc24d"
120
+ "payload": "3.68.0-internal-debug.591ab42"
121
121
  },
122
122
  "peerDependencies": {
123
123
  "graphql": "^16.8.1",
124
124
  "next": "^15.4.8",
125
- "payload": "3.68.0-internal-debug.dafc24d"
125
+ "payload": "3.68.0-internal-debug.591ab42"
126
126
  },
127
127
  "engines": {
128
128
  "node": "^18.20.2 || >=20.9.0"
@@ -135,10 +135,11 @@
135
135
  "build:babel": "rm -rf dist_optimized && babel dist --out-dir dist_optimized --source-maps --extensions .ts,.js,.tsx,.jsx,.cjs,.mjs && rm -rf dist && mv dist_optimized dist",
136
136
  "build:bundle-for-analysis": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm build:swc && pnpm build:babel && pnpm copyfiles && node ./bundle.js esbuild",
137
137
  "build:cjs": "swc ./src/withPayload.js -o ./dist/cjs/withPayload.cjs --config-file .swcrc-cjs --strip-leading-paths",
138
- "build:debug": "pnpm build",
138
+ "build:debug": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm build:swc:debug && pnpm copyfiles && pnpm build:types && pnpm build:cjs",
139
139
  "build:esbuild": "node bundleScss.js",
140
140
  "build:reactcompiler": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm build:swc && pnpm build:babel && pnpm copyfiles && pnpm build:types && pnpm build:esbuild && pnpm build:cjs",
141
141
  "build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
142
+ "build:swc:debug": "swc ./src -d ./dist --config-file .swcrc-debug --strip-leading-paths",
142
143
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
143
144
  "build:without_reactcompiler": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm copyfiles && pnpm build:types && pnpm build:swc && pnpm build:cjs && pnpm build:esbuild",
144
145
  "clean": "rimraf -g {dist,*.tsbuildinfo,esbuild}",