@payloadcms/next 3.68.0-internal.e81dde6 → 3.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/cjs/withPayload.cjs +314 -0
  2. package/dist/cjs/withPayload.cjs.map +7 -0
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/views/Document/getDocumentPermissions.js +1 -1
  7. package/dist/views/Document/getDocumentPermissions.js.map +1 -1
  8. package/dist/withPayload/withPayload.d.ts.map +1 -0
  9. package/dist/withPayload/withPayload.js.map +1 -0
  10. package/dist/{withPayload.utils.d.ts → withPayload/withPayload.utils.d.ts} +2 -5
  11. package/dist/withPayload/withPayload.utils.d.ts.map +1 -0
  12. package/dist/withPayload/withPayload.utils.js +108 -0
  13. package/dist/withPayload/withPayload.utils.js.map +1 -0
  14. package/dist/withPayload/withPayloadLegacy.d.ts.map +1 -0
  15. package/dist/{withPayloadLegacy.js → withPayload/withPayloadLegacy.js} +2 -2
  16. package/dist/withPayload/withPayloadLegacy.js.map +1 -0
  17. package/package.json +13 -11
  18. package/dist/elements/DocumentHeader/Tabs/Tab/index.scss +0 -38
  19. package/dist/elements/DocumentHeader/Tabs/index.scss +0 -54
  20. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.scss +0 -9
  21. package/dist/elements/DocumentHeader/index.scss +0 -64
  22. package/dist/elements/FormHeader/index.scss +0 -8
  23. package/dist/elements/Nav/NavWrapper/index.scss +0 -27
  24. package/dist/elements/Nav/SettingsMenuButton/index.scss +0 -11
  25. package/dist/elements/Nav/index.scss +0 -173
  26. package/dist/templates/Default/Wrapper/index.scss +0 -58
  27. package/dist/templates/Default/index.scss +0 -79
  28. package/dist/templates/Minimal/index.scss +0 -30
  29. package/dist/views/API/RenderJSON/index.scss +0 -129
  30. package/dist/views/API/index.scss +0 -119
  31. package/dist/views/Account/Settings/index.scss +0 -48
  32. package/dist/views/CreateFirstUser/index.scss +0 -21
  33. package/dist/views/Dashboard/Default/index.scss +0 -69
  34. package/dist/views/Login/LoginForm/index.scss +0 -10
  35. package/dist/views/Login/index.scss +0 -10
  36. package/dist/views/Logout/index.scss +0 -25
  37. package/dist/views/NotFound/index.scss +0 -57
  38. package/dist/views/ResetPassword/index.scss +0 -11
  39. package/dist/views/Unauthorized/index.scss +0 -14
  40. package/dist/views/Verify/index.scss +0 -16
  41. package/dist/views/Version/Default/index.scss +0 -170
  42. package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.scss +0 -81
  43. package/dist/views/Version/RenderFieldsToDiff/fields/Date/index.scss +0 -12
  44. package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.scss +0 -9
  45. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.scss +0 -59
  46. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.scss +0 -91
  47. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.scss +0 -4
  48. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.scss +0 -9
  49. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.scss +0 -4
  50. package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.scss +0 -121
  51. package/dist/views/Version/RenderFieldsToDiff/index.scss +0 -24
  52. package/dist/views/Version/Restore/index.scss +0 -84
  53. package/dist/views/Version/SelectComparison/VersionDrawer/index.scss +0 -18
  54. package/dist/views/Version/SelectComparison/index.scss +0 -9
  55. package/dist/views/Version/VersionPillLabel/index.scss +0 -26
  56. package/dist/views/Versions/cells/AutosaveCell/index.scss +0 -9
  57. package/dist/views/Versions/index.scss +0 -110
  58. package/dist/withPayload.d.ts.map +0 -1
  59. package/dist/withPayload.js.map +0 -1
  60. package/dist/withPayload.utils.d.ts.map +0 -1
  61. package/dist/withPayload.utils.js +0 -101
  62. package/dist/withPayload.utils.js.map +0 -1
  63. package/dist/withPayloadLegacy.d.ts.map +0 -1
  64. package/dist/withPayloadLegacy.js.map +0 -1
  65. /package/dist/{withPayload.d.ts → withPayload/withPayload.d.ts} +0 -0
  66. /package/dist/{withPayload.js → withPayload/withPayload.js} +0 -0
  67. /package/dist/{withPayloadLegacy.d.ts → withPayload/withPayloadLegacy.d.ts} +0 -0
@@ -0,0 +1,314 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // dist/withPayload/withPayload.js
30
+ var withPayload_exports = {};
31
+ __export(withPayload_exports, {
32
+ default: () => withPayload_default,
33
+ withPayload: () => withPayload
34
+ });
35
+ module.exports = __toCommonJS(withPayload_exports);
36
+
37
+ // dist/withPayload/withPayload.utils.js
38
+ var import_fs = require("fs");
39
+ var import_meta = {};
40
+ function _parseInt(input) {
41
+ return parseInt(input || "", 10);
42
+ }
43
+ var SEMVER_REGEXP = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i;
44
+ function parseSemver(input) {
45
+ const match = input.match(SEMVER_REGEXP) || [];
46
+ const major = _parseInt(match[1]);
47
+ const minor = _parseInt(match[2]);
48
+ const patch = _parseInt(match[3]);
49
+ const prerelease = match[4];
50
+ const canaryVersion = prerelease?.startsWith("canary.") ? parseInt(prerelease.split(".")[1] || "0", 10) : void 0;
51
+ return {
52
+ buildmetadata: match[5],
53
+ canaryVersion,
54
+ major: isNaN(major) ? void 0 : major,
55
+ minor: isNaN(minor) ? void 0 : minor,
56
+ patch: isNaN(patch) ? void 0 : patch,
57
+ prerelease: match[4]
58
+ };
59
+ }
60
+ function getNextjsVersion() {
61
+ try {
62
+ let pkgPath;
63
+ if (typeof import_meta?.resolve === "function") {
64
+ const pkgUrl = import_meta.resolve("next/package.json");
65
+ pkgPath = new URL(pkgUrl).pathname;
66
+ } else {
67
+ pkgPath = require.resolve("next/package.json");
68
+ }
69
+ const pkgJson = JSON.parse((0, import_fs.readFileSync)(pkgPath, "utf8"));
70
+ return parseSemver(pkgJson.version);
71
+ } catch (e) {
72
+ console.error("Payload: Error getting Next.js version", e);
73
+ return void 0;
74
+ }
75
+ }
76
+ function supportsTurbopackExternalizeTransitiveDependencies(version) {
77
+ if (!version) {
78
+ return false;
79
+ }
80
+ const {
81
+ canaryVersion,
82
+ major,
83
+ minor
84
+ } = version;
85
+ if (major === void 0 || minor === void 0) {
86
+ return false;
87
+ }
88
+ if (major > 16) {
89
+ return true;
90
+ }
91
+ if (major === 16) {
92
+ if (minor > 1) {
93
+ return true;
94
+ }
95
+ if (minor === 1) {
96
+ if (canaryVersion !== void 0) {
97
+ return canaryVersion >= 3;
98
+ } else {
99
+ return true;
100
+ }
101
+ }
102
+ }
103
+ return false;
104
+ }
105
+
106
+ // dist/withPayload/withPayloadLegacy.js
107
+ var withPayloadLegacy = (nextConfig = {}) => {
108
+ if (process.env.PAYLOAD_PATCH_TURBOPACK_WARNINGS !== "false") {
109
+ 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";
110
+ const turbopackConfigWarningText = "Unrecognized key(s) in object: 'turbopack'";
111
+ const consoleWarn = console.warn;
112
+ console.warn = (...args) => {
113
+ if (typeof args[1] === "string" && args[1].includes(turbopackWarningText) || typeof args[0] === "string" && args[0].includes(turbopackWarningText)) {
114
+ return;
115
+ }
116
+ const hasTurbopackConfigWarning = typeof args[1] === "string" && args[1].includes(turbopackConfigWarningText) || typeof args[0] === "string" && args[0].includes(turbopackConfigWarningText);
117
+ if (hasTurbopackConfigWarning) {
118
+ consoleWarn(...args);
119
+ 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 the latest supported Next.js version to resolve this warning.');
120
+ return;
121
+ }
122
+ consoleWarn(...args);
123
+ };
124
+ }
125
+ const isBuild = process.env.NODE_ENV === "production";
126
+ const isTurbopackNextjs15 = process.env.TURBOPACK === "1";
127
+ const isTurbopackNextjs16 = process.env.TURBOPACK === "auto";
128
+ if (isBuild && (isTurbopackNextjs15 || isTurbopackNextjs16)) {
129
+ throw new Error("Your Next.js and Payload versions do not support using Turbopack for production builds. Please upgrade to Next.js 16.1.0-canary.3 or higher if you want to use Turbopack for builds.");
130
+ }
131
+ const toReturn = {
132
+ ...nextConfig,
133
+ serverExternalPackages: [
134
+ // serverExternalPackages = webpack.externals, but with turbopack support and an additional check
135
+ // for whether the package is resolvable from the project root
136
+ ...nextConfig.serverExternalPackages || [],
137
+ // External, because it installs import-in-the-middle and require-in-the-middle - both in the default serverExternalPackages list.
138
+ "@sentry/nextjs"
139
+ ]
140
+ };
141
+ return toReturn;
142
+ };
143
+
144
+ // dist/withPayload/withPayload.js
145
+ var poweredByHeader = {
146
+ key: "X-Powered-By",
147
+ value: "Next.js, Payload"
148
+ };
149
+ var withPayload = (nextConfig = {}, options = {}) => {
150
+ const nextjsVersion = getNextjsVersion();
151
+ const supportsTurbopackBuild = supportsTurbopackExternalizeTransitiveDependencies(nextjsVersion);
152
+ const env = nextConfig.env || {};
153
+ if (nextConfig.experimental?.staleTimes?.dynamic) {
154
+ 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.");
155
+ env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH = "true";
156
+ }
157
+ const baseConfig = {
158
+ ...nextConfig,
159
+ env,
160
+ outputFileTracingExcludes: {
161
+ ...nextConfig.outputFileTracingExcludes || {},
162
+ "**/*": [...nextConfig.outputFileTracingExcludes?.["**/*"] || [], "drizzle-kit", "drizzle-kit/api"]
163
+ },
164
+ outputFileTracingIncludes: {
165
+ ...nextConfig.outputFileTracingIncludes || {},
166
+ "**/*": [...nextConfig.outputFileTracingIncludes?.["**/*"] || [], "@libsql/client"]
167
+ },
168
+ turbopack: {
169
+ ...nextConfig.turbopack || {}
170
+ },
171
+ // We disable the poweredByHeader here because we add it manually in the headers function below
172
+ ...nextConfig.poweredByHeader !== false ? {
173
+ poweredByHeader: false
174
+ } : {},
175
+ headers: async () => {
176
+ const headersFromConfig = "headers" in nextConfig ? await nextConfig.headers() : [];
177
+ return [...headersFromConfig || [], {
178
+ headers: [{
179
+ key: "Accept-CH",
180
+ value: "Sec-CH-Prefers-Color-Scheme"
181
+ }, {
182
+ key: "Vary",
183
+ value: "Sec-CH-Prefers-Color-Scheme"
184
+ }, {
185
+ key: "Critical-CH",
186
+ value: "Sec-CH-Prefers-Color-Scheme"
187
+ }, ...nextConfig.poweredByHeader !== false ? [poweredByHeader] : []],
188
+ source: "/:path*"
189
+ }];
190
+ },
191
+ serverExternalPackages: [
192
+ // WHY: without externalizing graphql, a graphql version error will be thrown
193
+ // during runtime ("Ensure that there is only one instance of \"graphql\" in the node_modules\ndirectory.")
194
+ "graphql",
195
+ ...process.env.NODE_ENV === "development" && options.devBundleServerPackages !== true ? (
196
+ /**
197
+ * Unless explicitly disabled by the user, by passing `devBundleServerPackages: true` to withPayload, we
198
+ * do not bundle server-only packages during dev for two reasons:
199
+ *
200
+ * 1. Performance: Fewer files to compile means faster compilation speeds.
201
+ * 2. Turbopack support: Webpack's externals are not supported by Turbopack.
202
+ *
203
+ * Regarding Turbopack support: Unlike webpack.externals, we cannot use serverExternalPackages to
204
+ * externalized packages that are not resolvable from the project root. So including a package like
205
+ * "drizzle-kit" in here would do nothing - Next.js will ignore the rule and still bundle the package -
206
+ * because it detects that the package is not resolvable from the project root (= not directly installed
207
+ * by the user in their own package.json).
208
+ *
209
+ * Instead, we can use serverExternalPackages for the entry-point packages that *are* installed directly
210
+ * by the user (e.g. db-postgres, which then installs drizzle-kit as a dependency).
211
+ *
212
+ *
213
+ *
214
+ * We should only do this during development, not build, because externalizing these packages can hurt
215
+ * the bundle size. Not only does it disable tree-shaking, it also risks installing duplicate copies of the
216
+ * same package.
217
+ *
218
+ * Example:
219
+ * - @payloadcms/richtext-lexical (in bundle) -> installs qs-esm (bundled because of importer)
220
+ * - payload (not in bundle, external) -> installs qs-esm (external because of importer)
221
+ * Result: we have two copies of qs-esm installed - one in the bundle, and one in node_modules.
222
+ *
223
+ * During development, these bundle size difference do not matter much, and development speed /
224
+ * turbopack support are more important.
225
+ */
226
+ ["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"]
227
+ ) : []
228
+ ],
229
+ webpack: (webpackConfig, webpackOptions) => {
230
+ const incomingWebpackConfig = typeof nextConfig.webpack === "function" ? nextConfig.webpack(webpackConfig, webpackOptions) : webpackConfig;
231
+ return {
232
+ ...incomingWebpackConfig,
233
+ externals: [
234
+ ...incomingWebpackConfig?.externals || [],
235
+ /**
236
+ * See the explanation in the serverExternalPackages section above.
237
+ * We need to force Webpack to emit require() calls for these packages, even though they are not
238
+ * 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.
239
+ *
240
+ * This is the only way to get Webpack Build to work, without the bundle size caveats of externalizing the
241
+ * entry point packages, as explained in the serverExternalPackages section above.
242
+ */
243
+ "drizzle-kit",
244
+ "drizzle-kit/api",
245
+ "sharp",
246
+ "libsql",
247
+ "require-in-the-middle"
248
+ ],
249
+ plugins: [
250
+ ...incomingWebpackConfig?.plugins || [],
251
+ // Fix cloudflare:sockets error: https://github.com/vercel/next.js/discussions/50177
252
+ new webpackOptions.webpack.IgnorePlugin({
253
+ resourceRegExp: /^pg-native$|^cloudflare:sockets$/
254
+ })
255
+ ],
256
+ resolve: {
257
+ ...incomingWebpackConfig?.resolve || {},
258
+ alias: {
259
+ ...incomingWebpackConfig?.resolve?.alias || {}
260
+ },
261
+ fallback: {
262
+ ...incomingWebpackConfig?.resolve?.fallback || {},
263
+ /*
264
+ * This fixes the following warning when running next build with webpack (tested on Next.js 16.0.3 with Payload 3.64.0):
265
+ *
266
+ * ⚠ Compiled with warnings in 8.7s
267
+ *
268
+ * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js
269
+ * Module not found: Can't resolve 'aws4' in '/Users/alessio/Documents/temp/next16p/node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib'
270
+ *
271
+ * Import trace for requested module:
272
+ * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js
273
+ * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js
274
+ * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/index.js
275
+ * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/lib/index.js
276
+ * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/index.js
277
+ * ./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
278
+ * ./src/payload.config.ts
279
+ * ./src/app/my-route/route.ts
280
+ *
281
+ **/
282
+ aws4: false
283
+ }
284
+ }
285
+ };
286
+ }
287
+ };
288
+ if (nextConfig.basePath) {
289
+ baseConfig.env.NEXT_BASE_PATH = nextConfig.basePath;
290
+ }
291
+ if (!supportsTurbopackBuild) {
292
+ return withPayloadLegacy(baseConfig);
293
+ } else {
294
+ return {
295
+ ...baseConfig,
296
+ serverExternalPackages: [
297
+ ...baseConfig.serverExternalPackages || [],
298
+ "drizzle-kit",
299
+ "drizzle-kit/api",
300
+ "sharp",
301
+ "libsql",
302
+ "require-in-the-middle",
303
+ // Prevents turbopack build errors by the thread-stream package which is installed by pino
304
+ "pino"
305
+ ]
306
+ };
307
+ }
308
+ };
309
+ var withPayload_default = withPayload;
310
+ // Annotate the CommonJS export names for ESM import in node:
311
+ 0 && (module.exports = {
312
+ withPayload
313
+ });
314
+ //# sourceMappingURL=withPayload.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/withPayload/withPayload.ts", "../../src/withPayload/withPayload.utils.ts", "../../src/withPayload/withPayloadLegacy.ts"],
4
+ "sourcesContent": ["/* eslint-disable no-console */\n/* eslint-disable no-restricted-exports */\nimport type { NextConfig } from 'next'\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 = (\n nextConfig: NextConfig = {},\n options: { devBundleServerPackages?: boolean } = {},\n): NextConfig => {\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 const baseConfig: NextConfig = {\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 // 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", "/* eslint-disable no-console */\n/**\n * This was taken and modified from https://github.com/getsentry/sentry-javascript/blob/15256034ee8150a5b7dcb97d23eca1a5486f0cae/packages/nextjs/src/config/util.ts\n *\n * MIT License\n *\n * Copyright (c) 2012 Functional Software, Inc. dba Sentry\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n * of the Software, and to permit persons to whom the Software is furnished to do\n * so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { readFileSync } from 'fs'\n\nfunction _parseInt(input: string | undefined): number {\n return parseInt(input || '', 10)\n}\n\n/**\n * Represents Semantic Versioning object\n */\ntype SemVer = {\n buildmetadata?: string\n /**\n * undefined if not a canary version\n */\n canaryVersion?: number\n major?: number\n minor?: number\n patch?: number\n prerelease?: string\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$/i\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nexport function parseSemver(input: string): SemVer {\n const match = input.match(SEMVER_REGEXP) || []\n const major = _parseInt(match[1])\n const minor = _parseInt(match[2])\n const patch = _parseInt(match[3])\n\n const prerelease = match[4]\n const canaryVersion = prerelease?.startsWith('canary.')\n ? parseInt(prerelease.split('.')[1] || '0', 10)\n : undefined\n\n return {\n buildmetadata: match[5],\n canaryVersion,\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n }\n}\n\n/**\n * Returns the version of Next.js installed in the project, or undefined if it cannot be determined.\n */\nexport function getNextjsVersion(): SemVer | undefined {\n try {\n let pkgPath: string\n\n // Check if we're in ESM or CJS environment\n if (typeof import.meta?.resolve === 'function') {\n // ESM environment - use import.meta.resolve\n const pkgUrl = import.meta.resolve('next/package.json')\n pkgPath = new URL(pkgUrl).pathname\n } else {\n // CJS environment - use require.resolve\n pkgPath = require.resolve('next/package.json')\n }\n\n const pkgJson = JSON.parse(readFileSync(pkgPath, 'utf8'))\n return parseSemver(pkgJson.version)\n } catch (e) {\n console.error('Payload: Error getting Next.js version', e)\n return undefined\n }\n}\n\n/**\n * Checks if the current Next.js version supports Turbopack externalize transitive dependencies.\n * This was introduced in Next.js v16.1.0-canary.3\n */\nexport function supportsTurbopackExternalizeTransitiveDependencies(\n version: SemVer | undefined,\n): boolean {\n if (!version) {\n return false\n }\n\n const { canaryVersion, major, minor } = version\n\n if (major === undefined || minor === undefined) {\n return false\n }\n\n if (major > 16) {\n return true\n }\n\n if (major === 16) {\n if (minor > 1) {\n return true\n }\n if (minor === 1) {\n if (canaryVersion !== undefined) {\n // 16.1.0-canary.3+\n return canaryVersion >= 3\n } else {\n // Assume that Next.js 16.1 inherits support for this feature from the canary release\n return true\n }\n }\n }\n\n return false\n}\n", "/* eslint-disable no-console */\nimport type { NextConfig } from 'next'\n\n/**\n * Applies config options required to support Next.js versions before 16.1.0 and 16.1.0-canary.15.\n */\nexport const withPayloadLegacy = (nextConfig: NextConfig = {}): NextConfig => {\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 the latest supported Next.js version 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 'Your Next.js and Payload versions do not support using Turbopack for production builds. Please upgrade to Next.js 16.1.0-canary.3 or higher if you want to use Turbopack for builds.',\n )\n }\n\n const toReturn: NextConfig = {\n ...nextConfig,\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 // External, because it installs import-in-the-middle and require-in-the-middle - both in the default serverExternalPackages list.\n '@sentry/nextjs',\n ],\n }\n\n return toReturn\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;AC2BA,gBAA6B;AA3B7B;AA6BA,SAASA,UAAUC,OAAyB;AAC1C,SAAOC,SAASD,SAAS,IAAI,EAAA;AAC/B;AAkBA,IAAME,gBACJ;AAMK,SAASC,YAAYH,OAAa;AACvC,QAAMI,QAAQJ,MAAMI,MAAMF,aAAA,KAAkB,CA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BxB,WAAWwB,QAAQC,eAAeC,cAAA,IAClCD;AAEN,aAAO;QACL,GAAGE;QACHC,WAAW;UAAA,GACLD,uBAAuBC,aAAa,CAAA;;;;;;;;;UASxC;UACA;UACA;UACA;UACA;QAAA;QAEFC,SAAS;UAAA,GACHF,uBAAuBE,WAAW,CAAA;;UAEtC,IAAIH,eAAeF,QAAQM,aAAa;YACtCC,gBAAgB;UAClB,CAAA;QAAA;QAEFC,SAAS;UACP,GAAIL,uBAAuBK,WAAW,CAAC;UACvCC,OAAO;YACL,GAAIN,uBAAuBK,SAASC,SAAS,CAAC;UAChD;UACAC,UAAU;YACR,GAAIP,uBAAuBK,SAASE,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;YAoBjDC,MAAM;UACR;QACF;MACF;IACF;EACF;AAEA,MAAInC,WAAWoC,UAAU;AACvBvB,eAAWP,IAAI+B,iBAAiBrC,WAAWoC;EAC7C;AAEA,MAAI,CAAChC,wBAAwB;AAC3B,WAAOkC,kBAAkBzB,UAAA;EAC3B,OAAO;AACL,WAAO;MACL,GAAGA;MACHO,wBAAwB;QAAA,GAClBP,WAAWO,0BAA0B,CAAA;QACzC;QACA;QACA;QACA;QACA;;QAEA;MAAA;IAEJ;EACF;AACF;AAEA,IAAA,sBAAerB;",
6
+ "names": ["_parseInt", "input", "parseInt", "SEMVER_REGEXP", "parseSemver", "match", "major", "minor", "patch", "prerelease", "canaryVersion", "startsWith", "split", "undefined", "buildmetadata", "isNaN", "getNextjsVersion", "pkgPath", "import", "resolve", "pkgUrl", "URL", "pathname", "require", "pkgJson", "JSON", "parse", "readFileSync", "version", "e", "console", "error", "supportsTurbopackExternalizeTransitiveDependencies", "withPayloadLegacy", "nextConfig", "process", "env", "PAYLOAD_PATCH_TURBOPACK_WARNINGS", "turbopackWarningText", "turbopackConfigWarningText", "consoleWarn", "console", "warn", "args", "includes", "hasTurbopackConfigWarning", "isBuild", "NODE_ENV", "isTurbopackNextjs15", "TURBOPACK", "isTurbopackNextjs16", "Error", "toReturn", "serverExternalPackages", "poweredByHeader", "key", "value", "withPayload", "nextConfig", "options", "nextjsVersion", "getNextjsVersion", "supportsTurbopackBuild", "supportsTurbopackExternalizeTransitiveDependencies", "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", "withPayloadLegacy"]
7
+ }
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { default as withPayload } from "./withPayload.js";
1
+ export { default as withPayload } from "./withPayload/withPayload.js";
2
2
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { default as withPayload } from './withPayload.js';
1
+ export { default as withPayload } from './withPayload/withPayload.js';
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","withPayload"],"sources":["../src/index.js"],"sourcesContent":["export { default as withPayload } from './withPayload.js'\n"],"mappings":"AAAA,SAASA,OAAA,IAAWC,WAAW,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["default","withPayload"],"sources":["../src/index.js"],"sourcesContent":["export { default as withPayload } from './withPayload/withPayload.js'\n"],"mappings":"AAAA,SAASA,OAAA,IAAWC,WAAW,QAAQ","ignoreList":[]}
@@ -24,7 +24,7 @@ export const getDocumentPermissions = async args => {
24
24
  },
25
25
  req
26
26
  });
27
- if (collectionConfig.versions?.drafts) {
27
+ if (hasDraftsEnabled(collectionConfig)) {
28
28
  hasPublishPermission = (await docAccessOperation({
29
29
  id,
30
30
  collection: {
@@ -1 +1 @@
1
- {"version":3,"file":"getDocumentPermissions.js","names":["hasSavePermission","getHasSavePermission","isEditing","getIsEditing","docAccessOperation","docAccessOperationGlobal","logError","hasDraftsEnabled","getDocumentPermissions","args","id","collectionConfig","data","globalConfig","req","docPermissions","hasPublishPermission","collection","config","_status","versions","drafts","update","err","payload","collectionSlug","slug","globalSlug"],"sources":["../../../src/views/Document/getDocumentPermissions.tsx"],"sourcesContent":["import type {\n Data,\n PayloadRequest,\n SanitizedCollectionConfig,\n SanitizedDocumentPermissions,\n SanitizedGlobalConfig,\n} from 'payload'\n\nimport {\n hasSavePermission as getHasSavePermission,\n isEditing as getIsEditing,\n} from '@payloadcms/ui/shared'\nimport { docAccessOperation, docAccessOperationGlobal, logError } from 'payload'\nimport { hasDraftsEnabled } from 'payload/shared'\n\nexport const getDocumentPermissions = async (args: {\n collectionConfig?: SanitizedCollectionConfig\n data: Data\n globalConfig?: SanitizedGlobalConfig\n /**\n * When called for creating a new document, id is not provided.\n */\n id?: number | string\n req: PayloadRequest\n}): Promise<{\n docPermissions: SanitizedDocumentPermissions\n hasPublishPermission: boolean\n hasSavePermission: boolean\n}> => {\n const { id, collectionConfig, data = {}, globalConfig, req } = args\n\n let docPermissions: SanitizedDocumentPermissions\n let hasPublishPermission = false\n\n if (collectionConfig) {\n try {\n docPermissions = await docAccessOperation({\n id,\n collection: {\n config: collectionConfig,\n },\n data: {\n ...data,\n _status: 'draft',\n },\n req,\n })\n\n if (collectionConfig.versions?.drafts) {\n hasPublishPermission = (\n await docAccessOperation({\n id,\n collection: {\n config: collectionConfig,\n },\n data: {\n ...data,\n _status: 'published',\n },\n req,\n })\n ).update\n }\n } catch (err) {\n logError({ err, payload: req.payload })\n }\n }\n\n if (globalConfig) {\n try {\n docPermissions = await docAccessOperationGlobal({\n data,\n globalConfig,\n req,\n })\n\n if (hasDraftsEnabled(globalConfig)) {\n hasPublishPermission = (\n await docAccessOperationGlobal({\n data: {\n ...data,\n _status: 'published',\n },\n globalConfig,\n req,\n })\n ).update\n }\n } catch (err) {\n logError({ err, payload: req.payload })\n }\n }\n\n const hasSavePermission = getHasSavePermission({\n collectionSlug: collectionConfig?.slug,\n docPermissions,\n globalSlug: globalConfig?.slug,\n isEditing: getIsEditing({\n id,\n collectionSlug: collectionConfig?.slug,\n globalSlug: globalConfig?.slug,\n }),\n })\n\n return {\n docPermissions,\n hasPublishPermission,\n hasSavePermission,\n }\n}\n"],"mappings":"AAQA,SACEA,iBAAA,IAAqBC,oBAAoB,EACzCC,SAAA,IAAaC,YAAY,QACpB;AACP,SAASC,kBAAkB,EAAEC,wBAAwB,EAAEC,QAAQ,QAAQ;AACvE,SAASC,gBAAgB,QAAQ;AAEjC,OAAO,MAAMC,sBAAA,GAAyB,MAAOC,IAAA;EAc3C,MAAM;IAAEC,EAAE;IAAEC,gBAAgB;IAAEC,IAAA,GAAO,CAAC,CAAC;IAAEC,YAAY;IAAEC;EAAG,CAAE,GAAGL,IAAA;EAE/D,IAAIM,cAAA;EACJ,IAAIC,oBAAA,GAAuB;EAE3B,IAAIL,gBAAA,EAAkB;IACpB,IAAI;MACFI,cAAA,GAAiB,MAAMX,kBAAA,CAAmB;QACxCM,EAAA;QACAO,UAAA,EAAY;UACVC,MAAA,EAAQP;QACV;QACAC,IAAA,EAAM;UACJ,GAAGA,IAAI;UACPO,OAAA,EAAS;QACX;QACAL;MACF;MAEA,IAAIH,gBAAA,CAAiBS,QAAQ,EAAEC,MAAA,EAAQ;QACrCL,oBAAA,GAAuB,CACrB,MAAMZ,kBAAA,CAAmB;UACvBM,EAAA;UACAO,UAAA,EAAY;YACVC,MAAA,EAAQP;UACV;UACAC,IAAA,EAAM;YACJ,GAAGA,IAAI;YACPO,OAAA,EAAS;UACX;UACAL;QACF,EAAC,EACDQ,MAAM;MACV;IACF,EAAE,OAAOC,GAAA,EAAK;MACZjB,QAAA,CAAS;QAAEiB,GAAA;QAAKC,OAAA,EAASV,GAAA,CAAIU;MAAQ;IACvC;EACF;EAEA,IAAIX,YAAA,EAAc;IAChB,IAAI;MACFE,cAAA,GAAiB,MAAMV,wBAAA,CAAyB;QAC9CO,IAAA;QACAC,YAAA;QACAC;MACF;MAEA,IAAIP,gBAAA,CAAiBM,YAAA,GAAe;QAClCG,oBAAA,GAAuB,CACrB,MAAMX,wBAAA,CAAyB;UAC7BO,IAAA,EAAM;YACJ,GAAGA,IAAI;YACPO,OAAA,EAAS;UACX;UACAN,YAAA;UACAC;QACF,EAAC,EACDQ,MAAM;MACV;IACF,EAAE,OAAOC,GAAA,EAAK;MACZjB,QAAA,CAAS;QAAEiB,GAAA;QAAKC,OAAA,EAASV,GAAA,CAAIU;MAAQ;IACvC;EACF;EAEA,MAAMxB,iBAAA,GAAoBC,oBAAA,CAAqB;IAC7CwB,cAAA,EAAgBd,gBAAA,EAAkBe,IAAA;IAClCX,cAAA;IACAY,UAAA,EAAYd,YAAA,EAAca,IAAA;IAC1BxB,SAAA,EAAWC,YAAA,CAAa;MACtBO,EAAA;MACAe,cAAA,EAAgBd,gBAAA,EAAkBe,IAAA;MAClCC,UAAA,EAAYd,YAAA,EAAca;IAC5B;EACF;EAEA,OAAO;IACLX,cAAA;IACAC,oBAAA;IACAhB;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"getDocumentPermissions.js","names":["hasSavePermission","getHasSavePermission","isEditing","getIsEditing","docAccessOperation","docAccessOperationGlobal","logError","hasDraftsEnabled","getDocumentPermissions","args","id","collectionConfig","data","globalConfig","req","docPermissions","hasPublishPermission","collection","config","_status","update","err","payload","collectionSlug","slug","globalSlug"],"sources":["../../../src/views/Document/getDocumentPermissions.tsx"],"sourcesContent":["import type {\n Data,\n PayloadRequest,\n SanitizedCollectionConfig,\n SanitizedDocumentPermissions,\n SanitizedGlobalConfig,\n} from 'payload'\n\nimport {\n hasSavePermission as getHasSavePermission,\n isEditing as getIsEditing,\n} from '@payloadcms/ui/shared'\nimport { docAccessOperation, docAccessOperationGlobal, logError } from 'payload'\nimport { hasDraftsEnabled } from 'payload/shared'\n\nexport const getDocumentPermissions = async (args: {\n collectionConfig?: SanitizedCollectionConfig\n data: Data\n globalConfig?: SanitizedGlobalConfig\n /**\n * When called for creating a new document, id is not provided.\n */\n id?: number | string\n req: PayloadRequest\n}): Promise<{\n docPermissions: SanitizedDocumentPermissions\n hasPublishPermission: boolean\n hasSavePermission: boolean\n}> => {\n const { id, collectionConfig, data = {}, globalConfig, req } = args\n\n let docPermissions: SanitizedDocumentPermissions\n let hasPublishPermission = false\n\n if (collectionConfig) {\n try {\n docPermissions = await docAccessOperation({\n id,\n collection: {\n config: collectionConfig,\n },\n data: {\n ...data,\n _status: 'draft',\n },\n req,\n })\n\n if (hasDraftsEnabled(collectionConfig)) {\n hasPublishPermission = (\n await docAccessOperation({\n id,\n collection: {\n config: collectionConfig,\n },\n data: {\n ...data,\n _status: 'published',\n },\n req,\n })\n ).update\n }\n } catch (err) {\n logError({ err, payload: req.payload })\n }\n }\n\n if (globalConfig) {\n try {\n docPermissions = await docAccessOperationGlobal({\n data,\n globalConfig,\n req,\n })\n\n if (hasDraftsEnabled(globalConfig)) {\n hasPublishPermission = (\n await docAccessOperationGlobal({\n data: {\n ...data,\n _status: 'published',\n },\n globalConfig,\n req,\n })\n ).update\n }\n } catch (err) {\n logError({ err, payload: req.payload })\n }\n }\n\n const hasSavePermission = getHasSavePermission({\n collectionSlug: collectionConfig?.slug,\n docPermissions,\n globalSlug: globalConfig?.slug,\n isEditing: getIsEditing({\n id,\n collectionSlug: collectionConfig?.slug,\n globalSlug: globalConfig?.slug,\n }),\n })\n\n return {\n docPermissions,\n hasPublishPermission,\n hasSavePermission,\n }\n}\n"],"mappings":"AAQA,SACEA,iBAAA,IAAqBC,oBAAoB,EACzCC,SAAA,IAAaC,YAAY,QACpB;AACP,SAASC,kBAAkB,EAAEC,wBAAwB,EAAEC,QAAQ,QAAQ;AACvE,SAASC,gBAAgB,QAAQ;AAEjC,OAAO,MAAMC,sBAAA,GAAyB,MAAOC,IAAA;EAc3C,MAAM;IAAEC,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ClCT,cAAA;IACAU,UAAA,EAAYZ,YAAA,EAAcW,IAAA;IAC1BtB,SAAA,EAAWC,YAAA,CAAa;MACtBO,EAAA;MACAa,cAAA,EAAgBZ,gBAAA,EAAkBa,IAAA;MAClCC,UAAA,EAAYZ,YAAA,EAAcW;IAC5B;EACF;EAEA,OAAO;IACLT,cAAA;IACAC,oBAAA;IACAhB;EACF;AACF","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withPayload.d.ts","sourceRoot":"","sources":["../../src/withPayload/withPayload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAatC;;;;KAIK;AACL,eAAO,MAAM,WAAW,gBACV,UAAU,YACb;IAAE,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAAE,KAC7C,UA8MF,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -0,0 +1 @@
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.ts"],"sourcesContent":["/* eslint-disable no-console */\n/* eslint-disable no-restricted-exports */\nimport type { NextConfig } from 'next'\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 = (\n nextConfig: NextConfig = {},\n options: { devBundleServerPackages?: boolean } = {},\n): NextConfig => {\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 const baseConfig: NextConfig = {\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 // 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":"AAAA,gCACA,0CAGA,SACEA,gBAAgB,EAChBC,kDAAkD,QAC7C;AACP,SAASC,iBAAiB,QAAQ;AAElC,MAAMC,eAAA,GAAkB;EACtBC,GAAA,EAAK;EACLC,KAAA,EAAO;AACT;AAEA;;;;;AAKA,OAAO,MAAMC,WAAA,GAAcA,CACzBC,UAAA,GAAyB,CAAC,CAAC,EAC3BC,OAAA,GAAiD,CAAC,CAAC;EAEnD,MAAMC,aAAA,GAAgBT,gBAAA;EAEtB,MAAMU,sBAAA,GAAyBT,kDAAA,CAAmDQ,aAAA;EAElF,MAAME,GAAA,GAAMJ,UAAA,CAAWI,GAAG,IAAI,CAAC;EAE/B,IAAIJ,UAAA,CAAWK,YAAY,EAAEC,UAAA,EAAYC,OAAA,EAAS;IAChDC,OAAA,CAAQC,IAAI,CACV;IAEFL,GAAA,CAAIM,uCAAuC,GAAG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YD,GACD,EAAE,EACP;IACDC,OAAA,EAASA,CAACC,aAAA,EAAeC,cAAA;MACvB,MAAMC,qBAAA,GACJ,OAAOzB,UAAA,CAAWsB,OAAO,KAAK,aAC1BtB,UAAA,CAAWsB,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,C,IACHF,qBAAA,EAAuBE,OAAA,IAAW,EAAE;QACxC;QACA,IAAIH,cAAA,CAAeF,OAAO,CAACM,YAAY,CAAC;UACtCC,cAAA,EAAgB;QAClB,GACD;QACDC,OAAA,EAAS;UACP,IAAIL,qBAAA,EAAuBK,OAAA,IAAW,CAAC,CAAC;UACxCC,KAAA,EAAO;YACL,IAAIN,qBAAA,EAAuBK,OAAA,EAASC,KAAA,IAAS,CAAC,CAAC;UACjD;UACAC,QAAA,EAAU;YACR,IAAIP,qBAAA,EAAuBK,OAAA,EAASE,QAAA,IAAY,CAAC,CAAC;YAClD;;;;;;;;;;;;;;;;;;;YAmBAC,IAAA,EAAM;UACR;QACF;MACF;IACF;EACF;EAEA,IAAIjC,UAAA,CAAWkC,QAAQ,EAAE;IACvBvB,UAAA,CAAWP,GAAG,CAAC+B,cAAc,GAAGnC,UAAA,CAAWkC,QAAQ;EACrD;EAEA,IAAI,CAAC/B,sBAAA,EAAwB;IAC3B,OAAOR,iBAAA,CAAkBgB,UAAA;EAC3B,OAAO;IACL,OAAO;MACL,GAAGA,UAAU;MACbO,sBAAA,EAAwB,C,IAClBP,UAAA,CAAWO,sBAAsB,IAAI,EAAE,GAC3C,eACA,mBACA,SACA,UACA;MACA;MACA;IAEJ;EACF;AACF;AAEA,eAAenB,WAAA","ignoreList":[]}
@@ -47,11 +47,8 @@ export declare function parseSemver(input: string): SemVer;
47
47
  */
48
48
  export declare function getNextjsVersion(): SemVer | undefined;
49
49
  /**
50
- * Checks if the current Next.js version supports native debug ids for turbopack.
51
- * This feature was first introduced in Next.js v15.6.0-canary.36 and marked stable in Next.js v16
52
- *
53
- * @param version - version string to check.
54
- * @returns true if Next.js version supports native debug ids for turbopack builds
50
+ * Checks if the current Next.js version supports Turbopack externalize transitive dependencies.
51
+ * This was introduced in Next.js v16.1.0-canary.3
55
52
  */
56
53
  export declare function supportsTurbopackExternalizeTransitiveDependencies(version: SemVer | undefined): boolean;
57
54
  export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withPayload.utils.d.ts","sourceRoot":"","sources":["../../src/withPayload/withPayload.utils.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAQH;;GAEG;AACH,KAAK,MAAM,GAAG;IACZ,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAMD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAmBjD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,SAAS,CAoBrD;AAED;;;GAGG;AACH,wBAAgB,kDAAkD,CAChE,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,OAAO,CA+BT"}
@@ -0,0 +1,108 @@
1
+ /* eslint-disable no-console */ /**
2
+ * This was taken and modified from https://github.com/getsentry/sentry-javascript/blob/15256034ee8150a5b7dcb97d23eca1a5486f0cae/packages/nextjs/src/config/util.ts
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2012 Functional Software, Inc. dba Sentry
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
9
+ * this software and associated documentation files (the "Software"), to deal in
10
+ * the Software without restriction, including without limitation the rights to
11
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12
+ * of the Software, and to permit persons to whom the Software is furnished to do
13
+ * so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ */import { readFileSync } from 'fs';
26
+ function _parseInt(input) {
27
+ return parseInt(input || '', 10);
28
+ }
29
+ // https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
30
+ const SEMVER_REGEXP = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i;
31
+ /**
32
+ * Parses input into a SemVer interface
33
+ * @param input string representation of a semver version
34
+ */
35
+ export function parseSemver(input) {
36
+ const match = input.match(SEMVER_REGEXP) || [];
37
+ const major = _parseInt(match[1]);
38
+ const minor = _parseInt(match[2]);
39
+ const patch = _parseInt(match[3]);
40
+ const prerelease = match[4];
41
+ const canaryVersion = prerelease?.startsWith('canary.') ? parseInt(prerelease.split('.')[1] || '0', 10) : undefined;
42
+ return {
43
+ buildmetadata: match[5],
44
+ canaryVersion,
45
+ major: isNaN(major) ? undefined : major,
46
+ minor: isNaN(minor) ? undefined : minor,
47
+ patch: isNaN(patch) ? undefined : patch,
48
+ prerelease: match[4]
49
+ };
50
+ }
51
+ /**
52
+ * Returns the version of Next.js installed in the project, or undefined if it cannot be determined.
53
+ */
54
+ export function getNextjsVersion() {
55
+ try {
56
+ let pkgPath;
57
+ // Check if we're in ESM or CJS environment
58
+ if (typeof import.meta?.resolve === 'function') {
59
+ // ESM environment - use import.meta.resolve
60
+ const pkgUrl = import.meta.resolve('next/package.json');
61
+ pkgPath = new URL(pkgUrl).pathname;
62
+ } else {
63
+ // CJS environment - use require.resolve
64
+ pkgPath = require.resolve('next/package.json');
65
+ }
66
+ const pkgJson = JSON.parse(readFileSync(pkgPath, 'utf8'));
67
+ return parseSemver(pkgJson.version);
68
+ } catch (e) {
69
+ console.error('Payload: Error getting Next.js version', e);
70
+ return undefined;
71
+ }
72
+ }
73
+ /**
74
+ * Checks if the current Next.js version supports Turbopack externalize transitive dependencies.
75
+ * This was introduced in Next.js v16.1.0-canary.3
76
+ */
77
+ export function supportsTurbopackExternalizeTransitiveDependencies(version) {
78
+ if (!version) {
79
+ return false;
80
+ }
81
+ const {
82
+ canaryVersion,
83
+ major,
84
+ minor
85
+ } = version;
86
+ if (major === undefined || minor === undefined) {
87
+ return false;
88
+ }
89
+ if (major > 16) {
90
+ return true;
91
+ }
92
+ if (major === 16) {
93
+ if (minor > 1) {
94
+ return true;
95
+ }
96
+ if (minor === 1) {
97
+ if (canaryVersion !== undefined) {
98
+ // 16.1.0-canary.3+
99
+ return canaryVersion >= 3;
100
+ } else {
101
+ // Assume that Next.js 16.1 inherits support for this feature from the canary release
102
+ return true;
103
+ }
104
+ }
105
+ }
106
+ return false;
107
+ }
108
+ //# sourceMappingURL=withPayload.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withPayload.utils.js","names":["readFileSync","_parseInt","input","parseInt","SEMVER_REGEXP","parseSemver","match","major","minor","patch","prerelease","canaryVersion","startsWith","split","undefined","buildmetadata","isNaN","getNextjsVersion","pkgPath","import","meta","resolve","pkgUrl","URL","pathname","require","pkgJson","JSON","parse","version","e","console","error","supportsTurbopackExternalizeTransitiveDependencies"],"sources":["../../src/withPayload/withPayload.utils.ts"],"sourcesContent":["/* eslint-disable no-console */\n/**\n * This was taken and modified from https://github.com/getsentry/sentry-javascript/blob/15256034ee8150a5b7dcb97d23eca1a5486f0cae/packages/nextjs/src/config/util.ts\n *\n * MIT License\n *\n * Copyright (c) 2012 Functional Software, Inc. dba Sentry\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n * of the Software, and to permit persons to whom the Software is furnished to do\n * so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { readFileSync } from 'fs'\n\nfunction _parseInt(input: string | undefined): number {\n return parseInt(input || '', 10)\n}\n\n/**\n * Represents Semantic Versioning object\n */\ntype SemVer = {\n buildmetadata?: string\n /**\n * undefined if not a canary version\n */\n canaryVersion?: number\n major?: number\n minor?: number\n patch?: number\n prerelease?: string\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$/i\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nexport function parseSemver(input: string): SemVer {\n const match = input.match(SEMVER_REGEXP) || []\n const major = _parseInt(match[1])\n const minor = _parseInt(match[2])\n const patch = _parseInt(match[3])\n\n const prerelease = match[4]\n const canaryVersion = prerelease?.startsWith('canary.')\n ? parseInt(prerelease.split('.')[1] || '0', 10)\n : undefined\n\n return {\n buildmetadata: match[5],\n canaryVersion,\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n }\n}\n\n/**\n * Returns the version of Next.js installed in the project, or undefined if it cannot be determined.\n */\nexport function getNextjsVersion(): SemVer | undefined {\n try {\n let pkgPath: string\n\n // Check if we're in ESM or CJS environment\n if (typeof import.meta?.resolve === 'function') {\n // ESM environment - use import.meta.resolve\n const pkgUrl = import.meta.resolve('next/package.json')\n pkgPath = new URL(pkgUrl).pathname\n } else {\n // CJS environment - use require.resolve\n pkgPath = require.resolve('next/package.json')\n }\n\n const pkgJson = JSON.parse(readFileSync(pkgPath, 'utf8'))\n return parseSemver(pkgJson.version)\n } catch (e) {\n console.error('Payload: Error getting Next.js version', e)\n return undefined\n }\n}\n\n/**\n * Checks if the current Next.js version supports Turbopack externalize transitive dependencies.\n * This was introduced in Next.js v16.1.0-canary.3\n */\nexport function supportsTurbopackExternalizeTransitiveDependencies(\n version: SemVer | undefined,\n): boolean {\n if (!version) {\n return false\n }\n\n const { canaryVersion, major, minor } = version\n\n if (major === undefined || minor === undefined) {\n return false\n }\n\n if (major > 16) {\n return true\n }\n\n if (major === 16) {\n if (minor > 1) {\n return true\n }\n if (minor === 1) {\n if (canaryVersion !== undefined) {\n // 16.1.0-canary.3+\n return canaryVersion >= 3\n } else {\n // Assume that Next.js 16.1 inherits support for this feature from the canary release\n return true\n }\n }\n }\n\n return false\n}\n"],"mappings":"AAAA,gCACA;;;;;;;;;;;;;;;;;;;;;;;;kCA0BA,SAASA,YAAY,QAAQ;AAE7B,SAASC,UAAUC,KAAyB;EAC1C,OAAOC,QAAA,CAASD,KAAA,IAAS,IAAI;AAC/B;AAiBA;AACA,MAAME,aAAA,GACJ;AAEF;;;;AAIA,OAAO,SAASC,YAAYH,KAAa;EACvC,MAAMI,KAAA,GAAQJ,KAAA,CAAMI,KAAK,CAACF,aAAA,KAAkB,EAAE;EAC9C,MAAMG,KAAA,GAAQN,SAAA,CAAUK,KAAK,CAAC,EAAE;EAChC,MAAME,KAAA,GAAQP,SAAA,CAAUK,KAAK,CAAC,EAAE;EAChC,MAAMG,KAAA,GAAQR,SAAA,CAAUK,KAAK,CAAC,EAAE;EAEhC,MAAMI,UAAA,GAAaJ,KAAK,CAAC,EAAE;EAC3B,MAAMK,aAAA,GAAgBD,UAAA,EAAYE,UAAA,CAAW,aACzCT,QAAA,CAASO,UAAA,CAAWG,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,KAAK,MAC1CC,SAAA;EAEJ,OAAO;IACLC,aAAA,EAAeT,KAAK,CAAC,EAAE;IACvBK,aAAA;IACAJ,KAAA,EAAOS,KAAA,CAAMT,KAAA,IAASO,SAAA,GAAYP,KAAA;IAClCC,KAAA,EAAOQ,KAAA,CAAMR,KAAA,IAASM,SAAA,GAAYN,KAAA;IAClCC,KAAA,EAAOO,KAAA,CAAMP,KAAA,IAASK,SAAA,GAAYL,KAAA;IAClCC,UAAA,EAAYJ,KAAK,CAAC;EACpB;AACF;AAEA;;;AAGA,OAAO,SAASW,iBAAA;EACd,IAAI;IACF,IAAIC,OAAA;IAEJ;IACA,IAAI,OAAOC,MAAA,CAAAC,IAAA,EAAaC,OAAA,KAAY,YAAY;MAC9C;MACA,MAAMC,MAAA,GAASH,MAAA,CAAAC,IAAA,CAAYC,OAAO,CAAC;MACnCH,OAAA,GAAU,IAAIK,GAAA,CAAID,MAAA,EAAQE,QAAQ;IACpC,OAAO;MACL;MACAN,OAAA,GAAUO,OAAA,CAAQJ,OAAO,CAAC;IAC5B;IAEA,MAAMK,OAAA,GAAUC,IAAA,CAAKC,KAAK,CAAC5B,YAAA,CAAakB,OAAA,EAAS;IACjD,OAAOb,WAAA,CAAYqB,OAAA,CAAQG,OAAO;EACpC,EAAE,OAAOC,CAAA,EAAG;IACVC,OAAA,CAAQC,KAAK,CAAC,0CAA0CF,CAAA;IACxD,OAAOhB,SAAA;EACT;AACF;AAEA;;;;AAIA,OAAO,SAASmB,mDACdJ,OAA2B;EAE3B,IAAI,CAACA,OAAA,EAAS;IACZ,OAAO;EACT;EAEA,MAAM;IAAElB,aAAa;IAAEJ,KAAK;IAAEC;EAAK,CAAE,GAAGqB,OAAA;EAExC,IAAItB,KAAA,KAAUO,SAAA,IAAaN,KAAA,KAAUM,SAAA,EAAW;IAC9C,OAAO;EACT;EAEA,IAAIP,KAAA,GAAQ,IAAI;IACd,OAAO;EACT;EAEA,IAAIA,KAAA,KAAU,IAAI;IAChB,IAAIC,KAAA,GAAQ,GAAG;MACb,OAAO;IACT;IACA,IAAIA,KAAA,KAAU,GAAG;MACf,IAAIG,aAAA,KAAkBG,SAAA,EAAW;QAC/B;QACA,OAAOH,aAAA,IAAiB;MAC1B,OAAO;QACL;QACA,OAAO;MACT;IACF;EACF;EAEA,OAAO;AACT","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withPayloadLegacy.d.ts","sourceRoot":"","sources":["../../src/withPayload/withPayloadLegacy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAEtC;;GAEG;AACH,eAAO,MAAM,iBAAiB,gBAAgB,UAAU,KAAQ,UA4D/D,CAAA"}