chore: bump nextjs dependencies to ^14.2 (#5820)

fix(plugin-seo): overriding existing endpoints
This commit is contained in:
Paul
2024-04-12 12:32:45 -03:00
committed by GitHub
parent 0d40d87b31
commit 2f446e11d6
13 changed files with 199 additions and 219 deletions

View File

@@ -127,7 +127,7 @@
"lint-staged": "^14.0.1", "lint-staged": "^14.0.1",
"minimist": "1.2.8", "minimist": "1.2.8",
"mongodb-memory-server": "^9.0", "mongodb-memory-server": "^9.0",
"next": "14.2.0-canary.22", "next": "^14.2",
"node-mocks-http": "^1.14.1", "node-mocks-http": "^1.14.1",
"nodemon": "3.0.3", "nodemon": "3.0.3",
"open": "^10.1.0", "open": "^10.1.0",

View File

@@ -77,7 +77,7 @@
}, },
"peerDependencies": { "peerDependencies": {
"http-status": "1.6.2", "http-status": "1.6.2",
"next": "14.2.0-canary.23", "next": "^14.2",
"payload": "workspace:*" "payload": "workspace:*"
}, },
"publishConfig": { "publishConfig": {

View File

@@ -45,7 +45,7 @@ const seo =
Field: (props) => ( Field: (props) => (
<MetaTitle <MetaTitle
{...props} {...props}
hasGenerateTitleFn={typeof pluginConfig.generateTitle === 'function'} hasGenerateTitleFn={typeof pluginConfig?.generateTitle === 'function'}
/> />
), ),
}, },
@@ -62,7 +62,7 @@ const seo =
<MetaDescription <MetaDescription
{...props} {...props}
hasGenerateDescriptionFn={ hasGenerateDescriptionFn={
typeof pluginConfig.generateDescription === 'function' typeof pluginConfig?.generateDescription === 'function'
} }
/> />
), ),
@@ -82,7 +82,7 @@ const seo =
Field: (props) => ( Field: (props) => (
<MetaImage <MetaImage
{...props} {...props}
hasGenerateImageFn={typeof pluginConfig.generateImage === 'function'} hasGenerateImageFn={typeof pluginConfig?.generateImage === 'function'}
/> />
), ),
}, },
@@ -105,7 +105,7 @@ const seo =
Field: (props) => ( Field: (props) => (
<Preview <Preview
{...props} {...props}
hasGenerateURLFn={typeof pluginConfig.generateURL === 'function'} hasGenerateURLFn={typeof pluginConfig?.generateURL === 'function'}
/> />
), ),
}, },
@@ -194,11 +194,12 @@ const seo =
return collection return collection
}) || [], }) || [],
endpoints: [ endpoints: [
...config.endpoints,
{ {
handler: async (req) => { handler: async (req) => {
const args: Parameters<GenerateTitle>[0] = const args: Parameters<GenerateTitle>[0] =
req.data as unknown as Parameters<GenerateTitle>[0] req.data as unknown as Parameters<GenerateTitle>[0]
const result = await pluginConfig.generateTitle(args) const result = pluginConfig.generateTitle ? await pluginConfig.generateTitle(args) : ''
return new Response(JSON.stringify({ result }), { status: 200 }) return new Response(JSON.stringify({ result }), { status: 200 })
}, },
method: 'post', method: 'post',
@@ -208,7 +209,9 @@ const seo =
handler: async (req) => { handler: async (req) => {
const args: Parameters<GenerateDescription>[0] = const args: Parameters<GenerateDescription>[0] =
req.data as unknown as Parameters<GenerateDescription>[0] req.data as unknown as Parameters<GenerateDescription>[0]
const result = await pluginConfig.generateDescription(args) const result = pluginConfig.generateDescription
? await pluginConfig.generateDescription(args)
: ''
return new Response(JSON.stringify({ result }), { status: 200 }) return new Response(JSON.stringify({ result }), { status: 200 })
}, },
method: 'post', method: 'post',
@@ -218,7 +221,7 @@ const seo =
handler: async (req) => { handler: async (req) => {
const args: Parameters<GenerateURL>[0] = const args: Parameters<GenerateURL>[0] =
req.data as unknown as Parameters<GenerateURL>[0] req.data as unknown as Parameters<GenerateURL>[0]
const result = await pluginConfig.generateURL(args) const result = pluginConfig.generateURL ? await pluginConfig.generateURL(args) : ''
return new Response(JSON.stringify({ result }), { status: 200 }) return new Response(JSON.stringify({ result }), { status: 200 })
}, },
method: 'post', method: 'post',
@@ -228,7 +231,7 @@ const seo =
handler: async (req) => { handler: async (req) => {
const args: Parameters<GenerateImage>[0] = const args: Parameters<GenerateImage>[0] =
req.data as unknown as Parameters<GenerateImage>[0] req.data as unknown as Parameters<GenerateImage>[0]
const result = await pluginConfig.generateImage(args) const result = pluginConfig.generateImage ? await pluginConfig.generateImage(args) : ''
return new Response(result, { status: 200 }) return new Response(result, { status: 200 })
}, },
method: 'post', method: 'post',

View File

@@ -216,7 +216,7 @@
"uuid": "9.0.1" "uuid": "9.0.1"
}, },
"peerDependencies": { "peerDependencies": {
"next": "14.2.0-canary.23", "next": "^14.2",
"payload": "workspace:*", "payload": "workspace:*",
"react": "^18.0.0" "react": "^18.0.0"
}, },

217
pnpm-lock.yaml generated
View File

@@ -200,8 +200,8 @@ importers:
specifier: ^9.0 specifier: ^9.0
version: 9.1.8 version: 9.1.8
next: next:
specifier: 14.2.0-canary.22 specifier: ^14.2
version: 14.2.0-canary.22(@babel/core@7.24.4)(react-dom@18.2.0)(react@18.2.0) version: 14.2.0(@babel/core@7.24.4)(@playwright/test@1.43.0)(react-dom@18.2.0)(react@18.2.0)(sass@1.74.1)
node-mocks-http: node-mocks-http:
specifier: ^1.14.1 specifier: ^1.14.1
version: 1.14.1 version: 1.14.1
@@ -628,8 +628,8 @@ importers:
specifier: 1.6.2 specifier: 1.6.2
version: 1.6.2 version: 1.6.2
next: next:
specifier: 14.2.0-canary.23 specifier: ^14.2
version: 14.2.0-canary.23(@babel/core@7.24.4)(react-dom@18.2.0)(react@18.2.0)(sass@1.74.1) version: 14.2.0(@babel/core@7.24.4)(@playwright/test@1.43.0)(react-dom@18.2.0)(react@18.2.0)(sass@1.74.1)
path-to-regexp: path-to-regexp:
specifier: ^6.2.1 specifier: ^6.2.1
version: 6.2.2 version: 6.2.2
@@ -1397,8 +1397,8 @@ importers:
specifier: 2.3.0 specifier: 2.3.0
version: 2.3.0 version: 2.3.0
next: next:
specifier: 14.2.0-canary.23 specifier: ^14.2
version: 14.2.0-canary.23(@babel/core@7.24.4)(react-dom@18.2.0)(react@18.2.0)(sass@1.74.1) version: 14.2.0(@babel/core@7.24.4)(@playwright/test@1.43.0)(react-dom@18.2.0)(react@18.2.0)(sass@1.74.1)
object-to-formdata: object-to-formdata:
specifier: 4.5.1 specifier: 4.5.1
version: 4.5.1 version: 4.5.1
@@ -4539,13 +4539,8 @@ packages:
- utf-8-validate - utf-8-validate
dev: true dev: true
/@next/env@14.2.0-canary.22: /@next/env@14.2.0:
resolution: {integrity: sha512-c72nBWQcgDwc711vtF0juZ81WPEHJbj22QzEkaqaS2cJty9IiyXTVTVzJHA1dueN9fDFCH3BeWDxoVn4y7MO8A==} resolution: {integrity: sha512-4+70ELtSbRtYUuyRpAJmKC8NHBW2x1HMje9KO2Xd7IkoyucmV9SjgO+qeWMC0JWkRQXgydv1O7yKOK8nu/rITQ==}
dev: true
/@next/env@14.2.0-canary.23:
resolution: {integrity: sha512-cBlFB8Y/iE3K2NX/Km4tP4RZGLsv0D72KI9KxmZepKSkaQBSbtHM0YeHnZ51CFe9UQKzQ/1mPnCY89BjiyIQtQ==}
dev: false
/@next/eslint-plugin-next@14.1.4: /@next/eslint-plugin-next@14.1.4:
resolution: {integrity: sha512-n4zYNLSyCo0Ln5b7qxqQeQ34OZKXwgbdcx6kmkQbywr+0k6M3Vinft0T72R6CDAcDrne2IAgSud4uWCzFgc5HA==} resolution: {integrity: sha512-n4zYNLSyCo0Ln5b7qxqQeQ34OZKXwgbdcx6kmkQbywr+0k6M3Vinft0T72R6CDAcDrne2IAgSud4uWCzFgc5HA==}
@@ -4553,166 +4548,76 @@ packages:
glob: 10.3.10 glob: 10.3.10
dev: true dev: true
/@next/swc-darwin-arm64@14.2.0-canary.22: /@next/swc-darwin-arm64@14.2.0:
resolution: {integrity: sha512-aMU93w01wjqi5kfCS7Khot+lRvEtKxNrRv3KuQpXYrSaVCytMBqVwiyugo3IF5FPNuO0kMk90Wct4gxHE9jIGw==} resolution: {integrity: sha512-kHktLlw0AceuDnkVljJ/4lTJagLzDiO3klR1Fzl2APDFZ8r+aTxNaNcPmpp0xLMkgRwwk6sggYeqq0Rz9K4zzA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@next/swc-darwin-arm64@14.2.0-canary.23: /@next/swc-darwin-x64@14.2.0:
resolution: {integrity: sha512-K1f7A/0ljZO7IX+M+phguFP8lxdqMgEv1x1+gC+UmyZ1c8Na1PgirGgUwdLKxuNjyxlRqY5lkQ/FDk2FOYBSLA==} resolution: {integrity: sha512-HFSDu7lb1U3RDxXNeKH3NGRR5KyTPBSUTuIOr9jXoAso7i76gNYvnTjbuzGVWt2X5izpH908gmOYWtI7un+JrA==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: false
optional: true
/@next/swc-darwin-x64@14.2.0-canary.22:
resolution: {integrity: sha512-188vbCauuryRk+ePTK6YJ5r+1tzDKVFeZmDK/1BHOeGqDUtzYqY0N+08iY4Nyg4rHb8OBO4CONfRSOTzGJw+Pg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@next/swc-darwin-x64@14.2.0-canary.23: /@next/swc-linux-arm64-gnu@14.2.0:
resolution: {integrity: sha512-3Zg0aZZV9Z0+4QCVNMH/LLW1dRD2mVNtuFBoTI6/7rWUiGrm/9+58sKyjjg+cE9S/zAKvJoFZP7Ask9vnrk4tg==} resolution: {integrity: sha512-iQsoWziO5ZMxDWZ4ZTCAc7hbJ1C9UDj/gATSqTaMjW2bJFwAsvf9UM79AKnljBl73uPZ+V0kH4rvnHTco4Ps2w==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: false
optional: true
/@next/swc-linux-arm64-gnu@14.2.0-canary.22:
resolution: {integrity: sha512-RzKik7qYGzW2+UIw0SALjfsVqTF4iO5m8otBBz0Rst5poBtjPtY7Wkp362Y69g2BoNM03tG/QhsM3HGyoGKwQQ==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@next/swc-linux-arm64-gnu@14.2.0-canary.23: /@next/swc-linux-arm64-musl@14.2.0:
resolution: {integrity: sha512-OMt5uTXtEZNKaeSvviJQVXzARr3Jyk1BKUQVD10hKUa4edWBcmnrpdqiDVoDCGt9kMOdKdGqJHOJUk/jV/G15w==} resolution: {integrity: sha512-0JOk2uzLUt8fJK5LpsKKZa74zAch7bJjjgJzR9aOMs231AlE4gPYzsSm430ckZitjPGKeH5bgDZjqwqJQKIS2w==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
dev: false
optional: true optional: true
/@next/swc-linux-arm64-musl@14.2.0-canary.22: /@next/swc-linux-x64-gnu@14.2.0:
resolution: {integrity: sha512-u7egrTZPX+xHMc07bpICwb79omVC8oEjClOJrf2zsqExXaem2AzkGOeK6P+vPKwXOQ1dbTsdbEoYI02BCpUvmQ==} resolution: {integrity: sha512-uYHkuTzX0NM6biKNp7hdKTf+BF0iMV254SxO0B8PgrQkxUBKGmk5ysHKB+FYBfdf9xei/t8OIKlXJs9ckD943A==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@next/swc-linux-arm64-musl@14.2.0-canary.23:
resolution: {integrity: sha512-vllciUQ4U99LCOBnsFt9QGf9AyE8yhBtNdNxbij5QsdQ/F53SamxrbYOgG7RisvRqFmWSQMfHdpGZOE0EUUsvQ==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: false
optional: true
/@next/swc-linux-x64-gnu@14.2.0-canary.22:
resolution: {integrity: sha512-9cHF5tVln5yGGZJIbbRtKj0dCRB+ySnQa6/xS6e6Obe//+M8hpIuzYUJFbb7LIyAs5TL0pVs1wiFLilyZGWqtA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@next/swc-linux-x64-gnu@14.2.0-canary.23: /@next/swc-linux-x64-musl@14.2.0:
resolution: {integrity: sha512-soKCxTCi0m0hOBSEchH2YTluvQzAEb8HIoQXxligU8C1fmFDX25pwQ4iSWmdvA6xDJn96PG2R64NyytTTMg9TQ==} resolution: {integrity: sha512-paN89nLs2dTBDtfXWty1/NVPit+q6ldwdktixYSVwiiAz647QDCd+EIYqoiS+/rPG3oXs/A7rWcJK9HVqfnMVg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
dev: false
optional: true optional: true
/@next/swc-linux-x64-musl@14.2.0-canary.22: /@next/swc-win32-arm64-msvc@14.2.0:
resolution: {integrity: sha512-tr/on4bRNu5uua86CnBVAoz7sYyoPn4n5k04hwlcHDVg08pi/DhmqPp1d7oJCSb7rY6imH3nSMqNqoAVROT2VQ==} resolution: {integrity: sha512-j1oiidZisnymYjawFqEfeGNcE22ZQ7lGUaa4pGOCVWrWeIDkPSj8zYgS9TzMNlg17Q3wSWCQC/F5uJAhSh7qcA==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@next/swc-linux-x64-musl@14.2.0-canary.23:
resolution: {integrity: sha512-Qr+4ySSYEh1hSSmUJ50oHtKopkqwo3RFb2CXpzcMqp+6U8WOMYBX+JTSCFdA3lSlUJqScIgoRoMDk9I3TZM71g==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: false
optional: true
/@next/swc-win32-arm64-msvc@14.2.0-canary.22:
resolution: {integrity: sha512-H8cvi02H8uk9a1ZvtTpsaC8yxfKRFCgi8G/dMMknzHbepOMcYLa0tUJmGqDWklWZY8RnuupNqJIt/MhLmSdoTA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [win32] os: [win32]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@next/swc-win32-arm64-msvc@14.2.0-canary.23: /@next/swc-win32-ia32-msvc@14.2.0:
resolution: {integrity: sha512-94HGrBqz9s7z6d6hlukbkF4LiU4Bw+a+C3i+J7pBA+3BHtIyffuqmnrP3HY92trP3M328GBN01H7/zqahcvwPQ==} resolution: {integrity: sha512-6ff6F4xb+QGD1jhx/dOT9Ot7PQ/GAYekV9ykwEh2EFS/cLTyU4Y3cXkX5cNtNIhpctS5NvyjW9gIksRNErYE0A==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: false
optional: true
/@next/swc-win32-ia32-msvc@14.2.0-canary.22:
resolution: {integrity: sha512-s8Jdg0CUp3OL5ccAMliIBzhKwSlwWDDSypjqkKcEVINnzJexgl7ymrCMzZWeNO0IOhJxMWaPdMf5xuEsSxBbKg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [ia32] cpu: [ia32]
os: [win32] os: [win32]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@next/swc-win32-ia32-msvc@14.2.0-canary.23: /@next/swc-win32-x64-msvc@14.2.0:
resolution: {integrity: sha512-lrvn6ekxPyrBidQxA0kE3xyys8fCLlbhi1tl2FA0QUPHvgPbu2127Q7+UFnl/NGC9veZfCbw6b7TVFyvPseRsQ==} resolution: {integrity: sha512-09DbG5vXAxz0eTFSf1uebWD36GF3D5toynRkgo2AlSrxwGZkWtJ1RhmrczRYQ17eD5bdo4FZ0ibiffdq5kc4vg==}
engines: {node: '>= 10'}
cpu: [ia32]
os: [win32]
requiresBuild: true
dev: false
optional: true
/@next/swc-win32-x64-msvc@14.2.0-canary.22:
resolution: {integrity: sha512-6MrHjj76CeuYTJnVXyd43OF9fOkBSmDRbkLp+kwa+O1GZmkFZyqRNORdtMWNKbmiFPxfhd+FOgHG9fl1l05gUQ==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
requiresBuild: true requiresBuild: true
dev: true
optional: true
/@next/swc-win32-x64-msvc@14.2.0-canary.23:
resolution: {integrity: sha512-T8zZcK8M5GYWzIKOlxcothb0sixdFSowUztZTNb/kmUK8Vz1Z+TFBxU00WvBDx9ymrGP2f4EKL9YQqu2d+BmcA==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
requiresBuild: true
dev: false
optional: true optional: true
/@nodelib/fs.scandir@2.1.5: /@nodelib/fs.scandir@2.1.5:
@@ -4818,7 +4723,6 @@ packages:
hasBin: true hasBin: true
dependencies: dependencies:
playwright: 1.43.0(patch_hash=smjs6qro5qsqddamrqipwrbi5i) playwright: 1.43.0(patch_hash=smjs6qro5qsqddamrqipwrbi5i)
dev: true
/@polka/url@1.0.0-next.25: /@polka/url@1.0.0-next.25:
resolution: {integrity: sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==} resolution: {integrity: sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==}
@@ -9963,7 +9867,6 @@ packages:
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin] os: [darwin]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/fsevents@2.3.3: /fsevents@2.3.3:
@@ -12364,61 +12267,26 @@ packages:
/next-tick@1.1.0: /next-tick@1.1.0:
resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==}
/next@14.2.0-canary.22(@babel/core@7.24.4)(react-dom@18.2.0)(react@18.2.0): /next@14.2.0(@babel/core@7.24.4)(@playwright/test@1.43.0)(react-dom@18.2.0)(react@18.2.0)(sass@1.74.1):
resolution: {integrity: sha512-nCqEuJLHRFDWpMfcql3D8V88GAGoEeZobxSCgi6ablFWMkzBGgrwZmsJi41OgtJnWwfF/c56MPXAgkFqbBcwyw==} resolution: {integrity: sha512-2T41HqJdKPqheR27ll7MFZ3gtTYvGew7cUc0PwPSyK9Ao5vvwpf9bYfP4V5YBGLckHF2kEGvrLte5BqLSv0s8g==}
engines: {node: '>=18.17.0'} engines: {node: '>=18.17.0'}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
'@opentelemetry/api': ^1.1.0 '@opentelemetry/api': ^1.1.0
'@playwright/test': ^1.41.2
react: ^18.2.0 react: ^18.2.0
react-dom: ^18.2.0 react-dom: ^18.2.0
sass: ^1.3.0 sass: ^1.3.0
peerDependenciesMeta: peerDependenciesMeta:
'@opentelemetry/api': '@opentelemetry/api':
optional: true optional: true
sass: '@playwright/test':
optional: true
dependencies:
'@next/env': 14.2.0-canary.22
'@swc/helpers': 0.5.5
busboy: 1.6.0
caniuse-lite: 1.0.30001607
graceful-fs: 4.2.11
postcss: 8.4.31
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
styled-jsx: 5.1.1(@babel/core@7.24.4)(react@18.2.0)
optionalDependencies:
'@next/swc-darwin-arm64': 14.2.0-canary.22
'@next/swc-darwin-x64': 14.2.0-canary.22
'@next/swc-linux-arm64-gnu': 14.2.0-canary.22
'@next/swc-linux-arm64-musl': 14.2.0-canary.22
'@next/swc-linux-x64-gnu': 14.2.0-canary.22
'@next/swc-linux-x64-musl': 14.2.0-canary.22
'@next/swc-win32-arm64-msvc': 14.2.0-canary.22
'@next/swc-win32-ia32-msvc': 14.2.0-canary.22
'@next/swc-win32-x64-msvc': 14.2.0-canary.22
transitivePeerDependencies:
- '@babel/core'
- babel-plugin-macros
dev: true
/next@14.2.0-canary.23(@babel/core@7.24.4)(react-dom@18.2.0)(react@18.2.0)(sass@1.74.1):
resolution: {integrity: sha512-HuQYIeSlmBmTueVIxn0Zjxx5I4MD6vG3p6AsFySTF7/hMSF5qFUCHGIj3YJRWsDcUw/LQhuGPNLaGUg119YegQ==}
engines: {node: '>=18.17.0'}
hasBin: true
peerDependencies:
'@opentelemetry/api': ^1.1.0
react: ^18.2.0
react-dom: ^18.2.0
sass: ^1.3.0
peerDependenciesMeta:
'@opentelemetry/api':
optional: true optional: true
sass: sass:
optional: true optional: true
dependencies: dependencies:
'@next/env': 14.2.0-canary.23 '@next/env': 14.2.0
'@playwright/test': 1.43.0
'@swc/helpers': 0.5.5 '@swc/helpers': 0.5.5
busboy: 1.6.0 busboy: 1.6.0
caniuse-lite: 1.0.30001607 caniuse-lite: 1.0.30001607
@@ -12429,19 +12297,18 @@ packages:
sass: 1.74.1 sass: 1.74.1
styled-jsx: 5.1.1(@babel/core@7.24.4)(react@18.2.0) styled-jsx: 5.1.1(@babel/core@7.24.4)(react@18.2.0)
optionalDependencies: optionalDependencies:
'@next/swc-darwin-arm64': 14.2.0-canary.23 '@next/swc-darwin-arm64': 14.2.0
'@next/swc-darwin-x64': 14.2.0-canary.23 '@next/swc-darwin-x64': 14.2.0
'@next/swc-linux-arm64-gnu': 14.2.0-canary.23 '@next/swc-linux-arm64-gnu': 14.2.0
'@next/swc-linux-arm64-musl': 14.2.0-canary.23 '@next/swc-linux-arm64-musl': 14.2.0
'@next/swc-linux-x64-gnu': 14.2.0-canary.23 '@next/swc-linux-x64-gnu': 14.2.0
'@next/swc-linux-x64-musl': 14.2.0-canary.23 '@next/swc-linux-x64-musl': 14.2.0
'@next/swc-win32-arm64-msvc': 14.2.0-canary.23 '@next/swc-win32-arm64-msvc': 14.2.0
'@next/swc-win32-ia32-msvc': 14.2.0-canary.23 '@next/swc-win32-ia32-msvc': 14.2.0
'@next/swc-win32-x64-msvc': 14.2.0-canary.23 '@next/swc-win32-x64-msvc': 14.2.0
transitivePeerDependencies: transitivePeerDependencies:
- '@babel/core' - '@babel/core'
- babel-plugin-macros - babel-plugin-macros
dev: false
/node-abi@3.57.0: /node-abi@3.57.0:
resolution: {integrity: sha512-Dp+A9JWxRaKuHP35H77I4kCKesDy5HUDEmScia2FyncMTOXASMyg251F5PhFoDA5uqBrDDffiLpbqnrZmNXW+g==} resolution: {integrity: sha512-Dp+A9JWxRaKuHP35H77I4kCKesDy5HUDEmScia2FyncMTOXASMyg251F5PhFoDA5uqBrDDffiLpbqnrZmNXW+g==}
@@ -13111,7 +12978,6 @@ packages:
resolution: {integrity: sha512-iWFjyBUH97+pUFiyTqSLd8cDMMOS0r2ZYz2qEsPjH8/bX++sbIJT35MSwKnp1r/OQBAqC5XO99xFbJ9XClhf4w==} resolution: {integrity: sha512-iWFjyBUH97+pUFiyTqSLd8cDMMOS0r2ZYz2qEsPjH8/bX++sbIJT35MSwKnp1r/OQBAqC5XO99xFbJ9XClhf4w==}
engines: {node: '>=16'} engines: {node: '>=16'}
hasBin: true hasBin: true
dev: true
/playwright@1.43.0(patch_hash=smjs6qro5qsqddamrqipwrbi5i): /playwright@1.43.0(patch_hash=smjs6qro5qsqddamrqipwrbi5i):
resolution: {integrity: sha512-SiOKHbVjTSf6wHuGCbqrEyzlm6qvXcv7mENP+OZon1I07brfZLGdfWV0l/efAzVx7TF3Z45ov1gPEkku9q25YQ==} resolution: {integrity: sha512-SiOKHbVjTSf6wHuGCbqrEyzlm6qvXcv7mENP+OZon1I07brfZLGdfWV0l/efAzVx7TF3Z45ov1gPEkku9q25YQ==}
@@ -13121,7 +12987,6 @@ packages:
playwright-core: 1.43.0 playwright-core: 1.43.0
optionalDependencies: optionalDependencies:
fsevents: 2.3.2 fsevents: 2.3.2
dev: true
patched: true patched: true
/pluralize@8.0.0: /pluralize@8.0.0:

View File

@@ -5,7 +5,8 @@ import { expect, test } from '@playwright/test'
import path from 'path' import path from 'path'
import { fileURLToPath } from 'url' import { fileURLToPath } from 'url'
import type { ReadOnlyCollection, RestrictedVersion } from './payload-types.js' import type { PayloadTestSDK } from '../helpers/sdk/index.js'
import type { Config, ReadOnlyCollection, RestrictedVersion } from './payload-types.js'
import { import {
closeNav, closeNav,
@@ -17,7 +18,7 @@ import {
saveDocAndAssert, saveDocAndAssert,
} from '../helpers.js' } from '../helpers.js'
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
import { initPayloadE2E } from '../helpers/initPayloadE2E.js' import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
import { POLL_TOPASS_TIMEOUT } from '../playwright.config.js' import { POLL_TOPASS_TIMEOUT } from '../playwright.config.js'
import { import {
docLevelAccessSlug, docLevelAccessSlug,
@@ -40,7 +41,7 @@ const dirname = path.dirname(filename)
*/ */
const { beforeAll, describe } = test const { beforeAll, describe } = test
let payload: Payload let payload: PayloadTestSDK<Config>
describe('access control', () => { describe('access control', () => {
let page: Page let page: Page
let url: AdminUrlUtil let url: AdminUrlUtil
@@ -50,7 +51,7 @@ describe('access control', () => {
let serverURL: string let serverURL: string
beforeAll(async ({ browser }) => { beforeAll(async ({ browser }) => {
;({ payload, serverURL } = await initPayloadE2E({ dirname })) ;({ payload, serverURL } = await initPayloadE2ENoConfig<Config>({ dirname }))
url = new AdminUrlUtil(serverURL, slug) url = new AdminUrlUtil(serverURL, slug)
restrictedUrl = new AdminUrlUtil(serverURL, restrictedSlug) restrictedUrl = new AdminUrlUtil(serverURL, restrictedSlug)

View File

@@ -6,8 +6,10 @@ import path from 'path'
import { wait } from 'payload/utilities' import { wait } from 'payload/utilities'
import { fileURLToPath } from 'url' import { fileURLToPath } from 'url'
import type { PayloadTestSDK } from '../helpers/sdk/index.js'
import type { import type {
FieldsRelationship as CollectionWithRelationships, FieldsRelationship as CollectionWithRelationships,
Config,
RelationOne, RelationOne,
RelationRestricted, RelationRestricted,
RelationTwo, RelationTwo,
@@ -23,7 +25,7 @@ import {
saveDocAndAssert, saveDocAndAssert,
} from '../helpers.js' } from '../helpers.js'
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
import { initPayloadE2E } from '../helpers/initPayloadE2E.js' import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
import { import {
relationFalseFilterOptionSlug, relationFalseFilterOptionSlug,
relationOneSlug, relationOneSlug,
@@ -34,12 +36,13 @@ import {
relationWithTitleSlug, relationWithTitleSlug,
slug, slug,
} from './collectionSlugs.js' } from './collectionSlugs.js'
const filename = fileURLToPath(import.meta.url) const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename) const dirname = path.dirname(filename)
const { beforeAll, beforeEach, describe } = test const { beforeAll, beforeEach, describe } = test
let payload: Payload let payload: PayloadTestSDK<Config>
describe('fields - relationship', () => { describe('fields - relationship', () => {
let url: AdminUrlUtil let url: AdminUrlUtil
@@ -54,7 +57,7 @@ describe('fields - relationship', () => {
let serverURL: string let serverURL: string
beforeAll(async ({ browser }) => { beforeAll(async ({ browser }) => {
;({ payload, serverURL } = await initPayloadE2E({ dirname })) ;({ payload, serverURL } = await initPayloadE2ENoConfig<Config>({ dirname }))
url = new AdminUrlUtil(serverURL, slug) url = new AdminUrlUtil(serverURL, slug)

View File

@@ -1,29 +1,30 @@
import type { SerializedBlockNode, SerializedLinkNode } from '@payloadcms/richtext-lexical' import type { SerializedBlockNode, SerializedLinkNode } from '@payloadcms/richtext-lexical'
import type { Page } from '@playwright/test' import type { Page } from '@playwright/test'
import type { PayloadTestSDK } from 'helpers/sdk/index.js'
import type { SerializedEditorState, SerializedParagraphNode, SerializedTextNode } from 'lexical' import type { SerializedEditorState, SerializedParagraphNode, SerializedTextNode } from 'lexical'
import type { Payload } from 'payload'
import { expect, test } from '@playwright/test' import { expect, test } from '@playwright/test'
import { initPayloadE2ENoConfig } from 'helpers/initPayloadE2ENoConfig.js'
import { reInitializeDB } from 'helpers/reInit.js'
import path from 'path' import path from 'path'
import { fileURLToPath } from 'url' import { fileURLToPath } from 'url'
import type { LexicalField } from '../../payload-types.js' import type { Config, LexicalField } from '../../payload-types.js'
import { initPageConsoleErrorCatch, saveDocAndAssert } from '../../../helpers.js' import { initPageConsoleErrorCatch, saveDocAndAssert } from '../../../helpers.js'
import { AdminUrlUtil } from '../../../helpers/adminUrlUtil.js' import { AdminUrlUtil } from '../../../helpers/adminUrlUtil.js'
import { initPayloadE2E } from '../../../helpers/initPayloadE2E.js'
import { RESTClient } from '../../../helpers/rest.js' import { RESTClient } from '../../../helpers/rest.js'
import { POLL_TOPASS_TIMEOUT } from '../../../playwright.config.js' import { POLL_TOPASS_TIMEOUT } from '../../../playwright.config.js'
import { clearAndSeedEverything } from '../../seed.js'
import { lexicalFieldsSlug } from '../../slugs.js' import { lexicalFieldsSlug } from '../../slugs.js'
import { lexicalDocData } from './data.js' import { lexicalDocData } from './data.js'
const filename = fileURLToPath(import.meta.url) const filename = fileURLToPath(import.meta.url)
const currentFolder = path.dirname(filename) const currentFolder = path.dirname(filename)
const dirname = path.resolve(currentFolder, '../../') const dirname = path.resolve(currentFolder, '../../')
const { beforeAll, beforeEach, describe } = test const { beforeAll, beforeEach, describe } = test
let payload: Payload let payload: PayloadTestSDK<Config>
let client: RESTClient let client: RESTClient
let page: Page let page: Page
let serverURL: string let serverURL: string
@@ -49,7 +50,7 @@ async function navigateToLexicalFields(navigateToListView: boolean = true) {
describe('lexical', () => { describe('lexical', () => {
beforeAll(async ({ browser }) => { beforeAll(async ({ browser }) => {
process.env.SEED_IN_CONFIG_ONINIT = 'false' // Makes it so the payload config onInit seed is not run. Otherwise, the seed would be run unnecessarily twice for the initial test run - once for beforeEach and once for onInit process.env.SEED_IN_CONFIG_ONINIT = 'false' // Makes it so the payload config onInit seed is not run. Otherwise, the seed would be run unnecessarily twice for the initial test run - once for beforeEach and once for onInit
;({ payload, serverURL } = await initPayloadE2E({ dirname })) ;({ payload, serverURL } = await initPayloadE2ENoConfig({ dirname }))
const context = await browser.newContext() const context = await browser.newContext()
page = await context.newPage() page = await context.newPage()
@@ -57,7 +58,12 @@ describe('lexical', () => {
initPageConsoleErrorCatch(page) initPageConsoleErrorCatch(page)
}) })
beforeEach(async () => { beforeEach(async () => {
await clearAndSeedEverything(payload) await reInitializeDB({
serverURL,
snapshotKey: 'fieldsLexicalTest',
uploadsDir: path.resolve(dirname, '../Upload/uploads'),
})
if (client) { if (client) {
await client.logout() await client.logout()
} }

View File

@@ -4,12 +4,11 @@ import { expect, test } from '@playwright/test'
import path from 'path' import path from 'path'
import { fileURLToPath } from 'url' import { fileURLToPath } from 'url'
import type { Page as PayloadPage } from './payload-types.js' import type { Config, Page as PayloadPage } from './payload-types.js'
import { ensureAutoLoginAndCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js' import { ensureAutoLoginAndCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js'
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
import { initPayloadE2E } from '../helpers/initPayloadE2E.js' import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
const filename = fileURLToPath(import.meta.url) const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename) const dirname = path.dirname(filename)
@@ -23,7 +22,7 @@ let childId: string
describe('Nested Docs Plugin', () => { describe('Nested Docs Plugin', () => {
beforeAll(async ({ browser }) => { beforeAll(async ({ browser }) => {
const { serverURL, payload } = await initPayloadE2E({ dirname }) const { serverURL, payload } = await initPayloadE2ENoConfig<Config>({ dirname })
url = new AdminUrlUtil(serverURL, 'pages') url = new AdminUrlUtil(serverURL, 'pages')
const context = await browser.newContext() const context = await browser.newContext()
page = await context.newPage() page = await context.newPage()

View File

@@ -1,9 +1,115 @@
/* tslint:disable */
/* eslint-disable */
/**
* This file was automatically generated by Payload.
* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
* and re-run `payload generate:types` to regenerate this file.
*/
export interface Config {
collections: {
pages: Page
categories: Category
users: User
'payload-preferences': PayloadPreference
'payload-migrations': PayloadMigration
}
globals: {}
locale: 'en' | 'es' | 'de'
user: User & {
collection: 'users'
}
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "pages".
*/
export interface Page { export interface Page {
id: string id: string
parent?: string title: string
slug: string slug: string
_status?: 'draft' | 'published' fullTitle?: string | null
title?: string parent?: (string | null) | Page
breadcrumbs?:
| {
doc?: (string | null) | Page
url?: string | null
label?: string | null
id?: string | null
}[]
| null
updatedAt: string
createdAt: string
_status?: ('draft' | 'published') | null
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "categories".
*/
export interface Category {
id: string
name: string
categorization?:
| {
doc?: (string | null) | Category
url?: string | null
label?: string | null
test?: string | null
id?: string | null
}[]
| null
owner?: (string | null) | Category
updatedAt: string
createdAt: string
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "users".
*/
export interface User {
id: string
updatedAt: string
createdAt: string
email: string
resetPasswordToken?: string | null
resetPasswordExpiration?: string | null
salt?: string | null
hash?: string | null
loginAttempts?: number | null
lockUntil?: string | null
password?: string | null
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-preferences".
*/
export interface PayloadPreference {
id: string
user: {
relationTo: 'users'
value: string | User
}
key?: string | null
value?:
| {
[k: string]: unknown
}
| unknown[]
| string
| number
| boolean
| null
updatedAt: string
createdAt: string
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-migrations".
*/
export interface PayloadMigration {
id: string
name?: string | null
batch?: number | null
updatedAt: string updatedAt: string
createdAt: string createdAt: string
} }

View File

@@ -41,10 +41,6 @@ export default buildConfigWithDefaults({
await seed(payload) await seed(payload)
}, },
plugins: [ plugins: [
seo({
collections: ['users'],
tabbedUI: true,
}),
seo({ seo({
collections: ['pages'], collections: ['pages'],
fieldOverrides: { fieldOverrides: {

View File

@@ -5,11 +5,11 @@ import path from 'path'
import { getFileByPath } from 'payload/uploads' import { getFileByPath } from 'payload/uploads'
import { fileURLToPath } from 'url' import { fileURLToPath } from 'url'
import type { Page as PayloadPage } from './payload-types.js' import type { Config, Page as PayloadPage } from './payload-types.js'
import { ensureAutoLoginAndCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js' import { ensureAutoLoginAndCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js'
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
import { initPayloadE2E } from '../helpers/initPayloadE2E.js' import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
import { mediaSlug } from './shared.js' import { mediaSlug } from './shared.js'
const filename = fileURLToPath(import.meta.url) const filename = fileURLToPath(import.meta.url)
@@ -23,7 +23,7 @@ let id: string
describe('SEO Plugin', () => { describe('SEO Plugin', () => {
beforeAll(async ({ browser }) => { beforeAll(async ({ browser }) => {
const { serverURL, payload } = await initPayloadE2E({ dirname }) const { serverURL, payload } = await initPayloadE2ENoConfig<Config>({ dirname })
url = new AdminUrlUtil(serverURL, 'pages') url = new AdminUrlUtil(serverURL, 'pages')
const context = await browser.newContext() const context = await browser.newContext()

View File

@@ -6,7 +6,8 @@ import path from 'path'
import { wait } from 'payload/utilities' import { wait } from 'payload/utilities'
import { fileURLToPath } from 'url' import { fileURLToPath } from 'url'
import type { Media } from './payload-types.js' import type { PayloadTestSDK } from '../helpers/sdk/index.js'
import type { Config, Media } from './payload-types.js'
import { import {
ensureAutoLoginAndCompilationIsDone, ensureAutoLoginAndCompilationIsDone,
@@ -15,7 +16,7 @@ import {
saveDocAndAssert, saveDocAndAssert,
} from '../helpers.js' } from '../helpers.js'
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
import { initPayloadE2E } from '../helpers/initPayloadE2E.js' import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
import { RESTClient } from '../helpers/rest.js' import { RESTClient } from '../helpers/rest.js'
import { import {
adminThumbnailFunctionSlug, adminThumbnailFunctionSlug,
@@ -29,7 +30,7 @@ const dirname = path.dirname(filename)
const { beforeAll, describe } = test const { beforeAll, describe } = test
let payload: Payload let payload: PayloadTestSDK<Config>
let client: RESTClient let client: RESTClient
let serverURL: string let serverURL: string
let mediaURL: AdminUrlUtil let mediaURL: AdminUrlUtil
@@ -44,7 +45,7 @@ describe('uploads', () => {
let audioDoc: Media let audioDoc: Media
beforeAll(async ({ browser }) => { beforeAll(async ({ browser }) => {
;({ payload, serverURL } = await initPayloadE2E({ dirname })) ;({ payload, serverURL } = await initPayloadE2ENoConfig<Config>({ dirname }))
client = new RESTClient(null, { defaultSlug: 'users', serverURL }) client = new RESTClient(null, { defaultSlug: 'users', serverURL })
await client.login() await client.login()