@payloadcms/next 3.68.0-internal.6fa474a → 3.68.0-internal.a0125d7
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/cjs/withPayload.cjs +313 -2
- package/dist/cjs/withPayload.cjs.map +3 -3
- package/dist/prod/styles.css +1 -1
- package/dist/withPayload/withPayload.utils.d.ts.map +1 -1
- package/dist/withPayload/withPayload.utils.js +38 -28
- package/dist/withPayload/withPayload.utils.js.map +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withPayload.utils.d.ts","sourceRoot":"","sources":["../../src/withPayload/withPayload.utils.ts"],"names":[],"mappings":"
|
|
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;;;;;;GAMG;AACH,wBAAgB,kDAAkD,CAChE,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,OAAO,CA+BT"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
26
|
function _parseInt(input) {
|
|
27
27
|
return parseInt(input || '', 10);
|
|
28
28
|
}
|
|
@@ -53,10 +53,20 @@ export function parseSemver(input) {
|
|
|
53
53
|
*/
|
|
54
54
|
export function getNextjsVersion() {
|
|
55
55
|
try {
|
|
56
|
-
|
|
57
|
-
|
|
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'));
|
|
58
67
|
return parseSemver(pkgJson.version);
|
|
59
|
-
} catch {
|
|
68
|
+
} catch (e) {
|
|
69
|
+
console.error('Payload: Error getting Next.js version', e);
|
|
60
70
|
return undefined;
|
|
61
71
|
}
|
|
62
72
|
}
|
|
@@ -1 +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","
|
|
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 native debug ids for turbopack.\n * This feature was first introduced in Next.js v15.6.0-canary.36 and marked stable in Next.js v16\n *\n * @param version - version string to check.\n * @returns true if Next.js version supports native debug ids for turbopack builds\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.15+\n return canaryVersion >= 15\n } else {\n // Assume that Next.js 16.1 inherits support for this feature from the canary release\n return true\n }\n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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;;;;;;;AAOA,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":[]}
|
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.a0125d7",
|
|
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/graphql": "3.68.0-internal.
|
|
101
|
-
"@payloadcms/translations": "3.68.0-internal.
|
|
102
|
-
"@payloadcms/ui": "3.68.0-internal.
|
|
100
|
+
"@payloadcms/graphql": "3.68.0-internal.a0125d7",
|
|
101
|
+
"@payloadcms/translations": "3.68.0-internal.a0125d7",
|
|
102
|
+
"@payloadcms/ui": "3.68.0-internal.a0125d7"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@babel/cli": "7.27.2",
|
|
@@ -113,16 +113,16 @@
|
|
|
113
113
|
"@types/react-dom": "19.2.3",
|
|
114
114
|
"@types/uuid": "10.0.0",
|
|
115
115
|
"babel-plugin-react-compiler": "19.1.0-rc.3",
|
|
116
|
-
"esbuild": "0.
|
|
116
|
+
"esbuild": "0.27.1",
|
|
117
117
|
"esbuild-sass-plugin": "3.3.1",
|
|
118
118
|
"swc-plugin-transform-remove-imports": "8.3.0",
|
|
119
|
-
"
|
|
120
|
-
"
|
|
119
|
+
"payload": "3.68.0-internal.a0125d7",
|
|
120
|
+
"@payloadcms/eslint-config": "3.28.0"
|
|
121
121
|
},
|
|
122
122
|
"peerDependencies": {
|
|
123
123
|
"graphql": "^16.8.1",
|
|
124
124
|
"next": "^15.4.8 || ^16.1.0",
|
|
125
|
-
"payload": "3.68.0-internal.
|
|
125
|
+
"payload": "3.68.0-internal.a0125d7"
|
|
126
126
|
},
|
|
127
127
|
"engines": {
|
|
128
128
|
"node": "^18.20.2 || >=20.9.0"
|