@payloadcms/next 3.71.0-internal-debug.e053082 → 3.71.0-internal.49c4f67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/login.js +58 -52
- package/dist/auth/login.js.map +1 -1
- package/dist/auth/logout.js +44 -39
- package/dist/auth/logout.js.map +1 -1
- package/dist/auth/refresh.js +47 -45
- package/dist/auth/refresh.js.map +1 -1
- package/dist/cjs/withPayload.cjs +23 -61
- package/dist/cjs/withPayload.cjs.map +2 -2
- package/dist/config.js +0 -1
- package/dist/config.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js +15 -9
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js +71 -40
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js +59 -65
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.js +70 -80
- package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js +23 -16
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js +69 -61
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js.map +1 -1
- package/dist/elements/DocumentHeader/index.js +28 -48
- package/dist/elements/DocumentHeader/index.js.map +1 -1
- package/dist/elements/FormHeader/index.js +16 -30
- package/dist/elements/FormHeader/index.js.map +1 -1
- package/dist/elements/Logo/index.js +34 -19
- package/dist/elements/Logo/index.js.map +1 -1
- package/dist/elements/Nav/NavHamburger/index.js +44 -23
- package/dist/elements/Nav/NavHamburger/index.js.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.js +54 -28
- package/dist/elements/Nav/NavWrapper/index.js.map +1 -1
- package/dist/elements/Nav/SettingsMenuButton/index.js +39 -33
- package/dist/elements/Nav/SettingsMenuButton/index.js.map +1 -1
- package/dist/elements/Nav/getNavPrefs.js +22 -27
- package/dist/elements/Nav/getNavPrefs.js.map +1 -1
- package/dist/elements/Nav/index.client.js +118 -97
- package/dist/elements/Nav/index.client.js.map +1 -1
- package/dist/elements/Nav/index.js +127 -148
- package/dist/elements/Nav/index.js.map +1 -1
- package/dist/exports/auth.js +0 -1
- package/dist/exports/auth.js.map +1 -1
- package/dist/exports/client.js +1 -1
- package/dist/exports/client.js.map +1 -1
- package/dist/exports/layouts.js +0 -1
- package/dist/exports/layouts.js.map +1 -1
- package/dist/exports/routes.js +0 -1
- package/dist/exports/routes.js.map +1 -1
- package/dist/exports/rsc.js +0 -1
- package/dist/exports/rsc.js.map +1 -1
- package/dist/exports/templates.js +0 -1
- package/dist/exports/templates.js.map +1 -1
- package/dist/exports/utilities.js +12 -7
- package/dist/exports/utilities.js.map +1 -1
- package/dist/exports/views.js +0 -1
- package/dist/exports/views.js.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/layouts/Root/NestProviders.js +20 -21
- package/dist/layouts/Root/NestProviders.js.map +1 -1
- package/dist/layouts/Root/checkDependencies.js +41 -49
- package/dist/layouts/Root/checkDependencies.js.map +1 -1
- package/dist/layouts/Root/index.js +103 -128
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/prod/styles.css +1 -5
- package/dist/routes/graphql/handler.js +122 -114
- package/dist/routes/graphql/handler.js.map +1 -1
- package/dist/routes/graphql/index.js +0 -1
- package/dist/routes/graphql/index.js.map +1 -1
- package/dist/routes/graphql/playground.js +27 -28
- package/dist/routes/graphql/playground.js.map +1 -1
- package/dist/routes/index.js +0 -1
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/rest/index.js +22 -23
- package/dist/routes/rest/index.js.map +1 -1
- package/dist/routes/rest/og/image.js +79 -103
- package/dist/routes/rest/og/image.js.map +1 -1
- package/dist/routes/rest/og/index.js +54 -59
- package/dist/routes/rest/og/index.js.map +1 -1
- package/dist/templates/Default/NavHamburger/index.js +20 -12
- package/dist/templates/Default/NavHamburger/index.js.map +1 -1
- package/dist/templates/Default/Wrapper/index.js +44 -20
- package/dist/templates/Default/Wrapper/index.js.map +1 -1
- package/dist/templates/Default/index.js +116 -147
- package/dist/templates/Default/index.js.map +1 -1
- package/dist/templates/Minimal/index.js +17 -26
- package/dist/templates/Minimal/index.js.map +1 -1
- package/dist/utilities/getExistingAuthToken.js +2 -3
- package/dist/utilities/getExistingAuthToken.js.map +1 -1
- package/dist/utilities/getNextRequestI18n.js +13 -12
- package/dist/utilities/getNextRequestI18n.js.map +1 -1
- package/dist/utilities/getPayloadHMR.js +5 -5
- package/dist/utilities/getPayloadHMR.js.map +1 -1
- package/dist/utilities/getPreferences.js +22 -27
- package/dist/utilities/getPreferences.js.map +1 -1
- package/dist/utilities/getRequestLocale.js +14 -13
- package/dist/utilities/getRequestLocale.js.map +1 -1
- package/dist/utilities/getRequestTheme.js +19 -19
- package/dist/utilities/getRequestTheme.js.map +1 -1
- package/dist/utilities/getRouteWithoutAdmin.js +5 -3
- package/dist/utilities/getRouteWithoutAdmin.js.map +1 -1
- package/dist/utilities/handleAuthRedirect.js +36 -22
- package/dist/utilities/handleAuthRedirect.js.map +1 -1
- package/dist/utilities/handleServerFunctions.js +41 -34
- package/dist/utilities/handleServerFunctions.js.map +1 -1
- package/dist/utilities/initReq.js +96 -78
- package/dist/utilities/initReq.js.map +1 -1
- package/dist/utilities/isCustomAdminView.js +26 -22
- package/dist/utilities/isCustomAdminView.js.map +1 -1
- package/dist/utilities/isPublicAdminRoute.js +20 -26
- package/dist/utilities/isPublicAdminRoute.js.map +1 -1
- package/dist/utilities/meta.js +63 -68
- package/dist/utilities/meta.js.map +1 -1
- package/dist/utilities/selectiveCache.js +26 -25
- package/dist/utilities/selectiveCache.js.map +1 -1
- package/dist/utilities/setPayloadAuthCookie.js +22 -19
- package/dist/utilities/setPayloadAuthCookie.js.map +1 -1
- package/dist/utilities/slugify.js +33 -24
- package/dist/utilities/slugify.js.map +1 -1
- package/dist/utilities/timestamp.js +6 -7
- package/dist/utilities/timestamp.js.map +1 -1
- package/dist/views/API/LocaleSelector/index.js +39 -17
- package/dist/views/API/LocaleSelector/index.js.map +1 -1
- package/dist/views/API/RenderJSON/index.js +126 -171
- package/dist/views/API/RenderJSON/index.js.map +1 -1
- package/dist/views/API/index.client.js +197 -290
- package/dist/views/API/index.client.js.map +1 -1
- package/dist/views/API/index.js +2 -7
- package/dist/views/API/index.js.map +1 -1
- package/dist/views/API/metadata.js +23 -18
- package/dist/views/API/metadata.js.map +1 -1
- package/dist/views/Account/ResetPreferences/index.js +102 -78
- package/dist/views/Account/ResetPreferences/index.js.map +1 -1
- package/dist/views/Account/Settings/LanguageSelector.js +47 -18
- package/dist/views/Account/Settings/LanguageSelector.js.map +1 -1
- package/dist/views/Account/Settings/index.js +25 -60
- package/dist/views/Account/Settings/index.js.map +1 -1
- package/dist/views/Account/ToggleTheme/index.js +55 -38
- package/dist/views/Account/ToggleTheme/index.js.map +1 -1
- package/dist/views/Account/index.client.js +32 -16
- package/dist/views/Account/index.client.js.map +1 -1
- package/dist/views/Account/index.js +158 -147
- package/dist/views/Account/index.js.map +1 -1
- package/dist/views/Account/metadata.js +12 -8
- package/dist/views/Account/metadata.js.map +1 -1
- package/dist/views/BrowseByFolder/buildView.js +157 -138
- package/dist/views/BrowseByFolder/buildView.js.map +1 -1
- package/dist/views/BrowseByFolder/index.js +16 -16
- package/dist/views/BrowseByFolder/index.js.map +1 -1
- package/dist/views/BrowseByFolder/metadata.js +15 -13
- package/dist/views/BrowseByFolder/metadata.js.map +1 -1
- package/dist/views/CollectionFolders/buildView.js +142 -122
- package/dist/views/CollectionFolders/buildView.js.map +1 -1
- package/dist/views/CollectionFolders/index.js +16 -16
- package/dist/views/CollectionFolders/index.js.map +1 -1
- package/dist/views/CollectionFolders/metadata.js +21 -18
- package/dist/views/CollectionFolders/metadata.js.map +1 -1
- package/dist/views/CollectionFolders/renderFolderViewSlots.js +61 -58
- package/dist/views/CollectionFolders/renderFolderViewSlots.js.map +1 -1
- package/dist/views/CollectionTrash/index.js +17 -17
- package/dist/views/CollectionTrash/index.js.map +1 -1
- package/dist/views/CollectionTrash/metadata.js +21 -18
- package/dist/views/CollectionTrash/metadata.js.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +103 -117
- package/dist/views/CreateFirstUser/index.client.js.map +1 -1
- package/dist/views/CreateFirstUser/index.js +81 -87
- package/dist/views/CreateFirstUser/index.js.map +1 -1
- package/dist/views/CreateFirstUser/metadata.js +12 -8
- package/dist/views/CreateFirstUser/metadata.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/DashboardStepNav.js +138 -147
- package/dist/views/Dashboard/Default/ModularDashboard/DashboardStepNav.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/index.client.js +405 -423
- package/dist/views/Dashboard/Default/ModularDashboard/index.client.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/index.js +75 -72
- package/dist/views/Dashboard/Default/ModularDashboard/index.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/RenderWidget.js +89 -62
- package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/RenderWidget.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/getDefaultLayoutServerFn.js +47 -40
- package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/getDefaultLayoutServerFn.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/renderWidgetServerFn.js +65 -64
- package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/renderWidgetServerFn.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/useDashboardLayout.js +147 -164
- package/dist/views/Dashboard/Default/ModularDashboard/useDashboardLayout.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/utils/collisionDetection.js +30 -31
- package/dist/views/Dashboard/Default/ModularDashboard/utils/collisionDetection.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/utils/sensors.js +229 -223
- package/dist/views/Dashboard/Default/ModularDashboard/utils/sensors.js.map +1 -1
- package/dist/views/Dashboard/Default/index.js +45 -59
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- package/dist/views/Dashboard/index.js +42 -46
- package/dist/views/Dashboard/index.js.map +1 -1
- package/dist/views/Dashboard/metadata.js +14 -10
- package/dist/views/Dashboard/metadata.js.map +1 -1
- package/dist/views/Document/getCustomDocumentViewByKey.js +2 -3
- package/dist/views/Document/getCustomDocumentViewByKey.js.map +1 -1
- package/dist/views/Document/getCustomViewByRoute.js +30 -27
- package/dist/views/Document/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Document/getDocPreferences.js +41 -40
- package/dist/views/Document/getDocPreferences.js.map +1 -1
- package/dist/views/Document/getDocumentData.js +55 -44
- package/dist/views/Document/getDocumentData.js.map +1 -1
- package/dist/views/Document/getDocumentPermissions.js +80 -77
- package/dist/views/Document/getDocumentPermissions.js.map +1 -1
- package/dist/views/Document/getDocumentView.js +283 -313
- package/dist/views/Document/getDocumentView.js.map +1 -1
- package/dist/views/Document/getIsLocked.js +66 -66
- package/dist/views/Document/getIsLocked.js.map +1 -1
- package/dist/views/Document/getMetaBySegment.js +136 -130
- package/dist/views/Document/getMetaBySegment.js.map +1 -1
- package/dist/views/Document/getVersions.js +195 -205
- package/dist/views/Document/getVersions.js.map +1 -1
- package/dist/views/Document/handleServerFunction.js +128 -103
- package/dist/views/Document/handleServerFunction.js.map +1 -1
- package/dist/views/Document/index.js +355 -316
- package/dist/views/Document/index.js.map +1 -1
- package/dist/views/Document/metadata.js +1 -2
- package/dist/views/Document/metadata.js.map +1 -1
- package/dist/views/Document/renderDocumentSlots.js +132 -121
- package/dist/views/Document/renderDocumentSlots.js.map +1 -1
- package/dist/views/Edit/index.js +6 -10
- package/dist/views/Edit/index.js.map +1 -1
- package/dist/views/Edit/metadata.js +46 -36
- package/dist/views/Edit/metadata.js.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +164 -130
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
- package/dist/views/ForgotPassword/index.js +62 -79
- package/dist/views/ForgotPassword/index.js.map +1 -1
- package/dist/views/ForgotPassword/metadata.js +12 -8
- package/dist/views/ForgotPassword/metadata.js.map +1 -1
- package/dist/views/List/createSerializableValue.js +11 -12
- package/dist/views/List/createSerializableValue.js.map +1 -1
- package/dist/views/List/enrichDocsWithVersionStatus.js +86 -86
- package/dist/views/List/enrichDocsWithVersionStatus.js.map +1 -1
- package/dist/views/List/extractRelationshipDisplayValue.js +14 -15
- package/dist/views/List/extractRelationshipDisplayValue.js.map +1 -1
- package/dist/views/List/extractValueOrRelationshipID.js +15 -16
- package/dist/views/List/extractValueOrRelationshipID.js.map +1 -1
- package/dist/views/List/handleGroupBy.js +150 -133
- package/dist/views/List/handleGroupBy.js.map +1 -1
- package/dist/views/List/handleServerFunction.js +121 -98
- package/dist/views/List/handleServerFunction.js.map +1 -1
- package/dist/views/List/index.js +323 -305
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/List/metadata.js +20 -17
- package/dist/views/List/metadata.js.map +1 -1
- package/dist/views/List/renderListViewSlots.js +75 -82
- package/dist/views/List/renderListViewSlots.js.map +1 -1
- package/dist/views/List/resolveAllFilterOptions.js +45 -43
- package/dist/views/List/resolveAllFilterOptions.js.map +1 -1
- package/dist/views/List/transformColumnsToSelect.js +8 -9
- package/dist/views/List/transformColumnsToSelect.js.map +1 -1
- package/dist/views/Login/LoginField/index.js +89 -57
- package/dist/views/Login/LoginField/index.js.map +1 -1
- package/dist/views/Login/LoginForm/index.js +160 -107
- package/dist/views/Login/LoginForm/index.js.map +1 -1
- package/dist/views/Login/index.js +85 -82
- package/dist/views/Login/index.js.map +1 -1
- package/dist/views/Login/metadata.js +12 -8
- package/dist/views/Login/metadata.js.map +1 -1
- package/dist/views/Logout/LogoutClient.js +120 -84
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/Logout/index.js +29 -29
- package/dist/views/Logout/index.js.map +1 -1
- package/dist/views/Logout/metadata.js +11 -7
- package/dist/views/Logout/metadata.js.map +1 -1
- package/dist/views/NotFound/index.client.js +82 -71
- package/dist/views/NotFound/index.client.js.map +1 -1
- package/dist/views/NotFound/index.js +73 -72
- package/dist/views/NotFound/index.js.map +1 -1
- package/dist/views/NotFound/metadata.js +9 -7
- package/dist/views/NotFound/metadata.js.map +1 -1
- package/dist/views/ResetPassword/ResetPasswordForm/index.js +108 -97
- package/dist/views/ResetPassword/ResetPasswordForm/index.js.map +1 -1
- package/dist/views/ResetPassword/index.js +73 -93
- package/dist/views/ResetPassword/index.js.map +1 -1
- package/dist/views/ResetPassword/metadata.js +12 -8
- package/dist/views/ResetPassword/metadata.js.map +1 -1
- package/dist/views/Root/attachViewActions.js +23 -18
- package/dist/views/Root/attachViewActions.js.map +1 -1
- package/dist/views/Root/generateCustomViewMetadata.js +21 -19
- package/dist/views/Root/generateCustomViewMetadata.js.map +1 -1
- package/dist/views/Root/getCustomViewByKey.js +14 -12
- package/dist/views/Root/getCustomViewByKey.js.map +1 -1
- package/dist/views/Root/getCustomViewByRoute.js +42 -31
- package/dist/views/Root/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Root/getDocumentViewInfo.js +23 -24
- package/dist/views/Root/getDocumentViewInfo.js.map +1 -1
- package/dist/views/Root/getRouteData.js +325 -333
- package/dist/views/Root/getRouteData.js.map +1 -1
- package/dist/views/Root/index.js +270 -248
- package/dist/views/Root/index.js.map +1 -1
- package/dist/views/Root/isPathMatchingRoute.js +26 -21
- package/dist/views/Root/isPathMatchingRoute.js.map +1 -1
- package/dist/views/Root/metadata.js +181 -176
- package/dist/views/Root/metadata.js.map +1 -1
- package/dist/views/Unauthorized/index.js +46 -54
- package/dist/views/Unauthorized/index.js.map +1 -1
- package/dist/views/Unauthorized/metadata.js +12 -8
- package/dist/views/Unauthorized/metadata.js.map +1 -1
- package/dist/views/Verify/index.client.js +43 -25
- package/dist/views/Verify/index.client.js.map +1 -1
- package/dist/views/Verify/index.js +64 -69
- package/dist/views/Verify/index.js.map +1 -1
- package/dist/views/Verify/metadata.js +12 -8
- package/dist/views/Verify/metadata.js.map +1 -1
- package/dist/views/Version/Default/SelectedLocalesContext.js +4 -4
- package/dist/views/Version/Default/SelectedLocalesContext.js.map +1 -1
- package/dist/views/Version/Default/SetStepNav.js +127 -86
- package/dist/views/Version/Default/SetStepNav.js.map +1 -1
- package/dist/views/Version/Default/index.js +236 -380
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/Default/types.js +1 -2
- package/dist/views/Version/Default/types.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js +119 -102
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js +73 -78
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js +408 -363
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js +51 -40
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Date/index.js +67 -35
- package/dist/views/Version/RenderFieldsToDiff/fields/Date/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js +56 -59
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +117 -139
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.js +41 -36
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +178 -192
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js +11 -17
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +73 -48
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +143 -132
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +81 -56
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.js +211 -252
- package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js +22 -23
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.js +9 -12
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js +228 -213
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js +826 -1005
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.js +1 -2
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js +43 -44
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js +36 -32
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js +129 -145
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js.map +1 -1
- package/dist/views/Version/Restore/index.js +93 -117
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/VersionDrawer/CreatedAtCell.js +50 -33
- package/dist/views/Version/SelectComparison/VersionDrawer/CreatedAtCell.js.map +1 -1
- package/dist/views/Version/SelectComparison/VersionDrawer/index.js +226 -170
- package/dist/views/Version/SelectComparison/VersionDrawer/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/index.js +50 -73
- package/dist/views/Version/SelectComparison/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/types.js +1 -2
- package/dist/views/Version/SelectComparison/types.js.map +1 -1
- package/dist/views/Version/SelectLocales/index.js +32 -34
- package/dist/views/Version/SelectLocales/index.js.map +1 -1
- package/dist/views/Version/VersionPillLabel/VersionPillLabel.js +95 -104
- package/dist/views/Version/VersionPillLabel/VersionPillLabel.js.map +1 -1
- package/dist/views/Version/VersionPillLabel/getVersionLabel.js +27 -23
- package/dist/views/Version/VersionPillLabel/getVersionLabel.js.map +1 -1
- package/dist/views/Version/fetchVersions.js +138 -113
- package/dist/views/Version/fetchVersions.js.map +1 -1
- package/dist/views/Version/index.js +323 -325
- package/dist/views/Version/index.js.map +1 -1
- package/dist/views/Version/metadata.js +50 -43
- package/dist/views/Version/metadata.js.map +1 -1
- package/dist/views/Versions/buildColumns.js +79 -95
- package/dist/views/Versions/buildColumns.js.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.js +38 -34
- package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.js +53 -32
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
- package/dist/views/Versions/cells/ID/index.js +8 -10
- package/dist/views/Versions/cells/ID/index.js.map +1 -1
- package/dist/views/Versions/index.client.js +83 -106
- package/dist/views/Versions/index.client.js.map +1 -1
- package/dist/views/Versions/index.js +143 -143
- package/dist/views/Versions/index.js.map +1 -1
- package/dist/views/Versions/metadata.js +44 -37
- package/dist/views/Versions/metadata.js.map +1 -1
- package/dist/views/Versions/types.js +1 -2
- package/dist/views/Versions/types.js.map +1 -1
- package/dist/withPayload/withPayload.js +144 -198
- package/dist/withPayload/withPayload.js.map +1 -1
- package/dist/withPayload/withPayload.utils.js +73 -65
- package/dist/withPayload/withPayload.utils.js.map +1 -1
- package/dist/withPayload/withPayloadLegacy.js +40 -41
- package/dist/withPayload/withPayloadLegacy.js.map +1 -1
- package/package.json +7 -7
- package/dist/elements/DocumentHeader/Tabs/Tab/index.scss +0 -38
- package/dist/elements/DocumentHeader/Tabs/index.scss +0 -54
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.scss +0 -9
- package/dist/elements/DocumentHeader/index.scss +0 -64
- package/dist/elements/FormHeader/index.scss +0 -8
- package/dist/elements/Nav/NavWrapper/index.scss +0 -27
- package/dist/elements/Nav/SettingsMenuButton/index.scss +0 -11
- package/dist/elements/Nav/index.scss +0 -173
- package/dist/esbuildEntry.d.ts +0 -5
- package/dist/esbuildEntry.d.ts.map +0 -1
- package/dist/esbuildEntry.js +0 -6
- package/dist/esbuildEntry.js.map +0 -1
- package/dist/templates/Default/Wrapper/index.scss +0 -58
- package/dist/templates/Default/index.scss +0 -79
- package/dist/templates/Minimal/index.scss +0 -30
- package/dist/views/API/RenderJSON/index.scss +0 -129
- package/dist/views/API/index.scss +0 -119
- package/dist/views/Account/Settings/index.scss +0 -48
- package/dist/views/CreateFirstUser/index.scss +0 -21
- package/dist/views/Dashboard/Default/ModularDashboard/index.scss +0 -316
- package/dist/views/Login/LoginForm/index.scss +0 -10
- package/dist/views/Login/index.scss +0 -10
- package/dist/views/Logout/index.scss +0 -25
- package/dist/views/NotFound/index.scss +0 -57
- package/dist/views/ResetPassword/index.scss +0 -11
- package/dist/views/Unauthorized/index.scss +0 -14
- package/dist/views/Verify/index.scss +0 -16
- package/dist/views/Version/Default/index.scss +0 -170
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.scss +0 -81
- package/dist/views/Version/RenderFieldsToDiff/fields/Date/index.scss +0 -12
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.scss +0 -9
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.scss +0 -59
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.scss +0 -91
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.scss +0 -4
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.scss +0 -9
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.scss +0 -4
- package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.scss +0 -121
- package/dist/views/Version/RenderFieldsToDiff/index.scss +0 -24
- package/dist/views/Version/Restore/index.scss +0 -84
- package/dist/views/Version/SelectComparison/VersionDrawer/index.scss +0 -18
- package/dist/views/Version/SelectComparison/index.scss +0 -9
- package/dist/views/Version/VersionPillLabel/index.scss +0 -26
- package/dist/views/Versions/cells/AutosaveCell/index.scss +0 -9
- package/dist/views/Versions/index.scss +0 -110
|
@@ -3,213 +3,159 @@
|
|
|
3
3
|
* imported directly in next.config.mjs files. Since next.config files run before the build process,
|
|
4
4
|
* TypeScript compilation is not available. This ensures compatibility with all templates and
|
|
5
5
|
* user projects regardless of their TypeScript setup.
|
|
6
|
-
*/
|
|
6
|
+
*/import { getNextjsVersion, supportsTurbopackExternalizeTransitiveDependencies } from './withPayload.utils.js';
|
|
7
7
|
import { withPayloadLegacy } from './withPayloadLegacy.js';
|
|
8
8
|
const poweredByHeader = {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
key: 'X-Powered-By',
|
|
10
|
+
value: 'Next.js, Payload'
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* @param {import('next').NextConfig} nextConfig
|
|
14
14
|
* @param {Object} [options] - Optional configuration options
|
|
15
15
|
* @param {boolean} [options.devBundleServerPackages] - Whether to bundle server packages in development mode. @default false
|
|
16
|
-
* */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
* See the explanation in the serverExternalPackages section above.
|
|
143
|
-
* We need to force Webpack to emit require() calls for these packages, even though they are not
|
|
144
|
-
* 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.
|
|
145
|
-
*
|
|
146
|
-
* This is the only way to get Webpack Build to work, without the bundle size caveats of externalizing the
|
|
147
|
-
* entry point packages, as explained in the serverExternalPackages section above.
|
|
148
|
-
*/ 'drizzle-kit',
|
|
149
|
-
'drizzle-kit/api',
|
|
150
|
-
'sharp',
|
|
151
|
-
'libsql',
|
|
152
|
-
'require-in-the-middle'
|
|
153
|
-
],
|
|
154
|
-
plugins: [
|
|
155
|
-
...incomingWebpackConfig?.plugins || [],
|
|
156
|
-
// Fix cloudflare:sockets error: https://github.com/vercel/next.js/discussions/50177
|
|
157
|
-
new webpackOptions.webpack.IgnorePlugin({
|
|
158
|
-
resourceRegExp: /^pg-native$|^cloudflare:sockets$/
|
|
159
|
-
})
|
|
160
|
-
],
|
|
161
|
-
resolve: {
|
|
162
|
-
...incomingWebpackConfig?.resolve || {},
|
|
163
|
-
alias: {
|
|
164
|
-
...incomingWebpackConfig?.resolve?.alias || {}
|
|
165
|
-
},
|
|
166
|
-
fallback: {
|
|
167
|
-
...incomingWebpackConfig?.resolve?.fallback || {},
|
|
168
|
-
/*
|
|
169
|
-
* This fixes the following warning when running next build with webpack (tested on Next.js 16.0.3 with Payload 3.64.0):
|
|
170
|
-
*
|
|
171
|
-
* ⚠ Compiled with warnings in 8.7s
|
|
172
|
-
*
|
|
173
|
-
* ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js
|
|
174
|
-
* Module not found: Can't resolve 'aws4' in '/Users/alessio/Documents/temp/next16p/node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib'
|
|
175
|
-
*
|
|
176
|
-
* Import trace for requested module:
|
|
177
|
-
* ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js
|
|
178
|
-
* ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js
|
|
179
|
-
* ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/index.js
|
|
180
|
-
* ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/lib/index.js
|
|
181
|
-
* ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/index.js
|
|
182
|
-
* ./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
|
|
183
|
-
* ./src/payload.config.ts
|
|
184
|
-
* ./src/app/my-route/route.ts
|
|
185
|
-
*
|
|
186
|
-
**/ aws4: false
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
};
|
|
16
|
+
* */
|
|
17
|
+
export const withPayload = (nextConfig = {}, options = {}) => {
|
|
18
|
+
const nextjsVersion = getNextjsVersion();
|
|
19
|
+
const supportsTurbopackBuild = supportsTurbopackExternalizeTransitiveDependencies(nextjsVersion);
|
|
20
|
+
const env = nextConfig.env || {};
|
|
21
|
+
if (nextConfig.experimental?.staleTimes?.dynamic) {
|
|
22
|
+
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.');
|
|
23
|
+
env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH = 'true';
|
|
24
|
+
}
|
|
25
|
+
/** @type {import('next').NextConfig} */
|
|
26
|
+
const baseConfig = {
|
|
27
|
+
...nextConfig,
|
|
28
|
+
env,
|
|
29
|
+
outputFileTracingExcludes: {
|
|
30
|
+
...(nextConfig.outputFileTracingExcludes || {}),
|
|
31
|
+
'**/*': [...(nextConfig.outputFileTracingExcludes?.['**/*'] || []), 'drizzle-kit', 'drizzle-kit/api']
|
|
32
|
+
},
|
|
33
|
+
outputFileTracingIncludes: {
|
|
34
|
+
...(nextConfig.outputFileTracingIncludes || {}),
|
|
35
|
+
'**/*': [...(nextConfig.outputFileTracingIncludes?.['**/*'] || []), '@libsql/client']
|
|
36
|
+
},
|
|
37
|
+
turbopack: {
|
|
38
|
+
...(nextConfig.turbopack || {})
|
|
39
|
+
},
|
|
40
|
+
// We disable the poweredByHeader here because we add it manually in the headers function below
|
|
41
|
+
...(nextConfig.poweredByHeader !== false ? {
|
|
42
|
+
poweredByHeader: false
|
|
43
|
+
} : {}),
|
|
44
|
+
headers: async () => {
|
|
45
|
+
const headersFromConfig = 'headers' in nextConfig ? await nextConfig.headers() : [];
|
|
46
|
+
return [...(headersFromConfig || []), {
|
|
47
|
+
headers: [{
|
|
48
|
+
key: 'Accept-CH',
|
|
49
|
+
value: 'Sec-CH-Prefers-Color-Scheme'
|
|
50
|
+
}, {
|
|
51
|
+
key: 'Vary',
|
|
52
|
+
value: 'Sec-CH-Prefers-Color-Scheme'
|
|
53
|
+
}, {
|
|
54
|
+
key: 'Critical-CH',
|
|
55
|
+
value: 'Sec-CH-Prefers-Color-Scheme'
|
|
56
|
+
}, ...(nextConfig.poweredByHeader !== false ? [poweredByHeader] : [])],
|
|
57
|
+
source: '/:path*'
|
|
58
|
+
}];
|
|
59
|
+
},
|
|
60
|
+
serverExternalPackages: [...(nextConfig.serverExternalPackages || []),
|
|
61
|
+
// WHY: without externalizing graphql, a graphql version error will be thrown
|
|
62
|
+
// during runtime ("Ensure that there is only one instance of \"graphql\" in the node_modules\ndirectory.")
|
|
63
|
+
'graphql', ...(process.env.NODE_ENV === 'development' && options.devBundleServerPackages !== true ?
|
|
64
|
+
/**
|
|
65
|
+
* Unless explicitly disabled by the user, by passing `devBundleServerPackages: true` to withPayload, we
|
|
66
|
+
* do not bundle server-only packages during dev for two reasons:
|
|
67
|
+
*
|
|
68
|
+
* 1. Performance: Fewer files to compile means faster compilation speeds.
|
|
69
|
+
* 2. Turbopack support: Webpack's externals are not supported by Turbopack.
|
|
70
|
+
*
|
|
71
|
+
* Regarding Turbopack support: Unlike webpack.externals, we cannot use serverExternalPackages to
|
|
72
|
+
* externalized packages that are not resolvable from the project root. So including a package like
|
|
73
|
+
* "drizzle-kit" in here would do nothing - Next.js will ignore the rule and still bundle the package -
|
|
74
|
+
* because it detects that the package is not resolvable from the project root (= not directly installed
|
|
75
|
+
* by the user in their own package.json).
|
|
76
|
+
*
|
|
77
|
+
* Instead, we can use serverExternalPackages for the entry-point packages that *are* installed directly
|
|
78
|
+
* by the user (e.g. db-postgres, which then installs drizzle-kit as a dependency).
|
|
79
|
+
*
|
|
80
|
+
*
|
|
81
|
+
*
|
|
82
|
+
* We should only do this during development, not build, because externalizing these packages can hurt
|
|
83
|
+
* the bundle size. Not only does it disable tree-shaking, it also risks installing duplicate copies of the
|
|
84
|
+
* same package.
|
|
85
|
+
*
|
|
86
|
+
* Example:
|
|
87
|
+
* - @payloadcms/richtext-lexical (in bundle) -> installs qs-esm (bundled because of importer)
|
|
88
|
+
* - payload (not in bundle, external) -> installs qs-esm (external because of importer)
|
|
89
|
+
* Result: we have two copies of qs-esm installed - one in the bundle, and one in node_modules.
|
|
90
|
+
*
|
|
91
|
+
* During development, these bundle size difference do not matter much, and development speed /
|
|
92
|
+
* turbopack support are more important.
|
|
93
|
+
*/
|
|
94
|
+
['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'] : [])],
|
|
95
|
+
webpack: (webpackConfig, webpackOptions) => {
|
|
96
|
+
const incomingWebpackConfig = typeof nextConfig.webpack === 'function' ? nextConfig.webpack(webpackConfig, webpackOptions) : webpackConfig;
|
|
97
|
+
return {
|
|
98
|
+
...incomingWebpackConfig,
|
|
99
|
+
externals: [...(incomingWebpackConfig?.externals || []),
|
|
100
|
+
/**
|
|
101
|
+
* See the explanation in the serverExternalPackages section above.
|
|
102
|
+
* We need to force Webpack to emit require() calls for these packages, even though they are not
|
|
103
|
+
* 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.
|
|
104
|
+
*
|
|
105
|
+
* This is the only way to get Webpack Build to work, without the bundle size caveats of externalizing the
|
|
106
|
+
* entry point packages, as explained in the serverExternalPackages section above.
|
|
107
|
+
*/
|
|
108
|
+
'drizzle-kit', 'drizzle-kit/api', 'sharp', 'libsql', 'require-in-the-middle'],
|
|
109
|
+
plugins: [...(incomingWebpackConfig?.plugins || []),
|
|
110
|
+
// Fix cloudflare:sockets error: https://github.com/vercel/next.js/discussions/50177
|
|
111
|
+
new webpackOptions.webpack.IgnorePlugin({
|
|
112
|
+
resourceRegExp: /^pg-native$|^cloudflare:sockets$/
|
|
113
|
+
})],
|
|
114
|
+
resolve: {
|
|
115
|
+
...(incomingWebpackConfig?.resolve || {}),
|
|
116
|
+
alias: {
|
|
117
|
+
...(incomingWebpackConfig?.resolve?.alias || {})
|
|
118
|
+
},
|
|
119
|
+
fallback: {
|
|
120
|
+
...(incomingWebpackConfig?.resolve?.fallback || {}),
|
|
121
|
+
/*
|
|
122
|
+
* This fixes the following warning when running next build with webpack (tested on Next.js 16.0.3 with Payload 3.64.0):
|
|
123
|
+
*
|
|
124
|
+
* ⚠ Compiled with warnings in 8.7s
|
|
125
|
+
*
|
|
126
|
+
* ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js
|
|
127
|
+
* Module not found: Can't resolve 'aws4' in '/Users/alessio/Documents/temp/next16p/node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib'
|
|
128
|
+
*
|
|
129
|
+
* Import trace for requested module:
|
|
130
|
+
* ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js
|
|
131
|
+
* ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js
|
|
132
|
+
* ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/index.js
|
|
133
|
+
* ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/lib/index.js
|
|
134
|
+
* ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/index.js
|
|
135
|
+
* ./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
|
|
136
|
+
* ./src/payload.config.ts
|
|
137
|
+
* ./src/app/my-route/route.ts
|
|
138
|
+
*
|
|
139
|
+
**/
|
|
140
|
+
aws4: false
|
|
141
|
+
}
|
|
190
142
|
}
|
|
191
|
-
|
|
192
|
-
if (nextConfig.basePath) {
|
|
193
|
-
baseConfig.env.NEXT_BASE_PATH = nextConfig.basePath;
|
|
194
|
-
}
|
|
195
|
-
if (!supportsTurbopackBuild) {
|
|
196
|
-
return withPayloadLegacy(baseConfig);
|
|
197
|
-
} else {
|
|
198
|
-
return {
|
|
199
|
-
...baseConfig,
|
|
200
|
-
serverExternalPackages: [
|
|
201
|
-
...baseConfig.serverExternalPackages || [],
|
|
202
|
-
'drizzle-kit',
|
|
203
|
-
'drizzle-kit/api',
|
|
204
|
-
'sharp',
|
|
205
|
-
'libsql',
|
|
206
|
-
'require-in-the-middle',
|
|
207
|
-
// Prevents turbopack build errors by the thread-stream package which is installed by pino
|
|
208
|
-
'pino'
|
|
209
|
-
]
|
|
210
|
-
};
|
|
143
|
+
};
|
|
211
144
|
}
|
|
145
|
+
};
|
|
146
|
+
if (nextConfig.basePath) {
|
|
147
|
+
baseConfig.env.NEXT_BASE_PATH = nextConfig.basePath;
|
|
148
|
+
}
|
|
149
|
+
if (!supportsTurbopackBuild) {
|
|
150
|
+
return withPayloadLegacy(baseConfig);
|
|
151
|
+
} else {
|
|
152
|
+
return {
|
|
153
|
+
...baseConfig,
|
|
154
|
+
serverExternalPackages: [...(baseConfig.serverExternalPackages || []), 'drizzle-kit', 'drizzle-kit/api', 'sharp', 'libsql', 'require-in-the-middle',
|
|
155
|
+
// Prevents turbopack build errors by the thread-stream package which is installed by pino
|
|
156
|
+
'pino']
|
|
157
|
+
};
|
|
158
|
+
}
|
|
212
159
|
};
|
|
213
160
|
export default withPayload;
|
|
214
|
-
|
|
215
161
|
//# sourceMappingURL=withPayload.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/withPayload/withPayload.js"],"sourcesContent":["/**\n * These files must remain as plain JavaScript (.js) rather than TypeScript (.ts) because they are\n * imported directly in next.config.mjs files. Since next.config files run before the build process,\n * TypeScript compilation is not available. This ensures compatibility with all templates and\n * user projects regardless of their TypeScript setup.\n */\nimport {\n getNextjsVersion,\n supportsTurbopackExternalizeTransitiveDependencies,\n} from './withPayload.utils.js'\nimport { withPayloadLegacy } from './withPayloadLegacy.js'\n\nconst poweredByHeader = {\n key: 'X-Powered-By',\n value: 'Next.js, Payload',\n}\n\n/**\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 * */\nexport const withPayload = (nextConfig = {}, options = {}) => {\n const nextjsVersion = getNextjsVersion()\n\n const supportsTurbopackBuild = supportsTurbopackExternalizeTransitiveDependencies(nextjsVersion)\n\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 /** @type {import('next').NextConfig} */\n const baseConfig = {\n ...nextConfig,\n env,\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 turbopack: {\n ...(nextConfig.turbopack || {}),\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 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 source: '/:path*',\n },\n ]\n },\n serverExternalPackages: [\n ...(nextConfig.serverExternalPackages || []),\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 ...(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 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 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 }\n },\n }\n\n if (nextConfig.basePath) {\n baseConfig.env.NEXT_BASE_PATH = nextConfig.basePath\n }\n\n if (!supportsTurbopackBuild) {\n return withPayloadLegacy(baseConfig)\n } else {\n return {\n ...baseConfig,\n serverExternalPackages: [\n ...(baseConfig.serverExternalPackages || []),\n 'drizzle-kit',\n 'drizzle-kit/api',\n 'sharp',\n 'libsql',\n 'require-in-the-middle',\n // Prevents turbopack build errors by the thread-stream package which is installed by pino\n 'pino',\n ],\n }\n }\n}\n\nexport default withPayload\n"],"names":["getNextjsVersion","supportsTurbopackExternalizeTransitiveDependencies","withPayloadLegacy","poweredByHeader","key","value","withPayload","nextConfig","options","nextjsVersion","supportsTurbopackBuild","env","experimental","staleTimes","dynamic","console","warn","NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH","baseConfig","outputFileTracingExcludes","outputFileTracingIncludes","turbopack","headers","headersFromConfig","source","serverExternalPackages","process","NODE_ENV","devBundleServerPackages","webpack","webpackConfig","webpackOptions","incomingWebpackConfig","externals","plugins","IgnorePlugin","resourceRegExp","resolve","alias","fallback","aws4","basePath","NEXT_BASE_PATH"],"mappings":"AAAA;;;;;CAKC,GACD,SACEA,gBAAgB,EAChBC,kDAAkD,QAC7C,yBAAwB;AAC/B,SAASC,iBAAiB,QAAQ,yBAAwB;AAE1D,MAAMC,kBAAkB;IACtBC,KAAK;IACLC,OAAO;AACT;AAEA;;;;GAIG,GACH,OAAO,MAAMC,cAAc,CAACC,aAAa,CAAC,CAAC,EAAEC,UAAU,CAAC,CAAC;IACvD,MAAMC,gBAAgBT;IAEtB,MAAMU,yBAAyBT,mDAAmDQ;IAElF,MAAME,MAAMJ,WAAWI,GAAG,IAAI,CAAC;IAE/B,IAAIJ,WAAWK,YAAY,EAAEC,YAAYC,SAAS;QAChDC,QAAQC,IAAI,CACV;QAEFL,IAAIM,uCAAuC,GAAG;IAChD;IAEA,sCAAsC,GACtC,MAAMC,aAAa;QACjB,GAAGX,UAAU;QACbI;QACAQ,2BAA2B;YACzB,GAAIZ,WAAWY,yBAAyB,IAAI,CAAC,CAAC;YAC9C,QAAQ;mBACFZ,WAAWY,yBAAyB,EAAE,CAAC,OAAO,IAAI,EAAE;gBACxD;gBACA;aACD;QACH;QACAC,2BAA2B;YACzB,GAAIb,WAAWa,yBAAyB,IAAI,CAAC,CAAC;YAC9C,QAAQ;mBAAKb,WAAWa,yBAAyB,EAAE,CAAC,OAAO,IAAI,EAAE;gBAAG;aAAiB;QACvF;QACAC,WAAW;YACT,GAAId,WAAWc,SAAS,IAAI,CAAC,CAAC;QAChC;QACA,+FAA+F;QAC/F,GAAId,WAAWJ,eAAe,KAAK,QAAQ;YAAEA,iBAAiB;QAAM,IAAI,CAAC,CAAC;QAC1EmB,SAAS;YACP,MAAMC,oBAAoB,aAAahB,aAAa,MAAMA,WAAWe,OAAO,KAAK,EAAE;YAEnF,OAAO;mBACDC,qBAAqB,EAAE;gBAC3B;oBACED,SAAS;wBACP;4BACElB,KAAK;4BACLC,OAAO;wBACT;wBACA;4BACED,KAAK;4BACLC,OAAO;wBACT;wBACA;4BACED,KAAK;4BACLC,OAAO;wBACT;2BACIE,WAAWJ,eAAe,KAAK,QAAQ;4BAACA;yBAAgB,GAAG,EAAE;qBAClE;oBACDqB,QAAQ;gBACV;aACD;QACH;QACAC,wBAAwB;eAClBlB,WAAWkB,sBAAsB,IAAI,EAAE;YAC3C,6EAA6E;YAC7E,2GAA2G;YAC3G;eACIC,QAAQf,GAAG,CAACgB,QAAQ,KAAK,iBAAiBnB,QAAQoB,uBAAuB,KAAK,OAC9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA6BC,GACD;gBACE;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;aAYD,GAXC,sGAAsG;YACtG,2DAA2D;YAC3D,qCAAqC;YACrC,8BAA8B;YAC9B,8BAA8B;YAC9B,+BAA+B;YAC/B,8BAA8B;YAC9B,4BAA4B;YAC5B,2BAA2B;YAC3B,oCAAoC;YACpC,oCAAoC;YAEtC,EAAE;SACP;QACDC,SAAS,CAACC,eAAeC;YACvB,MAAMC,wBACJ,OAAOzB,WAAWsB,OAAO,KAAK,aAC1BtB,WAAWsB,OAAO,CAACC,eAAeC,kBAClCD;YAEN,OAAO;gBACL,GAAGE,qBAAqB;gBACxBC,WAAW;uBACLD,uBAAuBC,aAAa,EAAE;oBAC1C;;;;;;;WAOC,GACD;oBACA;oBACA;oBACA;oBACA;iBACD;gBACDC,SAAS;uBACHF,uBAAuBE,WAAW,EAAE;oBACxC,oFAAoF;oBACpF,IAAIH,eAAeF,OAAO,CAACM,YAAY,CAAC;wBACtCC,gBAAgB;oBAClB;iBACD;gBACDC,SAAS;oBACP,GAAIL,uBAAuBK,WAAW,CAAC,CAAC;oBACxCC,OAAO;wBACL,GAAIN,uBAAuBK,SAASC,SAAS,CAAC,CAAC;oBACjD;oBACAC,UAAU;wBACR,GAAIP,uBAAuBK,SAASE,YAAY,CAAC,CAAC;wBAClD;;;;;;;;;;;;;;;;;;cAkBE,GACFC,MAAM;oBACR;gBACF;YACF;QACF;IACF;IAEA,IAAIjC,WAAWkC,QAAQ,EAAE;QACvBvB,WAAWP,GAAG,CAAC+B,cAAc,GAAGnC,WAAWkC,QAAQ;IACrD;IAEA,IAAI,CAAC/B,wBAAwB;QAC3B,OAAOR,kBAAkBgB;IAC3B,OAAO;QACL,OAAO;YACL,GAAGA,UAAU;YACbO,wBAAwB;mBAClBP,WAAWO,sBAAsB,IAAI,EAAE;gBAC3C;gBACA;gBACA;gBACA;gBACA;gBACA,0FAA0F;gBAC1F;aACD;QACH;IACF;AACF,EAAC;AAED,eAAenB,YAAW"}
|
|
1
|
+
{"version":3,"file":"withPayload.js","names":["getNextjsVersion","supportsTurbopackExternalizeTransitiveDependencies","withPayloadLegacy","poweredByHeader","key","value","withPayload","nextConfig","options","nextjsVersion","supportsTurbopackBuild","env","experimental","staleTimes","dynamic","console","warn","NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH","baseConfig","outputFileTracingExcludes","outputFileTracingIncludes","turbopack","headers","headersFromConfig","source","serverExternalPackages","process","NODE_ENV","devBundleServerPackages","webpack","webpackConfig","webpackOptions","incomingWebpackConfig","externals","plugins","IgnorePlugin","resourceRegExp","resolve","alias","fallback","aws4","basePath","NEXT_BASE_PATH"],"sources":["../../src/withPayload/withPayload.js"],"sourcesContent":["/**\n * These files must remain as plain JavaScript (.js) rather than TypeScript (.ts) because they are\n * imported directly in next.config.mjs files. Since next.config files run before the build process,\n * TypeScript compilation is not available. This ensures compatibility with all templates and\n * user projects regardless of their TypeScript setup.\n */\nimport {\n getNextjsVersion,\n supportsTurbopackExternalizeTransitiveDependencies,\n} from './withPayload.utils.js'\nimport { withPayloadLegacy } from './withPayloadLegacy.js'\n\nconst poweredByHeader = {\n key: 'X-Powered-By',\n value: 'Next.js, Payload',\n}\n\n/**\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 * */\nexport const withPayload = (nextConfig = {}, options = {}) => {\n const nextjsVersion = getNextjsVersion()\n\n const supportsTurbopackBuild = supportsTurbopackExternalizeTransitiveDependencies(nextjsVersion)\n\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 /** @type {import('next').NextConfig} */\n const baseConfig = {\n ...nextConfig,\n env,\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 turbopack: {\n ...(nextConfig.turbopack || {}),\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 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 source: '/:path*',\n },\n ]\n },\n serverExternalPackages: [\n ...(nextConfig.serverExternalPackages || []),\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 ...(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 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 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 }\n },\n }\n\n if (nextConfig.basePath) {\n baseConfig.env.NEXT_BASE_PATH = nextConfig.basePath\n }\n\n if (!supportsTurbopackBuild) {\n return withPayloadLegacy(baseConfig)\n } else {\n return {\n ...baseConfig,\n serverExternalPackages: [\n ...(baseConfig.serverExternalPackages || []),\n 'drizzle-kit',\n 'drizzle-kit/api',\n 'sharp',\n 'libsql',\n 'require-in-the-middle',\n // Prevents turbopack build errors by the thread-stream package which is installed by pino\n 'pino',\n ],\n }\n }\n}\n\nexport default withPayload\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -22,13 +22,14 @@
|
|
|
22
22
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
23
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
24
|
* SOFTWARE.
|
|
25
|
-
*/
|
|
25
|
+
*/import { readFileSync } from 'fs';
|
|
26
26
|
import { fileURLToPath } from 'url';
|
|
27
27
|
/**
|
|
28
28
|
* @param {string | undefined} input
|
|
29
29
|
* @returns {number}
|
|
30
|
-
*/
|
|
31
|
-
|
|
30
|
+
*/
|
|
31
|
+
function _parseInt(input) {
|
|
32
|
+
return parseInt(input || '', 10);
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
35
|
* Represents Semantic Versioning object
|
|
@@ -45,81 +46,88 @@ const SEMVER_REGEXP = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\
|
|
|
45
46
|
* Parses input into a SemVer interface
|
|
46
47
|
* @param {string} input - string representation of a semver version
|
|
47
48
|
* @returns {SemVer}
|
|
48
|
-
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
*/
|
|
50
|
+
export function parseSemver(input) {
|
|
51
|
+
const match = input.match(SEMVER_REGEXP) || [];
|
|
52
|
+
const major = _parseInt(match[1]);
|
|
53
|
+
const minor = _parseInt(match[2]);
|
|
54
|
+
const patch = _parseInt(match[3]);
|
|
55
|
+
const prerelease = match[4];
|
|
56
|
+
const canaryVersion = prerelease?.startsWith('canary.') ? parseInt(prerelease.split('.')[1] || '0', 10) : undefined;
|
|
57
|
+
return {
|
|
58
|
+
buildmetadata: match[5],
|
|
59
|
+
canaryVersion,
|
|
60
|
+
major: isNaN(major) ? undefined : major,
|
|
61
|
+
minor: isNaN(minor) ? undefined : minor,
|
|
62
|
+
patch: isNaN(patch) ? undefined : patch,
|
|
63
|
+
prerelease: match[4]
|
|
64
|
+
};
|
|
63
65
|
}
|
|
64
66
|
/**
|
|
65
67
|
* Returns the version of Next.js installed in the project, or undefined if it cannot be determined.
|
|
66
68
|
* @returns {SemVer | undefined}
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const pkgJson = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
82
|
-
return parseSemver(pkgJson.version);
|
|
83
|
-
} catch (e) {
|
|
84
|
-
console.error('Payload: Error getting Next.js version', e);
|
|
85
|
-
return undefined;
|
|
69
|
+
*/
|
|
70
|
+
export function getNextjsVersion() {
|
|
71
|
+
try {
|
|
72
|
+
/** @type {string} */let pkgPath;
|
|
73
|
+
// Check if we're in ESM or CJS environment
|
|
74
|
+
if (typeof import.meta?.resolve === 'function') {
|
|
75
|
+
// ESM environment - use import.meta.resolve
|
|
76
|
+
const pkgUrl = import.meta.resolve('next/package.json');
|
|
77
|
+
// Use fileURLToPath for proper cross-platform path handling (Windows, macOS, Linux)
|
|
78
|
+
// new URL().pathname returns '/C:/path' on Windows which causes path resolution issues
|
|
79
|
+
pkgPath = fileURLToPath(pkgUrl);
|
|
80
|
+
} else {
|
|
81
|
+
// CJS environment - use require.resolve
|
|
82
|
+
pkgPath = require.resolve('next/package.json');
|
|
86
83
|
}
|
|
84
|
+
const pkgJson = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
85
|
+
return parseSemver(pkgJson.version);
|
|
86
|
+
} catch (e) {
|
|
87
|
+
console.error('Payload: Error getting Next.js version', e);
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
87
90
|
}
|
|
88
91
|
/**
|
|
89
92
|
* Checks if the current Next.js version supports Turbopack externalize transitive dependencies.
|
|
90
93
|
* This was introduced in Next.js v16.1.0-canary.3
|
|
91
94
|
* @param {SemVer | undefined} version
|
|
92
95
|
* @returns {boolean}
|
|
93
|
-
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
*/
|
|
97
|
+
export function supportsTurbopackExternalizeTransitiveDependencies(version) {
|
|
98
|
+
if (!version) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
const {
|
|
102
|
+
canaryVersion,
|
|
103
|
+
major,
|
|
104
|
+
minor,
|
|
105
|
+
patch
|
|
106
|
+
} = version;
|
|
107
|
+
if (major === undefined || minor === undefined) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
if (major > 16) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
if (major === 16) {
|
|
114
|
+
if (minor > 1) {
|
|
115
|
+
return true;
|
|
100
116
|
}
|
|
101
|
-
if (
|
|
117
|
+
if (minor === 1) {
|
|
118
|
+
// 16.1.1+ and canaries support this feature
|
|
119
|
+
if (patch > 0) {
|
|
102
120
|
return true;
|
|
121
|
+
}
|
|
122
|
+
if (canaryVersion !== undefined) {
|
|
123
|
+
// 16.1.0-canary.3+
|
|
124
|
+
return canaryVersion >= 3;
|
|
125
|
+
} else {
|
|
126
|
+
// Next.js 16.1.0
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
103
129
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
if (minor === 1) {
|
|
109
|
-
// 16.1.1+ and canaries support this feature
|
|
110
|
-
if (patch > 0) {
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
if (canaryVersion !== undefined) {
|
|
114
|
-
// 16.1.0-canary.3+
|
|
115
|
-
return canaryVersion >= 3;
|
|
116
|
-
} else {
|
|
117
|
-
// Next.js 16.1.0
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return false;
|
|
130
|
+
}
|
|
131
|
+
return false;
|
|
123
132
|
}
|
|
124
|
-
|
|
125
133
|
//# sourceMappingURL=withPayload.utils.js.map
|