@payloadcms/next 3.68.0-internal-debug.591ab42 → 3.68.0-internal.2b8df4a
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/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 -0
- 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 +23 -24
- 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 +19 -20
- 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 +133 -183
- 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/getVisibleEntities.js +23 -12
- package/dist/utilities/getVisibleEntities.js.map +1 -1
- package/dist/utilities/handleAuthRedirect.js +36 -22
- package/dist/utilities/handleAuthRedirect.js.map +1 -1
- package/dist/utilities/handleServerFunctions.js +39 -32
- 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 +195 -287
- 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 +91 -74
- 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 +28 -62
- 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 +155 -144
- 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 +158 -139
- 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 +143 -123
- 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 +101 -114
- 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/index.js +152 -176
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- package/dist/views/Dashboard/index.js +90 -97
- 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 +194 -204
- 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 +354 -315
- 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 +119 -96
- 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 +157 -104
- 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 +119 -83
- 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 +72 -71
- 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 +107 -94
- 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 +269 -247
- 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 +62 -68
- 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 +210 -251
- 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/getFieldPathsModified.js +22 -25
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldPathsModified.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 +91 -116
- 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 +140 -140
- 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.js +169 -216
- package/dist/withPayload.js.map +1 -1
- package/package.json +8 -9
- 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/withPayload.js
CHANGED
|
@@ -4,226 +4,179 @@
|
|
|
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
|
-
* */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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'
|
|
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);
|
|
45
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'
|
|
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 ?
|
|
46
94
|
/**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
+
}
|
|
61
167
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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;
|
|
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
|
+
};
|
|
224
174
|
}
|
|
225
|
-
|
|
175
|
+
};
|
|
176
|
+
if (nextConfig.basePath) {
|
|
177
|
+
toReturn.env.NEXT_BASE_PATH = nextConfig.basePath;
|
|
178
|
+
}
|
|
179
|
+
return toReturn;
|
|
226
180
|
};
|
|
227
181
|
export default withPayload;
|
|
228
|
-
|
|
229
182
|
//# sourceMappingURL=withPayload.js.map
|
package/dist/withPayload.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,+BAChD,OAAOE,IAAI,CAAC,EAAE,KAAK,YAAYA,IAAI,CAAC,EAAE,CAACC,QAAQ,CAACH;YAEnD,IAAII,2BAA2B;gBAC7BH,eAAeC;gBACfD,YACE;gBAEF;YACF;YAEAA,eAAeC;QACjB;IACF;IAEA,MAAMG,UAAUR,QAAQP,GAAG,CAACgB,QAAQ,KAAK;IACzC,MAAMC,sBAAsBV,QAAQP,GAAG,CAACkB,SAAS,KAAK;I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Payload","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,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,gCACA,4BACA,uBACA,6BACA,+BAYD,GACD,EAAE,EACP;IACDC,OAAA,EAASA,CAACC,aAAA,EAAeC,cAAA;MACvB,MAAMC,qBAAA,GACJ,OAAOtC,UAAA,CAAWmC,OAAO,KAAK,aAC1BnC,UAAA,CAAWmC,OAAO,CAACC,aAAA,EAAeC,cAAA,IAClCD,aAAA;MAEN,OAAO;QACL,GAAGE,qBAAqB;QACxBC,SAAA,EAAW,C,IACLD,qBAAA,EAAuBC,SAAA,IAAa,EAAE;QAC1C;;;;;;;;QAQA,eACA,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":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/next",
|
|
3
|
-
"version": "3.68.0-internal
|
|
3
|
+
"version": "3.68.0-internal.2b8df4a",
|
|
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/
|
|
101
|
-
"@payloadcms/
|
|
102
|
-
"@payloadcms/translations": "3.68.0-internal
|
|
100
|
+
"@payloadcms/ui": "3.68.0-internal.2b8df4a",
|
|
101
|
+
"@payloadcms/graphql": "3.68.0-internal.2b8df4a",
|
|
102
|
+
"@payloadcms/translations": "3.68.0-internal.2b8df4a"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@babel/cli": "7.27.2",
|
|
@@ -115,14 +115,14 @@
|
|
|
115
115
|
"babel-plugin-react-compiler": "19.1.0-rc.3",
|
|
116
116
|
"esbuild": "0.25.5",
|
|
117
117
|
"esbuild-sass-plugin": "3.3.1",
|
|
118
|
-
"swc-plugin-transform-remove-imports": "
|
|
118
|
+
"swc-plugin-transform-remove-imports": "8.3.0",
|
|
119
119
|
"@payloadcms/eslint-config": "3.28.0",
|
|
120
|
-
"payload": "3.68.0-internal
|
|
120
|
+
"payload": "3.68.0-internal.2b8df4a"
|
|
121
121
|
},
|
|
122
122
|
"peerDependencies": {
|
|
123
123
|
"graphql": "^16.8.1",
|
|
124
124
|
"next": "^15.4.8",
|
|
125
|
-
"payload": "3.68.0-internal
|
|
125
|
+
"payload": "3.68.0-internal.2b8df4a"
|
|
126
126
|
},
|
|
127
127
|
"engines": {
|
|
128
128
|
"node": "^18.20.2 || >=20.9.0"
|
|
@@ -135,11 +135,10 @@
|
|
|
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": "
|
|
138
|
+
"build:debug": "pnpm build",
|
|
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",
|
|
143
142
|
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
144
143
|
"build:without_reactcompiler": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm copyfiles && pnpm build:types && pnpm build:swc && pnpm build:cjs && pnpm build:esbuild",
|
|
145
144
|
"clean": "rimraf -g {dist,*.tsbuildinfo,esbuild}",
|
package/dist/esbuildEntry.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"esbuildEntry.d.ts","sourceRoot":"","sources":["../src/esbuildEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA"}
|
package/dist/esbuildEntry.js
DELETED
package/dist/esbuildEntry.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/esbuildEntry.ts"],"sourcesContent":["export { RootLayout } from './layouts/Root/index.js'\nexport { DashboardView } from './views/Dashboard/index.js'\nexport { LoginView } from './views/Login/index.js'\nexport { RootPage } from './views/Root/index.js'\n"],"names":["RootLayout","DashboardView","LoginView","RootPage"],"mappings":"AAAA,SAASA,UAAU,QAAQ,0BAAyB;AACpD,SAASC,aAAa,QAAQ,6BAA4B;AAC1D,SAASC,SAAS,QAAQ,yBAAwB;AAClD,SAASC,QAAQ,QAAQ,wBAAuB"}
|