Compare commits
702 Commits
db-postgre
...
db-mongodb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a523eff98 | ||
|
|
f320a87f92 | ||
|
|
d1a0822f80 | ||
|
|
da533d6b64 | ||
|
|
fb3b95e52d | ||
|
|
a9d96b1037 | ||
|
|
ea7ce6fd97 | ||
|
|
354b73c3aa | ||
|
|
96fc3df532 | ||
|
|
c7a315a7d1 | ||
|
|
b722f202af | ||
|
|
720760225f | ||
|
|
f7d4c04f65 | ||
|
|
6b1b4ffd27 | ||
|
|
6325b334ec | ||
|
|
79b1b88a2f | ||
|
|
b2beec302f | ||
|
|
fbc2064a10 | ||
|
|
900a9eafeb | ||
|
|
06cd52b622 | ||
|
|
c7ec557466 | ||
|
|
4c587acc10 | ||
|
|
6f39b809b3 | ||
|
|
796669279a | ||
|
|
886fca8e37 | ||
|
|
30db52ac45 | ||
|
|
f04a18a258 | ||
|
|
cdc10be1a2 | ||
|
|
a5b2333140 | ||
|
|
afe1834f9a | ||
|
|
3d7a2de00d | ||
|
|
5ea88bb47d | ||
|
|
386fe0741d | ||
|
|
b6d9a2021f | ||
|
|
1f8f173741 | ||
|
|
36576f152a | ||
|
|
4ea8ace4c8 | ||
|
|
3a83f08518 | ||
|
|
4607dbf976 | ||
|
|
94d8d2790b | ||
|
|
e6b9fb4fab | ||
|
|
6918be20ba | ||
|
|
e4881bb02f | ||
|
|
ed748102d6 | ||
|
|
88627f22e5 | ||
|
|
a2a44a81f2 | ||
|
|
b2b0f10935 | ||
|
|
2ebb9b8752 | ||
|
|
d383a00b65 | ||
|
|
d6ff8e3e69 | ||
|
|
20373903fd | ||
|
|
6d94e57225 | ||
|
|
a14b15200a | ||
|
|
0da3b59daf | ||
|
|
46fc41cbd9 | ||
|
|
237eebdf87 | ||
|
|
422c803da6 | ||
|
|
7e919aa87c | ||
|
|
d393225289 | ||
|
|
a4f36aa8a0 | ||
|
|
3404bab83f | ||
|
|
89f273bf89 | ||
|
|
4d8d4c214a | ||
|
|
dc13b101f7 | ||
|
|
42d8d11fd7 | ||
|
|
56e58e9ec7 | ||
|
|
c564a83ab6 | ||
|
|
a4fa0ef393 | ||
|
|
dac9514eb0 | ||
|
|
760565f1e9 | ||
|
|
436825cc0b | ||
|
|
7256a6b8b9 | ||
|
|
8066806d13 | ||
|
|
7a15545773 | ||
|
|
9d4969685f | ||
|
|
3ebcc5120c | ||
|
|
ed68583392 | ||
|
|
87c58bc0ba | ||
|
|
22bd80b8c2 | ||
|
|
09d303c8b3 | ||
|
|
aa22392c4f | ||
|
|
da3f99d57f | ||
|
|
24c89e2ad7 | ||
|
|
8e05d8f064 | ||
|
|
9ba7265529 | ||
|
|
4f2b080d1c | ||
|
|
115e592b54 | ||
|
|
c8fbfc43bd | ||
|
|
6cfa8a373e | ||
|
|
6c5d525d8e | ||
|
|
f53b713154 | ||
|
|
435eb6204e | ||
|
|
c4561a4390 | ||
|
|
8fe712cb66 | ||
|
|
459a55dfb6 | ||
|
|
8de0b89458 | ||
|
|
718ab6f93b | ||
|
|
5bf1cd6d93 | ||
|
|
556904e75c | ||
|
|
0851ef41d7 | ||
|
|
6616942b78 | ||
|
|
59fabc757d | ||
|
|
650f78a2b9 | ||
|
|
d6826f792c | ||
|
|
3032e0b5a2 | ||
|
|
c30b59c5fe | ||
|
|
3182d422c4 | ||
|
|
ce1e7a5d14 | ||
|
|
03101f0f54 | ||
|
|
80bf97ebb4 | ||
|
|
ed5da473b5 | ||
|
|
01feb6d92d | ||
|
|
daf1f5fa7d | ||
|
|
35f00fa83d | ||
|
|
5fb52f6d17 | ||
|
|
41925cef9c | ||
|
|
bff88b3956 | ||
|
|
11d237ece8 | ||
|
|
7f80aa95a4 | ||
|
|
fc0c612e47 | ||
|
|
24eab3af1d | ||
|
|
c8f57dd9b9 | ||
|
|
b901401ab3 | ||
|
|
00a1ce754a | ||
|
|
7eee0ec355 | ||
|
|
78312d9d8d | ||
|
|
fa8d591b4b | ||
|
|
a0019d0a78 | ||
|
|
5a0d0dbc02 | ||
|
|
fa550740eb | ||
|
|
e987e2b0ed | ||
|
|
69ca713e45 | ||
|
|
71a3e5ba10 | ||
|
|
9c250d57a4 | ||
|
|
06b5b3dc6f | ||
|
|
4f77073e2c | ||
|
|
41e3212949 | ||
|
|
e9eac9acce | ||
|
|
7e20298648 | ||
|
|
e8f237783b | ||
|
|
d4e6791494 | ||
|
|
fa4ceb5322 | ||
|
|
9149913319 | ||
|
|
284f66e6d8 | ||
|
|
a13ec2ebc4 | ||
|
|
eaef0e7395 | ||
|
|
4268b7833e | ||
|
|
c476d01f4e | ||
|
|
1a5db608c0 | ||
|
|
94de5c6c24 | ||
|
|
5d4ef620b1 | ||
|
|
cac33ac275 | ||
|
|
219aa3b2f3 | ||
|
|
dd0ff50621 | ||
|
|
591c0a0786 | ||
|
|
a197161390 | ||
|
|
ae5b397bc8 | ||
|
|
e6b2d3d1fc | ||
|
|
6b19525a65 | ||
|
|
c86ae0a9d2 | ||
|
|
9277b306de | ||
|
|
156eae2551 | ||
|
|
e197e0316f | ||
|
|
863b79348b | ||
|
|
30ff65d0b4 | ||
|
|
3185771551 | ||
|
|
ea83c3f3a2 | ||
|
|
072f7febd2 | ||
|
|
b5c7bbed93 | ||
|
|
931f6ff519 | ||
|
|
0af36af16c | ||
|
|
f6adbae0c7 | ||
|
|
67d61df563 | ||
|
|
01380bebe5 | ||
|
|
5719b1b39a | ||
|
|
f259645488 | ||
|
|
eec60d5883 | ||
|
|
d4548d73d5 | ||
|
|
ccc7c51c90 | ||
|
|
ec5e35ff71 | ||
|
|
55b9bf40df | ||
|
|
5282673746 | ||
|
|
298ca0b7ae | ||
|
|
71407e19e2 | ||
|
|
09078bdb40 | ||
|
|
e84f5ded28 | ||
|
|
a475b9b28b | ||
|
|
baad7d3360 | ||
|
|
7fcb972dfa | ||
|
|
01245b07f8 | ||
|
|
d2f45343da | ||
|
|
5ba95df674 | ||
|
|
40f98e4a0d | ||
|
|
584ead9fe2 | ||
|
|
b6bf354f6a | ||
|
|
9918c2499a | ||
|
|
8c48c8beb5 | ||
|
|
2697753715 | ||
|
|
4b13686f61 | ||
|
|
ab7999d3c1 | ||
|
|
a592188c1d | ||
|
|
5ff0846b6c | ||
|
|
13cabf129e | ||
|
|
c173e55b89 | ||
|
|
bcdd2d626f | ||
|
|
67682248c8 | ||
|
|
7c52d6ee28 | ||
|
|
bc65b53ce5 | ||
|
|
c8cc6ea1cc | ||
|
|
4e05e6fd85 | ||
|
|
6988a68eaf | ||
|
|
a272692726 | ||
|
|
229e4459cb | ||
|
|
056585ed31 | ||
|
|
b545433ee6 | ||
|
|
4c938b5f9e | ||
|
|
f1d8fa9999 | ||
|
|
1670a603f6 | ||
|
|
22f1fa8fc9 | ||
|
|
370e8d1938 | ||
|
|
3a3eab761e | ||
|
|
238f7e1b94 | ||
|
|
58e2083882 | ||
|
|
20cde242fb | ||
|
|
f50a392d59 | ||
|
|
fa1740d906 | ||
|
|
e847061c74 | ||
|
|
ebd5e6ae8f | ||
|
|
48de89794b | ||
|
|
ef4b5d8bfd | ||
|
|
5711d42eca | ||
|
|
a446a788a9 | ||
|
|
df57196d19 | ||
|
|
86c563e4e5 | ||
|
|
734b8c08ed | ||
|
|
68c5a57515 | ||
|
|
d9f0b7bd30 | ||
|
|
5ecfe3da28 | ||
|
|
3e3163e875 | ||
|
|
cfe1698dfd | ||
|
|
5722634660 | ||
|
|
cdbfc9132a | ||
|
|
dd0ac066ce | ||
|
|
8b8ceabbdd | ||
|
|
8da18d3496 | ||
|
|
6cd4df3dc4 | ||
|
|
e74dc8633b | ||
|
|
2f945919a3 | ||
|
|
52dc9177d7 | ||
|
|
cec757d098 | ||
|
|
80e57150a0 | ||
|
|
2969da7402 | ||
|
|
35da1db99f | ||
|
|
a578226d34 | ||
|
|
8c75f32620 | ||
|
|
c3ab8b9115 | ||
|
|
993568a195 | ||
|
|
c3cec64220 | ||
|
|
084e9f0ff8 | ||
|
|
9f0ef9b7da | ||
|
|
c384f490c8 | ||
|
|
45a62ba949 | ||
|
|
1eae5f9c99 | ||
|
|
dfa861557d | ||
|
|
228fd58020 | ||
|
|
150799e10e | ||
|
|
823436a883 | ||
|
|
cbb0ba1a2c | ||
|
|
cb39354a9d | ||
|
|
1625ff244e | ||
|
|
24918fe1d2 | ||
|
|
b8a58666e7 | ||
|
|
2e6a2c8355 | ||
|
|
1fdff92525 | ||
|
|
7da5f6e92a | ||
|
|
67c7572e5f | ||
|
|
e311e8fff9 | ||
|
|
086e50b9b3 | ||
|
|
66ab6c587d | ||
|
|
786fb926c2 | ||
|
|
7d954b11a3 | ||
|
|
3c5044368d | ||
|
|
f129d6c607 | ||
|
|
de2d985405 | ||
|
|
060f3c73fa | ||
|
|
62ae7be113 | ||
|
|
771df061b4 | ||
|
|
09e64c3be8 | ||
|
|
1a006fef19 | ||
|
|
c4cac99875 | ||
|
|
d616772740 | ||
|
|
c9844f2958 | ||
|
|
7bbd292efa | ||
|
|
3eefe8cb21 | ||
|
|
b0a62442e5 | ||
|
|
c6ce6024d2 | ||
|
|
927a1ab049 | ||
|
|
f23ae28d45 | ||
|
|
8938f2b7e9 | ||
|
|
ed8a9ffa09 | ||
|
|
2a549438e0 | ||
|
|
46121b5891 | ||
|
|
f3b6e49781 | ||
|
|
36740b70d4 | ||
|
|
5d1677a84e | ||
|
|
c73113565a | ||
|
|
ad924c8d7b | ||
|
|
bb6956cd32 | ||
|
|
4fab26db9d | ||
|
|
56cf767e18 | ||
|
|
5c97d05acf | ||
|
|
6bad383a95 | ||
|
|
4b726eb139 | ||
|
|
e13d8da7c2 | ||
|
|
0a45389a25 | ||
|
|
2abdce31f8 | ||
|
|
b5b487ab90 | ||
|
|
940bfe4f18 | ||
|
|
41dcdd4e01 | ||
|
|
ced5ad8b76 | ||
|
|
11429135ee | ||
|
|
3d5858ca6d | ||
|
|
5456695728 | ||
|
|
b79da5920a | ||
|
|
a0a92952eb | ||
|
|
a687dfdb16 | ||
|
|
b9d7e82052 | ||
|
|
fb10af8365 | ||
|
|
53427443a7 | ||
|
|
62fae5520d | ||
|
|
8b186dbf83 | ||
|
|
3dbb70a9e6 | ||
|
|
adef360275 | ||
|
|
abebd7f440 | ||
|
|
e9ed969ad9 | ||
|
|
4ede3384f0 | ||
|
|
008eb640f0 | ||
|
|
019ef358a5 | ||
|
|
72950b2b82 | ||
|
|
5b2ea583d2 | ||
|
|
6fb0289e71 | ||
|
|
f2bbe662f2 | ||
|
|
6b1a7f0843 | ||
|
|
7633922ec1 | ||
|
|
c4c7c20c8c | ||
|
|
ee403b79f4 | ||
|
|
0221394c06 | ||
|
|
741ab0487d | ||
|
|
8a513ba7af | ||
|
|
e76cd58425 | ||
|
|
888f937e3c | ||
|
|
3de43379e7 | ||
|
|
6c3a5d9c85 | ||
|
|
fcca4a46f9 | ||
|
|
32dc030e17 | ||
|
|
8769d042f9 | ||
|
|
76c9704850 | ||
|
|
f8da32a9bd | ||
|
|
a89df757bf | ||
|
|
a12240b71e | ||
|
|
dfb9a93547 | ||
|
|
a2e336470a | ||
|
|
f6994e57dd | ||
|
|
297e7f8c1d | ||
|
|
5c9a01aa1c | ||
|
|
df7499483a | ||
|
|
131333fc3a | ||
|
|
60cf803e8d | ||
|
|
7eb8d8bed1 | ||
|
|
2f799a9420 | ||
|
|
09584940d1 | ||
|
|
87063a03c4 | ||
|
|
b7e2f2a57b | ||
|
|
25c4d858e9 | ||
|
|
02c83b65ef | ||
|
|
bfe8de3fd6 | ||
|
|
bd16e9fb53 | ||
|
|
6cb8794c5a | ||
|
|
e56518e702 | ||
|
|
20cfd61dbf | ||
|
|
65899766d6 | ||
|
|
17dbc1e484 | ||
|
|
ee62c2a722 | ||
|
|
1f7f5e5cdb | ||
|
|
7ab9c386ca | ||
|
|
b4b66e2f16 | ||
|
|
bd64ec3c49 | ||
|
|
8ddbb67f07 | ||
|
|
d61ced9cbd | ||
|
|
ada165a21e | ||
|
|
715e154817 | ||
|
|
8d4fd14ff2 | ||
|
|
4c8f33e098 | ||
|
|
42f1a23b7f | ||
|
|
da4d9018c1 | ||
|
|
e8458f84bc | ||
|
|
5b6705b4f6 | ||
|
|
b4d1eaf1fb | ||
|
|
93b049288b | ||
|
|
35e14cf044 | ||
|
|
76e715aa6d | ||
|
|
2c8ea533af | ||
|
|
60c14557ff | ||
|
|
a38b43dc4f | ||
|
|
12e85f654e | ||
|
|
c02463be69 | ||
|
|
1b6d0cf4da | ||
|
|
e59e6ed65e | ||
|
|
d6a11921e0 | ||
|
|
a8b366992a | ||
|
|
4841dbf7ab | ||
|
|
9ee7041f9f | ||
|
|
856962c6c6 | ||
|
|
ba0651cecf | ||
|
|
573c8de380 | ||
|
|
a64297b376 | ||
|
|
9f5ec1784c | ||
|
|
caf9e5699e | ||
|
|
505d58f7b6 | ||
|
|
e11a0fb285 | ||
|
|
0363c85dbd | ||
|
|
9d43805242 | ||
|
|
0dd39bcad2 | ||
|
|
fa660cd4ef | ||
|
|
fd9cbd2cdb | ||
|
|
4f6eb1e307 | ||
|
|
e3278bf981 | ||
|
|
50860bc8c1 | ||
|
|
71057aa5ef | ||
|
|
52f7890989 | ||
|
|
6200a119f9 | ||
|
|
46eb61d18a | ||
|
|
246c78c6c7 | ||
|
|
37efc13c1e | ||
|
|
2766489476 | ||
|
|
0c1102a138 | ||
|
|
e765b96a4e | ||
|
|
01c42d9630 | ||
|
|
f421a2715d | ||
|
|
edd7a8086c | ||
|
|
010db46e08 | ||
|
|
fc8a6e107e | ||
|
|
2a85bb9fa9 | ||
|
|
c069f46f4c | ||
|
|
eb65340923 | ||
|
|
64bb16a6ff | ||
|
|
6f6e3cabe7 | ||
|
|
e9b5309a39 | ||
|
|
2cb79f1752 | ||
|
|
5f740a60cc | ||
|
|
175d44b0ae | ||
|
|
e7ac1819ce | ||
|
|
288ff2b094 | ||
|
|
aca534ec59 | ||
|
|
a8951cb741 | ||
|
|
7f9dd2b4e1 | ||
|
|
8a9f8408cf | ||
|
|
f333ff1c5b | ||
|
|
d9dd7ca2c9 | ||
|
|
2790bab479 | ||
|
|
29b4bcd1b0 | ||
|
|
d9dd60ff70 | ||
|
|
07b970027d | ||
|
|
e7f5c2e767 | ||
|
|
4889fe29f5 | ||
|
|
71f6542341 | ||
|
|
c90830f961 | ||
|
|
d46d2c0595 | ||
|
|
16d6c26387 | ||
|
|
32df3067e1 | ||
|
|
3a7440dcb9 | ||
|
|
417f4b7aa9 | ||
|
|
822aec0a5c | ||
|
|
455622fa57 | ||
|
|
f93316e588 | ||
|
|
b7e65d1024 | ||
|
|
b5728104dd | ||
|
|
604197bb98 | ||
|
|
6b30a9702b | ||
|
|
ab974ee587 | ||
|
|
3a9efb21e0 | ||
|
|
2dd395f718 | ||
|
|
2df28355cf | ||
|
|
7607c17041 | ||
|
|
64560dd36b | ||
|
|
e72fff6768 | ||
|
|
f81b4d3a1b | ||
|
|
8305b65b98 | ||
|
|
275d15cfdc | ||
|
|
c09667edfc | ||
|
|
2cbb14f8dd | ||
|
|
936c125a42 | ||
|
|
5a8cdef103 | ||
|
|
26bc1b46c1 | ||
|
|
639a832600 | ||
|
|
ba4d751831 | ||
|
|
c2c60851b0 | ||
|
|
84cd214a89 | ||
|
|
6023191201 | ||
|
|
a7ccfaeb6f | ||
|
|
32a0972855 | ||
|
|
d354610978 | ||
|
|
97bd414d3d | ||
|
|
9f396598a0 | ||
|
|
c2e20277ec | ||
|
|
7e6f35f380 | ||
|
|
750646b3b8 | ||
|
|
e93599234d | ||
|
|
c1cf66dc53 | ||
|
|
2cd83f2aa6 | ||
|
|
0685717794 | ||
|
|
d318e2276c | ||
|
|
8d3974776c | ||
|
|
8f8b824432 | ||
|
|
7d60a22ccf | ||
|
|
2075c0e817 | ||
|
|
ad68a58859 | ||
|
|
31622dd448 | ||
|
|
2b51699ec3 | ||
|
|
eef80a8239 | ||
|
|
339fb96b7d | ||
|
|
fe8254c73d | ||
|
|
aef868f471 | ||
|
|
8e02db10ae | ||
|
|
44dd66cb72 | ||
|
|
713c6738aa | ||
|
|
5d18d2793a | ||
|
|
fe002cf9b2 | ||
|
|
434bdb72ab | ||
|
|
5a802d0d94 | ||
|
|
f70a7b80fc | ||
|
|
32665d11c5 | ||
|
|
1ed4c096a3 | ||
|
|
c4a492a62a | ||
|
|
e01473ec0c | ||
|
|
97a3be87f3 | ||
|
|
aa2c48cb71 | ||
|
|
ef31984e24 | ||
|
|
de37218c6b | ||
|
|
9d875332b0 | ||
|
|
c8d8f1fd73 | ||
|
|
ba29a5dd7a | ||
|
|
0c3b69795b | ||
|
|
3465f7c60d | ||
|
|
339ab3a838 | ||
|
|
cc9f9dd704 | ||
|
|
c13acfe47a | ||
|
|
715e13b78e | ||
|
|
27313995cc | ||
|
|
93afe1d000 | ||
|
|
790e401837 | ||
|
|
d7b16dd88f | ||
|
|
6962fabb4e | ||
|
|
9705e351b3 | ||
|
|
45744b0eed | ||
|
|
7c8f2b1855 | ||
|
|
a7c5d6476c | ||
|
|
932fefcb7d | ||
|
|
ae8342c3ed | ||
|
|
ec24bb9e2a | ||
|
|
e1a903d03e | ||
|
|
2f822d517d | ||
|
|
02a5648ff9 | ||
|
|
2ba244cb01 | ||
|
|
fab1ea5338 | ||
|
|
ac9c6c5c6d | ||
|
|
0a4745b869 | ||
|
|
bc0bb6c1b4 | ||
|
|
3aa0d3f3ee | ||
|
|
1f570f97a4 | ||
|
|
76067b4e50 | ||
|
|
82293292a1 | ||
|
|
ad9ccfd338 | ||
|
|
2b7547fbae | ||
|
|
4e1da749c9 | ||
|
|
fa119550ae | ||
|
|
e7ffa2638a | ||
|
|
666765f3fb | ||
|
|
fc14622555 | ||
|
|
0d83d83d3c | ||
|
|
aab2f5f7d2 | ||
|
|
80b0d79342 | ||
|
|
3fc4bc43ac | ||
|
|
fbdc74ea71 | ||
|
|
a0116685bd | ||
|
|
141e40ffb9 | ||
|
|
bd2c1c6bf2 | ||
|
|
ba90fdbdfd | ||
|
|
b7c3899e38 | ||
|
|
af4a41e219 | ||
|
|
5e59b5666c | ||
|
|
7a32f39c2c | ||
|
|
c4a09967f3 | ||
|
|
dd8c7906da | ||
|
|
c7bdf5eb43 | ||
|
|
3e0ba91c5b | ||
|
|
6940f2c0b7 | ||
|
|
474436e9ab | ||
|
|
9991fdb8c8 | ||
|
|
15c9ce56c2 | ||
|
|
3816431893 | ||
|
|
b8f62f6d52 | ||
|
|
3ca632bcbd | ||
|
|
a4032c49e9 | ||
|
|
7f89d404f8 | ||
|
|
c880a61f13 | ||
|
|
c3401be7c4 | ||
|
|
af8e283203 | ||
|
|
65d72b01f0 | ||
|
|
2bbe4286f6 | ||
|
|
b8eeea9ea1 | ||
|
|
eecdd0e118 | ||
|
|
f749732a0a | ||
|
|
78e2b518cf | ||
|
|
66fa70e275 | ||
|
|
6b31173ed0 | ||
|
|
91362587f0 | ||
|
|
9119087f71 | ||
|
|
321c666dba | ||
|
|
1ce678505b | ||
|
|
4938602ee0 | ||
|
|
4dd3f131b0 | ||
|
|
a4c4fc7060 | ||
|
|
db09f4839f | ||
|
|
e2b9e227a0 | ||
|
|
4f0bc2306f | ||
|
|
7ad4c26829 | ||
|
|
c71e079fae | ||
|
|
b90785fa8c | ||
|
|
472bf4401e | ||
|
|
77f7054832 | ||
|
|
6e340f008f | ||
|
|
1d3a9aee28 | ||
|
|
875d8dc27b | ||
|
|
01d092b219 | ||
|
|
a8d432f7b3 | ||
|
|
36a8dc49b3 | ||
|
|
e08e681eda | ||
|
|
1a2a576aa8 | ||
|
|
274f19c269 | ||
|
|
41d80a959c | ||
|
|
80da94c3e0 | ||
|
|
27a3b8ca6d | ||
|
|
7e44fa1010 | ||
|
|
1b10111ba9 | ||
|
|
2b01b9b41f | ||
|
|
422b63a9f6 | ||
|
|
fbc216e667 | ||
|
|
f0cc05ab91 | ||
|
|
65a53c7d76 | ||
|
|
12c85d7707 | ||
|
|
4a31090388 | ||
|
|
3d8d043ab1 | ||
|
|
a7780b10d9 | ||
|
|
b931072eed | ||
|
|
dfabfc5227 | ||
|
|
8b69625b57 | ||
|
|
d4d05ae3f3 | ||
|
|
e15e00b5f1 | ||
|
|
31efa57975 | ||
|
|
f05462efd3 | ||
|
|
92fa206fa4 | ||
|
|
b749f89c30 | ||
|
|
3b1b8ddc30 | ||
|
|
ec60147aff | ||
|
|
2f00aef66c | ||
|
|
238db1750c | ||
|
|
b4610a3fae | ||
|
|
ea22da4fc7 | ||
|
|
67df834f31 | ||
|
|
0962cd6fcb | ||
|
|
f478fee9ea | ||
|
|
2ccaa823e4 | ||
|
|
c2c2bb7f2d | ||
|
|
8f0d85fe13 | ||
|
|
db29b07b82 | ||
|
|
3207202808 | ||
|
|
24a4bc6f19 | ||
|
|
6b436d38e1 | ||
|
|
ae93006446 | ||
|
|
fc722573bf | ||
|
|
3fdf23a1a0 | ||
|
|
b72ba7fe86 | ||
|
|
3dd777343b | ||
|
|
f1f7592eb2 | ||
|
|
3816589e8b | ||
|
|
ba70b8065e | ||
|
|
9b88a47a47 | ||
|
|
9a747bc1eb | ||
|
|
f82723ef33 | ||
|
|
897f7be0f7 | ||
|
|
80f6c7ebe1 | ||
|
|
9da4151642 | ||
|
|
b89cbe5715 | ||
|
|
32a69f8f36 | ||
|
|
b398a92db4 | ||
|
|
3c58e51d17 | ||
|
|
6e2f43394d | ||
|
|
725a1d35ef | ||
|
|
2a2a2e3a2f | ||
|
|
2fbfb5d305 | ||
|
|
eeecbbedb6 |
@@ -23,3 +23,7 @@ indent_size = 2
|
|||||||
[*.json]
|
[*.json]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
12
.github/ISSUE_TEMPLATE/1.bug_report.yml
vendored
12
.github/ISSUE_TEMPLATE/1.bug_report.yml
vendored
@@ -10,7 +10,12 @@ body:
|
|||||||
id: reproduction-link
|
id: reproduction-link
|
||||||
attributes:
|
attributes:
|
||||||
label: Link to reproduction
|
label: Link to reproduction
|
||||||
description: Please add a link to a reproduction. See the fork [reproduction-guide](https://github.com/payloadcms/payload/blob/main/.github/reproduction-guide.md) for more information.
|
description: Want us to look into your issue faster? Follow the [reproduction-guide](https://github.com/payloadcms/payload/blob/main/.github/reproduction-guide.md) for more information.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Describe the Bug
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
@@ -19,11 +24,6 @@ body:
|
|||||||
description: Steps to reproduce the behavior, please provide a clear description of how to reproduce the issue, based on the linked minimal reproduction. Screenshots can be provided in the issue body below. If using code blocks, make sure that [syntax highlighting is correct](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) and double check that the rendered preview is not broken.
|
description: Steps to reproduce the behavior, please provide a clear description of how to reproduce the issue, based on the linked minimal reproduction. Screenshots can be provided in the issue body below. If using code blocks, make sure that [syntax highlighting is correct](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) and double check that the rendered preview is not broken.
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Describe the Bug
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
- type: input
|
||||||
id: version
|
id: version
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
15
.github/reproduction-guide.md
vendored
15
.github/reproduction-guide.md
vendored
@@ -1,10 +1,11 @@
|
|||||||
# Reproduction Guide
|
# Reproduction Guide
|
||||||
|
|
||||||
1. [fork](https://github.com/payloadcms/payload/fork) this repo
|
1. [Fork](https://github.com/payloadcms/payload/fork) this repo
|
||||||
2. run `yarn` to install dependencies
|
2. Optionally, create a new branch for your reproduction
|
||||||
3. open up the `test/_community` directory
|
3. Run `pnpm install` to install dependencies
|
||||||
4. add any necessary `collections/globals/fields` in this directory to recreate the issue you are experiencing
|
4. Open up the `test/_community` directory
|
||||||
5. run `yarn dev _community` to start the admin panel
|
5. Add any necessary `collections/globals/fields` in this directory to recreate the issue you are experiencing
|
||||||
|
6. Run `pnpm dev _community` to start the admin panel
|
||||||
|
|
||||||
**NOTE:** The goal is to isolate the problem by reducing the number of `collections/globals/fields` you add to the `test/_community` folder. This folder is _not_ meant for you to copy your project into, but rather recreate the issue you are experiencing with minimal config.
|
**NOTE:** The goal is to isolate the problem by reducing the number of `collections/globals/fields` you add to the `test/_community` folder. This folder is _not_ meant for you to copy your project into, but rather recreate the issue you are experiencing with minimal config.
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@
|
|||||||
- `config.ts` - This is the _granular_ Payload config for testing. It should be as lightweight as possible. Reference existing configs for an example
|
- `config.ts` - This is the _granular_ Payload config for testing. It should be as lightweight as possible. Reference existing configs for an example
|
||||||
- `int.spec.ts` [Optional] - This is the test file run by jest. Any test file must have a `*int.spec.ts` suffix.
|
- `int.spec.ts` [Optional] - This is the test file run by jest. Any test file must have a `*int.spec.ts` suffix.
|
||||||
- `e2e.spec.ts` [Optional] - This is the end-to-end test file that will load up the admin UI using the above config and run Playwright tests.
|
- `e2e.spec.ts` [Optional] - This is the end-to-end test file that will load up the admin UI using the above config and run Playwright tests.
|
||||||
- `payload-types.ts` - Generated types from `config.ts`. Generate this file by running `yarn dev:generate-types _community`.
|
- `payload-types.ts` - Generated types from `config.ts`. Generate this file by running `pnpm dev:generate-types _community`.
|
||||||
|
|
||||||
The directory split up in this way specifically to reduce friction when creating tests and to add the ability to boot up Payload with that specific config. You should modify the files in `test/_community` to get started.
|
The directory split up in this way specifically to reduce friction when creating tests and to add the ability to boot up Payload with that specific config. You should modify the files in `test/_community` to get started.
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ There are a couple ways run integration tests:
|
|||||||
- **Manually** - you can run all int tests in the `/test/_community/int.spec.ts` file by running the following command:
|
- **Manually** - you can run all int tests in the `/test/_community/int.spec.ts` file by running the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn test:int _community
|
pnpm test:int _community
|
||||||
```
|
```
|
||||||
|
|
||||||
### Running E2E tests (Admin Panel UI tests)
|
### Running E2E tests (Admin Panel UI tests)
|
||||||
|
|||||||
73
.github/workflows/main.yml
vendored
73
.github/workflows/main.yml
vendored
@@ -7,7 +7,36 @@ on:
|
|||||||
branches: ['main']
|
branches: ['main']
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
changes:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
outputs:
|
||||||
|
needs_build: ${{ steps.filter.outputs.needs_build }}
|
||||||
|
templates: ${{ steps.filter.outputs.templates }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 25
|
||||||
|
- uses: dorny/paths-filter@v2
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
needs_build:
|
||||||
|
- 'packages/**'
|
||||||
|
- 'test/**'
|
||||||
|
- 'pnpm-lock.yaml'
|
||||||
|
- 'package.json'
|
||||||
|
templates:
|
||||||
|
- 'templates/**'
|
||||||
|
- name: Log all filter results
|
||||||
|
run: |
|
||||||
|
echo "needs_build: ${{ steps.filter.outputs.needs_build }}"
|
||||||
|
echo "templates: ${{ steps.filter.outputs.templates }}"
|
||||||
|
|
||||||
core-build:
|
core-build:
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.needs_build == 'true' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -132,7 +161,12 @@ jobs:
|
|||||||
key: ${{ github.sha }}-${{ github.run_number }}
|
key: ${{ github.sha }}-${{ github.run_number }}
|
||||||
|
|
||||||
- name: E2E Tests
|
- name: E2E Tests
|
||||||
run: pnpm test:e2e --part ${{ matrix.part }} --bail
|
uses: nick-fields/retry@v2
|
||||||
|
with:
|
||||||
|
retry_on: error
|
||||||
|
max_attempts: 2
|
||||||
|
timeout_minutes: 15
|
||||||
|
command: pnpm test:e2e --part ${{ matrix.part }} --bail
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
if: always()
|
if: always()
|
||||||
@@ -213,8 +247,12 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
pkg:
|
pkg:
|
||||||
- plugin-cloud
|
|
||||||
- create-payload-app
|
- create-payload-app
|
||||||
|
- plugin-cloud
|
||||||
|
- plugin-cloud-storage
|
||||||
|
- plugin-form-builder
|
||||||
|
- plugin-nested-docs
|
||||||
|
- plugin-search
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Use Node.js 18
|
- name: Use Node.js 18
|
||||||
@@ -240,3 +278,34 @@ jobs:
|
|||||||
- name: Test ${{ matrix.pkg }}
|
- name: Test ${{ matrix.pkg }}
|
||||||
run: pnpm --filter ${{ matrix.pkg }} run test
|
run: pnpm --filter ${{ matrix.pkg }} run test
|
||||||
if: matrix.pkg != 'create-payload-app' # degit doesn't work within GitHub Actions
|
if: matrix.pkg != 'create-payload-app' # degit doesn't work within GitHub Actions
|
||||||
|
|
||||||
|
templates:
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.templates == 'true' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
template: [blank, website, ecommerce]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 25
|
||||||
|
|
||||||
|
- name: Use Node.js 18
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
|
||||||
|
- name: Start MongoDB
|
||||||
|
uses: supercharge/mongodb-github-action@1.10.0
|
||||||
|
with:
|
||||||
|
mongodb-version: 6.0
|
||||||
|
|
||||||
|
- name: Build Website
|
||||||
|
run: |
|
||||||
|
cd templates/${{ matrix.template }}
|
||||||
|
cp .env.example .env
|
||||||
|
yarn install
|
||||||
|
yarn build
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"verbose": true,
|
|
||||||
"git": {
|
|
||||||
"commitMessage": "chore(release): v${version}",
|
|
||||||
"requireCleanWorkingDir": true
|
|
||||||
},
|
|
||||||
"github": {
|
|
||||||
"release": true
|
|
||||||
},
|
|
||||||
"npm": {
|
|
||||||
"skipChecks": true
|
|
||||||
},
|
|
||||||
"hooks": {
|
|
||||||
"before:init": ["pnpm i", "pnpm clean", "pnpm test"]
|
|
||||||
},
|
|
||||||
"plugins": {
|
|
||||||
"@release-it/conventional-changelog": {
|
|
||||||
"preset": "angular",
|
|
||||||
"infile": "CHANGELOG.md"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
16
.release-it.pre.js
Normal file
16
.release-it.pre.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
module.exports = {
|
||||||
|
verbose: true,
|
||||||
|
git: {
|
||||||
|
requireCleanWorkingDir: false,
|
||||||
|
commit: false,
|
||||||
|
push: false,
|
||||||
|
tag: false,
|
||||||
|
},
|
||||||
|
npm: {
|
||||||
|
skipChecks: true,
|
||||||
|
tag: 'beta',
|
||||||
|
},
|
||||||
|
hooks: {
|
||||||
|
'before:init': ['pnpm install', 'pnpm clean', 'pnpm build'],
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
"verbose": true,
|
|
||||||
"git": {
|
|
||||||
"requireCleanWorkingDir": false,
|
|
||||||
"commit": false,
|
|
||||||
"push": false,
|
|
||||||
"tag": false
|
|
||||||
},
|
|
||||||
"github": {
|
|
||||||
"release": true
|
|
||||||
},
|
|
||||||
"npm": {
|
|
||||||
"skipChecks": true,
|
|
||||||
"tag": "canary"
|
|
||||||
},
|
|
||||||
"hooks": {
|
|
||||||
"before:init": ["pnpm i", "pnpm clean", "pnpm test"]
|
|
||||||
},
|
|
||||||
"plugins": {
|
|
||||||
"@release-it/conventional-changelog": {
|
|
||||||
"preset": "angular",
|
|
||||||
"infile": "CHANGELOG.md"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
17
.vscode/launch.json
vendored
17
.vscode/launch.json
vendored
@@ -9,6 +9,16 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"type": "node-terminal"
|
"type": "node-terminal"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "pnpm run dev plugin-cloud-storage",
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"name": "Run Dev - plugin-cloud-storage",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "node-terminal",
|
||||||
|
"env": {
|
||||||
|
"PAYLOAD_PUBLIC_CLOUD_STORAGE_ADAPTER": "s3"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "pnpm run dev fields",
|
"command": "pnpm run dev fields",
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
@@ -30,6 +40,13 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"type": "node-terminal"
|
"type": "node-terminal"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "pnpm run dev localization",
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"name": "Run Dev Localization",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "node-terminal"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "PAYLOAD_BUNDLER=vite pnpm run dev fields",
|
"command": "PAYLOAD_BUNDLER=vite pnpm run dev fields",
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
|
|||||||
220
CHANGELOG.md
220
CHANGELOG.md
@@ -1,3 +1,223 @@
|
|||||||
|
## [2.0.15](https://github.com/payloadcms/payload/compare/v2.0.14...v2.0.15) (2023-11-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* autosave updating data in unrelated docs ([b722f20](https://github.com/payloadcms/payload/commit/b722f202af39a1429298b700cac686ecbbd4b46b))
|
||||||
|
* better error handling within parseCookies ([#3720](https://github.com/payloadcms/payload/issues/3720)) ([6b1b4ff](https://github.com/payloadcms/payload/commit/6b1b4ffd27cc9a84e22ef2f3a8e389e5b72d41bc))
|
||||||
|
* block row removal w/ db-postgres adapter ([#3951](https://github.com/payloadcms/payload/issues/3951)) ([5ea88bb](https://github.com/payloadcms/payload/commit/5ea88bb47d9ed6457331ceab7d7c82b0face8311))
|
||||||
|
* deeply merges view configs ([#3954](https://github.com/payloadcms/payload/issues/3954)) ([a5b2333](https://github.com/payloadcms/payload/commit/a5b2333140447b12dbafd68592108ac342af4ea7))
|
||||||
|
* do not display field if read permission is false - admin panel ui ([#3949](https://github.com/payloadcms/payload/issues/3949)) ([cdc10be](https://github.com/payloadcms/payload/commit/cdc10be1a241c6a9ac09feab77bcd58d23ff3dd9))
|
||||||
|
* ensures dataloader does not run requests in parallel ([4607dbf](https://github.com/payloadcms/payload/commit/4607dbf97694bc899e597e9c7df50b6c878874f5))
|
||||||
|
* exclude files from dev bundle if aliased ([#3957](https://github.com/payloadcms/payload/issues/3957)) ([7966692](https://github.com/payloadcms/payload/commit/796669279afb8fe23723ce36e6e47a44b7088b09))
|
||||||
|
* field paths being mutated if they ended with the req.locale ([#3936](https://github.com/payloadcms/payload/issues/3936)) ([36576f1](https://github.com/payloadcms/payload/commit/36576f152ace41edd8b353703db2598d04deae44))
|
||||||
|
* findVersions pagination ([#3906](https://github.com/payloadcms/payload/issues/3906)) ([1f8f173](https://github.com/payloadcms/payload/commit/1f8f173741fd524c7c2f11cc104672854f625da9))
|
||||||
|
* global autosave and relevant e2e test ([a9d96b1](https://github.com/payloadcms/payload/commit/a9d96b10376fe1a4731b2ddb4d26ce38e333d5cb))
|
||||||
|
* **i18n:** polish translations ([#3934](https://github.com/payloadcms/payload/issues/3934)) ([e4881bb](https://github.com/payloadcms/payload/commit/e4881bb02f7c1e8f96d5b405c57e0fdc01a2e7fe))
|
||||||
|
* passes correct data to buildStateFromSchema on account page ([#3984](https://github.com/payloadcms/payload/issues/3984)) ([c7a315a](https://github.com/payloadcms/payload/commit/c7a315a7d1075361a7ee432a449769397c12185e))
|
||||||
|
* prevent sort from saving a new version in version list view ([#3944](https://github.com/payloadcms/payload/issues/3944)) ([900a9ea](https://github.com/payloadcms/payload/commit/900a9eafeb51b1e5130518d4f71034a2bf9e4c5b))
|
||||||
|
* properly load temp files into buffer ([#3996](https://github.com/payloadcms/payload/issues/3996)) ([d1a0822](https://github.com/payloadcms/payload/commit/d1a0822f8044a3f65416f4fe608e91a4ceea6b56))
|
||||||
|
* sort document tabs by order ([#3968](https://github.com/payloadcms/payload/issues/3968)) ([06cd52b](https://github.com/payloadcms/payload/commit/06cd52b622723503896af6262907d31b258d0a5e))
|
||||||
|
* vertical alignment in step nav when using larger logos ([#3955](https://github.com/payloadcms/payload/issues/3955)) ([b6d9a20](https://github.com/payloadcms/payload/commit/b6d9a2021fafea594353329fd304553bf7f2d091))
|
||||||
|
|
||||||
|
## [2.0.14](https://github.com/payloadcms/payload/compare/v2.0.13...v2.0.14) (2023-10-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* adds null to non-required field unions ([#3870](https://github.com/payloadcms/payload/issues/3870)) ([7e919aa](https://github.com/payloadcms/payload/commit/7e919aa87c0116c41bf41d75dcd91ff96576a46f))
|
||||||
|
* checks for user before accessing properties in preferences update operation([#3844](https://github.com/payloadcms/payload/issues/3844)) ([24eab3a](https://github.com/payloadcms/payload/commit/24eab3af1da3b08debe0580cce8ece08a86039a4))
|
||||||
|
* **db-mongodb:** improve find query performance ([#3836](https://github.com/payloadcms/payload/issues/3836)) ([56e58e9](https://github.com/payloadcms/payload/commit/56e58e9ec732f8365f53f214a9e950fbc2a7d8b9)), closes [#3904](https://github.com/payloadcms/payload/issues/3904)
|
||||||
|
* **db-mongodb:** versions pagination ([#3875](https://github.com/payloadcms/payload/issues/3875)) ([4f2b080](https://github.com/payloadcms/payload/commit/4f2b080d1cb5f9d4ab80aa106650307c11e8811b))
|
||||||
|
* disable webpack hot reload on production ([#3891](https://github.com/payloadcms/payload/issues/3891)) ([422c803](https://github.com/payloadcms/payload/commit/422c803da67982a063a028508c44009b9577646e))
|
||||||
|
* duplicate document copying to incorrect locale ([#3874](https://github.com/payloadcms/payload/issues/3874)) ([89f273b](https://github.com/payloadcms/payload/commit/89f273bf894512b69e8647be4cf4496bff37c99b))
|
||||||
|
* enables nested AND/OR queries ([#3834](https://github.com/payloadcms/payload/issues/3834)) ([237eebd](https://github.com/payloadcms/payload/commit/237eebdf87b7d33baa9baaa54946f4ebb4276bfb))
|
||||||
|
* ensure serverURL has string value for getBaseUploadFields function ([#3900](https://github.com/payloadcms/payload/issues/3900)) ([c564a83](https://github.com/payloadcms/payload/commit/c564a83ab61b672d9a2bcc875ab890b0fede5462))
|
||||||
|
* ensures compare-version select field cannot be cleared ([#3901](https://github.com/payloadcms/payload/issues/3901)) ([42d8d11](https://github.com/payloadcms/payload/commit/42d8d11fd7e5792b119f69f17dc1100c85cfa491))
|
||||||
|
* error handling when duplicating documents fails ([#3873](https://github.com/payloadcms/payload/issues/3873)) ([435eb62](https://github.com/payloadcms/payload/commit/435eb6204e550e898a81033f794fcf568e3b017c))
|
||||||
|
* generate new block ids on create ([#3871](https://github.com/payloadcms/payload/issues/3871)) ([3404bab](https://github.com/payloadcms/payload/commit/3404bab83f1112713675eb504870a4a1786c3822))
|
||||||
|
* global permissions for live preview ([#3854](https://github.com/payloadcms/payload/issues/3854)) ([3032e0b](https://github.com/payloadcms/payload/commit/3032e0b5a239db0762abd120b2db95f30ed5ca65))
|
||||||
|
* handles null & undefined relationship field values in versions view ([#3609](https://github.com/payloadcms/payload/issues/3609)) ([115e592](https://github.com/payloadcms/payload/commit/115e592b54d9174f316daa3cff31bcc801eaf92f))
|
||||||
|
* incorrect duplication of data in admin ui ([#3907](https://github.com/payloadcms/payload/issues/3907)) ([46fc41c](https://github.com/payloadcms/payload/commit/46fc41cbd9615c58248b4d2c44d24905dd676171))
|
||||||
|
* only apply focal manipulation when necessary ([#3902](https://github.com/payloadcms/payload/issues/3902)) ([a4f36aa](https://github.com/payloadcms/payload/commit/a4f36aa8a009e9c0156924320bbcf1d04b697223))
|
||||||
|
* graphql query errors transaction race condition ([#3795](https://github.com/payloadcms/payload/issues/3795)) ([dc13b10](https://github.com/payloadcms/payload/commit/dc13b101f7351f7bae60a4a4bbc25907ed82210f))
|
||||||
|
* removes conditional return of formattedEmails in sendEmail hook [#26](https://github.com/payloadcms/payload/issues/26) ([#28](https://github.com/payloadcms/payload/issues/28)) ([e8458f8](https://github.com/payloadcms/payload/commit/e8458f84bcd5bad74b189479931fbb7faea74900))
|
||||||
|
* resize image if no aspect ratio change ([#3859](https://github.com/payloadcms/payload/issues/3859)) ([f53b713](https://github.com/payloadcms/payload/commit/f53b7131548dbe9071c65ba110f7f0d206bb33b5))
|
||||||
|
* **richtext-*:** type issues with typescript strict mode enabled ([dac9514](https://github.com/payloadcms/payload/commit/dac9514eb00b99a3caeb9f217695b2b89368f7c9))
|
||||||
|
* **richtext-lexical:** Blocks node incorrectly marked as client module ([35f00fa](https://github.com/payloadcms/payload/commit/35f00fa83d2a90967e0707ca0fd960c5608a3bf3))
|
||||||
|
* **richtext-lexical:** remove unnecessary dependencies (fixes [#3889](https://github.com/payloadcms/payload/issues/3889)) ([760565f](https://github.com/payloadcms/payload/commit/760565f1e96e4cb1f6bce8663ad3fa8a16a2601c))
|
||||||
|
* set date to 12UTC for default, dayOnly and monthOnly fields ([#3887](https://github.com/payloadcms/payload/issues/3887)) ([d393225](https://github.com/payloadcms/payload/commit/d3932252891bb8721a5abc97e204dbb6a7f3fda2))
|
||||||
|
* store resized image on req or tempFilePath ([#3883](https://github.com/payloadcms/payload/issues/3883)) ([6c5d525](https://github.com/payloadcms/payload/commit/6c5d525d8e1267eebdffeb9f31b2ef3a4df1132d))
|
||||||
|
* unique field error handling ([#3888](https://github.com/payloadcms/payload/issues/3888)) ([4d8d4c2](https://github.com/payloadcms/payload/commit/4d8d4c214ab12571e9dc71e406117c4b19f63c6b))
|
||||||
|
|
||||||
|
## [2.0.13](https://github.com/payloadcms/payload/compare/v2.0.12...v2.0.13) (2023-10-24)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* adjusts props to accept components for before and after fields instead of functions ([#3820](https://github.com/payloadcms/payload/issues/3820)) ([c476d01](https://github.com/payloadcms/payload/commit/c476d01f4e5016f9c2bc338103ef2c778139a536))
|
||||||
|
* alignment of collapsible within row ([#3822](https://github.com/payloadcms/payload/issues/3822)) ([eaef0e7](https://github.com/payloadcms/payload/commit/eaef0e739546b4411d971da21170977ba73695f8))
|
||||||
|
* named tabs not appearing in the gql mutation input type ([#3835](https://github.com/payloadcms/payload/issues/3835)) ([a0019d0](https://github.com/payloadcms/payload/commit/a0019d0a78504b5c4d6aeec4823d7a0e224f1d6b))
|
||||||
|
* only parses live preview ready message when same origin ([#3791](https://github.com/payloadcms/payload/issues/3791)) ([e8f2377](https://github.com/payloadcms/payload/commit/e8f237783b9f48edf80b1d8c61142aeb2edb1c0b))
|
||||||
|
* prevent storing duplicate user preferences ([#3833](https://github.com/payloadcms/payload/issues/3833)) ([7eee0ec](https://github.com/payloadcms/payload/commit/7eee0ec3558c8b65afc38df7377073f042402ee3))
|
||||||
|
* prevents document sidebar from collapsing ([71a3e5b](https://github.com/payloadcms/payload/commit/71a3e5ba1037fe447dccad4a490fdfb1623ba0b0))
|
||||||
|
* renders live preview for globals ([#3801](https://github.com/payloadcms/payload/issues/3801)) ([a13ec2e](https://github.com/payloadcms/payload/commit/a13ec2ebc4858029c643f4530daa4ed49a7b024e))
|
||||||
|
* reverting localized versions ([#3831](https://github.com/payloadcms/payload/issues/3831)) ([5a0d0db](https://github.com/payloadcms/payload/commit/5a0d0dbc02850c0cd2035487361ba6e7a317bce7))
|
||||||
|
|
||||||
|
|
||||||
|
## [2.0.12](https://github.com/payloadcms/payload/compare/v2.0.11...v2.0.12) (2023-10-23)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* collection, global and field props for hooks, fix request context initialization, add context to global hooks ([#3780](https://github.com/payloadcms/payload/pull/3780))
|
||||||
|
* **richtext-lexical:** HTML Serializer ([#3685](https://github.com/payloadcms/payload/pull/3685))
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* remove duplicate removal of temp upload file ([#3818](https://github.com/payloadcms/payload/pull/3818))
|
||||||
|
* simplify how the search input and query params are connected ([#3797](https://github.com/payloadcms/payload/pull/3797))
|
||||||
|
* standardizes layout of document fields ([#3798](https://github.com/payloadcms/payload/pull/3798))
|
||||||
|
* issue where dragging unsortable item would crash the page ([#3789](https://github.com/payloadcms/payload/pull/3789))
|
||||||
|
* **richtext-lexical:** defaultValue property didn't fit into field schema ([b5c7bbed9](https://github.com/payloadcms/payload/commit/b5c7bbed93b532ec54a9c73537f4cb1290122a66))
|
||||||
|
* **richtext-*:** hasMany relationships not populated correctly ([e197e0316](https://github.com/payloadcms/payload/commit/e197e0316f9c01f945dc7f6d21ac28f9f0420f1d))
|
||||||
|
|
||||||
|
## [2.0.11](https://github.com/payloadcms/payload/compare/v2.0.10...v2.0.11) (2023-10-19)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add ability to opt out of type gen declare statement ([#3765](https://github.com/payloadcms/payload/pull/3765))
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* corrects versions collection casing ([#3739](https://github.com/payloadcms/payload/pull/3739))
|
||||||
|
* updates req after file resize ([#3754](https://github.com/payloadcms/payload/pull/3754))
|
||||||
|
* correctly renders focal point when crop is set to false ([#3759](https://github.com/payloadcms/payload/pull/3759))
|
||||||
|
* account for many slug types in generate types ([#3698](https://github.com/payloadcms/payload/pull/3698))
|
||||||
|
* handle graphQL: false on globals when building policy type ([#3729](https://github.com/payloadcms/payload/pull/3729))
|
||||||
|
* renders id as fallback title in DeleteDocument ([#3745](https://github.com/payloadcms/payload/pull/3745))
|
||||||
|
* properly handles hideAPIURL ([#3721](https://github.com/payloadcms/payload/pull/3721))
|
||||||
|
* filesRequiredOnCreate typing, tests, linting ([#3737](https://github.com/payloadcms/payload/pull/3737))
|
||||||
|
|
||||||
|
* **webpack-bundler:** corrects payload alias ([#3769](https://github.com/payloadcms/payload/pull/3769))
|
||||||
|
* **bundler-webpack:** better node_modules resolution ([#3744](https://github.com/payloadcms/payload/pull/3744))
|
||||||
|
* **db-postgres:** block and array inserts error ([#3714](https://github.com/payloadcms/payload/pull/3714))
|
||||||
|
* **live-preview:** properly handles uploads and hasOne monomorphic relationships ([#3719](https://github.com/payloadcms/payload/pull/3719))
|
||||||
|
|
||||||
|
## [2.0.10](https://github.com/payloadcms/payload/compare/v2.0.9...v2.0.10) (2023-10-17)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* filesRequired is optional for uploads ([#3668](https://github.com/payloadcms/payload/pull/3668)) ([48de897](https://github.com/payloadcms/payload/commit/48de89794b2c5d94183090b0830fd355d8d6c6f3))
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Register first user verify update missing transaction id / req ([#3665](https://github.com/payloadcms/payload/pull/3665)) ([68c5a5751](https://github.com/payloadcms/payload/commit/68c5a57515ffbba37c9194a75d0f672bdb10d96b))
|
||||||
|
|
||||||
|
## [2.0.8](https://github.com/payloadcms/payload/compare/v2.0.7...v2.0.8) (2023-10-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* allows filterOptions to return null ([c4cac99](https://github.com/payloadcms/payload/commit/c4cac998752730e7084598c92c77789da8c82e0d))
|
||||||
|
* **live-preview:** caches field schema ([#3711](https://github.com/payloadcms/payload/issues/3711)) ([dd0ac06](https://github.com/payloadcms/payload/commit/dd0ac066ce2ed88b85025309303610a95b6089e1))
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* autosave time shown minutes only ([#3492](https://github.com/payloadcms/payload/issues/3492)) ([e311e8f](https://github.com/payloadcms/payload/commit/e311e8fff9cd4264d7a71903f63c4fa825a3564d))
|
||||||
|
* blocks within groups in postgres ([45a62ba](https://github.com/payloadcms/payload/commit/45a62ba949aca33b25e0808773a5c2f1cf4adf82))
|
||||||
|
* bug with seeding ecommerce ([993568a](https://github.com/payloadcms/payload/commit/993568a1959ea10f960e35e4ed7a8e06af672a72))
|
||||||
|
* corrects add block index ([#3681](https://github.com/payloadcms/payload/issues/3681)) ([3c50443](https://github.com/payloadcms/payload/commit/3c5044368d5b30c76a2ff20c25b9234ef89dc205))
|
||||||
|
* misc upload crop/focal point updates ([#3580](https://github.com/payloadcms/payload/issues/3580)) ([d616772](https://github.com/payloadcms/payload/commit/d6167727401a01282345e63636560e029ae8e0f3))
|
||||||
|
* renders mobile document controls ([#3695](https://github.com/payloadcms/payload/issues/3695)) ([1625ff2](https://github.com/payloadcms/payload/commit/1625ff244e6e81e6edc0357037c3abc1a3bf8ba7))
|
||||||
|
* some local operations missing req.transactionID ([#3651](https://github.com/payloadcms/payload/issues/3651)) ([150799e](https://github.com/payloadcms/payload/commit/150799e10e580281d1af49388eb142ee9639a002))
|
||||||
|
* **richtext-*:** extra fields not being iterated correctly ([#3693](https://github.com/payloadcms/payload/issues/3693)) ([b8a5866](https://github.com/payloadcms/payload/commit/b8a58666e70f604af1e1cf349bcb4f9add0147e7))
|
||||||
|
* **richtext-*:** link drawer form receiving incorrect field schema ([#3696](https://github.com/payloadcms/payload/issues/3696)) ([cb39354](https://github.com/payloadcms/payload/commit/cb39354a9de3d20960110e453f62c4aa166d8448))
|
||||||
|
* **richtext-lexical:** [#3682](https://github.com/payloadcms/payload/issues/3682) isolated editor container causing z-index issues ([24918fe](https://github.com/payloadcms/payload/commit/24918fe1d2ca251e211632765d370c214cef2a38))
|
||||||
|
* **templates:** user access control ([#3712](https://github.com/payloadcms/payload/issues/3712)) ([8b8ceab](https://github.com/payloadcms/payload/commit/8b8ceabbdd6354761e7d744cacb1192cac3a2427))
|
||||||
|
|
||||||
|
|
||||||
|
## [2.0.6](https://github.com/payloadcms/payload/compare/v2.0.5...v2.0.6) (2023-10-14)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* document sidebar vertical overflow ([#3639](https://github.com/payloadcms/payload/issues/3639)) ([fcd4c8d](https://github.com/payloadcms/payload/commit/fcd4c8d83040f00d10142ca12ba92616618b966e))
|
||||||
|
* login form clearing out and field spacing ([#3633](https://github.com/payloadcms/payload/issues/3633)) ([4bd01df](https://github.com/payloadcms/payload/commit/4bd01df411e4ad2ccacdcd6de0fb21a8145c3964))
|
||||||
|
* sidebar field permissions ([#3629](https://github.com/payloadcms/payload/issues/3629)) ([c956a85](https://github.com/payloadcms/payload/commit/c956a85252bc7de1686925cc783694383c0ac9be))
|
||||||
|
* preview button conditions ([#3613](https://github.com/payloadcms/payload/issues/3613)) ([beed83b](https://github.com/payloadcms/payload/commit/beed83b231b19090902dd502ff5eab054a67a1a6))
|
||||||
|
* allows drafts to be duplicated ([1a99d66](https://github.com/payloadcms/payload/commit/1a99d66cd0675cf2cb2c4317a121721f35682ff3))
|
||||||
|
|
||||||
|
|
||||||
|
## [2.0.5](https://github.com/payloadcms/payload/compare/v2.0.4...v2.0.5) (2023-10-12)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* properly renders custom buttons for globals ([#3616](https://github.com/payloadcms/payload/issues/3616)) ([05cc287](https://github.com/payloadcms/payload/commit/05cc2873b4a19e2bd46be778f3610643d3e15d09))
|
||||||
|
* minor type issue in richText validate function ([06a51b3](https://github.com/payloadcms/payload/commit/06a51b3c9b9045b23051807aa03b222b542b46f5))
|
||||||
|
* live preview device size ([#3606](https://github.com/payloadcms/payload/issues/3606)) ([8bbac60](https://github.com/payloadcms/payload/commit/8bbac60e60a6dbe4dc0c7b05edbca7f6f2d1c569))
|
||||||
|
* properly handles nested routes for live preview ([#3586](https://github.com/payloadcms/payload/issues/3586)) ([6486468](https://github.com/payloadcms/payload/commit/64864686c418f9822bf61c45ece078a39e81b4cb))
|
||||||
|
* various stepnav related issues ([#3599](https://github.com/payloadcms/payload/issues/3599)) ([aaf8839](https://github.com/payloadcms/payload/commit/aaf883909c588bae1145ddddc5291a98740c2c03))
|
||||||
|
* database adapter types ([cc56da1](https://github.com/payloadcms/payload/commit/cc56da11d635d11ebbee67e6d0919c7275ede36e))
|
||||||
|
* postgres select fields within groups ([#3570](https://github.com/payloadcms/payload/issues/3570)) ([06e2fa9](https://github.com/payloadcms/payload/commit/06e2fa9d111c18fad3422953082266db9329fc91))
|
||||||
|
* [#3511](https://github.com/payloadcms/payload/issues/3511), documents don't delete their versions ([#3520](https://github.com/payloadcms/payload/issues/3520)) ([e3c7765](https://github.com/payloadcms/payload/commit/e3c776523a64da03a4756ee5ae8a84175090979f))
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- updates building your own live preview hook ([#3604](https://github.com/payloadcms/payload/issues/3604)) ([15c7f0dbf](https://github.com/payloadcms/payload/commit/15c7f0dbf3ebf5c6a2bb011970dda515a15acb56))
|
||||||
|
- update config overview ([cfd923140](https://github.com/payloadcms/payload/commit/1a006fef19a215d7ef74c71a210fd511727f95bd))
|
||||||
|
|
||||||
|
## [2.0.4](https://github.com/payloadcms/payload/compare/v2.0.3...v2.0.4) (2023-10-12)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- API tab breadcrumbs and results indentation ([#3564](https://github.com/payloadcms/payload/issues/3564)) ([e0afeec](https://github.com/payloadcms/payload/commit/e0afeeca974d0a0cac7aca8e40f9436449c902b5))
|
||||||
|
- sticky sidebar ([#3563](https://github.com/payloadcms/payload/issues/3563)) ([76e306d](https://github.com/payloadcms/payload/commit/76e306ddd8aae45f03fd4715415d6a44501a9400))
|
||||||
|
- sidebar width when fields have long descriptions ([#3562](https://github.com/payloadcms/payload/issues/3562)) ([cfc78ed](https://github.com/payloadcms/payload/commit/cfc78ed4f58647769f651da5a952fed20cfb217f))
|
||||||
|
- row field margins ([#3558](https://github.com/payloadcms/payload/issues/3558)) ([6d9353b](https://github.com/payloadcms/payload/commit/6d9353b53f4197bae2b15ca95298a87d784c7e76))
|
||||||
|
- removes nested array field configs from array value ([#3549](https://github.com/payloadcms/payload/issues/3549)) ([af892ec](https://github.com/payloadcms/payload/commit/af892ecb0e67777a97206bb5fccf489387ce68fc))
|
||||||
|
- [#3521](https://github.com/payloadcms/payload/issues/3521) ([eb97acd](https://github.com/payloadcms/payload/commit/eb97acd408f128438c2122ab6a6e2930f5b4a1ca))
|
||||||
|
- [#3540](https://github.com/payloadcms/payload/issues/3540) ([2567ac5](https://github.com/payloadcms/payload/commit/2567ac58bac851d0a15ee40db0f5f4737b199a75))
|
||||||
|
- row field width ([#3550](https://github.com/payloadcms/payload/issues/3550)) ([9ff014b](https://github.com/payloadcms/payload/commit/9ff014bbfe08d7b114c11824294f0d59f5f6c2c3))
|
||||||
|
- [#3541](https://github.com/payloadcms/payload/issues/3541) ([e6f0d35](https://github.com/payloadcms/payload/commit/e6f0d3598549a921e36f470adfcbacbaebaea53f))
|
||||||
|
- renders global label as page title ([#3532](https://github.com/payloadcms/payload/issues/3532)) ([ace3e57](https://github.com/payloadcms/payload/commit/ace3e577f6b1cbeb12860dc936c578c2a1f68570))
|
||||||
|
- increases document controls popup list button hitbox ([#3529](https://github.com/payloadcms/payload/issues/3529)) ([f009593](https://github.com/payloadcms/payload/commit/f0095937bafdd85c53c99bcc1d29d3361aa07238))
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- removes MONGODB_URI ([8bfae6b93](https://github.com/payloadcms/payload/commit/8bfae6b932d6c9bd0c628a203ebf8d24121d66f8))
|
||||||
|
- adds build your own plugin page ([#3184](https://github.com/payloadcms/payload/pull/3184)) ([15f650afd](https://github.com/payloadcms/payload/commit/15f650afdef717d62c162846fec77aa0f326bb43))
|
||||||
|
|
||||||
|
## [2.0.3](https://github.com/payloadcms/payload/compare/v2.0.2...v2.0.3) (2023-10-09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- webpack export default was not found [#3494](https://github.com/payloadcms/payload/issues/3494) ([be049ce](https://github.com/payloadcms/payload/commit/be049cea0029cf497822e337777b8a86b7d38bed))
|
||||||
|
- postgres generated type id [#3504](https://github.com/payloadcms/payload/issues/3504) ([c90d1fa](https://github.com/payloadcms/payload/commit/c90d1faa7fedd5d902949089fd457c56eed4643d))
|
||||||
|
- hasMany relationships unable to be cleared [#3513](https://github.com/payloadcms/payload/issues/3513) ([5d9384f](https://github.com/payloadcms/payload/commit/5d9384f53052c96403d8c07ae9d05edf3676c4ef))
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- move payload script mention to top of migrations ([26967fb92](https://github.com/payloadcms/payload/commit/26967fb92))
|
||||||
|
- payload script in package.json ([2f86c196e](https://github.com/payloadcms/payload/commit/2f86c196e))
|
||||||
|
- updates required node version ([70e068b18](https://github.com/payloadcms/payload/commit/70e068b18))
|
||||||
|
- improves custom views (#3499) ([6c17222a6](https://github.com/payloadcms/payload/commit/6c17222a6))
|
||||||
|
|
||||||
|
## [2.0.2](https://github.com/payloadcms/payload/compare/v2.0.1...v2.0.2) (2023-10-09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- beforeOperation hooks now correctly only run once ([e5d6a75](https://github.com/payloadcms/payload/commit/e5d6a75449acce2e53820a65386f1af78ff1317b))
|
||||||
|
|
||||||
|
## [2.0.1](https://github.com/payloadcms/payload/compare/v2.0.0...v2.0.1) (2023-10-09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- fix: richtext adapter types (#3497) ([7679e3f0a](https://github.com/payloadcms/payload/commit/7679e3f0aa351832ca933a3978d5931c47375e8b))
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- remove --save flag for install command ([f7c35df6d](https://github.com/payloadcms/payload/commit/f7c35df6de6817ef33837f60951cd2812431fec7))
|
||||||
|
- updates live preview docs ([ca97f692c](https://github.com/payloadcms/payload/commit/ca97f692c3d470e658e417daf29213b2b2b49e11))
|
||||||
|
- fixes label for rich text overview ([7df1256bf](https://github.com/payloadcms/payload/commit/7df1256bf61daa911089d308cf7c0532d524c9c6))
|
||||||
|
|
||||||
## [2.0.0](https://github.com/payloadcms/payload/releases/tag/v2.0.0) (2023-10-09)
|
## [2.0.0](https://github.com/payloadcms/payload/releases/tag/v2.0.0) (2023-10-09)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
@@ -89,3 +89,14 @@ If you are committing to [templates](./templates) or [examples](./examples), use
|
|||||||
## Pull Requests
|
## Pull Requests
|
||||||
|
|
||||||
For all Pull Requests, you should be extremely descriptive about both your problem and proposed solution. If there are any affected open or closed issues, please leave the issue number in your PR message.
|
For all Pull Requests, you should be extremely descriptive about both your problem and proposed solution. If there are any affected open or closed issues, please leave the issue number in your PR message.
|
||||||
|
|
||||||
|
## Previewing docs
|
||||||
|
|
||||||
|
This is how you can preview changes you made locally to the docs:
|
||||||
|
|
||||||
|
1. Clone our [website repository](https://github.com/payloadcms/website)
|
||||||
|
2. Run `yarn install`
|
||||||
|
3. Duplicate the `.env.example` file and rename it to `.env`
|
||||||
|
4. Add a `DOCS_DIR` environment variable to the `.env` file which points to the absolute path of your modified docs folder. For example `DOCS_DIR=/Users/yourname/Documents/GitHub/payload/docs`
|
||||||
|
5. Run `yarn run fetchDocs:local`. If this was successful, you should see no error messages and the following output: *Docs successfully written to /.../website/src/app/docs.json*. There could be error messages if you have incorrect markdown in your local docs folder. In this case, it will tell you how you can fix it
|
||||||
|
6. You're done! Now you can start the website locally using `yarn run dev` and preview the docs under [http://localhost:3000/docs/](http://localhost:3000/docs/)
|
||||||
|
|||||||
39
changelog.config.js
Normal file
39
changelog.config.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
module.exports = {
|
||||||
|
// gitRawCommitsOpts: {
|
||||||
|
// from: 'v2.0.9',
|
||||||
|
// path: 'packages/payload',
|
||||||
|
// },
|
||||||
|
// infile: 'CHANGELOG.md',
|
||||||
|
options: {
|
||||||
|
preset: {
|
||||||
|
name: 'conventionalcommits',
|
||||||
|
types: [
|
||||||
|
{ section: 'Features', type: 'feat' },
|
||||||
|
{ section: 'Features', type: 'feature' },
|
||||||
|
{ section: 'Bug Fixes', type: 'fix' },
|
||||||
|
{ section: 'Documentation', type: 'docs' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// outfile: 'NEW.md',
|
||||||
|
writerOpts: {
|
||||||
|
commitGroupsSort: (a, b) => {
|
||||||
|
const groupOrder = ['Features', 'Bug Fixes', 'Documentation']
|
||||||
|
return groupOrder.indexOf(a.title) - groupOrder.indexOf(b.title)
|
||||||
|
},
|
||||||
|
|
||||||
|
// Scoped commits at the end, alphabetical sort
|
||||||
|
commitsSort: (a, b) => {
|
||||||
|
if (a.scope || b.scope) {
|
||||||
|
if (!a.scope) return -1
|
||||||
|
if (!b.scope) return 1
|
||||||
|
return a.scope === b.scope
|
||||||
|
? a.subject.localeCompare(b.subject)
|
||||||
|
: a.scope.localeCompare(b.scope)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alphabetical sort
|
||||||
|
return a.subject.localeCompare(b.subject)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -96,7 +96,7 @@ To swap out any of these views, simply pass in your custom component to the `adm
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
For more granular control, pass a configuration object instead. Payload exposes all of the properties of `<Route />` component in [React Router v5](https://v5.reactrouter.com):
|
For more granular control, pass a configuration object instead. Each view corresponds to its own `<Route />` component in [React Router v5](https://v5.reactrouter.com). Payload exposes all of the properties of React Router:
|
||||||
|
|
||||||
| Property | Description |
|
| Property | Description |
|
||||||
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
|
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
|
||||||
@@ -129,13 +129,19 @@ To add a _new_ view to the Admin Panel, simply add another key to the `views` ob
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<Banner type="warning">
|
||||||
|
<strong>Note:</strong>
|
||||||
|
<br />
|
||||||
|
Routes are cascading. This means that unless explicitly given the `exact` property, they will match on URLs that simply _start_ with the route's path. This is helpful when creating catch-all routes in your application. Alternatively, you could define your nested route _before_ your parent route.
|
||||||
|
</Banner>
|
||||||
|
|
||||||
_For more examples regarding how to customize components, look at the following [examples](https://github.com/payloadcms/payload/tree/main/test/admin/components)._
|
_For more examples regarding how to customize components, look at the following [examples](https://github.com/payloadcms/payload/tree/main/test/admin/components)._
|
||||||
|
|
||||||
For help on how to build your own custom view components, see [building a custom view component](#building-a-custom-view-component).
|
For help on how to build your own custom view components, see [building a custom view component](#building-a-custom-view-component).
|
||||||
|
|
||||||
### Collections
|
### Collections
|
||||||
|
|
||||||
You can override components on a collection-by-collection basis via their `admin` property.
|
You can override components on a collection-by-collection basis via the `admin.components` property.
|
||||||
|
|
||||||
| Path | Description |
|
| Path | Description |
|
||||||
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
||||||
@@ -163,8 +169,8 @@ import {
|
|||||||
CustomPreviewButtonProps,
|
CustomPreviewButtonProps,
|
||||||
} from 'payload/types'
|
} from 'payload/types'
|
||||||
|
|
||||||
export const CustomSaveButton: CustomSaveButtonProps = ({ DefaultButton, label }) => {
|
export const CustomSaveButton: CustomSaveButtonProps = ({ DefaultButton, label, save }) => {
|
||||||
return <DefaultButton label={label} />
|
return <DefaultButton label={label} save={save} />
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CustomSaveDraftButton: CustomSaveDraftButtonProps = ({
|
export const CustomSaveDraftButton: CustomSaveDraftButtonProps = ({
|
||||||
@@ -259,14 +265,14 @@ You can also add _new_ tabs to the `Edit` view by adding another key to the `com
|
|||||||
|
|
||||||
### Globals
|
### Globals
|
||||||
|
|
||||||
As with Collections, you can override components on a global-by-global basis via their `admin` property.
|
As with Collections, you can override components on a global-by-global basis via the `admin.components` property.
|
||||||
|
|
||||||
| Path | Description |
|
| Path | Description |
|
||||||
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
|
||||||
| **`edit.SaveButton`** | Replace the default `Save` button with a custom component. Drafts must be disabled |
|
| **`elements.SaveButton`** | Replace the default `Save` button with a custom component. Drafts must be disabled |
|
||||||
| **`edit.SaveDraftButton`** | Replace the default `Save Draft` button with a custom component. Drafts must be enabled and autosave must be disabled. |
|
| **`elements.SaveDraftButton`** | Replace the default `Save Draft` button with a custom component. Drafts must be enabled and autosave must be disabled. |
|
||||||
| **`edit.PublishButton`** | Replace the default `Publish` button with a custom component. Drafts must be enabled. |
|
| **`elements.PublishButton`** | Replace the default `Publish` button with a custom component. Drafts must be enabled. |
|
||||||
| **`edit.PreviewButton`** | Replace the default `Preview` button with a custom component. |
|
| **`elements.PreviewButton`** | Replace the default `Preview` button with a custom component. |
|
||||||
| **`views`** | Override or create new views within the Payload Admin UI. [More](#global-views) |
|
| **`views`** | Override or create new views within the Payload Admin UI. [More](#global-views) |
|
||||||
|
|
||||||
#### Global views
|
#### Global views
|
||||||
@@ -442,7 +448,9 @@ These are the props that will be passed to your custom Cell to use in your own c
|
|||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import type { Props } from 'payload/components/views/Cell'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|
||||||
const baseClass = 'custom-cell'
|
const baseClass = 'custom-cell'
|
||||||
|
|
||||||
const CustomCell: React.FC<Props> = (props) => {
|
const CustomCell: React.FC<Props> = (props) => {
|
||||||
|
|||||||
@@ -91,14 +91,34 @@ This way when your bundler goes to import a file that contains server-only modul
|
|||||||
|
|
||||||
To remove files that contain server-only modules from your bundle, you can use an `alias`.
|
To remove files that contain server-only modules from your bundle, you can use an `alias`.
|
||||||
|
|
||||||
First create new file that exports an empty object:
|
In the Subscriptions config file above, we are importing the hook like so:
|
||||||
```js
|
|
||||||
// mocks/emptyObject.js
|
|
||||||
|
|
||||||
export default {}
|
```ts
|
||||||
|
// collections/Subscriptions/index.ts
|
||||||
|
|
||||||
|
import createStripeSubscription from './hooks/createStripeSubscription'
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, in your Payload config, you can alias the file containing the server-only module to the mock module. For example, here's how you'd do this in Webpack:
|
By default the browser bundle will now include all the code from that file and any files down the tree. We know that the file imports `stripe`.
|
||||||
|
|
||||||
|
To fix this, we need to alias the `createStripeSubscription` file to a different file that can safely be included in the browser bundle.
|
||||||
|
|
||||||
|
First, we will create a mock file to replace the server-only file when bundling:
|
||||||
|
```js
|
||||||
|
// mocks/modules.js
|
||||||
|
|
||||||
|
export default {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NOTE: if you are destructuring an import
|
||||||
|
* the mock file will need to export matching
|
||||||
|
* variables as the destructured object.
|
||||||
|
*
|
||||||
|
* export const namedExport = {}
|
||||||
|
*/
|
||||||
|
```
|
||||||
|
|
||||||
|
Aliasing with [Webpack](/docs/admin/webpack) can be done by:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
// payload.config.ts
|
// payload.config.ts
|
||||||
@@ -106,10 +126,16 @@ Then, in your Payload config, you can alias the file containing the server-only
|
|||||||
import { buildConfig } from 'payload/config'
|
import { buildConfig } from 'payload/config'
|
||||||
import { webpackBundler } from '@payloadcms/bundler-webpack'
|
import { webpackBundler } from '@payloadcms/bundler-webpack'
|
||||||
|
|
||||||
|
import { Subscriptions } from './collections/Subscriptions'
|
||||||
|
|
||||||
const mockModulePath = path.resolve(__dirname, 'mocks/emptyObject.js')
|
const mockModulePath = path.resolve(__dirname, 'mocks/emptyObject.js')
|
||||||
const pathToFileWithServerOnlyModule = path.resolve(__dirname, 'hooks/syncStripeCustomer.ts')
|
const fullFilePath = path.resolve(
|
||||||
|
__dirname,
|
||||||
|
'collections/Subscriptions/hooks/createStripeSubscription'
|
||||||
|
)
|
||||||
|
|
||||||
export default buildConfig({
|
export default buildConfig({
|
||||||
|
collections: [Subscriptions],
|
||||||
admin: {
|
admin: {
|
||||||
bundler: webpackBundler(),
|
bundler: webpackBundler(),
|
||||||
webpack: (config) => {
|
webpack: (config) => {
|
||||||
@@ -120,7 +146,42 @@ export default buildConfig({
|
|||||||
// highlight-start
|
// highlight-start
|
||||||
alias: {
|
alias: {
|
||||||
...config.resolve.alias,
|
...config.resolve.alias,
|
||||||
[pathToFileWithServerOnlyModule]: mockModulePath,
|
[fullFilePath]: mockModulePath,
|
||||||
|
},
|
||||||
|
// highlight-end
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
Aliasing with [Vite](/docs/admin/vite) can be done by:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// payload.config.ts
|
||||||
|
|
||||||
|
import { buildConfig } from 'payload/config'
|
||||||
|
import { viteBundler } from '@payloadcms/bundler-vite'
|
||||||
|
|
||||||
|
import { Subscriptions } from './collections/Subscriptions'
|
||||||
|
|
||||||
|
const mockModulePath = path.resolve(__dirname, 'mocks/emptyObject.js')
|
||||||
|
|
||||||
|
export default buildConfig({
|
||||||
|
collections: [Subscriptions],
|
||||||
|
admin: {
|
||||||
|
bundler: viteBundler(),
|
||||||
|
vite: (config) => {
|
||||||
|
return {
|
||||||
|
...config,
|
||||||
|
resolve: {
|
||||||
|
...config.resolve,
|
||||||
|
// highlight-start
|
||||||
|
alias: {
|
||||||
|
...config.resolve.alias,
|
||||||
|
// remember, vite aliases are exact-match only
|
||||||
|
'./hooks/createStripeSubscription': mockModulePath,
|
||||||
},
|
},
|
||||||
// highlight-end
|
// highlight-end
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ order: 90
|
|||||||
desc: NEEDS TO BE WRITTEN
|
desc: NEEDS TO BE WRITTEN
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<Banner type="info">
|
||||||
|
The Vite bundler is currently in beta. If you would like to help us test this package, we'd love to hear from you if you find any [bugs or issues](https://github.com/payloadcms/payload/issues/)!
|
||||||
|
</Banner>
|
||||||
|
|
||||||
Payload has a Vite bundler that you can install and bundle the Admin Panel with. This is an alternative to the [Webpack](/docs/admin/webpack) bundler and might give some performance boosts to your development workflow.
|
Payload has a Vite bundler that you can install and bundle the Admin Panel with. This is an alternative to the [Webpack](/docs/admin/webpack) bundler and might give some performance boosts to your development workflow.
|
||||||
|
|
||||||
To use Vite as your bundler, first you need to install the package:
|
To use Vite as your bundler, first you need to install the package:
|
||||||
@@ -13,9 +17,19 @@ To use Vite as your bundler, first you need to install the package:
|
|||||||
yarn add @payloadcms/bundler-vite
|
yarn add @payloadcms/bundler-vite
|
||||||
```
|
```
|
||||||
|
|
||||||
<Banner>
|
Then you will need to add the [bundler](/docs/admin/bundlers) to your Payload config:
|
||||||
The Vite bundler is currently in beta. If you would like to help us test this package, we'd love to hear if you find any bugs or issues!
|
|
||||||
</Banner>
|
```ts
|
||||||
|
import { buildConfig } from '@payloadcms/config'
|
||||||
|
import viteBundler from '@payloadcms/bundler-vite'
|
||||||
|
|
||||||
|
export default buildConfig({
|
||||||
|
collections: [],
|
||||||
|
admin: {
|
||||||
|
bundler: viteBundler(),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
Vite works fundamentally differently than Webpack. In development mode, it will first pre-bundle any of your dependencies that are CommonJS-only, and then it'll leverage ESM directly in your browser for a better HMR experience.
|
Vite works fundamentally differently than Webpack. In development mode, it will first pre-bundle any of your dependencies that are CommonJS-only, and then it'll leverage ESM directly in your browser for a better HMR experience.
|
||||||
|
|
||||||
@@ -31,8 +45,35 @@ Here are the main differences between how Vite aliases work and how Webpack alia
|
|||||||
|
|
||||||
**Vite aliases do not work with absolute paths.**
|
**Vite aliases do not work with absolute paths.**
|
||||||
|
|
||||||
In Vite, an alias will only match if the `find` property _exactly matches_ how you are importing your server-only file. So if you are importing a file with a relative path, i.e. `'../../my-module'`, and your alias is absolute, your alias will not work.
|
In Vite, alias keys must <strong>exactly match</strong> a import paths. If you have 2 files that import the same server-only module, but have different import paths, you would need to add 2 aliases to support both import paths.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// File A
|
||||||
|
import serverOnlyModule from '../server-only-module'
|
||||||
|
|
||||||
|
// File B
|
||||||
|
import serverOnlyModule from '../../server-only-module'
|
||||||
|
|
||||||
|
// payload.config.ts
|
||||||
|
// You would need to add 2 aliases to support both import paths
|
||||||
|
export const buildConfig({
|
||||||
|
collections: [],
|
||||||
|
admin: {
|
||||||
|
bundler: viteBundler(),
|
||||||
|
vite: (incomingViteConfig) => ({
|
||||||
|
...incomingViteConfig,
|
||||||
|
resolve: {
|
||||||
|
...(incomingViteConfig?.resolve || {}),
|
||||||
|
alias: {
|
||||||
|
...(incomingViteConfig?.resolve?.alias || {}),
|
||||||
|
'../server-only-module': path.resolve(__dirname, './path/to/browser-safe-module.js'),
|
||||||
|
'../../server-only-module': path.resolve(__dirname, './path/to/browser-safe-module.js'),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
**Vite aliases do not get applied to pre-bundled dependencies.**
|
**Vite aliases do not get applied to pre-bundled dependencies.**
|
||||||
|
|
||||||
@@ -58,7 +99,7 @@ This will effectively alias the entire plugin and work with Vite. If the plugin
|
|||||||
|
|
||||||
### Extending the Vite config
|
### Extending the Vite config
|
||||||
|
|
||||||
The Payload config supports a new property for plugins to be able to extend the Vite config specifically. That property exists on the main Payload config under `admin.vite`.
|
The Payload config supports a new property for plugins to be able to extend the Vite config specifically. That property exists on the main Payload config under `admin.vite`. You can check out the [Vite docs](https://vitejs.dev/config/shared-options.html) for more information on what you can do with the Vite config.
|
||||||
|
|
||||||
It's a function that takes a Vite config, and returns an updated Vite config. Here's an example:
|
It's a function that takes a Vite config, and returns an updated Vite config. Here's an example:
|
||||||
|
|
||||||
@@ -66,17 +107,24 @@ It's a function that takes a Vite config, and returns an updated Vite config. He
|
|||||||
export const buildConfig({
|
export const buildConfig({
|
||||||
collections: [],
|
collections: [],
|
||||||
admin: {
|
admin: {
|
||||||
|
bundler: viteBundler(),
|
||||||
vite: (incomingViteConfig) => ({
|
vite: (incomingViteConfig) => ({
|
||||||
...incomingViteConfig,
|
...incomingViteConfig,
|
||||||
resolve: {
|
resolve: {
|
||||||
...incomingViteConfig.resolve,
|
...(incomingViteConfig?.resolve || {}),
|
||||||
// Do whatever you need here
|
alias: {
|
||||||
|
...(incomingViteConfig?.resolve?.alias || {}),
|
||||||
|
// custom aliases go here
|
||||||
|
'../server-only-module': path.resolve(__dirname, './path/to/browser-safe-module.js'),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Learn more about [aliasing server-only modules](http://localhost:3000/docs/admin/excluding-server-code#aliasing-server-only-modules).
|
||||||
|
|
||||||
Even though there is a new property for Vite configs specifically, we have implemented some "compatibility" between Webpack and Vite out-of-the-box.
|
Even though there is a new property for Vite configs specifically, we have implemented some "compatibility" between Webpack and Vite out-of-the-box.
|
||||||
|
|
||||||
If your config specifies Webpack aliases, we attempt to leverage them automatically within the Vite config. They are merged into the Vite alias configuration seamlessly and may work out-of-the-box.
|
If your config specifies Webpack aliases, we attempt to leverage them automatically within the Vite config. They are merged into the Vite alias configuration seamlessly and may work out-of-the-box.
|
||||||
@@ -48,7 +48,7 @@ In addition to the default [field admin config](/docs/fields/overview#admin-conf
|
|||||||
|
|
||||||
| Option | Description |
|
| Option | Description |
|
||||||
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| **`editorOptions`** | Options that can be passed to the monaco editor, [view the full list](https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.IDiffEditorConstructionOptions.html). |
|
| **`editorOptions`** | Options that can be passed to the monaco editor, [view the full list](https://microsoft.github.io/monaco-editor/typedoc/variables/editor.EditorOptions.html). |
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ export const Page: CollectionConfig = {
|
|||||||
- [Rich Text](/docs/fields/rich-text) - fully extensible Rich Text editor
|
- [Rich Text](/docs/fields/rich-text) - fully extensible Rich Text editor
|
||||||
- [Row](/docs/fields/row) - used for admin field layout, no effect on data shape
|
- [Row](/docs/fields/row) - used for admin field layout, no effect on data shape
|
||||||
- [Select](/docs/fields/select) - dropdown / picklist style value selector
|
- [Select](/docs/fields/select) - dropdown / picklist style value selector
|
||||||
|
- [Tabs](/docs/fields/tabs) - used for admin layout, nest fields within tabs
|
||||||
- [Text](/docs/fields/text) - simple text input
|
- [Text](/docs/fields/text) - simple text input
|
||||||
- [Textarea](/docs/fields/textarea) - allows a bit larger of a text editor
|
- [Textarea](/docs/fields/textarea) - allows a bit larger of a text editor
|
||||||
- [Upload](/docs/fields/upload) - allows local file and image upload
|
- [Upload](/docs/fields/upload) - allows local file and image upload
|
||||||
|
|||||||
@@ -267,3 +267,27 @@ Relationship fields with `hasMany` set to more than one kind of collections save
|
|||||||
Querying is done in the same way as the earlier Polymorphic example:
|
Querying is done in the same way as the earlier Polymorphic example:
|
||||||
|
|
||||||
`?where[owners.value][equals]=6031ac9e1289176380734024`.
|
`?where[owners.value][equals]=6031ac9e1289176380734024`.
|
||||||
|
|
||||||
|
|
||||||
|
#### Querying and Filtering Polymorphic Relationships
|
||||||
|
|
||||||
|
Polymorphic and non-polymorphic relationships must be queried differently because of how the related data is stored and may be inconsistent across different collections. Because of this, filtering polymorphic relationship fields from the Collection List admin UI is limited to the `id` value.
|
||||||
|
|
||||||
|
For a polymorphic relationship, the response will always be an array of objects. Each object will contain the `relationTo` and `value` properties.
|
||||||
|
|
||||||
|
The data can be queried by the related document ID:
|
||||||
|
|
||||||
|
`?where[field.value][equals]=6031ac9e1289176380734024`.
|
||||||
|
|
||||||
|
Or by the related document Collection slug:
|
||||||
|
|
||||||
|
`?where[field.relationTo][equals]=your-collection-slug`.
|
||||||
|
|
||||||
|
However, you **cannot** query on any field values within the related document.
|
||||||
|
Since we are referencing multiple collections, the field you are querying on may not exist and break the query.
|
||||||
|
|
||||||
|
<Banner type="warning">
|
||||||
|
<strong>Note:</strong>
|
||||||
|
<br />
|
||||||
|
You <strong>cannot</strong> query on a field within a polymorphic relationship as you would with a non-polymorphic relationship.
|
||||||
|
</Banner>
|
||||||
|
|||||||
@@ -11,19 +11,23 @@ keywords: documentation, getting started, guide, Content Management System, cms,
|
|||||||
title="Payload Introduction - Closing the Gap Between Headless CMS and Application Frameworks"
|
title="Payload Introduction - Closing the Gap Between Headless CMS and Application Frameworks"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Banner type="success">
|
Payload is a headless CMS and application framework. It's meant to provide a massive boost to your
|
||||||
Payload is a headless CMS and application framework. It’s meant to provide a massive boost to your
|
|
||||||
development process, but importantly, stay out of your way as your apps get more complex.
|
development process, but importantly, stay out of your way as your apps get more complex.
|
||||||
|
|
||||||
|
<Banner type="success">
|
||||||
|
<strong>Payload 2.0 has been released!</strong>
|
||||||
|
<br />
|
||||||
|
Includes Postgres support, Live Preview, Lexical Editor, and more. <a href="/blog/payload-2-0">Read the announcement</a>.
|
||||||
</Banner>
|
</Banner>
|
||||||
|
|
||||||
Out of the box, Payload gives you a lot of the things that you often need when developing a new website, web app, or native app:
|
Out of the box, Payload gives you a lot of the things that you often need when developing a new website, web app, or native app:
|
||||||
|
|
||||||
- A MongoDB database to store your data
|
- A database to store your data (Postgres and MongoDB supported)
|
||||||
- A way to store, retrieve, and manipulate data of any shape via full REST and GraphQL APIs
|
- A way to store, retrieve, and manipulate data of any shape via full REST and GraphQL APIs
|
||||||
- Authentication—complete with commonly required functionality like registration, email verification, login, & password reset
|
- Authentication—complete with commonly required functionality like registration, email verification, login, & password reset
|
||||||
- Deep access control to your data, based on document or field-level functions
|
- Deep access control to your data, based on document or field-level functions
|
||||||
- File storage and access control
|
- File storage and access control
|
||||||
- A beautiful admin UI that’s generated specifically to suit your data
|
- A beautiful admin UI that's generated specifically to suit your data
|
||||||
|
|
||||||
## What does "headless" mean?
|
## What does "headless" mean?
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ Please do note that this does not run before the client-side validation. If you
|
|||||||
3. `validate` runs on the server
|
3. `validate` runs on the server
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { CollectionBeforeOperationHook } from 'payload/types'
|
import { CollectionBeforeValidateHook } from 'payload/types'
|
||||||
|
|
||||||
const beforeValidateHook: CollectionBeforeValidateHook = async ({
|
const beforeValidateHook: CollectionBeforeValidateHook = async ({
|
||||||
data, // incoming data to update or create with
|
data, // incoming data to update or create with
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ All field-level hooks are formatted to accept the same arguments, although some
|
|||||||
Field Hooks receive one `args` argument that contains the following properties:
|
Field Hooks receive one `args` argument that contains the following properties:
|
||||||
|
|
||||||
| Option | Description |
|
| Option | Description |
|
||||||
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| **`data`** | The data passed to update the document within `create` and `update` operations, and the full document itself in the `afterRead` hook. |
|
| **`data`** | The data passed to update the document within `create` and `update` operations, and the full document itself in the `afterRead` hook. |
|
||||||
| **`siblingData`** | The sibling data passed to a field that the hook is running against. |
|
| **`siblingData`** | The sibling data passed to a field that the hook is running against. |
|
||||||
| **`findMany`** | Boolean to denote if this hook is running against finding one, or finding many within the `afterRead` hook. |
|
| **`findMany`** | Boolean to denote if this hook is running against finding one, or finding many within the `afterRead` hook. |
|
||||||
@@ -73,6 +73,10 @@ Field Hooks receive one `args` argument that contains the following properties:
|
|||||||
| **`req`** | The Express `request` object. It is mocked for Local API operations. |
|
| **`req`** | The Express `request` object. It is mocked for Local API operations. |
|
||||||
| **`value`** | The value of the field. |
|
| **`value`** | The value of the field. |
|
||||||
| **`previousValue`** | The previous value of the field, before changes were applied, only in `afterChange` hooks. |
|
| **`previousValue`** | The previous value of the field, before changes were applied, only in `afterChange` hooks. |
|
||||||
|
| **`context`** | Context passed to this hook. More info can be found under [Context](/docs/hooks/context) |
|
||||||
|
| **`field`** | The field which the hook is running against. |
|
||||||
|
| **`collection`** | The collection which the field belongs to. If the field belongs to a global, this will be null. |
|
||||||
|
| **`global`** | The global which the field belongs to. If the field belongs to a collection, this will be null. |
|
||||||
|
|
||||||
#### Return value
|
#### Return value
|
||||||
|
|
||||||
|
|||||||
@@ -400,6 +400,70 @@ const result = await payload.updateGlobal({
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Next.js Conflict with Local API
|
||||||
|
|
||||||
|
There is a known issue when using the Local API with Next.js version `13.4.13` and higher. Next.js executes within a separate child process, and Payload has not been initalized yet in these instances. That means that unless you explicitly initialize Payload within your operation, it will not be running and return no data / an empty object.
|
||||||
|
|
||||||
|
As a workaround, we recommend leveraging the following pattern to determine and ensure Payload is initalized:
|
||||||
|
|
||||||
|
```
|
||||||
|
import dotenv from 'dotenv'
|
||||||
|
import path from 'path'
|
||||||
|
import type { Payload } from 'payload'
|
||||||
|
import payload from 'payload'
|
||||||
|
import type { InitOptions } from 'payload/config'
|
||||||
|
import { seed as seedData } from './seed'
|
||||||
|
|
||||||
|
dotenv.config({
|
||||||
|
path: path.resolve(__dirname, '../.env'),
|
||||||
|
})
|
||||||
|
|
||||||
|
let cached = (global as any).payload
|
||||||
|
|
||||||
|
if (!cached) {
|
||||||
|
cached = (global as any).payload = { client: null, promise: null }
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Args {
|
||||||
|
initOptions?: Partial<InitOptions>
|
||||||
|
seed?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getPayloadClient = async ({ initOptions, seed }: Args = {}): Promise<Payload> => {
|
||||||
|
if (!process.env.DATABASE_URI) {
|
||||||
|
throw new Error('DATABASE_URI environment variable is missing')
|
||||||
|
}
|
||||||
|
if (!process.env.PAYLOAD_SECRET) {
|
||||||
|
throw new Error('PAYLOAD_SECRET environment variable is missing')
|
||||||
|
}
|
||||||
|
if (cached.client) {
|
||||||
|
return cached.client
|
||||||
|
}
|
||||||
|
if (!cached.promise) {
|
||||||
|
cached.promise = payload.init({
|
||||||
|
mongoURL: process.env.DATABASE_URI,
|
||||||
|
secret: process.env.PAYLOAD_SECRET,
|
||||||
|
local: initOptions?.express ? false : true,
|
||||||
|
...(initOptions || {}),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
process.env.PAYLOAD_DROP_DATABASE = seed ? 'true' : 'false'
|
||||||
|
cached.client = await cached.promise
|
||||||
|
if (seed) {
|
||||||
|
payload.logger.info('---- SEEDING DATABASE ----')
|
||||||
|
await seedData(payload)
|
||||||
|
}
|
||||||
|
} catch (e: unknown) {
|
||||||
|
cached.promise = null
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
return cached.client
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
To checkout how this works in a project, take a look at our [custom server example](https://github.com/payloadcms/payload/blob/master/examples/custom-server/src/getPayload.ts).
|
||||||
|
|
||||||
## Example Script using Local API
|
## Example Script using Local API
|
||||||
|
|
||||||
The Local API is especially useful for running scripts
|
The Local API is especially useful for running scripts
|
||||||
|
|||||||
@@ -158,6 +158,17 @@ DigitalOcean provides extremely helpful documentation that can walk you through
|
|||||||
1. [Create a new MongoDB and user](https://medium.com/@mhagemann/how-to-add-a-new-user-to-a-mongodb-database-d896776b5362)
|
1. [Create a new MongoDB and user](https://medium.com/@mhagemann/how-to-add-a-new-user-to-a-mongodb-database-d896776b5362)
|
||||||
1. [Set up Node for production](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-20-04)
|
1. [Set up Node for production](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-20-04)
|
||||||
|
|
||||||
|
### Swap Space
|
||||||
|
|
||||||
|
Swap refers to a section of storage on the hard drive that is reserved to temporarily store data that can no longer fit within RAM. This allows for the expansion of your server's working memory, with some limitations. Swap space comes into play when available RAM can no longer accommodate actively used application data, enabling the system to continue functioning.
|
||||||
|
|
||||||
|
Insufficient space can lead to deployment errors and memory-related issues, resulting in application crashes, sluggish performance, or an unresponsive server.
|
||||||
|
|
||||||
|
Common deployment error due to **space limitations** (as reported by users):
|
||||||
|
- `Error: Command failed with exit code 1`
|
||||||
|
|
||||||
|
To configure swap, we recommend following this tutorial on [How To Add Swap Space](https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-22-04).
|
||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
|
|
||||||
This is an example of a multi-stage docker build of Payload for production. Ensure you are setting your environment variables on deployment, like `PAYLOAD_SECRET`, `PAYLOAD_CONFIG_PATH`, and `DATABASE_URI` if needed.
|
This is an example of a multi-stage docker build of Payload for production. Ensure you are setting your environment variables on deployment, like `PAYLOAD_SECRET`, `PAYLOAD_CONFIG_PATH`, and `DATABASE_URI` if needed.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
title: Lexical Rich Text
|
title: Lexical Rich Text
|
||||||
label: Lexical
|
label: Lexical
|
||||||
order: 30
|
order: 30
|
||||||
desc: Built by Meta, Lexical is an incredibly powerful rich text editor and it works beautifully within Payload.
|
desc: Built by Meta, Lexical is an incredibly powerful rich text editor, and it works beautifully within Payload.
|
||||||
keywords: lexical, rich text, editor, headless cms
|
keywords: lexical, rich text, editor, headless cms
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -45,7 +45,39 @@ export default buildConfig({
|
|||||||
You can also override Lexical settings on a field-by-field basis as follows:
|
You can also override Lexical settings on a field-by-field basis as follows:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { CollectionConfig } from 'payload/types'
|
import type { CollectionConfig } from 'payload/types'
|
||||||
|
import {
|
||||||
|
lexicalEditor
|
||||||
|
} from '@payloadcms/richtext-lexical'
|
||||||
|
|
||||||
|
export const Pages: CollectionConfig = {
|
||||||
|
slug: 'pages',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'content',
|
||||||
|
type: 'richText',
|
||||||
|
// Pass the Lexical editor here and override base settings as necessary
|
||||||
|
editor: lexicalEditor({})
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Extending the lexical editor with Features
|
||||||
|
|
||||||
|
Lexical has been designed with extensibility in mind. Whether you're aiming to introduce new functionalities or tweak the existing ones, Lexical makes it seamless for you to bring those changes to life.
|
||||||
|
|
||||||
|
### Features: The Building Blocks
|
||||||
|
|
||||||
|
At the heart of Lexical's customization potential are "features". While Lexical ships with a set of default features we believe are essential for most use cases, the true power lies in your ability to redefine, expand, or prune these as needed.
|
||||||
|
|
||||||
|
If you remove all the default features, you're left with a blank editor. You can then add in only the features you need, or you can build your own custom features from scratch.
|
||||||
|
|
||||||
|
### Integrating New Features
|
||||||
|
|
||||||
|
To weave in your custom features, utilize the `features` prop when initializing the Lexical Editor. Here's a basic example of how this is done:
|
||||||
|
|
||||||
|
```ts
|
||||||
import {
|
import {
|
||||||
BlocksFeature,
|
BlocksFeature,
|
||||||
LinkFeature,
|
LinkFeature,
|
||||||
@@ -55,13 +87,7 @@ import {
|
|||||||
import { Banner } from '../blocks/Banner'
|
import { Banner } from '../blocks/Banner'
|
||||||
import { CallToAction } from '../blocks/CallToAction'
|
import { CallToAction } from '../blocks/CallToAction'
|
||||||
|
|
||||||
export const Pages: CollectionConfig = {
|
|
||||||
slug: 'pages',
|
|
||||||
fields: [
|
|
||||||
{
|
{
|
||||||
name: 'content',
|
|
||||||
type: 'richText',
|
|
||||||
// Pass the Lexical editor here and override base settings as necessary
|
|
||||||
editor: lexicalEditor({
|
editor: lexicalEditor({
|
||||||
features: ({ defaultFeatures }) => [
|
features: ({ defaultFeatures }) => [
|
||||||
...defaultFeatures,
|
...defaultFeatures,
|
||||||
@@ -108,9 +134,461 @@ export const Pages: CollectionConfig = {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
]
|
```
|
||||||
|
|
||||||
|
## Features overview
|
||||||
|
|
||||||
|
Here's an overview of all the included features:
|
||||||
|
|
||||||
|
| Feature Name | Included by default | Description |
|
||||||
|
|--------------------------------|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **`BoldTextFeature`** | Yes | Handles the bold text format |
|
||||||
|
| **`ItalicTextFeature`** | Yes | Handles the italic text format |
|
||||||
|
| **`UnderlineTextFeature`** | Yes | Handles the underline text format |
|
||||||
|
| **`StrikethroughTextFeature`** | Yes | Handles the strikethrough text format |
|
||||||
|
| **`SubscriptTextFeature`** | Yes | Handles the subscript text format |
|
||||||
|
| **`SuperscriptTextFeature`** | Yes | Handles the superscript text format |
|
||||||
|
| **`InlineCodeTextFeature`** | Yes | Handles the inline-code text format |
|
||||||
|
| **`ParagraphFeature`** | Yes | Handles paragraphs. Since they are already a key feature of lexical itself, this Feature mainly handles the Slash and Add-Block menu entries for paragraphs |
|
||||||
|
| **`HeadingFeature`** | Yes | Adds Heading Nodes (by default, H1 - H6, but that can be customized) |
|
||||||
|
| **`AlignFeature`** | Yes | Allows you to align text left, centered and right |
|
||||||
|
| **`IndentFeature`** | Yes | Allows you to indent text with the tab key |
|
||||||
|
| **`UnoderedListFeature`** | Yes | Adds unordered lists (ol) |
|
||||||
|
| **`OrderedListFeature`** | Yes | Adds ordered lists (ul) |
|
||||||
|
| **`CheckListFeature`** | Yes | Adds checklists |
|
||||||
|
| **`LinkFeature`** | Yes | Allows you to create internal and external links |
|
||||||
|
| **`RelationshipFeature`** | Yes | Allows you to create block-level (not inline) relationships to other documents |
|
||||||
|
| **`BlockQuoteFeature`** | Yes | Allows you to create block-level quotes |
|
||||||
|
| **`UploadFeature`** | Yes | Allows you to create block-level upload nodes - this supports all kinds of uploads, not just images |
|
||||||
|
| **`BlocksFeature`** | No | Allows you to use Payload's [Blocks Field](/docs/fields/blocks) directly inside your editor. In the feature props, you can specify the allowed blocks - just like in the Blocks field. |
|
||||||
|
| **`TreeViewFeature`** | No | Adds a debug box under the editor, which allows you to see the current editor state live, the dom, as well as time travel. Very useful for debugging |
|
||||||
|
|
||||||
|
## Creating your own, custom Feature
|
||||||
|
|
||||||
|
Creating your own custom feature requires deep knowledge of the Lexical editor. We recommend you take a look at the [Lexical documentation](https://lexical.dev/docs/intro) first - especially the "concepts" section.
|
||||||
|
|
||||||
|
Next, take a look at the [features we've already built](https://github.com/payloadcms/payload/tree/main/packages/richtext-lexical/src/field/features) - understanding how they work will help you understand how to create your own. There is no difference between the features included by default and the ones you create yourself - since those features are all isolated from the "core", you have access to the same APIs, whether the feature is part of payload or not!
|
||||||
|
|
||||||
|
## Converters
|
||||||
|
|
||||||
|
### Lexical => HTML
|
||||||
|
|
||||||
|
Lexical saves data in JSON, but can also generate its HTML representation via two main methods:
|
||||||
|
|
||||||
|
1. **Outputting HTML from the Collection:** Create a new field in your collection to convert saved JSON content to HTML. Payload generates and outputs the HTML for use in your frontend.
|
||||||
|
2. **Generating HTML on the Frontend:** Convert JSON to HTML on-demand, either in your frontend or elsewhere.
|
||||||
|
|
||||||
|
The editor comes with built-in HTML serializers, simplifying the process of converting JSON to HTML.
|
||||||
|
|
||||||
|
#### Outputting HTML from the Collection
|
||||||
|
|
||||||
|
To add HTML generation directly within the collection, follow the example below:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import type { CollectionConfig } from 'payload/types'
|
||||||
|
|
||||||
|
import {
|
||||||
|
HTMLConverterFeature,
|
||||||
|
lexicalEditor,
|
||||||
|
lexicalHTML
|
||||||
|
} from '@payloadcms/richtext-lexical'
|
||||||
|
|
||||||
|
const Pages: CollectionConfig = {
|
||||||
|
slug: 'pages',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'nameOfYourRichTextField',
|
||||||
|
type: 'richText',
|
||||||
|
editor: lexicalEditor({
|
||||||
|
features: ({ defaultFeatures }) => [
|
||||||
|
...defaultFeatures,
|
||||||
|
// The HTMLConverter Feature is the feature which manages the HTML serializers. If you do not pass any arguments to it, it will use the default serializers.
|
||||||
|
HTMLConverterFeature({}),
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
lexicalHTML('nameOfYourRichTextField', { name: 'nameOfYourRichTextField_html' }),
|
||||||
|
],
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
The `lexicalHTML()` function creates a new field that automatically converts the referenced lexical richText field into HTML through an afterRead hook.
|
||||||
|
|
||||||
|
#### Generating HTML in the Frontend:
|
||||||
|
|
||||||
|
If you wish to convert JSON to HTML ad-hoc, use this code snippet:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import type { SerializedEditorState } from 'lexical'
|
||||||
|
import {
|
||||||
|
type SanitizedEditorConfig,
|
||||||
|
convertLexicalToHTML,
|
||||||
|
consolidateHTMLConverters,
|
||||||
|
} from '@payloadcms/richtext-lexical'
|
||||||
|
|
||||||
|
async function lexicalToHTML(editorData: SerializedEditorState, editorConfig: SanitizedEditorConfig) {
|
||||||
|
return await convertLexicalToHTML({
|
||||||
|
converters: consolidateHTMLConverters({ editorConfig }),
|
||||||
|
data: editorData,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
```
|
||||||
|
This method employs `convertLexicalToHTML` from `@payloadcms/richtext-lexical`, which converts the serialized editor state into HTML.
|
||||||
|
|
||||||
|
Because every `Feature` is able to provide html converters, and because the `htmlFeature` can modify those or provide their own, we need to consolidate them with the default html Converters using the `consolidateHTMLConverters` function.
|
||||||
|
|
||||||
|
#### Creating your own HTML Converter
|
||||||
|
|
||||||
|
HTML Converters are typed as `HTMLConverter`, which contains the node type it should handle, and a function that accepts the serialized node from the lexical editor, and outputs the HTML string. Here's the HTML Converter of the Upload node as an example:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import type { HTMLConverter } from '@payloadcms/richtext-lexical'
|
||||||
|
import payload from 'payload'
|
||||||
|
|
||||||
|
const UploadHTMLConverter: HTMLConverter<SerializedUploadNode> = {
|
||||||
|
converter: async ({ node }) => {
|
||||||
|
const uploadDocument = await payload.findByID({
|
||||||
|
id: node.value.id,
|
||||||
|
collection: node.relationTo,
|
||||||
|
})
|
||||||
|
const url = (payload?.config?.serverURL || '') + uploadDocument?.url
|
||||||
|
|
||||||
|
if (!(uploadDocument?.mimeType as string)?.startsWith('image')) {
|
||||||
|
// Only images can be serialized as HTML
|
||||||
|
return ``
|
||||||
|
}
|
||||||
|
|
||||||
|
return `<img src="${url}" alt="${uploadDocument?.filename}" width="${uploadDocument?.width}" height="${uploadDocument?.height}"/>`
|
||||||
|
},
|
||||||
|
nodeTypes: [UploadNode.getType()], // This is the type of the lexical node that this converter can handle. Instead of hardcoding 'upload' we can get the node type directly from the UploadNode, since it's static.
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
As you can see, we have access to all the information saved in the node (for the Upload node, this is `value`and `relationTo`) and we can use that to generate the HTML.
|
||||||
|
|
||||||
|
The `convertLexicalToHTML` is part of `@payloadcms/richtext-lexical` automatically handles traversing the editor state and calling the correct converter for each node.
|
||||||
|
|
||||||
|
#### Embedding the HTML Converter in your Feature
|
||||||
|
|
||||||
|
You can embed your HTML Converter directly within your custom `Feature`, allowing it to be handled automatically by the `consolidateHTMLConverters` function. Here is an example:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
export const UploadFeature = (props?: UploadFeatureProps): FeatureProvider => {
|
||||||
|
return {
|
||||||
|
feature: () => {
|
||||||
|
return {
|
||||||
|
nodes: [
|
||||||
|
{
|
||||||
|
converters: {
|
||||||
|
html: yourHTMLConverter, // <= This is where you define your HTML Converter
|
||||||
|
},
|
||||||
|
node: UploadNode,
|
||||||
|
type: UploadNode.getType(),
|
||||||
|
//...
|
||||||
|
},
|
||||||
|
],
|
||||||
|
plugins: [/*...*/],
|
||||||
|
props: props,
|
||||||
|
slashMenu: {/*...*/},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
key: 'upload',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Headless Editor
|
||||||
|
|
||||||
|
Lexical provides a seamless way to perform conversions between various other formats:
|
||||||
|
- HTML to Lexical (or, importing HTML into the lexical editor)
|
||||||
|
- Markdown to Lexical (or, importing Markdown into the lexical editor)
|
||||||
|
- Lexical to Markdown
|
||||||
|
|
||||||
|
A headless editor can perform such conversions outside of the main editor instance. Follow this method to initiate a headless editor:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createHeadlessEditor } from '@lexical/headless' // <= make sure this package is installed
|
||||||
|
import {
|
||||||
|
getEnabledNodes,
|
||||||
|
sanitizeEditorConfig,
|
||||||
|
} from '@payloadcms/richtext-lexical'
|
||||||
|
|
||||||
|
const yourEditorConfig; // <= your editor config here
|
||||||
|
|
||||||
|
const headlessEditor = await createHeadlessEditor({
|
||||||
|
nodes: getEnabledNodes({
|
||||||
|
editorConfig: sanitizeEditorConfig(yourEditorConfig),
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### HTML => Lexical
|
||||||
|
|
||||||
|
Once you have your headless editor instance, you can use it to convert HTML to Lexical:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { $generateNodesFromDOM } from '@lexical/html'
|
||||||
|
import { $getRoot,$getSelection } from 'lexical'
|
||||||
|
|
||||||
|
headlessEditor.update(() => {
|
||||||
|
// In a headless environment you can use a package such as JSDom to parse the HTML string.
|
||||||
|
const dom = new JSDOM(htmlString)
|
||||||
|
|
||||||
|
// Once you have the DOM instance it's easy to generate LexicalNodes.
|
||||||
|
const nodes = $generateNodesFromDOM(editor, dom.window.document)
|
||||||
|
|
||||||
|
// Select the root
|
||||||
|
$getRoot().select()
|
||||||
|
|
||||||
|
// Insert them at a selection.
|
||||||
|
const selection = $getSelection()
|
||||||
|
selection.insertNodes(nodes)
|
||||||
|
}, { discrete: true })
|
||||||
|
|
||||||
|
// Do this if you then want to get the editor JSON
|
||||||
|
const editorJSON = headlessEditor.getEditorState().toJSON()
|
||||||
|
```
|
||||||
|
|
||||||
|
This has been taken from the [lexical serialization & deserialization docs](https://lexical.dev/docs/concepts/serialization#html---lexical).
|
||||||
|
|
||||||
|
<Banner type="success">
|
||||||
|
<strong>Note:</strong>
|
||||||
|
<br />
|
||||||
|
Using the <code>discrete: true</code> flag ensures instant updates to the editor state. If immediate reading of the updated state isn't necessary, you can omit the flag.
|
||||||
|
</Banner>
|
||||||
|
|
||||||
|
### Markdown => Lexical
|
||||||
|
|
||||||
|
Convert markdown content to the Lexical editor format with the following:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { $convertFromMarkdownString } from '@lexical/markdown'
|
||||||
|
import { sanitizeEditorConfig } from '@payloadcms/richtext-lexical'
|
||||||
|
|
||||||
|
const yourSanitizedEditorConfig = sanitizeEditorConfig(yourEditorConfig) // <= your editor config here
|
||||||
|
const markdown = `# Hello World`
|
||||||
|
|
||||||
|
headlessEditor.update(() => { $convertFromMarkdownString(markdown, yourSanitizedEditorConfig.features.markdownTransformers) }, { discrete: true })
|
||||||
|
|
||||||
|
// Do this if you then want to get the editor JSON
|
||||||
|
const editorJSON = headlessEditor.getEditorState().toJSON()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Lexical => Markdown
|
||||||
|
|
||||||
|
Export content from the Lexical editor into Markdown format using these steps:
|
||||||
|
|
||||||
|
1. Import your current editor state into the headless editor.
|
||||||
|
2. Convert and fetch the resulting markdown string.
|
||||||
|
|
||||||
|
Here's the code for it:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { $convertToMarkdownString } from '@lexical/markdown'
|
||||||
|
import { sanitizeEditorConfig } from '@payloadcms/richtext-lexical'
|
||||||
|
import type { SerializedEditorState } from "lexical"
|
||||||
|
|
||||||
|
const yourSanitizedEditorConfig = sanitizeEditorConfig(yourEditorConfig) // <= your editor config here
|
||||||
|
const yourEditorState: SerializedEditorState // <= your current editor state here
|
||||||
|
|
||||||
|
// Import editor state into your headless editor
|
||||||
|
try {
|
||||||
|
headlessEditor.setEditorState(headlessEditor.parseEditorState(yourEditorState)) // This should commit the editor state immediately
|
||||||
|
} catch (e) {
|
||||||
|
logger.error({ err: e }, 'ERROR parsing editor state')
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// Export to markdown
|
||||||
|
let markdown: string
|
||||||
|
headlessEditor.getEditorState().read(() => {
|
||||||
|
markdown = $convertToMarkdownString(yourSanitizedEditorConfig?.features?.markdownTransformers)
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
The `.setEditorState()` function immediately updates your editor state. Thus, there's no need for the `discrete: true` flag when reading the state afterward.
|
||||||
|
|
||||||
|
## Migrating from Slate
|
||||||
|
|
||||||
|
While both Slate and Lexical save the editor state in JSON, the structure of the JSON is different.
|
||||||
|
|
||||||
|
### Migration via SlateToLexicalFeature
|
||||||
|
|
||||||
|
One way to handle this is to just give your lexical editor the ability to read the slate JSON.
|
||||||
|
|
||||||
|
Simply add the `SlateToLexicalFeature` to your editor:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import type { CollectionConfig } from 'payload/types'
|
||||||
|
|
||||||
|
import {
|
||||||
|
SlateToLexicalFeature,
|
||||||
|
lexicalEditor,
|
||||||
|
} from '@payloadcms/richtext-lexical'
|
||||||
|
|
||||||
|
const Pages: CollectionConfig = {
|
||||||
|
slug: 'pages',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'nameOfYourRichTextField',
|
||||||
|
type: 'richText',
|
||||||
|
editor: lexicalEditor({
|
||||||
|
features: ({ defaultFeatures }) => [
|
||||||
|
...defaultFeatures,
|
||||||
|
SlateToLexicalFeature({})
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
and done! Now, everytime this lexical editor is initialized, it converts the slate date to lexical on-the-fly. If the data is already in lexical format, it will just pass it through.
|
||||||
|
|
||||||
|
This is by far the easiest way to migrate from Slate to Lexical, although it does come with a few caveats:
|
||||||
|
- There is a performance hit when initializing the lexical editor
|
||||||
|
- The editor will still output the Slate data in the output JSON, as the on-the-fly converter only runs for the admin panel
|
||||||
|
|
||||||
|
The easy way to solve this: Just save the document! This overrides the slate data with the lexical data, and the next time the document is loaded, the lexical data will be used. This solves both the performance and the output issue for that specific document.
|
||||||
|
|
||||||
|
### Migration via migration script
|
||||||
|
|
||||||
|
The method described above does not solve the issue for all documents, though. If you want to convert all your documents to lexical, you can use a migration script. Here's a simple example:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import type { Payload } from 'payload'
|
||||||
|
import type { YourDocumentType } from 'payload/generated-types'
|
||||||
|
|
||||||
|
import {
|
||||||
|
cloneDeep,
|
||||||
|
convertSlateToLexical,
|
||||||
|
defaultSlateConverters,
|
||||||
|
} from '@payloadcms/richtext-lexical'
|
||||||
|
|
||||||
|
import { AnotherCustomConverter } from './lexicalFeatures/converters/AnotherCustomConverter'
|
||||||
|
|
||||||
|
export async function convertAll(payload: Payload, collectionName: string, fieldName: string) {
|
||||||
|
const docs: YourDocumentType[] = await payload.db.collections[collectionName].find({}).exec() // Use MongoDB models directly to query all documents at once
|
||||||
|
console.log(`Found ${docs.length} ${collectionName} docs`)
|
||||||
|
|
||||||
|
const converters = cloneDeep([...defaultSlateConverters, AnotherCustomConverter])
|
||||||
|
|
||||||
|
// Split docs into batches of 20.
|
||||||
|
const batchSize = 20
|
||||||
|
const batches = []
|
||||||
|
for (let i = 0; i < docs.length; i += batchSize) {
|
||||||
|
batches.push(docs.slice(i, i + batchSize))
|
||||||
|
}
|
||||||
|
|
||||||
|
let processed = 0 // Number of processed docs
|
||||||
|
|
||||||
|
for (const batch of batches) {
|
||||||
|
// Process each batch asynchronously
|
||||||
|
const promises = batch.map(async (doc: YourDocumentType) => {
|
||||||
|
const richText = doc[fieldName]
|
||||||
|
|
||||||
|
if (richText && Array.isArray(richText) && !('root' in richText)) { // It's Slate data - skip already-converted data
|
||||||
|
const converted = convertSlateToLexical({
|
||||||
|
converters: converters,
|
||||||
|
slateData: richText,
|
||||||
|
})
|
||||||
|
|
||||||
|
await payload.update({
|
||||||
|
id: doc.id,
|
||||||
|
collection: collectionName as any,
|
||||||
|
data: {
|
||||||
|
[fieldName]: converted,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Wait for all promises in the batch to complete. Resolving batches of 20 asynchronously is faster than waiting for each doc to update individually
|
||||||
|
await Promise.all(promises)
|
||||||
|
|
||||||
|
// Update the count of processed docs
|
||||||
|
processed += batch.length
|
||||||
|
console.log(`Converted ${processed} of ${docs.length}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The `convertSlateToLexical` is the same method used in the `SlateToLexicalFeature` - it handles traversing the Slate JSON for you.
|
||||||
|
|
||||||
|
Do note that this script might require adjustment depending on your document structure, especially if you have nested richText fields or localization enabled.
|
||||||
|
|
||||||
|
### Converting custom Slate nodes
|
||||||
|
|
||||||
|
If you have custom Slate nodes, create a custom converter for them. Here's the Upload converter as an example:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import type { SerializedUploadNode } from '../uploadNode.'
|
||||||
|
import type { SlateNodeConverter } from '@payloadcms/richtext-lexical'
|
||||||
|
|
||||||
|
export const SlateUploadConverter: SlateNodeConverter = {
|
||||||
|
converter({ slateNode }) {
|
||||||
|
return {
|
||||||
|
fields: {
|
||||||
|
...slateNode.fields,
|
||||||
|
},
|
||||||
|
format: '',
|
||||||
|
relationTo: slateNode.relationTo,
|
||||||
|
type: 'upload',
|
||||||
|
value: {
|
||||||
|
id: slateNode.value?.id || '',
|
||||||
|
},
|
||||||
|
version: 1,
|
||||||
|
} as const as SerializedUploadNode
|
||||||
|
},
|
||||||
|
nodeTypes: ['upload'],
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
It's pretty simple: You get a Slate node as input, and you return the lexical node. The `nodeTypes` array is used to determine which Slate nodes this converter can handle.
|
||||||
|
|
||||||
|
When using a migration script, you can add your custom converters to the `converters` property of the `convertSlateToLexical` props, as seen in the example above
|
||||||
|
|
||||||
|
When using the `SlateToLexicalFeature`, you can add your custom converters to the `converters` property of the `SlateToLexicalFeature` props:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import type { CollectionConfig } from 'payload/types'
|
||||||
|
|
||||||
|
import {
|
||||||
|
SlateToLexicalFeature,
|
||||||
|
lexicalEditor,
|
||||||
|
defaultSlateConverters
|
||||||
|
} from '@payloadcms/richtext-lexical'
|
||||||
|
|
||||||
|
import { YourCustomConverter } from '../converters/YourCustomConverter'
|
||||||
|
|
||||||
|
const Pages: CollectionConfig = {
|
||||||
|
slug: 'pages',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'nameOfYourRichTextField',
|
||||||
|
type: 'richText',
|
||||||
|
editor: lexicalEditor({
|
||||||
|
features: ({ defaultFeatures }) => [
|
||||||
|
...defaultFeatures,
|
||||||
|
SlateToLexicalFeature({
|
||||||
|
converters: [
|
||||||
|
...defaultSlateConverters,
|
||||||
|
YourCustomConverter
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Migrating from payload-plugin-lexical
|
||||||
|
|
||||||
|
Migrating from [payload-plugin-lexical](https://github.com/AlessioGr/payload-plugin-lexical) works similar to migrating from Slate.
|
||||||
|
|
||||||
|
Instead of a `SlateToLexicalFeature` there is a `LexicalPluginToLexicalFeature` you can use. And instead of `convertSlateToLexical` you can use `convertLexicalPluginToLexical`.
|
||||||
|
|
||||||
|
## Coming Soon
|
||||||
|
|
||||||
Lots more documentation will be coming soon, which will show in detail how to create your own custom features within Lexical.
|
Lots more documentation will be coming soon, which will show in detail how to create your own custom features within Lexical.
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,32 @@ payload generate:types
|
|||||||
|
|
||||||
You can run this command whenever you need to regenerate your types, and then you can use these types in your Payload code directly.
|
You can run this command whenever you need to regenerate your types, and then you can use these types in your Payload code directly.
|
||||||
|
|
||||||
|
### Disable declare statement
|
||||||
|
|
||||||
|
By default, `generate:types` will add a `declare` statement to your types file, which automatically enables type inference within Payload.
|
||||||
|
|
||||||
|
If you are using your `payload-types.ts` file in other repos, though, it might be better to disable this `declare` statement, so that you don't get any TS errors in projects that use your Payload types, but do not have Payload installed.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// payload.config.ts
|
||||||
|
{
|
||||||
|
// ...
|
||||||
|
typescript: {
|
||||||
|
declare: false, // defaults to true if not set
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
If you do disable the `declare` pattern, you'll need to manually add a `declare` statement to your code in order for Payload types to be recognized. Here's an example showing how to declare your types in your `payload.config.ts` file:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { Config } from './payload-types'
|
||||||
|
|
||||||
|
declare module 'payload' {
|
||||||
|
export interface GeneratedTypes extends Config {}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Custom output file path
|
### Custom output file path
|
||||||
|
|
||||||
You can specify where you want your types to be generated by adding a property to your Payload config:
|
You can specify where you want your types to be generated by adding a property to your Payload config:
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ Every Payload Collection can opt-in to supporting Uploads by specifying the `upl
|
|||||||
| **`mimeTypes`** | Restrict mimeTypes in the file picker. Array of valid mimetypes or mimetype wildcards [More](#mimetypes) |
|
| **`mimeTypes`** | Restrict mimeTypes in the file picker. Array of valid mimetypes or mimetype wildcards [More](#mimetypes) |
|
||||||
| **`staticOptions`** | Set options for `express.static` to use while serving your static files. [More](http://expressjs.com/en/resources/middleware/serve-static.html) format) |
|
| **`staticOptions`** | Set options for `express.static` to use while serving your static files. [More](http://expressjs.com/en/resources/middleware/serve-static.html) format) |
|
||||||
| **`resizeOptions`** | An object passed to the the Sharp image library to resize the uploaded file. [More](https://sharp.pixelplumbing.com/api-resize) |
|
| **`resizeOptions`** | An object passed to the the Sharp image library to resize the uploaded file. [More](https://sharp.pixelplumbing.com/api-resize) |
|
||||||
|
| **`filesRequiredOnCreate`** | Mandate file data on creation, default is true. |
|
||||||
|
|
||||||
_An asterisk denotes that a property above is required._
|
_An asterisk denotes that a property above is required._
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Collections and Globals both support the same options for configuring autosave.
|
|||||||
|
|
||||||
| Drafts Autosave Options | Description |
|
| Drafts Autosave Options | Description |
|
||||||
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `interval` | Define an `interval` in milliseconds to automatically save progress while documents are edited. Document updates are "debounced" at this interval. Defaults to `2000`. |
|
| `interval` | Define an `interval` in milliseconds to automatically save progress while documents are edited. Document updates are "debounced" at this interval. Defaults to `800`. |
|
||||||
|
|
||||||
**Example config with versions, drafts, and autosave enabled:**
|
**Example config with versions, drafts, and autosave enabled:**
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ When `autosave` is enabled, all `update` operations within Payload expose a new
|
|||||||
|
|
||||||
#### How autosaves are stored
|
#### How autosaves are stored
|
||||||
|
|
||||||
If we created a new version for each autosave, you'd quickly find a ton of autosaves that clutter up your `_versions` collection within the database. That would be messy quick because `autosave` is typically set to save a document every ~2000ms or so.
|
If we created a new version for each autosave, you'd quickly find a ton of autosaves that clutter up your `_versions` collection within the database. That would be messy quick because `autosave` is typically set to save a document at ~800ms intervals.
|
||||||
|
|
||||||
<Banner type="success">
|
<Banner type="success">
|
||||||
Instead of creating a new version each time a document is autosaved, Payload smartly only creates{' '}
|
Instead of creating a new version each time a document is autosaved, Payload smartly only creates{' '}
|
||||||
|
|||||||
@@ -21,16 +21,6 @@ export default buildConfig({
|
|||||||
components: {
|
components: {
|
||||||
beforeLogin: [BeforeLogin],
|
beforeLogin: [BeforeLogin],
|
||||||
},
|
},
|
||||||
webpack: config => ({
|
|
||||||
...config,
|
|
||||||
resolve: {
|
|
||||||
...config.resolve,
|
|
||||||
alias: {
|
|
||||||
...config.resolve.alias,
|
|
||||||
dotenv: path.resolve(__dirname, './dotenv.js'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
editor: slateEditor({}),
|
editor: slateEditor({}),
|
||||||
db: mongooseAdapter({
|
db: mongooseAdapter({
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const start = async (): Promise<void> => {
|
|||||||
app.listen(PORT, async () => {
|
app.listen(PORT, async () => {
|
||||||
payload.logger.info(`Next.js is now building...`)
|
payload.logger.info(`Next.js is now building...`)
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
await nextBuild(path.join(__dirname, '../'))
|
await nextBuild(path.join(__dirname, '..'))
|
||||||
process.exit()
|
process.exit()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"next": "^13.4.8",
|
"next": "^13.5.0",
|
||||||
"payload-admin-bar": "^1.0.6",
|
"payload-admin-bar": "^1.0.6",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-dom": "18.2.0"
|
"react-dom": "18.2.0"
|
||||||
|
|||||||
@@ -65,10 +65,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
|
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
|
||||||
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
|
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
|
||||||
|
|
||||||
"@next/env@13.4.8":
|
"@next/env@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/env/-/env-13.4.8.tgz#8048ef3c3d770a3f3d1dd51d159593acfbd4e517"
|
resolved "https://registry.yarnpkg.com/@next/env/-/env-13.5.0.tgz#a61dee2f29b09985847eabcc4c8a815031267a36"
|
||||||
integrity sha512-twuSf1klb3k9wXI7IZhbZGtFCWvGD4wXTY2rmvzIgVhXhs7ISThrbNyutBx3jWIL8Y/Hk9+woytFz5QsgtcRKQ==
|
integrity sha512-mxhf/BskjPURT+qEjNP7wBvqre2q6OXEIbydF8BrH+duSSJQnB4/vzzuJDoahYwTXiUaXpouAnMWHZdG0HU62g==
|
||||||
|
|
||||||
"@next/eslint-plugin-next@13.4.3":
|
"@next/eslint-plugin-next@13.4.3":
|
||||||
version "13.4.3"
|
version "13.4.3"
|
||||||
@@ -84,50 +84,50 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
glob "7.1.7"
|
glob "7.1.7"
|
||||||
|
|
||||||
"@next/swc-darwin-arm64@13.4.8":
|
"@next/swc-darwin-arm64@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.4.8.tgz#3838d7c96750b7f427ac47b97503fc013734f6e6"
|
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.5.0.tgz#45ea191e13593088572d0048d4ddfc1fcdb3c8ed"
|
||||||
integrity sha512-MSFplVM4dTWOuKAUv0XR9gY7AWtMSBu9os9f+kp+s5rWhM1I2CdR3obFttd6366nS/W/VZxbPM5oEIdlIa46zA==
|
integrity sha512-DavPD8oRjSoCRJana5DCAWdRZ4nbS7/pPw13DlnukFfMPJUk5hCAC3+NbqEyekS/X1IBFdZWSV2lJIdzTn4s6w==
|
||||||
|
|
||||||
"@next/swc-darwin-x64@13.4.8":
|
"@next/swc-darwin-x64@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.4.8.tgz#3de9c26a2ee7b189f22433bf8137256a2517f258"
|
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.5.0.tgz#582e8df7d563c057581bc118fff1cea79391d6e7"
|
||||||
integrity sha512-Reox+UXgonon9P0WNDE6w85DGtyBqGitl/ryznOvn6TvfxEaZIpTgeu3ZrJLU9dHSMhiK7YAM793mE/Zii2/Qw==
|
integrity sha512-s5QSKKB0CTKFWp3CNMC5GH1YOipH1Jjr5P3w+RQTC4Aybo6xPqeWp/UyDW0fxmLRq0e1zgnOMgDQRdxAkoThrw==
|
||||||
|
|
||||||
"@next/swc-linux-arm64-gnu@13.4.8":
|
"@next/swc-linux-arm64-gnu@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.4.8.tgz#9536314c931b9e78f20e4a424eace9993015c6e1"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.5.0.tgz#7ee0a43b6635eca1e80a887304b7bfe31254a4a6"
|
||||||
integrity sha512-kdyzYvAYtqQVgzIKNN7e1rLU8aZv86FDSRqPlOkKZlvqudvTO0iohuTPmnEEDlECeBM6qRPShNffotDcU/R2KA==
|
integrity sha512-E0fCKA8F2vfgZWwcv4iq642No75EiACSNUBNGvc5lx/ylqAUdNwE/9+x2SHv+LPUXFhZ6hZLR0Qox/oKgZqFlg==
|
||||||
|
|
||||||
"@next/swc-linux-arm64-musl@13.4.8":
|
"@next/swc-linux-arm64-musl@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.4.8.tgz#a894ec6a078edd28f5cfab60593a61e05b6b605b"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.5.0.tgz#99a1efd6b68a4d0dfdc24b81f14cd8b8251425a9"
|
||||||
integrity sha512-oWxx4yRkUGcR81XwbI+T0zhZ3bDF6V1aVLpG+C7hSG50ULpV8gC39UxVO22/bv93ZlcfMY4zl8xkz9Klct6dpQ==
|
integrity sha512-jG/blDDLndFRUcafCQO4TOI3VuoIZh3jQriZ7JaVCgAEZe0D1EUrxKdbBarZ74isutHZ6DpNGRDi/0OHFZpJAA==
|
||||||
|
|
||||||
"@next/swc-linux-x64-gnu@13.4.8":
|
"@next/swc-linux-x64-gnu@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.4.8.tgz#b8af198dc0b4a8c64deb0494ae285e3e1a465910"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.5.0.tgz#7c85acd45879a20d8fb102b3212e792924d02e93"
|
||||||
integrity sha512-anhtvuO6eE9YRhYnaEGTfbpH3L5gT/9qPFcNoi6xS432r/4DAtpJY8kNktqkTVevVIC/pVumqO8tV59PR3zbNg==
|
integrity sha512-6JWR7U41uNL6HGwNbGg3Oedt+FN4YuA126sHWKTq3ic5kkhEusIIdVo7+WcswVJl8nTMB1yT3gEPwygQbVYVUA==
|
||||||
|
|
||||||
"@next/swc-linux-x64-musl@13.4.8":
|
"@next/swc-linux-x64-musl@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.4.8.tgz#d2ad24001020665a78405f595995c22750ec63c4"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.5.0.tgz#23aad9ab7621f53bb947b727e659d85e74b0e31a"
|
||||||
integrity sha512-aR+J4wWfNgH1DwCCBNjan7Iumx0lLtn+2/rEYuhIrYLY4vnxqSVGz9u3fXcgUwo6Q9LT8NFkaqK1vPprdq+BXg==
|
integrity sha512-uY+wrYfD5QUossqznwidOpJYmmcBwojToZx55shihtbTl6afVYzOxsUbRXLdWmZAa36ckxXpqkvuFNS8icQuug==
|
||||||
|
|
||||||
"@next/swc-win32-arm64-msvc@13.4.8":
|
"@next/swc-win32-arm64-msvc@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.4.8.tgz#e5c4bfaa105fbe2bdb21a6d01467edd39a29cf37"
|
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.5.0.tgz#5a45686335e5f54342faf9d9ed25f55a4107ce7f"
|
||||||
integrity sha512-OWBKIrJwQBTqrat0xhxEB/jcsjJR3+diD9nc/Y8F1mRdQzsn4bPsomgJyuqPVZs6Lz3K18qdIkvywmfSq75SsQ==
|
integrity sha512-lWZ5vJTULxTOdLcRmrllNgAdDRSDwk8oqJMyDxpqS691NG5uhle9ZwRj3g1F1/vHNkDa+B7PmWhQgG0nmlbKZg==
|
||||||
|
|
||||||
"@next/swc-win32-ia32-msvc@13.4.8":
|
"@next/swc-win32-ia32-msvc@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.4.8.tgz#c49c4d9f91845855bf544d5d14e8e13311da9931"
|
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.5.0.tgz#b9990965762aaa109bdeb7b49cbdc7e4af7f9014"
|
||||||
integrity sha512-agiPWGjUndXGTOn4ChbKipQXRA6/UPkywAWIkx7BhgGv48TiJfHTK6MGfBoL9tS6B4mtW39++uy0wFPnfD0JWg==
|
integrity sha512-jirQXnVCU9hi3cHzgd33d4qSBXn1/0gUT/KtXqy9Ux9OTcIcjJT3TcAzoLJLTdhRg7op3MZoSnuFeWl8kmGGNw==
|
||||||
|
|
||||||
"@next/swc-win32-x64-msvc@13.4.8":
|
"@next/swc-win32-x64-msvc@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.4.8.tgz#22c5c8fa05680f2775a29c6c5a74cf04b8cc9d90"
|
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.5.0.tgz#4385c5d9c0db39c2623aed566b3ec7fedaf6f190"
|
||||||
integrity sha512-UIRKoByVKbuR6SnFG4JM8EMFlJrfEGuUQ1ihxzEleWcNwRMMiVaCj1KyqfTOW8VTQhJ0u8P1Ngg6q1RwnIBTtw==
|
integrity sha512-Q8QYLyWcMMUp3DohI04VyJbLNCfFMNTxYNhujvJD2lowuqnqApUBP2DxI/jCZRMFWgKi76n5u8UboLVeYXn6jA==
|
||||||
|
|
||||||
"@nodelib/fs.scandir@2.1.5":
|
"@nodelib/fs.scandir@2.1.5":
|
||||||
version "2.1.5"
|
version "2.1.5"
|
||||||
@@ -172,10 +172,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.3.2.tgz#31b9c510d8cada9683549e1dbb4284cca5001faf"
|
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.3.2.tgz#31b9c510d8cada9683549e1dbb4284cca5001faf"
|
||||||
integrity sha512-V+MvGwaHH03hYhY+k6Ef/xKd6RYlc4q8WBx+2ANmipHJcKuktNcI/NgEsJgdSUF6Lw32njT6OnrRsKYCdgHjYw==
|
integrity sha512-V+MvGwaHH03hYhY+k6Ef/xKd6RYlc4q8WBx+2ANmipHJcKuktNcI/NgEsJgdSUF6Lw32njT6OnrRsKYCdgHjYw==
|
||||||
|
|
||||||
"@swc/helpers@0.5.1":
|
"@swc/helpers@0.5.2":
|
||||||
version "0.5.1"
|
version "0.5.2"
|
||||||
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.1.tgz#e9031491aa3f26bfcc974a67f48bd456c8a5357a"
|
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.2.tgz#85ea0c76450b61ad7d10a37050289eded783c27d"
|
||||||
integrity sha512-sJ902EfIzn1Fa+qYmjdQqh8tPsoxyBz+8yBKC2HKUxyezKJFwPGOn7pv4WY6QuQW//ySQi5lJjA/ZT9sNWWNTg==
|
integrity sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^2.4.0"
|
tslib "^2.4.0"
|
||||||
|
|
||||||
@@ -1729,13 +1729,13 @@ natural-compare@^1.4.0:
|
|||||||
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
||||||
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
|
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
|
||||||
|
|
||||||
next@^13.4.8:
|
next@^13.5.0:
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/next/-/next-13.4.8.tgz#72245bf4fdf328970147ee30de97142c39b1cb3f"
|
resolved "https://registry.yarnpkg.com/next/-/next-13.5.0.tgz#3a3ce5b8c89c4fff9c6f0b2452bcb03f63d8c84c"
|
||||||
integrity sha512-lxUjndYKjZHGK3CWeN2RI+/6ni6EUvjiqGWXAYPxUfGIdFGQ5XoisrqAJ/dF74aP27buAfs8MKIbIMMdxjqSBg==
|
integrity sha512-mhguN5JPZXhhrD/nNcezXgKoxN8GT8xZvvGhUQV2ETiaNm+KHRWT1rCbrF5FlbG2XCcLRKOmOe3D5YQgXmJrDQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@next/env" "13.4.8"
|
"@next/env" "13.5.0"
|
||||||
"@swc/helpers" "0.5.1"
|
"@swc/helpers" "0.5.2"
|
||||||
busboy "1.6.0"
|
busboy "1.6.0"
|
||||||
caniuse-lite "^1.0.30001406"
|
caniuse-lite "^1.0.30001406"
|
||||||
postcss "8.4.14"
|
postcss "8.4.14"
|
||||||
@@ -1743,15 +1743,15 @@ next@^13.4.8:
|
|||||||
watchpack "2.4.0"
|
watchpack "2.4.0"
|
||||||
zod "3.21.4"
|
zod "3.21.4"
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
"@next/swc-darwin-arm64" "13.4.8"
|
"@next/swc-darwin-arm64" "13.5.0"
|
||||||
"@next/swc-darwin-x64" "13.4.8"
|
"@next/swc-darwin-x64" "13.5.0"
|
||||||
"@next/swc-linux-arm64-gnu" "13.4.8"
|
"@next/swc-linux-arm64-gnu" "13.5.0"
|
||||||
"@next/swc-linux-arm64-musl" "13.4.8"
|
"@next/swc-linux-arm64-musl" "13.5.0"
|
||||||
"@next/swc-linux-x64-gnu" "13.4.8"
|
"@next/swc-linux-x64-gnu" "13.5.0"
|
||||||
"@next/swc-linux-x64-musl" "13.4.8"
|
"@next/swc-linux-x64-musl" "13.5.0"
|
||||||
"@next/swc-win32-arm64-msvc" "13.4.8"
|
"@next/swc-win32-arm64-msvc" "13.5.0"
|
||||||
"@next/swc-win32-ia32-msvc" "13.4.8"
|
"@next/swc-win32-ia32-msvc" "13.5.0"
|
||||||
"@next/swc-win32-x64-msvc" "13.4.8"
|
"@next/swc-win32-x64-msvc" "13.5.0"
|
||||||
|
|
||||||
normalize-path@^3.0.0, normalize-path@~3.0.0:
|
normalize-path@^3.0.0, normalize-path@~3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"next": "^13.4.8",
|
"next": "^13.5.0",
|
||||||
"payload-admin-bar": "^1.0.6",
|
"payload-admin-bar": "^1.0.6",
|
||||||
"qs": "^6.11.0",
|
"qs": "^6.11.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
|
|||||||
@@ -53,10 +53,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
|
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
|
||||||
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
|
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
|
||||||
|
|
||||||
"@next/env@13.4.8":
|
"@next/env@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/env/-/env-13.4.8.tgz#8048ef3c3d770a3f3d1dd51d159593acfbd4e517"
|
resolved "https://registry.yarnpkg.com/@next/env/-/env-13.5.0.tgz#a61dee2f29b09985847eabcc4c8a815031267a36"
|
||||||
integrity sha512-twuSf1klb3k9wXI7IZhbZGtFCWvGD4wXTY2rmvzIgVhXhs7ISThrbNyutBx3jWIL8Y/Hk9+woytFz5QsgtcRKQ==
|
integrity sha512-mxhf/BskjPURT+qEjNP7wBvqre2q6OXEIbydF8BrH+duSSJQnB4/vzzuJDoahYwTXiUaXpouAnMWHZdG0HU62g==
|
||||||
|
|
||||||
"@next/eslint-plugin-next@^13.4.8":
|
"@next/eslint-plugin-next@^13.4.8":
|
||||||
version "13.4.8"
|
version "13.4.8"
|
||||||
@@ -65,50 +65,50 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
glob "7.1.7"
|
glob "7.1.7"
|
||||||
|
|
||||||
"@next/swc-darwin-arm64@13.4.8":
|
"@next/swc-darwin-arm64@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.4.8.tgz#3838d7c96750b7f427ac47b97503fc013734f6e6"
|
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.5.0.tgz#45ea191e13593088572d0048d4ddfc1fcdb3c8ed"
|
||||||
integrity sha512-MSFplVM4dTWOuKAUv0XR9gY7AWtMSBu9os9f+kp+s5rWhM1I2CdR3obFttd6366nS/W/VZxbPM5oEIdlIa46zA==
|
integrity sha512-DavPD8oRjSoCRJana5DCAWdRZ4nbS7/pPw13DlnukFfMPJUk5hCAC3+NbqEyekS/X1IBFdZWSV2lJIdzTn4s6w==
|
||||||
|
|
||||||
"@next/swc-darwin-x64@13.4.8":
|
"@next/swc-darwin-x64@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.4.8.tgz#3de9c26a2ee7b189f22433bf8137256a2517f258"
|
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.5.0.tgz#582e8df7d563c057581bc118fff1cea79391d6e7"
|
||||||
integrity sha512-Reox+UXgonon9P0WNDE6w85DGtyBqGitl/ryznOvn6TvfxEaZIpTgeu3ZrJLU9dHSMhiK7YAM793mE/Zii2/Qw==
|
integrity sha512-s5QSKKB0CTKFWp3CNMC5GH1YOipH1Jjr5P3w+RQTC4Aybo6xPqeWp/UyDW0fxmLRq0e1zgnOMgDQRdxAkoThrw==
|
||||||
|
|
||||||
"@next/swc-linux-arm64-gnu@13.4.8":
|
"@next/swc-linux-arm64-gnu@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.4.8.tgz#9536314c931b9e78f20e4a424eace9993015c6e1"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.5.0.tgz#7ee0a43b6635eca1e80a887304b7bfe31254a4a6"
|
||||||
integrity sha512-kdyzYvAYtqQVgzIKNN7e1rLU8aZv86FDSRqPlOkKZlvqudvTO0iohuTPmnEEDlECeBM6qRPShNffotDcU/R2KA==
|
integrity sha512-E0fCKA8F2vfgZWwcv4iq642No75EiACSNUBNGvc5lx/ylqAUdNwE/9+x2SHv+LPUXFhZ6hZLR0Qox/oKgZqFlg==
|
||||||
|
|
||||||
"@next/swc-linux-arm64-musl@13.4.8":
|
"@next/swc-linux-arm64-musl@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.4.8.tgz#a894ec6a078edd28f5cfab60593a61e05b6b605b"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.5.0.tgz#99a1efd6b68a4d0dfdc24b81f14cd8b8251425a9"
|
||||||
integrity sha512-oWxx4yRkUGcR81XwbI+T0zhZ3bDF6V1aVLpG+C7hSG50ULpV8gC39UxVO22/bv93ZlcfMY4zl8xkz9Klct6dpQ==
|
integrity sha512-jG/blDDLndFRUcafCQO4TOI3VuoIZh3jQriZ7JaVCgAEZe0D1EUrxKdbBarZ74isutHZ6DpNGRDi/0OHFZpJAA==
|
||||||
|
|
||||||
"@next/swc-linux-x64-gnu@13.4.8":
|
"@next/swc-linux-x64-gnu@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.4.8.tgz#b8af198dc0b4a8c64deb0494ae285e3e1a465910"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.5.0.tgz#7c85acd45879a20d8fb102b3212e792924d02e93"
|
||||||
integrity sha512-anhtvuO6eE9YRhYnaEGTfbpH3L5gT/9qPFcNoi6xS432r/4DAtpJY8kNktqkTVevVIC/pVumqO8tV59PR3zbNg==
|
integrity sha512-6JWR7U41uNL6HGwNbGg3Oedt+FN4YuA126sHWKTq3ic5kkhEusIIdVo7+WcswVJl8nTMB1yT3gEPwygQbVYVUA==
|
||||||
|
|
||||||
"@next/swc-linux-x64-musl@13.4.8":
|
"@next/swc-linux-x64-musl@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.4.8.tgz#d2ad24001020665a78405f595995c22750ec63c4"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.5.0.tgz#23aad9ab7621f53bb947b727e659d85e74b0e31a"
|
||||||
integrity sha512-aR+J4wWfNgH1DwCCBNjan7Iumx0lLtn+2/rEYuhIrYLY4vnxqSVGz9u3fXcgUwo6Q9LT8NFkaqK1vPprdq+BXg==
|
integrity sha512-uY+wrYfD5QUossqznwidOpJYmmcBwojToZx55shihtbTl6afVYzOxsUbRXLdWmZAa36ckxXpqkvuFNS8icQuug==
|
||||||
|
|
||||||
"@next/swc-win32-arm64-msvc@13.4.8":
|
"@next/swc-win32-arm64-msvc@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.4.8.tgz#e5c4bfaa105fbe2bdb21a6d01467edd39a29cf37"
|
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.5.0.tgz#5a45686335e5f54342faf9d9ed25f55a4107ce7f"
|
||||||
integrity sha512-OWBKIrJwQBTqrat0xhxEB/jcsjJR3+diD9nc/Y8F1mRdQzsn4bPsomgJyuqPVZs6Lz3K18qdIkvywmfSq75SsQ==
|
integrity sha512-lWZ5vJTULxTOdLcRmrllNgAdDRSDwk8oqJMyDxpqS691NG5uhle9ZwRj3g1F1/vHNkDa+B7PmWhQgG0nmlbKZg==
|
||||||
|
|
||||||
"@next/swc-win32-ia32-msvc@13.4.8":
|
"@next/swc-win32-ia32-msvc@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.4.8.tgz#c49c4d9f91845855bf544d5d14e8e13311da9931"
|
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.5.0.tgz#b9990965762aaa109bdeb7b49cbdc7e4af7f9014"
|
||||||
integrity sha512-agiPWGjUndXGTOn4ChbKipQXRA6/UPkywAWIkx7BhgGv48TiJfHTK6MGfBoL9tS6B4mtW39++uy0wFPnfD0JWg==
|
integrity sha512-jirQXnVCU9hi3cHzgd33d4qSBXn1/0gUT/KtXqy9Ux9OTcIcjJT3TcAzoLJLTdhRg7op3MZoSnuFeWl8kmGGNw==
|
||||||
|
|
||||||
"@next/swc-win32-x64-msvc@13.4.8":
|
"@next/swc-win32-x64-msvc@13.5.0":
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.4.8.tgz#22c5c8fa05680f2775a29c6c5a74cf04b8cc9d90"
|
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.5.0.tgz#4385c5d9c0db39c2623aed566b3ec7fedaf6f190"
|
||||||
integrity sha512-UIRKoByVKbuR6SnFG4JM8EMFlJrfEGuUQ1ihxzEleWcNwRMMiVaCj1KyqfTOW8VTQhJ0u8P1Ngg6q1RwnIBTtw==
|
integrity sha512-Q8QYLyWcMMUp3DohI04VyJbLNCfFMNTxYNhujvJD2lowuqnqApUBP2DxI/jCZRMFWgKi76n5u8UboLVeYXn6jA==
|
||||||
|
|
||||||
"@nodelib/fs.scandir@2.1.5":
|
"@nodelib/fs.scandir@2.1.5":
|
||||||
version "2.1.5"
|
version "2.1.5"
|
||||||
@@ -136,10 +136,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@payloadcms/eslint-config/-/eslint-config-0.0.2.tgz#cadb97ccd6476204a38e057b3cf57dc80efb209f"
|
resolved "https://registry.yarnpkg.com/@payloadcms/eslint-config/-/eslint-config-0.0.2.tgz#cadb97ccd6476204a38e057b3cf57dc80efb209f"
|
||||||
integrity sha512-EcS7qyX4++eBP/MS4QgrFOzzplsVMaPDfEcxWYoH9OLJCUTlGz8UmfMZPWU7DeAuyehJdij+BywSrcprqun9rA==
|
integrity sha512-EcS7qyX4++eBP/MS4QgrFOzzplsVMaPDfEcxWYoH9OLJCUTlGz8UmfMZPWU7DeAuyehJdij+BywSrcprqun9rA==
|
||||||
|
|
||||||
"@swc/helpers@0.5.1":
|
"@swc/helpers@0.5.2":
|
||||||
version "0.5.1"
|
version "0.5.2"
|
||||||
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.1.tgz#e9031491aa3f26bfcc974a67f48bd456c8a5357a"
|
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.2.tgz#85ea0c76450b61ad7d10a37050289eded783c27d"
|
||||||
integrity sha512-sJ902EfIzn1Fa+qYmjdQqh8tPsoxyBz+8yBKC2HKUxyezKJFwPGOn7pv4WY6QuQW//ySQi5lJjA/ZT9sNWWNTg==
|
integrity sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^2.4.0"
|
tslib "^2.4.0"
|
||||||
|
|
||||||
@@ -1392,13 +1392,13 @@ natural-compare@^1.4.0:
|
|||||||
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
||||||
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
|
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
|
||||||
|
|
||||||
next@^13.4.8:
|
next@^13.5.0:
|
||||||
version "13.4.8"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/next/-/next-13.4.8.tgz#72245bf4fdf328970147ee30de97142c39b1cb3f"
|
resolved "https://registry.yarnpkg.com/next/-/next-13.5.0.tgz#3a3ce5b8c89c4fff9c6f0b2452bcb03f63d8c84c"
|
||||||
integrity sha512-lxUjndYKjZHGK3CWeN2RI+/6ni6EUvjiqGWXAYPxUfGIdFGQ5XoisrqAJ/dF74aP27buAfs8MKIbIMMdxjqSBg==
|
integrity sha512-mhguN5JPZXhhrD/nNcezXgKoxN8GT8xZvvGhUQV2ETiaNm+KHRWT1rCbrF5FlbG2XCcLRKOmOe3D5YQgXmJrDQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@next/env" "13.4.8"
|
"@next/env" "13.5.0"
|
||||||
"@swc/helpers" "0.5.1"
|
"@swc/helpers" "0.5.2"
|
||||||
busboy "1.6.0"
|
busboy "1.6.0"
|
||||||
caniuse-lite "^1.0.30001406"
|
caniuse-lite "^1.0.30001406"
|
||||||
postcss "8.4.14"
|
postcss "8.4.14"
|
||||||
@@ -1406,15 +1406,15 @@ next@^13.4.8:
|
|||||||
watchpack "2.4.0"
|
watchpack "2.4.0"
|
||||||
zod "3.21.4"
|
zod "3.21.4"
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
"@next/swc-darwin-arm64" "13.4.8"
|
"@next/swc-darwin-arm64" "13.5.0"
|
||||||
"@next/swc-darwin-x64" "13.4.8"
|
"@next/swc-darwin-x64" "13.5.0"
|
||||||
"@next/swc-linux-arm64-gnu" "13.4.8"
|
"@next/swc-linux-arm64-gnu" "13.5.0"
|
||||||
"@next/swc-linux-arm64-musl" "13.4.8"
|
"@next/swc-linux-arm64-musl" "13.5.0"
|
||||||
"@next/swc-linux-x64-gnu" "13.4.8"
|
"@next/swc-linux-x64-gnu" "13.5.0"
|
||||||
"@next/swc-linux-x64-musl" "13.4.8"
|
"@next/swc-linux-x64-musl" "13.5.0"
|
||||||
"@next/swc-win32-arm64-msvc" "13.4.8"
|
"@next/swc-win32-arm64-msvc" "13.5.0"
|
||||||
"@next/swc-win32-ia32-msvc" "13.4.8"
|
"@next/swc-win32-ia32-msvc" "13.5.0"
|
||||||
"@next/swc-win32-x64-msvc" "13.4.8"
|
"@next/swc-win32-x64-msvc" "13.5.0"
|
||||||
|
|
||||||
normalize-path@^3.0.0, normalize-path@~3.0.0:
|
normalize-path@^3.0.0, normalize-path@~3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Form Builder Example Front-End
|
# Form Builder Example Front-End
|
||||||
|
|
||||||
This is a [Next.js](https://nextjs.org) app using the [Pages Router](https://nextjs.org/docs/pages). It was made explicitly for Payload's [Form Builder Example](https://github.com/payloadcms/payload/tree/master/examples/form-builder/payload).
|
This is a [Next.js](https://nextjs.org) app using the [Pages Router](https://nextjs.org/docs/pages). It was made explicitly for Payload's [Form Builder Example](https://github.com/payloadcms/payload/tree/main/examples/form-builder/payload).
|
||||||
|
|
||||||
> This example uses the Pages Router, the legacy API of Next.js. If your app is using the latest [App Router](https://nextjs.org/docs/app), we will add an example for that soon.
|
> This example uses the Pages Router, the legacy API of Next.js. If your app is using the latest [App Router](https://nextjs.org/docs/app), we will add an example for that soon.
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ This is a [Next.js](https://nextjs.org) app using the [Pages Router](https://nex
|
|||||||
|
|
||||||
### Payload
|
### Payload
|
||||||
|
|
||||||
First you'll need a running Payload app. There is one made explicitly for this example and [can be found here](https://github.com/payloadcms/payload/tree/master/examples/form-builder/payload). If you have not done so already, clone it down and follow the setup instructions there.
|
First you'll need a running Payload app. There is one made explicitly for this example and [can be found here](https://github.com/payloadcms/payload/tree/main/examples/form-builder/payload). If you have not done so already, clone it down and follow the setup instructions there.
|
||||||
|
|
||||||
### Next.js App
|
### Next.js App
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ First you'll need a running Payload app. There is one made explicitly for this e
|
|||||||
4. `yarn dev` or `npm run dev` to start the server
|
4. `yarn dev` or `npm run dev` to start the server
|
||||||
5. `open http://localhost:3001` to see the result
|
5. `open http://localhost:3001` to see the result
|
||||||
|
|
||||||
Once running you will find a couple seeded pages on your local environment with some basic instructions. You can also start editing the pages by modifying the documents within Payload. See the [Form Builder Example](https://github.com/payloadcms/payload/tree/master/examples/form-builder/payload) for full details.
|
Once running you will find a couple seeded pages on your local environment with some basic instructions. You can also start editing the pages by modifying the documents within Payload. See the [Form Builder Example](https://github.com/payloadcms/payload/tree/main/examples/form-builder/payload) for full details.
|
||||||
|
|
||||||
## Learn More
|
## Learn More
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
"@faceless-ui/modal": "^2.0.1",
|
"@faceless-ui/modal": "^2.0.1",
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"graphql": "^16.8.1",
|
"graphql": "^16.8.1",
|
||||||
"next": "12.3.1",
|
"next": "13.5.0",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-dom": "18.2.0",
|
"react-dom": "18.2.0",
|
||||||
"react-hook-form": "^7.41.0",
|
"react-hook-form": "^7.41.0",
|
||||||
|
|||||||
@@ -224,10 +224,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
|
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
|
||||||
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
|
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
|
||||||
|
|
||||||
"@next/env@12.3.1":
|
"@next/env@13.5.0":
|
||||||
version "12.3.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/env/-/env-12.3.1.tgz#18266bd92de3b4aa4037b1927aa59e6f11879260"
|
resolved "https://registry.yarnpkg.com/@next/env/-/env-13.5.0.tgz#a61dee2f29b09985847eabcc4c8a815031267a36"
|
||||||
integrity sha512-9P9THmRFVKGKt9DYqeC2aKIxm8rlvkK38V1P1sRE7qyoPBIs8l9oo79QoSdPtOWfzkbDAVUqvbQGgTMsb8BtJg==
|
integrity sha512-mxhf/BskjPURT+qEjNP7wBvqre2q6OXEIbydF8BrH+duSSJQnB4/vzzuJDoahYwTXiUaXpouAnMWHZdG0HU62g==
|
||||||
|
|
||||||
"@next/eslint-plugin-next@12.3.1":
|
"@next/eslint-plugin-next@12.3.1":
|
||||||
version "12.3.1"
|
version "12.3.1"
|
||||||
@@ -236,70 +236,50 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
glob "7.1.7"
|
glob "7.1.7"
|
||||||
|
|
||||||
"@next/swc-android-arm-eabi@12.3.1":
|
"@next/swc-darwin-arm64@13.5.0":
|
||||||
version "12.3.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.3.1.tgz#b15ce8ad376102a3b8c0f3c017dde050a22bb1a3"
|
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.5.0.tgz#45ea191e13593088572d0048d4ddfc1fcdb3c8ed"
|
||||||
integrity sha512-i+BvKA8tB//srVPPQxIQN5lvfROcfv4OB23/L1nXznP+N/TyKL8lql3l7oo2LNhnH66zWhfoemg3Q4VJZSruzQ==
|
integrity sha512-DavPD8oRjSoCRJana5DCAWdRZ4nbS7/pPw13DlnukFfMPJUk5hCAC3+NbqEyekS/X1IBFdZWSV2lJIdzTn4s6w==
|
||||||
|
|
||||||
"@next/swc-android-arm64@12.3.1":
|
"@next/swc-darwin-x64@13.5.0":
|
||||||
version "12.3.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.3.1.tgz#85d205f568a790a137cb3c3f720d961a2436ac9c"
|
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.5.0.tgz#582e8df7d563c057581bc118fff1cea79391d6e7"
|
||||||
integrity sha512-CmgU2ZNyBP0rkugOOqLnjl3+eRpXBzB/I2sjwcGZ7/Z6RcUJXK5Evz+N0ucOxqE4cZ3gkTeXtSzRrMK2mGYV8Q==
|
integrity sha512-s5QSKKB0CTKFWp3CNMC5GH1YOipH1Jjr5P3w+RQTC4Aybo6xPqeWp/UyDW0fxmLRq0e1zgnOMgDQRdxAkoThrw==
|
||||||
|
|
||||||
"@next/swc-darwin-arm64@12.3.1":
|
"@next/swc-linux-arm64-gnu@13.5.0":
|
||||||
version "12.3.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.3.1.tgz#b105457d6760a7916b27e46c97cb1a40547114ae"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.5.0.tgz#7ee0a43b6635eca1e80a887304b7bfe31254a4a6"
|
||||||
integrity sha512-hT/EBGNcu0ITiuWDYU9ur57Oa4LybD5DOQp4f22T6zLfpoBMfBibPtR8XktXmOyFHrL/6FC2p9ojdLZhWhvBHg==
|
integrity sha512-E0fCKA8F2vfgZWwcv4iq642No75EiACSNUBNGvc5lx/ylqAUdNwE/9+x2SHv+LPUXFhZ6hZLR0Qox/oKgZqFlg==
|
||||||
|
|
||||||
"@next/swc-darwin-x64@12.3.1":
|
"@next/swc-linux-arm64-musl@13.5.0":
|
||||||
version "12.3.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.3.1.tgz#6947b39082271378896b095b6696a7791c6e32b1"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.5.0.tgz#99a1efd6b68a4d0dfdc24b81f14cd8b8251425a9"
|
||||||
integrity sha512-9S6EVueCVCyGf2vuiLiGEHZCJcPAxglyckTZcEwLdJwozLqN0gtS0Eq0bQlGS3dH49Py/rQYpZ3KVWZ9BUf/WA==
|
integrity sha512-jG/blDDLndFRUcafCQO4TOI3VuoIZh3jQriZ7JaVCgAEZe0D1EUrxKdbBarZ74isutHZ6DpNGRDi/0OHFZpJAA==
|
||||||
|
|
||||||
"@next/swc-freebsd-x64@12.3.1":
|
"@next/swc-linux-x64-gnu@13.5.0":
|
||||||
version "12.3.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.3.1.tgz#2b6c36a4d84aae8b0ea0e0da9bafc696ae27085a"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.5.0.tgz#7c85acd45879a20d8fb102b3212e792924d02e93"
|
||||||
integrity sha512-qcuUQkaBZWqzM0F1N4AkAh88lLzzpfE6ImOcI1P6YeyJSsBmpBIV8o70zV+Wxpc26yV9vpzb+e5gCyxNjKJg5Q==
|
integrity sha512-6JWR7U41uNL6HGwNbGg3Oedt+FN4YuA126sHWKTq3ic5kkhEusIIdVo7+WcswVJl8nTMB1yT3gEPwygQbVYVUA==
|
||||||
|
|
||||||
"@next/swc-linux-arm-gnueabihf@12.3.1":
|
"@next/swc-linux-x64-musl@13.5.0":
|
||||||
version "12.3.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.3.1.tgz#6e421c44285cfedac1f4631d5de330dd60b86298"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.5.0.tgz#23aad9ab7621f53bb947b727e659d85e74b0e31a"
|
||||||
integrity sha512-diL9MSYrEI5nY2wc/h/DBewEDUzr/DqBjIgHJ3RUNtETAOB3spMNHvJk2XKUDjnQuluLmFMloet9tpEqU2TT9w==
|
integrity sha512-uY+wrYfD5QUossqznwidOpJYmmcBwojToZx55shihtbTl6afVYzOxsUbRXLdWmZAa36ckxXpqkvuFNS8icQuug==
|
||||||
|
|
||||||
"@next/swc-linux-arm64-gnu@12.3.1":
|
"@next/swc-win32-arm64-msvc@13.5.0":
|
||||||
version "12.3.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.3.1.tgz#8863f08a81f422f910af126159d2cbb9552ef717"
|
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.5.0.tgz#5a45686335e5f54342faf9d9ed25f55a4107ce7f"
|
||||||
integrity sha512-o/xB2nztoaC7jnXU3Q36vGgOolJpsGG8ETNjxM1VAPxRwM7FyGCPHOMk1XavG88QZSQf+1r+POBW0tLxQOJ9DQ==
|
integrity sha512-lWZ5vJTULxTOdLcRmrllNgAdDRSDwk8oqJMyDxpqS691NG5uhle9ZwRj3g1F1/vHNkDa+B7PmWhQgG0nmlbKZg==
|
||||||
|
|
||||||
"@next/swc-linux-arm64-musl@12.3.1":
|
"@next/swc-win32-ia32-msvc@13.5.0":
|
||||||
version "12.3.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.3.1.tgz#0038f07cf0b259d70ae0c80890d826dfc775d9f3"
|
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.5.0.tgz#b9990965762aaa109bdeb7b49cbdc7e4af7f9014"
|
||||||
integrity sha512-2WEasRxJzgAmP43glFNhADpe8zB7kJofhEAVNbDJZANp+H4+wq+/cW1CdDi8DqjkShPEA6/ejJw+xnEyDID2jg==
|
integrity sha512-jirQXnVCU9hi3cHzgd33d4qSBXn1/0gUT/KtXqy9Ux9OTcIcjJT3TcAzoLJLTdhRg7op3MZoSnuFeWl8kmGGNw==
|
||||||
|
|
||||||
"@next/swc-linux-x64-gnu@12.3.1":
|
"@next/swc-win32-x64-msvc@13.5.0":
|
||||||
version "12.3.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.3.1.tgz#c66468f5e8181ffb096c537f0dbfb589baa6a9c1"
|
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.5.0.tgz#4385c5d9c0db39c2623aed566b3ec7fedaf6f190"
|
||||||
integrity sha512-JWEaMyvNrXuM3dyy9Pp5cFPuSSvG82+yABqsWugjWlvfmnlnx9HOQZY23bFq3cNghy5V/t0iPb6cffzRWylgsA==
|
integrity sha512-Q8QYLyWcMMUp3DohI04VyJbLNCfFMNTxYNhujvJD2lowuqnqApUBP2DxI/jCZRMFWgKi76n5u8UboLVeYXn6jA==
|
||||||
|
|
||||||
"@next/swc-linux-x64-musl@12.3.1":
|
|
||||||
version "12.3.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.3.1.tgz#c6269f3e96ac0395bc722ad97ce410ea5101d305"
|
|
||||||
integrity sha512-xoEWQQ71waWc4BZcOjmatuvPUXKTv6MbIFzpm4LFeCHsg2iwai0ILmNXf81rJR+L1Wb9ifEke2sQpZSPNz1Iyg==
|
|
||||||
|
|
||||||
"@next/swc-win32-arm64-msvc@12.3.1":
|
|
||||||
version "12.3.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.3.1.tgz#83c639ee969cee36ce247c3abd1d9df97b5ecade"
|
|
||||||
integrity sha512-hswVFYQYIeGHE2JYaBVtvqmBQ1CppplQbZJS/JgrVI3x2CurNhEkmds/yqvDONfwfbttTtH4+q9Dzf/WVl3Opw==
|
|
||||||
|
|
||||||
"@next/swc-win32-ia32-msvc@12.3.1":
|
|
||||||
version "12.3.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.3.1.tgz#52995748b92aa8ad053440301bc2c0d9fbcf27c2"
|
|
||||||
integrity sha512-Kny5JBehkTbKPmqulr5i+iKntO5YMP+bVM8Hf8UAmjSMVo3wehyLVc9IZkNmcbxi+vwETnQvJaT5ynYBkJ9dWA==
|
|
||||||
|
|
||||||
"@next/swc-win32-x64-msvc@12.3.1":
|
|
||||||
version "12.3.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.3.1.tgz#27d71a95247a9eaee03d47adee7e3bd594514136"
|
|
||||||
integrity sha512-W1ijvzzg+kPEX6LAc+50EYYSEo0FVu7dmTE+t+DM4iOLqgGHoW9uYSz9wCVdkXOEEMP9xhXfGpcSxsfDucyPkA==
|
|
||||||
|
|
||||||
"@nodelib/fs.scandir@2.1.5":
|
"@nodelib/fs.scandir@2.1.5":
|
||||||
version "2.1.5"
|
version "2.1.5"
|
||||||
@@ -327,10 +307,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.2.0.tgz#8be36a1f66f3265389e90b5f9c9962146758f728"
|
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.2.0.tgz#8be36a1f66f3265389e90b5f9c9962146758f728"
|
||||||
integrity sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==
|
integrity sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==
|
||||||
|
|
||||||
"@swc/helpers@0.4.11":
|
"@swc/helpers@0.5.2":
|
||||||
version "0.4.11"
|
version "0.5.2"
|
||||||
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.11.tgz#db23a376761b3d31c26502122f349a21b592c8de"
|
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.2.tgz#85ea0c76450b61ad7d10a37050289eded783c27d"
|
||||||
integrity sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw==
|
integrity sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^2.4.0"
|
tslib "^2.4.0"
|
||||||
|
|
||||||
@@ -616,6 +596,13 @@ braces@^3.0.2, braces@~3.0.2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
fill-range "^7.0.1"
|
fill-range "^7.0.1"
|
||||||
|
|
||||||
|
busboy@1.6.0:
|
||||||
|
version "1.6.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893"
|
||||||
|
integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==
|
||||||
|
dependencies:
|
||||||
|
streamsearch "^1.1.0"
|
||||||
|
|
||||||
call-bind@^1.0.0, call-bind@^1.0.2:
|
call-bind@^1.0.0, call-bind@^1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
|
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
|
||||||
@@ -666,6 +653,11 @@ chalk@^4.0.0:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents "~2.3.2"
|
fsevents "~2.3.2"
|
||||||
|
|
||||||
|
client-only@0.0.1:
|
||||||
|
version "0.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1"
|
||||||
|
integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==
|
||||||
|
|
||||||
color-convert@^1.9.0:
|
color-convert@^1.9.0:
|
||||||
version "1.9.3"
|
version "1.9.3"
|
||||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
|
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
|
||||||
@@ -1276,6 +1268,11 @@ glob-parent@^6.0.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
is-glob "^4.0.3"
|
is-glob "^4.0.3"
|
||||||
|
|
||||||
|
glob-to-regexp@^0.4.1:
|
||||||
|
version "0.4.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e"
|
||||||
|
integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==
|
||||||
|
|
||||||
glob@7.1.7:
|
glob@7.1.7:
|
||||||
version "7.1.7"
|
version "7.1.7"
|
||||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
|
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
|
||||||
@@ -1333,6 +1330,11 @@ gopd@^1.0.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
get-intrinsic "^1.1.3"
|
get-intrinsic "^1.1.3"
|
||||||
|
|
||||||
|
graceful-fs@^4.1.2:
|
||||||
|
version "4.2.11"
|
||||||
|
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
|
||||||
|
integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==
|
||||||
|
|
||||||
grapheme-splitter@^1.0.4:
|
grapheme-splitter@^1.0.4:
|
||||||
version "1.0.4"
|
version "1.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e"
|
resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e"
|
||||||
@@ -1778,31 +1780,29 @@ natural-compare@^1.4.0:
|
|||||||
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
||||||
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
|
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
|
||||||
|
|
||||||
next@12.3.1:
|
next@13.5.0:
|
||||||
version "12.3.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/next/-/next-12.3.1.tgz#127b825ad2207faf869b33393ec8c75fe61e50f1"
|
resolved "https://registry.yarnpkg.com/next/-/next-13.5.0.tgz#3a3ce5b8c89c4fff9c6f0b2452bcb03f63d8c84c"
|
||||||
integrity sha512-l7bvmSeIwX5lp07WtIiP9u2ytZMv7jIeB8iacR28PuUEFG5j0HGAPnMqyG5kbZNBG2H7tRsrQ4HCjuMOPnANZw==
|
integrity sha512-mhguN5JPZXhhrD/nNcezXgKoxN8GT8xZvvGhUQV2ETiaNm+KHRWT1rCbrF5FlbG2XCcLRKOmOe3D5YQgXmJrDQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@next/env" "12.3.1"
|
"@next/env" "13.5.0"
|
||||||
"@swc/helpers" "0.4.11"
|
"@swc/helpers" "0.5.2"
|
||||||
|
busboy "1.6.0"
|
||||||
caniuse-lite "^1.0.30001406"
|
caniuse-lite "^1.0.30001406"
|
||||||
postcss "8.4.14"
|
postcss "8.4.14"
|
||||||
styled-jsx "5.0.7"
|
styled-jsx "5.1.1"
|
||||||
use-sync-external-store "1.2.0"
|
watchpack "2.4.0"
|
||||||
|
zod "3.21.4"
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
"@next/swc-android-arm-eabi" "12.3.1"
|
"@next/swc-darwin-arm64" "13.5.0"
|
||||||
"@next/swc-android-arm64" "12.3.1"
|
"@next/swc-darwin-x64" "13.5.0"
|
||||||
"@next/swc-darwin-arm64" "12.3.1"
|
"@next/swc-linux-arm64-gnu" "13.5.0"
|
||||||
"@next/swc-darwin-x64" "12.3.1"
|
"@next/swc-linux-arm64-musl" "13.5.0"
|
||||||
"@next/swc-freebsd-x64" "12.3.1"
|
"@next/swc-linux-x64-gnu" "13.5.0"
|
||||||
"@next/swc-linux-arm-gnueabihf" "12.3.1"
|
"@next/swc-linux-x64-musl" "13.5.0"
|
||||||
"@next/swc-linux-arm64-gnu" "12.3.1"
|
"@next/swc-win32-arm64-msvc" "13.5.0"
|
||||||
"@next/swc-linux-arm64-musl" "12.3.1"
|
"@next/swc-win32-ia32-msvc" "13.5.0"
|
||||||
"@next/swc-linux-x64-gnu" "12.3.1"
|
"@next/swc-win32-x64-msvc" "13.5.0"
|
||||||
"@next/swc-linux-x64-musl" "12.3.1"
|
|
||||||
"@next/swc-win32-arm64-msvc" "12.3.1"
|
|
||||||
"@next/swc-win32-ia32-msvc" "12.3.1"
|
|
||||||
"@next/swc-win32-x64-msvc" "12.3.1"
|
|
||||||
|
|
||||||
normalize-path@^3.0.0, normalize-path@~3.0.0:
|
normalize-path@^3.0.0, normalize-path@~3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
@@ -2229,6 +2229,11 @@ stop-iteration-iterator@^1.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
internal-slot "^1.0.4"
|
internal-slot "^1.0.4"
|
||||||
|
|
||||||
|
streamsearch@^1.1.0:
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764"
|
||||||
|
integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==
|
||||||
|
|
||||||
string.prototype.matchall@^4.0.8:
|
string.prototype.matchall@^4.0.8:
|
||||||
version "4.0.8"
|
version "4.0.8"
|
||||||
resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3"
|
resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3"
|
||||||
@@ -2278,10 +2283,12 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1:
|
|||||||
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
|
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
|
||||||
integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
|
integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
|
||||||
|
|
||||||
styled-jsx@5.0.7:
|
styled-jsx@5.1.1:
|
||||||
version "5.0.7"
|
version "5.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.7.tgz#be44afc53771b983769ac654d355ca8d019dff48"
|
resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.1.1.tgz#839a1c3aaacc4e735fed0781b8619ea5d0009d1f"
|
||||||
integrity sha512-b3sUzamS086YLRuvnaDigdAewz1/EFYlHpYBP5mZovKEdQQOIIYq8lApylub3HHZ6xFjV051kkGU7cudJmrXEA==
|
integrity sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==
|
||||||
|
dependencies:
|
||||||
|
client-only "0.0.1"
|
||||||
|
|
||||||
stylis@4.1.3:
|
stylis@4.1.3:
|
||||||
version "4.1.3"
|
version "4.1.3"
|
||||||
@@ -2421,10 +2428,13 @@ use-isomorphic-layout-effect@^1.1.2:
|
|||||||
resolved "https://registry.yarnpkg.com/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz#497cefb13d863d687b08477d9e5a164ad8c1a6fb"
|
resolved "https://registry.yarnpkg.com/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz#497cefb13d863d687b08477d9e5a164ad8c1a6fb"
|
||||||
integrity sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==
|
integrity sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==
|
||||||
|
|
||||||
use-sync-external-store@1.2.0:
|
watchpack@2.4.0:
|
||||||
version "1.2.0"
|
version "2.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a"
|
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d"
|
||||||
integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==
|
integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==
|
||||||
|
dependencies:
|
||||||
|
glob-to-regexp "^0.4.1"
|
||||||
|
graceful-fs "^4.1.2"
|
||||||
|
|
||||||
which-boxed-primitive@^1.0.2:
|
which-boxed-primitive@^1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
@@ -2502,3 +2512,8 @@ zen-observable@0.8.15:
|
|||||||
version "0.8.15"
|
version "0.8.15"
|
||||||
resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15"
|
resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15"
|
||||||
integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==
|
integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==
|
||||||
|
|
||||||
|
zod@3.21.4:
|
||||||
|
version "3.21.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db"
|
||||||
|
integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
# Payload Live Preview Example Front-End
|
# Payload Live Preview Example Front-End
|
||||||
|
|
||||||
This is a [Next.js](https://nextjs.org) app using the [App Router](https://nextjs.org/docs/app). It was made explicitly for Payload's [Live Preview Example](https://github.com/payloadcms/payload/tree/master/examples/live-preview/payload).
|
This is a [Next.js](https://nextjs.org) app using the [App Router](https://nextjs.org/docs/app). It was made explicitly for Payload's [Live Preview Example](https://github.com/payloadcms/payload/tree/main/examples/live-preview/payload).
|
||||||
|
|
||||||
> This example uses the App Router, the latest API of Next.js. If your app is using the legacy [Pages Router](https://nextjs.org/docs/pages), check out the official [Pages Router Example](https://github.com/payloadcms/payload/tree/master/examples/live-preview/next-pages).
|
> This example uses the App Router, the latest API of Next.js. If your app is using the legacy [Pages Router](https://nextjs.org/docs/pages), check out the official [Pages Router Example](https://github.com/payloadcms/payload/tree/main/examples/live-preview/next-pages).
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
### Payload
|
### Payload
|
||||||
|
|
||||||
First you'll need a running Payload app. There is one made explicitly for this example and [can be found here](https://github.com/payloadcms/payload/tree/master/examples/live-preview/payload). If you have not done so already, clone it down and follow the setup instructions there. This will provide all the necessary APIs that your Next.js app requires for authentication.
|
First you'll need a running Payload app. There is one made explicitly for this example and [can be found here](https://github.com/payloadcms/payload/tree/main/examples/live-preview/payload). If you have not done so already, clone it down and follow the setup instructions there. This will provide all the necessary APIs that your Next.js app requires for authentication.
|
||||||
|
|
||||||
### Next.js
|
### Next.js
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ First you'll need a running Payload app. There is one made explicitly for this e
|
|||||||
4. `yarn dev` or `npm run dev` to start the server
|
4. `yarn dev` or `npm run dev` to start the server
|
||||||
5. `open http://localhost:3001` to see the result
|
5. `open http://localhost:3001` to see the result
|
||||||
|
|
||||||
Once running you will find a couple seeded pages on your local environment with some basic instructions. You can also start editing the pages by modifying the documents within Payload. See the [Live Preview Example](https://github.com/payloadcms/payload/tree/master/examples/live-preview/payload) for full details.
|
Once running you will find a couple seeded pages on your local environment with some basic instructions. You can also start editing the pages by modifying the documents within Payload. See the [Live Preview Example](https://github.com/payloadcms/payload/tree/main/examples/live-preview/payload) for full details.
|
||||||
|
|
||||||
## Learn More
|
## Learn More
|
||||||
|
|
||||||
@@ -32,6 +32,6 @@ You can check out [the Payload GitHub repository](https://github.com/payloadcms/
|
|||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new) from the creators of Next.js. You could also combine this app into a [single Express server](https://github.com/payloadcms/payload/tree/master/examples/custom-server) and deploy in to [Payload Cloud](https://payloadcms.com/new/import).
|
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new) from the creators of Next.js. You could also combine this app into a [single Express server](https://github.com/payloadcms/payload/tree/main/examples/custom-server) and deploy in to [Payload Cloud](https://payloadcms.com/new/import).
|
||||||
|
|
||||||
Check out our [Payload deployment documentation](https://payloadcms.com/docs/production/deployment) or the [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
Check out our [Payload deployment documentation](https://payloadcms.com/docs/production/deployment) or the [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@payloadcms/live-preview-react": "^1.0.0-beta.3",
|
"@payloadcms/live-preview-react": "latest",
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"next": "^13.4.8",
|
"next": "^13.4.8",
|
||||||
"payload-admin-bar": "^1.0.6",
|
"payload-admin-bar": "^1.0.6",
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,14 @@
|
|||||||
# Payload Live Preview Example Front-End
|
# Payload Live Preview Example Front-End
|
||||||
|
|
||||||
This is a [Next.js](https://nextjs.org) app using the [Pages Router](https://nextjs.org/docs/pages). It was made explicitly for Payload's [Live Preview Example](https://github.com/payloadcms/payload/tree/master/examples/live-preview/payload).
|
This is a [Next.js](https://nextjs.org) app using the [Pages Router](https://nextjs.org/docs/pages). It was made explicitly for Payload's [Live Preview Example](https://github.com/payloadcms/payload/tree/main/examples/live-preview/payload).
|
||||||
|
|
||||||
> This example uses the Pages Router, the legacy API of Next.js. If your app is using the latest [App Router](https://nextjs.org/docs/app), check out the official [App Router Example](https://github.com/payloadcms/payload/tree/master/examples/live-preview/next-app).
|
> This example uses the Pages Router, the legacy API of Next.js. If your app is using the latest [App Router](https://nextjs.org/docs/app), check out the official [App Router Example](https://github.com/payloadcms/payload/tree/main/examples/live-preview/next-app).
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
### Payload
|
### Payload
|
||||||
|
|
||||||
First you'll need a running Payload app. There is one made explicitly for this example and [can be found here](https://github.com/payloadcms/payload/tree/master/examples/live-preview/payload). If you have not done so already, clone it down and follow the setup instructions there. This will provide all the necessary APIs that your Next.js app requires for authentication.
|
First you'll need a running Payload app. There is one made explicitly for this example and [can be found here](https://github.com/payloadcms/payload/tree/main/examples/live-preview/payload). If you have not done so already, clone it down and follow the setup instructions there. This will provide all the necessary APIs that your Next.js app requires for authentication.
|
||||||
|
|
||||||
### Next.js
|
### Next.js
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ First you'll need a running Payload app. There is one made explicitly for this e
|
|||||||
4. `yarn dev` or `npm run dev` to start the server
|
4. `yarn dev` or `npm run dev` to start the server
|
||||||
5. `open http://localhost:3001` to see the result
|
5. `open http://localhost:3001` to see the result
|
||||||
|
|
||||||
Once running you will find a couple seeded pages on your local environment with some basic instructions. You can also start editing the pages by modifying the documents within Payload. See the [Live Preview Example](https://github.com/payloadcms/payload/tree/master/examples/live-preview/payload) for full details.
|
Once running you will find a couple seeded pages on your local environment with some basic instructions. You can also start editing the pages by modifying the documents within Payload. See the [Live Preview Example](https://github.com/payloadcms/payload/tree/main/examples/live-preview/payload) for full details.
|
||||||
|
|
||||||
## Learn More
|
## Learn More
|
||||||
|
|
||||||
@@ -32,6 +32,6 @@ You can check out [the Payload GitHub repository](https://github.com/payloadcms/
|
|||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new) from the creators of Next.js. You could also combine this app into a [single Express server](https://github.com/payloadcms/payload/tree/master/examples/custom-server) and deploy in to [Payload Cloud](https://payloadcms.com/new/import).
|
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new) from the creators of Next.js. You could also combine this app into a [single Express server](https://github.com/payloadcms/payload/tree/main/examples/custom-server) and deploy in to [Payload Cloud](https://payloadcms.com/new/import).
|
||||||
|
|
||||||
Check out our [Payload deployment documentation](https://payloadcms.com/docs/production/deployment) or the [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
Check out our [Payload deployment documentation](https://payloadcms.com/docs/production/deployment) or the [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@payloadcms/live-preview-react": "^1.0.0-beta.3",
|
"@payloadcms/live-preview-react": "latest",
|
||||||
"@types/escape-html": "^1.0.2",
|
"@types/escape-html": "^1.0.2",
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"next": "^13.4.8",
|
"next": "^13.4.8",
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
# Payload Live Preview Example
|
# Payload Live Preview Example
|
||||||
|
|
||||||
The [Payload Live Preview Example](https://github.com/payloadcms/payload/tree/master/examples/live-preview/payload) demonstrates how to implement [Live Preview](https://payloadcms.com/docs/live-preview) in [Payload](https://github.com/payloadcms/payload). With Live Preview you can render your front-end application directly within the Admin panel. As you type, your changes take effect in real-time. No need to save a draft or publish your changes.
|
The [Payload Live Preview Example](https://github.com/payloadcms/payload/tree/main/examples/live-preview/payload) demonstrates how to implement [Live Preview](https://payloadcms.com/docs/live-preview) in [Payload](https://github.com/payloadcms/payload). With Live Preview you can render your front-end application directly within the Admin panel. As you type, your changes take effect in real-time. No need to save a draft or publish your changes.
|
||||||
|
|
||||||
There are various fully working front-ends made explicitly for this example, including:
|
There are various fully working front-ends made explicitly for this example, including:
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ See the [Collections](https://payloadcms.com/docs/configuration/collections) doc
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
For additional help with authentication, see the [Authentication](https://payloadcms.com/docs/authentication/overview#authentication-overview) docs or the official [Auth Example](https://github.com/payloadcms/payload/tree/master/examples/auth).
|
For additional help with authentication, see the [Authentication](https://payloadcms.com/docs/authentication/overview#authentication-overview) docs or the official [Auth Example](https://github.com/payloadcms/payload/tree/main/examples/auth).
|
||||||
|
|
||||||
- #### Pages
|
- #### Pages
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Redirects Example Front-End
|
# Redirects Example Front-End
|
||||||
|
|
||||||
This is a [Next.js](https://nextjs.org) app using the [Pages Router](https://nextjs.org/docs/pages). It was made explicitly for Payload's [Redirects Example](https://github.com/payloadcms/payload/tree/master/examples/redireects/payload).
|
This is a [Next.js](https://nextjs.org) app using the [Pages Router](https://nextjs.org/docs/pages). It was made explicitly for Payload's [Redirects Example](https://github.com/payloadcms/payload/tree/main/examples/redireects/payload).
|
||||||
|
|
||||||
> This example uses the Pages Router, the legacy API of Next.js. If your app is using the latest [App Router](https://nextjs.org/docs/app), we will soon add a new example for you to use soon.
|
> This example uses the Pages Router, the legacy API of Next.js. If your app is using the latest [App Router](https://nextjs.org/docs/app), we will soon add a new example for you to use soon.
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ This is a [Next.js](https://nextjs.org) app using the [Pages Router](https://nex
|
|||||||
|
|
||||||
### Payload
|
### Payload
|
||||||
|
|
||||||
First you'll need a running Payload app. There is one made explicitly for this example and [can be found here](https://github.com/payloadcms/payload/tree/master/examples/redirects/payload). If you have not done so already, clone it down and follow the setup instructions there.
|
First you'll need a running Payload app. There is one made explicitly for this example and [can be found here](https://github.com/payloadcms/payload/tree/main/examples/redirects/payload). If you have not done so already, clone it down and follow the setup instructions there.
|
||||||
|
|
||||||
### Next.js App
|
### Next.js App
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"next": "^13.1.6",
|
"next": "^13.5.0",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-dom": "18.2.0",
|
"react-dom": "18.2.0",
|
||||||
"sass": "^1.55.0",
|
"sass": "^1.55.0",
|
||||||
|
|||||||
@@ -36,10 +36,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
|
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
|
||||||
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
|
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
|
||||||
|
|
||||||
"@next/env@13.2.1":
|
"@next/env@13.5.0":
|
||||||
version "13.2.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/env/-/env-13.2.1.tgz#082d42cfc0c794e9185d7b4133d71440ba2e795d"
|
resolved "https://registry.yarnpkg.com/@next/env/-/env-13.5.0.tgz#a61dee2f29b09985847eabcc4c8a815031267a36"
|
||||||
integrity sha512-Hq+6QZ6kgmloCg8Kgrix+4F0HtvLqVK3FZAnlAoS0eonaDemHe1Km4kwjSWRE3JNpJNcKxFHF+jsZrYo0SxWoQ==
|
integrity sha512-mxhf/BskjPURT+qEjNP7wBvqre2q6OXEIbydF8BrH+duSSJQnB4/vzzuJDoahYwTXiUaXpouAnMWHZdG0HU62g==
|
||||||
|
|
||||||
"@next/eslint-plugin-next@^13.1.6":
|
"@next/eslint-plugin-next@^13.1.6":
|
||||||
version "13.2.1"
|
version "13.2.1"
|
||||||
@@ -48,70 +48,50 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
glob "7.1.7"
|
glob "7.1.7"
|
||||||
|
|
||||||
"@next/swc-android-arm-eabi@13.2.1":
|
"@next/swc-darwin-arm64@13.5.0":
|
||||||
version "13.2.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.2.1.tgz#67f2580fbbe05ee006220688972c5e3a555fc741"
|
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.5.0.tgz#45ea191e13593088572d0048d4ddfc1fcdb3c8ed"
|
||||||
integrity sha512-Yua7mUpEd1wzIT6Jjl3dpRizIfGp9NR4F2xeRuQv+ae+SDI1Em2WyM9m46UL+oeW5GpMiEHoaBagr47RScZFmQ==
|
integrity sha512-DavPD8oRjSoCRJana5DCAWdRZ4nbS7/pPw13DlnukFfMPJUk5hCAC3+NbqEyekS/X1IBFdZWSV2lJIdzTn4s6w==
|
||||||
|
|
||||||
"@next/swc-android-arm64@13.2.1":
|
"@next/swc-darwin-x64@13.5.0":
|
||||||
version "13.2.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-13.2.1.tgz#460a02b69eb23bb5f402266bcea9cadae59415c1"
|
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.5.0.tgz#582e8df7d563c057581bc118fff1cea79391d6e7"
|
||||||
integrity sha512-Bifcr2f6VwInOdq1uH/9lp8fH7Nf7XGkIx4XceVd32LPJqG2c6FZU8ZRBvTdhxzXVpt5TPtuXhOP4Ij9UPqsVw==
|
integrity sha512-s5QSKKB0CTKFWp3CNMC5GH1YOipH1Jjr5P3w+RQTC4Aybo6xPqeWp/UyDW0fxmLRq0e1zgnOMgDQRdxAkoThrw==
|
||||||
|
|
||||||
"@next/swc-darwin-arm64@13.2.1":
|
"@next/swc-linux-arm64-gnu@13.5.0":
|
||||||
version "13.2.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.2.1.tgz#8b8530ff417802027471aee2419f78a58a863ccb"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.5.0.tgz#7ee0a43b6635eca1e80a887304b7bfe31254a4a6"
|
||||||
integrity sha512-gvqm+fGMYxAkwBapH0Vvng5yrb6HTkIvZfY4oEdwwYrwuLdkjqnJygCMgpNqIFmAHSXgtlWxfYv1VC8sjN81Kw==
|
integrity sha512-E0fCKA8F2vfgZWwcv4iq642No75EiACSNUBNGvc5lx/ylqAUdNwE/9+x2SHv+LPUXFhZ6hZLR0Qox/oKgZqFlg==
|
||||||
|
|
||||||
"@next/swc-darwin-x64@13.2.1":
|
"@next/swc-linux-arm64-musl@13.5.0":
|
||||||
version "13.2.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.2.1.tgz#80aebb3329a1e4568a28de1ee177780b3d50330c"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.5.0.tgz#99a1efd6b68a4d0dfdc24b81f14cd8b8251425a9"
|
||||||
integrity sha512-HGqVqmaZWj6zomqOZUVbO5NhlABL0iIaxTmd0O5B0MoMa5zpDGoaHSG+fxgcWMXcGcxmUNchv1NfNOYiTKoHOg==
|
integrity sha512-jG/blDDLndFRUcafCQO4TOI3VuoIZh3jQriZ7JaVCgAEZe0D1EUrxKdbBarZ74isutHZ6DpNGRDi/0OHFZpJAA==
|
||||||
|
|
||||||
"@next/swc-freebsd-x64@13.2.1":
|
"@next/swc-linux-x64-gnu@13.5.0":
|
||||||
version "13.2.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.2.1.tgz#250ea2ab7e1734f22d11c677c463fab9ac33a516"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.5.0.tgz#7c85acd45879a20d8fb102b3212e792924d02e93"
|
||||||
integrity sha512-N/a4JarAq+E+g+9K2ywJUmDIgU2xs2nA+BBldH0oq4zYJMRiUhL0iaN9G4e72VmGOJ61L/3W6VN8RIUOwTLoqQ==
|
integrity sha512-6JWR7U41uNL6HGwNbGg3Oedt+FN4YuA126sHWKTq3ic5kkhEusIIdVo7+WcswVJl8nTMB1yT3gEPwygQbVYVUA==
|
||||||
|
|
||||||
"@next/swc-linux-arm-gnueabihf@13.2.1":
|
"@next/swc-linux-x64-musl@13.5.0":
|
||||||
version "13.2.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.2.1.tgz#fe6bb29ed348a5f8ecae3740df22a8d8130c474a"
|
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.5.0.tgz#23aad9ab7621f53bb947b727e659d85e74b0e31a"
|
||||||
integrity sha512-WaFoerF/eRbhbE57TaIGJXbQAERADZ/RZ45u6qox9beb5xnWsyYgzX+WuN7Tkhyvga0/aMuVYFzS9CEay7D+bw==
|
integrity sha512-uY+wrYfD5QUossqznwidOpJYmmcBwojToZx55shihtbTl6afVYzOxsUbRXLdWmZAa36ckxXpqkvuFNS8icQuug==
|
||||||
|
|
||||||
"@next/swc-linux-arm64-gnu@13.2.1":
|
"@next/swc-win32-arm64-msvc@13.5.0":
|
||||||
version "13.2.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.2.1.tgz#4781b927fc5e421f3cea2b29e5d38e5e4837b198"
|
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.5.0.tgz#5a45686335e5f54342faf9d9ed25f55a4107ce7f"
|
||||||
integrity sha512-R+Jhc1/RJTnncE9fkePboHDNOCm1WJ8daanWbjKhfPySMyeniKYRwGn5SLYW3S8YlRS0QVdZaaszDSZWgUcsmA==
|
integrity sha512-lWZ5vJTULxTOdLcRmrllNgAdDRSDwk8oqJMyDxpqS691NG5uhle9ZwRj3g1F1/vHNkDa+B7PmWhQgG0nmlbKZg==
|
||||||
|
|
||||||
"@next/swc-linux-arm64-musl@13.2.1":
|
"@next/swc-win32-ia32-msvc@13.5.0":
|
||||||
version "13.2.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.2.1.tgz#c2ba0a121b0255ba62450916bc70e6d0e26cbc98"
|
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.5.0.tgz#b9990965762aaa109bdeb7b49cbdc7e4af7f9014"
|
||||||
integrity sha512-oI1UfZPidGAVddlL2eOTmfsuKV9EaT1aktIzVIxIAgxzQSdwsV371gU3G55ggkurzfdlgF3GThFePDWF0d8dmw==
|
integrity sha512-jirQXnVCU9hi3cHzgd33d4qSBXn1/0gUT/KtXqy9Ux9OTcIcjJT3TcAzoLJLTdhRg7op3MZoSnuFeWl8kmGGNw==
|
||||||
|
|
||||||
"@next/swc-linux-x64-gnu@13.2.1":
|
"@next/swc-win32-x64-msvc@13.5.0":
|
||||||
version "13.2.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.2.1.tgz#573c220f8b087e5d131d1fba58d3e1a670b220ad"
|
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.5.0.tgz#4385c5d9c0db39c2623aed566b3ec7fedaf6f190"
|
||||||
integrity sha512-PCygPwrQmS+7WUuAWWioWMZCzZm4PG91lfRxToLDg7yIm/3YfAw5N2EK2TaM9pzlWdvHQAqRMX/oLvv027xUiA==
|
integrity sha512-Q8QYLyWcMMUp3DohI04VyJbLNCfFMNTxYNhujvJD2lowuqnqApUBP2DxI/jCZRMFWgKi76n5u8UboLVeYXn6jA==
|
||||||
|
|
||||||
"@next/swc-linux-x64-musl@13.2.1":
|
|
||||||
version "13.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.2.1.tgz#950b5bb920b322ca7b447efbd12a9c7a10c3a642"
|
|
||||||
integrity sha512-sUAKxo7CFZYGHNxheGh9nIBElLYBM6md/liEGfOTwh/xna4/GTTcmkGWkF7PdnvaYNgcPIQgHIMYiAa6yBKAVw==
|
|
||||||
|
|
||||||
"@next/swc-win32-arm64-msvc@13.2.1":
|
|
||||||
version "13.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.2.1.tgz#dbff3c4f5a3812a7059dac05804148a0f98682db"
|
|
||||||
integrity sha512-qDmyEjDBpl/vBXxuOOKKWmPQOcARcZIMach1s7kjzaien0SySut/PHRlj56sosa81Wt4hTGhfhZ1R7g1n7+B8w==
|
|
||||||
|
|
||||||
"@next/swc-win32-ia32-msvc@13.2.1":
|
|
||||||
version "13.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.2.1.tgz#7d2c17be7b8d9963984f5c15cc2588127101f620"
|
|
||||||
integrity sha512-2joqFQ81ZYPg6DcikIzQn3DgjKglNhPAozx6dL5sCNkr1CPMD0YIkJgT3CnYyMHQ04Qi3Npv0XX3MD6LJO8OCA==
|
|
||||||
|
|
||||||
"@next/swc-win32-x64-msvc@13.2.1":
|
|
||||||
version "13.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.2.1.tgz#09713c6a925461f414e89422851326d1625bd4d2"
|
|
||||||
integrity sha512-r3+0fSaIZT6N237iMzwUhfNwjhAFvXjqB+4iuW+wcpxW+LHm1g/IoxN8eSRcb8jPItC86JxjAxpke0QL97qd6g==
|
|
||||||
|
|
||||||
"@nodelib/fs.scandir@2.1.5":
|
"@nodelib/fs.scandir@2.1.5":
|
||||||
version "2.1.5"
|
version "2.1.5"
|
||||||
@@ -139,10 +119,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@payloadcms/eslint-config/-/eslint-config-0.0.1.tgz#4324702ddef6c773b3f3033795a13e6b50c95a92"
|
resolved "https://registry.yarnpkg.com/@payloadcms/eslint-config/-/eslint-config-0.0.1.tgz#4324702ddef6c773b3f3033795a13e6b50c95a92"
|
||||||
integrity sha512-Il59+0C4E/bI6uM2hont3I+oABWkJZbfbItubje5SGMrXkymUq8jT/UZRk0eCt918bB7gihxDXx8guFnR/aNIw==
|
integrity sha512-Il59+0C4E/bI6uM2hont3I+oABWkJZbfbItubje5SGMrXkymUq8jT/UZRk0eCt918bB7gihxDXx8guFnR/aNIw==
|
||||||
|
|
||||||
"@swc/helpers@0.4.14":
|
"@swc/helpers@0.5.2":
|
||||||
version "0.4.14"
|
version "0.5.2"
|
||||||
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.14.tgz#1352ac6d95e3617ccb7c1498ff019654f1e12a74"
|
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.2.tgz#85ea0c76450b61ad7d10a37050289eded783c27d"
|
||||||
integrity sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==
|
integrity sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^2.4.0"
|
tslib "^2.4.0"
|
||||||
|
|
||||||
@@ -370,6 +350,13 @@ braces@^3.0.2, braces@~3.0.2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
fill-range "^7.0.1"
|
fill-range "^7.0.1"
|
||||||
|
|
||||||
|
busboy@1.6.0:
|
||||||
|
version "1.6.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893"
|
||||||
|
integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==
|
||||||
|
dependencies:
|
||||||
|
streamsearch "^1.1.0"
|
||||||
|
|
||||||
call-bind@^1.0.0, call-bind@^1.0.2:
|
call-bind@^1.0.0, call-bind@^1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
|
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
|
||||||
@@ -899,6 +886,11 @@ glob-parent@^6.0.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
is-glob "^4.0.3"
|
is-glob "^4.0.3"
|
||||||
|
|
||||||
|
glob-to-regexp@^0.4.1:
|
||||||
|
version "0.4.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e"
|
||||||
|
integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==
|
||||||
|
|
||||||
glob@7.1.7:
|
glob@7.1.7:
|
||||||
version "7.1.7"
|
version "7.1.7"
|
||||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
|
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
|
||||||
@@ -956,6 +948,11 @@ gopd@^1.0.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
get-intrinsic "^1.1.3"
|
get-intrinsic "^1.1.3"
|
||||||
|
|
||||||
|
graceful-fs@^4.1.2:
|
||||||
|
version "4.2.11"
|
||||||
|
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
|
||||||
|
integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==
|
||||||
|
|
||||||
grapheme-splitter@^1.0.4:
|
grapheme-splitter@^1.0.4:
|
||||||
version "1.0.4"
|
version "1.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e"
|
resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e"
|
||||||
@@ -1331,30 +1328,29 @@ natural-compare@^1.4.0:
|
|||||||
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
||||||
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
|
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
|
||||||
|
|
||||||
next@^13.1.6:
|
next@^13.5.0:
|
||||||
version "13.2.1"
|
version "13.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/next/-/next-13.2.1.tgz#34d823f518632b36379863228ed9f861c335b9c0"
|
resolved "https://registry.yarnpkg.com/next/-/next-13.5.0.tgz#3a3ce5b8c89c4fff9c6f0b2452bcb03f63d8c84c"
|
||||||
integrity sha512-qhgJlDtG0xidNViJUPeQHLGJJoT4zDj/El7fP3D3OzpxJDUfxsm16cK4WTMyvSX1ciIfAq05u+0HqFAa+VJ+Hg==
|
integrity sha512-mhguN5JPZXhhrD/nNcezXgKoxN8GT8xZvvGhUQV2ETiaNm+KHRWT1rCbrF5FlbG2XCcLRKOmOe3D5YQgXmJrDQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@next/env" "13.2.1"
|
"@next/env" "13.5.0"
|
||||||
"@swc/helpers" "0.4.14"
|
"@swc/helpers" "0.5.2"
|
||||||
|
busboy "1.6.0"
|
||||||
caniuse-lite "^1.0.30001406"
|
caniuse-lite "^1.0.30001406"
|
||||||
postcss "8.4.14"
|
postcss "8.4.14"
|
||||||
styled-jsx "5.1.1"
|
styled-jsx "5.1.1"
|
||||||
|
watchpack "2.4.0"
|
||||||
|
zod "3.21.4"
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
"@next/swc-android-arm-eabi" "13.2.1"
|
"@next/swc-darwin-arm64" "13.5.0"
|
||||||
"@next/swc-android-arm64" "13.2.1"
|
"@next/swc-darwin-x64" "13.5.0"
|
||||||
"@next/swc-darwin-arm64" "13.2.1"
|
"@next/swc-linux-arm64-gnu" "13.5.0"
|
||||||
"@next/swc-darwin-x64" "13.2.1"
|
"@next/swc-linux-arm64-musl" "13.5.0"
|
||||||
"@next/swc-freebsd-x64" "13.2.1"
|
"@next/swc-linux-x64-gnu" "13.5.0"
|
||||||
"@next/swc-linux-arm-gnueabihf" "13.2.1"
|
"@next/swc-linux-x64-musl" "13.5.0"
|
||||||
"@next/swc-linux-arm64-gnu" "13.2.1"
|
"@next/swc-win32-arm64-msvc" "13.5.0"
|
||||||
"@next/swc-linux-arm64-musl" "13.2.1"
|
"@next/swc-win32-ia32-msvc" "13.5.0"
|
||||||
"@next/swc-linux-x64-gnu" "13.2.1"
|
"@next/swc-win32-x64-msvc" "13.5.0"
|
||||||
"@next/swc-linux-x64-musl" "13.2.1"
|
|
||||||
"@next/swc-win32-arm64-msvc" "13.2.1"
|
|
||||||
"@next/swc-win32-ia32-msvc" "13.2.1"
|
|
||||||
"@next/swc-win32-x64-msvc" "13.2.1"
|
|
||||||
|
|
||||||
normalize-path@^3.0.0, normalize-path@~3.0.0:
|
normalize-path@^3.0.0, normalize-path@~3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
@@ -1642,6 +1638,11 @@ slate@^0.84.0:
|
|||||||
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
|
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
|
||||||
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
|
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
|
||||||
|
|
||||||
|
streamsearch@^1.1.0:
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764"
|
||||||
|
integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==
|
||||||
|
|
||||||
string.prototype.trimend@^1.0.6:
|
string.prototype.trimend@^1.0.6:
|
||||||
version "1.0.6"
|
version "1.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533"
|
resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533"
|
||||||
@@ -1783,6 +1784,14 @@ uri-js@^4.2.2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
punycode "^2.1.0"
|
punycode "^2.1.0"
|
||||||
|
|
||||||
|
watchpack@2.4.0:
|
||||||
|
version "2.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d"
|
||||||
|
integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==
|
||||||
|
dependencies:
|
||||||
|
glob-to-regexp "^0.4.1"
|
||||||
|
graceful-fs "^4.1.2"
|
||||||
|
|
||||||
which-boxed-primitive@^1.0.2:
|
which-boxed-primitive@^1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6"
|
resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6"
|
||||||
@@ -1832,3 +1841,8 @@ yocto-queue@^0.1.0:
|
|||||||
version "0.1.0"
|
version "0.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
|
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
|
||||||
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
|
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
|
||||||
|
|
||||||
|
zod@3.21.4:
|
||||||
|
version "3.21.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db"
|
||||||
|
integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==
|
||||||
|
|||||||
@@ -496,6 +496,16 @@
|
|||||||
"@jridgewell/trace-mapping" "^0.3.17"
|
"@jridgewell/trace-mapping" "^0.3.17"
|
||||||
jsesc "^2.5.1"
|
jsesc "^2.5.1"
|
||||||
|
|
||||||
|
"@babel/generator@^7.23.0":
|
||||||
|
version "7.23.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420"
|
||||||
|
integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==
|
||||||
|
dependencies:
|
||||||
|
"@babel/types" "^7.23.0"
|
||||||
|
"@jridgewell/gen-mapping" "^0.3.2"
|
||||||
|
"@jridgewell/trace-mapping" "^0.3.17"
|
||||||
|
jsesc "^2.5.1"
|
||||||
|
|
||||||
"@babel/helper-compilation-targets@^7.22.15":
|
"@babel/helper-compilation-targets@^7.22.15":
|
||||||
version "7.22.15"
|
version "7.22.15"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz#0698fc44551a26cf29f18d4662d5bf545a6cfc52"
|
resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz#0698fc44551a26cf29f18d4662d5bf545a6cfc52"
|
||||||
@@ -507,18 +517,23 @@
|
|||||||
lru-cache "^5.1.1"
|
lru-cache "^5.1.1"
|
||||||
semver "^6.3.1"
|
semver "^6.3.1"
|
||||||
|
|
||||||
|
"@babel/helper-environment-visitor@^7.22.20":
|
||||||
|
version "7.22.20"
|
||||||
|
resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167"
|
||||||
|
integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==
|
||||||
|
|
||||||
"@babel/helper-environment-visitor@^7.22.5":
|
"@babel/helper-environment-visitor@^7.22.5":
|
||||||
version "7.22.5"
|
version "7.22.5"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98"
|
resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98"
|
||||||
integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==
|
integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==
|
||||||
|
|
||||||
"@babel/helper-function-name@^7.22.5":
|
"@babel/helper-function-name@^7.23.0":
|
||||||
version "7.22.5"
|
version "7.23.0"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be"
|
resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759"
|
||||||
integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==
|
integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/template" "^7.22.5"
|
"@babel/template" "^7.22.15"
|
||||||
"@babel/types" "^7.22.5"
|
"@babel/types" "^7.23.0"
|
||||||
|
|
||||||
"@babel/helper-hoist-variables@^7.22.5":
|
"@babel/helper-hoist-variables@^7.22.5":
|
||||||
version "7.22.5"
|
version "7.22.5"
|
||||||
@@ -574,6 +589,11 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.15.tgz#601fa28e4cc06786c18912dca138cec73b882044"
|
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.15.tgz#601fa28e4cc06786c18912dca138cec73b882044"
|
||||||
integrity sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ==
|
integrity sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ==
|
||||||
|
|
||||||
|
"@babel/helper-validator-identifier@^7.22.20":
|
||||||
|
version "7.22.20"
|
||||||
|
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0"
|
||||||
|
integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==
|
||||||
|
|
||||||
"@babel/helper-validator-option@^7.22.15":
|
"@babel/helper-validator-option@^7.22.15":
|
||||||
version "7.22.15"
|
version "7.22.15"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040"
|
resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040"
|
||||||
@@ -602,6 +622,11 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.16.tgz#180aead7f247305cce6551bea2720934e2fa2c95"
|
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.16.tgz#180aead7f247305cce6551bea2720934e2fa2c95"
|
||||||
integrity sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==
|
integrity sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==
|
||||||
|
|
||||||
|
"@babel/parser@^7.23.0":
|
||||||
|
version "7.23.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719"
|
||||||
|
integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==
|
||||||
|
|
||||||
"@babel/plugin-syntax-async-generators@^7.8.4":
|
"@babel/plugin-syntax-async-generators@^7.8.4":
|
||||||
version "7.8.4"
|
version "7.8.4"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d"
|
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d"
|
||||||
@@ -707,7 +732,7 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
regenerator-runtime "^0.14.0"
|
regenerator-runtime "^0.14.0"
|
||||||
|
|
||||||
"@babel/template@^7.22.15", "@babel/template@^7.22.5", "@babel/template@^7.3.3":
|
"@babel/template@^7.22.15", "@babel/template@^7.3.3":
|
||||||
version "7.22.15"
|
version "7.22.15"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38"
|
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38"
|
||||||
integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==
|
integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==
|
||||||
@@ -717,18 +742,18 @@
|
|||||||
"@babel/types" "^7.22.15"
|
"@babel/types" "^7.22.15"
|
||||||
|
|
||||||
"@babel/traverse@^7.22.15", "@babel/traverse@^7.22.17":
|
"@babel/traverse@^7.22.15", "@babel/traverse@^7.22.17":
|
||||||
version "7.22.17"
|
version "7.23.2"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.17.tgz#b23c203ab3707e3be816043081b4a994fcacec44"
|
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.2.tgz#329c7a06735e144a506bdb2cad0268b7f46f4ad8"
|
||||||
integrity sha512-xK4Uwm0JnAMvxYZxOVecss85WxTEIbTa7bnGyf/+EgCL5Zt3U7htUpEOWv9detPlamGKuRzCqw74xVglDWpPdg==
|
integrity sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/code-frame" "^7.22.13"
|
"@babel/code-frame" "^7.22.13"
|
||||||
"@babel/generator" "^7.22.15"
|
"@babel/generator" "^7.23.0"
|
||||||
"@babel/helper-environment-visitor" "^7.22.5"
|
"@babel/helper-environment-visitor" "^7.22.20"
|
||||||
"@babel/helper-function-name" "^7.22.5"
|
"@babel/helper-function-name" "^7.23.0"
|
||||||
"@babel/helper-hoist-variables" "^7.22.5"
|
"@babel/helper-hoist-variables" "^7.22.5"
|
||||||
"@babel/helper-split-export-declaration" "^7.22.6"
|
"@babel/helper-split-export-declaration" "^7.22.6"
|
||||||
"@babel/parser" "^7.22.16"
|
"@babel/parser" "^7.23.0"
|
||||||
"@babel/types" "^7.22.17"
|
"@babel/types" "^7.23.0"
|
||||||
debug "^4.1.0"
|
debug "^4.1.0"
|
||||||
globals "^11.1.0"
|
globals "^11.1.0"
|
||||||
|
|
||||||
@@ -741,6 +766,15 @@
|
|||||||
"@babel/helper-validator-identifier" "^7.22.15"
|
"@babel/helper-validator-identifier" "^7.22.15"
|
||||||
to-fast-properties "^2.0.0"
|
to-fast-properties "^2.0.0"
|
||||||
|
|
||||||
|
"@babel/types@^7.23.0":
|
||||||
|
version "7.23.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb"
|
||||||
|
integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==
|
||||||
|
dependencies:
|
||||||
|
"@babel/helper-string-parser" "^7.22.5"
|
||||||
|
"@babel/helper-validator-identifier" "^7.22.20"
|
||||||
|
to-fast-properties "^2.0.0"
|
||||||
|
|
||||||
"@bcherny/json-schema-ref-parser@9.0.9":
|
"@bcherny/json-schema-ref-parser@9.0.9":
|
||||||
version "9.0.9"
|
version "9.0.9"
|
||||||
resolved "https://registry.yarnpkg.com/@bcherny/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#09899d405bc708c0acac0066ae8db5b94d465ca4"
|
resolved "https://registry.yarnpkg.com/@bcherny/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#09899d405bc708c0acac0066ae8db5b94d465ca4"
|
||||||
|
|||||||
16
package.json
16
package.json
@@ -24,7 +24,7 @@
|
|||||||
"script:release": "tsx ./scripts/release.ts",
|
"script:release": "tsx ./scripts/release.ts",
|
||||||
"test": "pnpm test:int && pnpm test:components && pnpm test:e2e",
|
"test": "pnpm test:int && pnpm test:components && pnpm test:e2e",
|
||||||
"test:components": "cross-env jest --config=jest.components.config.js",
|
"test:components": "cross-env jest --config=jest.components.config.js",
|
||||||
"test:e2e": "npx playwright install --with-deps && ts-node -T ./test/runE2E.ts",
|
"test:e2e": "npx playwright install --with-deps chromium && ts-node -T ./test/runE2E.ts",
|
||||||
"test:e2e:debug": "cross-env PWDEBUG=1 DISABLE_LOGGING=true playwright test",
|
"test:e2e:debug": "cross-env PWDEBUG=1 DISABLE_LOGGING=true playwright test",
|
||||||
"test:e2e:headed": "cross-env DISABLE_LOGGING=true playwright test --headed",
|
"test:e2e:headed": "cross-env DISABLE_LOGGING=true playwright test --headed",
|
||||||
"test:int:postgres": "cross-env PAYLOAD_DATABASE=postgres DISABLE_LOGGING=true jest --forceExit --detectOpenHandles",
|
"test:int:postgres": "cross-env PAYLOAD_DATABASE=postgres DISABLE_LOGGING=true jest --forceExit --detectOpenHandles",
|
||||||
@@ -40,6 +40,10 @@
|
|||||||
"@swc/register": "0.1.10",
|
"@swc/register": "0.1.10",
|
||||||
"@testing-library/jest-dom": "5.17.0",
|
"@testing-library/jest-dom": "5.17.0",
|
||||||
"@testing-library/react": "13.4.0",
|
"@testing-library/react": "13.4.0",
|
||||||
|
"@types/concat-stream": "^2.0.1",
|
||||||
|
"@types/conventional-changelog": "^3.1.4",
|
||||||
|
"@types/conventional-changelog-core": "^4.2.5",
|
||||||
|
"@types/conventional-changelog-preset-loader": "^2.3.4",
|
||||||
"@types/fs-extra": "^11.0.2",
|
"@types/fs-extra": "^11.0.2",
|
||||||
"@types/jest": "29.5.4",
|
"@types/jest": "29.5.4",
|
||||||
"@types/minimist": "1.2.2",
|
"@types/minimist": "1.2.2",
|
||||||
@@ -47,10 +51,16 @@
|
|||||||
"@types/prompts": "^2.4.5",
|
"@types/prompts": "^2.4.5",
|
||||||
"@types/qs": "6.9.7",
|
"@types/qs": "6.9.7",
|
||||||
"@types/react": "18.2.15",
|
"@types/react": "18.2.15",
|
||||||
|
"@types/semver": "^7.5.3",
|
||||||
"@types/shelljs": "0.8.12",
|
"@types/shelljs": "0.8.12",
|
||||||
"@types/testing-library__jest-dom": "5.14.8",
|
"@types/testing-library__jest-dom": "5.14.8",
|
||||||
|
"add-stream": "^1.0.0",
|
||||||
"chalk": "^5.3.0",
|
"chalk": "^5.3.0",
|
||||||
"chalk-template": "1.1.0",
|
"chalk-template": "1.1.0",
|
||||||
|
"concat-stream": "^2.0.0",
|
||||||
|
"conventional-changelog": "^5.1.0",
|
||||||
|
"conventional-changelog-core": "^7.0.0",
|
||||||
|
"conventional-changelog-preset-loader": "^4.1.0",
|
||||||
"copyfiles": "2.4.1",
|
"copyfiles": "2.4.1",
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"dotenv": "8.6.0",
|
"dotenv": "8.6.0",
|
||||||
@@ -58,6 +68,7 @@
|
|||||||
"form-data": "3.0.1",
|
"form-data": "3.0.1",
|
||||||
"fs-extra": "10.1.0",
|
"fs-extra": "10.1.0",
|
||||||
"get-port": "5.1.1",
|
"get-port": "5.1.1",
|
||||||
|
"get-stream": "6.0.1",
|
||||||
"glob": "8.1.0",
|
"glob": "8.1.0",
|
||||||
"graphql-request": "6.1.0",
|
"graphql-request": "6.1.0",
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
@@ -73,11 +84,14 @@
|
|||||||
"prettier": "^3.0.3",
|
"prettier": "^3.0.3",
|
||||||
"prompts": "2.4.2",
|
"prompts": "2.4.2",
|
||||||
"qs": "6.11.2",
|
"qs": "6.11.2",
|
||||||
|
"read-stream": "^2.1.1",
|
||||||
"rimraf": "3.0.2",
|
"rimraf": "3.0.2",
|
||||||
|
"semver": "^7.5.4",
|
||||||
"shelljs": "0.8.5",
|
"shelljs": "0.8.5",
|
||||||
"simple-git": "^3.20.0",
|
"simple-git": "^3.20.0",
|
||||||
"slash": "3.0.0",
|
"slash": "3.0.0",
|
||||||
"slate": "0.91.4",
|
"slate": "0.91.4",
|
||||||
|
"tempfile": "^3.0.0",
|
||||||
"ts-node": "10.9.1",
|
"ts-node": "10.9.1",
|
||||||
"tsx": "^3.13.0",
|
"tsx": "^3.13.0",
|
||||||
"turbo": "^1.10.15",
|
"turbo": "^1.10.15",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/bundler-vite",
|
"name": "@payloadcms/bundler-vite",
|
||||||
"version": "0.1.2",
|
"version": "0.1.3",
|
||||||
"description": "The officially supported Vite bundler adapter for Payload",
|
"description": "The officially supported Vite bundler adapter for Payload",
|
||||||
"repository": "https://github.com/payloadcms/payload",
|
"repository": "https://github.com/payloadcms/payload",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
"payload": "workspace:*"
|
"payload": "workspace:*"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
"payload": "^2.0.0",
|
||||||
"react-dom": "18.2.0"
|
"react-dom": "18.2.0"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ export const getViteConfig = async (payloadConfig: SanitizedConfig): Promise<Inl
|
|||||||
// Dependencies that need aliases should be excluded
|
// Dependencies that need aliases should be excluded
|
||||||
// from pre-bundling
|
// from pre-bundling
|
||||||
'@payloadcms/bundler-vite',
|
'@payloadcms/bundler-vite',
|
||||||
|
...(Object.keys(absoluteAliases) || []),
|
||||||
],
|
],
|
||||||
include: ['payload/components/root', 'react-dom/client'],
|
include: ['payload/components/root', 'react-dom/client'],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/bundler-webpack",
|
"name": "@payloadcms/bundler-webpack",
|
||||||
"version": "1.0.3",
|
"version": "1.0.5",
|
||||||
"description": "The officially supported Webpack bundler adapter for Payload",
|
"description": "The officially supported Webpack bundler adapter for Payload",
|
||||||
"repository": "https://github.com/payloadcms/payload",
|
"repository": "https://github.com/payloadcms/payload",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -58,6 +58,9 @@
|
|||||||
"@types/webpack-hot-middleware": "2.25.6",
|
"@types/webpack-hot-middleware": "2.25.6",
|
||||||
"payload": "workspace:*"
|
"payload": "workspace:*"
|
||||||
},
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"payload": "^2.0.0"
|
||||||
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"registry": "https://registry.npmjs.org/",
|
"registry": "https://registry.npmjs.org/",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import type { SanitizedConfig } from 'payload/config'
|
|||||||
import type { Configuration } from 'webpack'
|
import type { Configuration } from 'webpack'
|
||||||
|
|
||||||
import findNodeModules from 'find-node-modules'
|
import findNodeModules from 'find-node-modules'
|
||||||
|
import fs from 'fs'
|
||||||
import HtmlWebpackPlugin from 'html-webpack-plugin'
|
import HtmlWebpackPlugin from 'html-webpack-plugin'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import webpack from 'webpack'
|
import webpack from 'webpack'
|
||||||
@@ -9,11 +10,24 @@ import webpack from 'webpack'
|
|||||||
const mockModulePath = path.resolve(__dirname, '../mocks/emptyModule.js')
|
const mockModulePath = path.resolve(__dirname, '../mocks/emptyModule.js')
|
||||||
const mockDotENVPath = path.resolve(__dirname, '../mocks/dotENV.js')
|
const mockDotENVPath = path.resolve(__dirname, '../mocks/dotENV.js')
|
||||||
|
|
||||||
const nodeModulesPaths = findNodeModules({ cwd: process.cwd() })
|
const nodeModulesPaths = findNodeModules({ cwd: process.cwd(), relative: false })
|
||||||
const nodeModulesPath = path.resolve(nodeModulesPaths[0])
|
|
||||||
|
export const getBaseConfig = (payloadConfig: SanitizedConfig): Configuration => {
|
||||||
|
let nodeModulesPath = nodeModulesPaths.find((p) => {
|
||||||
|
const guess = path.resolve(p, 'payload/dist/admin')
|
||||||
|
if (fs.existsSync(guess)) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!nodeModulesPath) {
|
||||||
|
nodeModulesPath = process.cwd()
|
||||||
|
}
|
||||||
|
|
||||||
const adminFolderPath = path.resolve(nodeModulesPath, 'payload/dist/admin')
|
const adminFolderPath = path.resolve(nodeModulesPath, 'payload/dist/admin')
|
||||||
|
|
||||||
export const getBaseConfig = (payloadConfig: SanitizedConfig): Configuration => ({
|
const config: Configuration = {
|
||||||
entry: {
|
entry: {
|
||||||
main: [adminFolderPath],
|
main: [adminFolderPath],
|
||||||
},
|
},
|
||||||
@@ -64,7 +78,6 @@ export const getBaseConfig = (payloadConfig: SanitizedConfig): Configuration =>
|
|||||||
filename: path.normalize('./index.html'),
|
filename: path.normalize('./index.html'),
|
||||||
template: payloadConfig.admin.indexHTML,
|
template: payloadConfig.admin.indexHTML,
|
||||||
}),
|
}),
|
||||||
new webpack.HotModuleReplacementPlugin(),
|
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
@@ -83,4 +96,7 @@ export const getBaseConfig = (payloadConfig: SanitizedConfig): Configuration =>
|
|||||||
},
|
},
|
||||||
modules: ['node_modules', nodeModulesPath, path.resolve(__dirname, '../../node_modules')],
|
modules: ['node_modules', nodeModulesPath, path.resolve(__dirname, '../../node_modules')],
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
|
|
||||||
|
return config
|
||||||
|
}
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
export const webpackBundler = () => {}
|
export const webpackBundler = () => {}
|
||||||
|
|
||||||
|
export default () => {}
|
||||||
|
|||||||
15
packages/create-payload-app/.swcrc
Normal file
15
packages/create-payload-app/.swcrc
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/swcrc",
|
||||||
|
"sourceMaps": "inline",
|
||||||
|
"jsc": {
|
||||||
|
"target": "esnext",
|
||||||
|
"parser": {
|
||||||
|
"syntax": "typescript",
|
||||||
|
"tsx": true,
|
||||||
|
"dts": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"module": {
|
||||||
|
"type": "commonjs"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,18 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "create-payload-app",
|
"name": "create-payload-app",
|
||||||
"version": "0.5.2",
|
"version": "1.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bin": {
|
"bin": {
|
||||||
"create-payload-app": "bin/cli.js"
|
"create-payload-app": "bin/cli.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc && pnpm copyfiles",
|
"build": "pnpm build:swc",
|
||||||
"copyfiles": "copyfiles -u 1 \"src/templates/**\" \"src/lib/common-files/**\" dist",
|
"build:swc": "swc ./src -d ./dist --config-file .swcrc",
|
||||||
"clean": "rimraf dist",
|
"clean": "rimraf {dist,*.tsbuildinfo}",
|
||||||
"typecheck": "tsc --noEmit",
|
|
||||||
"lint": "eslint \"src/**/*.ts\"",
|
|
||||||
"lint:fix": "eslint \"src/**/*.ts\" --fix",
|
|
||||||
"lint-staged": "lint-staged --quiet",
|
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"prepublishOnly": "pnpm test && pnpm clean && pnpm build"
|
"prepublishOnly": "pnpm test && pnpm clean && pnpm build"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import type { BundlerType, CliArgs, DbType, ProjectTemplate } from '../types'
|
|||||||
import { createProject } from './create-project'
|
import { createProject } from './create-project'
|
||||||
import { bundlerPackages, dbPackages, editorPackages } from './packages'
|
import { bundlerPackages, dbPackages, editorPackages } from './packages'
|
||||||
import exp from 'constants'
|
import exp from 'constants'
|
||||||
|
import { getValidTemplates } from './templates'
|
||||||
|
|
||||||
const projectDir = path.resolve(__dirname, './tmp')
|
const projectDir = path.resolve(__dirname, './tmp')
|
||||||
describe('createProject', () => {
|
describe('createProject', () => {
|
||||||
@@ -78,17 +79,20 @@ describe('createProject', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
describe('db adapters and bundlers', () => {
|
describe('db adapters and bundlers', () => {
|
||||||
|
const templates = getValidTemplates()
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
['mongodb', 'webpack'],
|
['blank', 'mongodb', 'webpack'],
|
||||||
['postgres', 'webpack'],
|
['blank', 'postgres', 'webpack'],
|
||||||
])('update config and deps: %s, %s', async (db, bundler) => {
|
['website', 'mongodb', 'webpack'],
|
||||||
|
['website', 'postgres', 'webpack'],
|
||||||
|
['ecommerce', 'mongodb', 'webpack'],
|
||||||
|
['ecommerce', 'postgres', 'webpack'],
|
||||||
|
])('update config and deps: %s, %s, %s', async (templateName, db, bundler) => {
|
||||||
const projectName = 'starter-project'
|
const projectName = 'starter-project'
|
||||||
const template: ProjectTemplate = {
|
|
||||||
name: 'blank',
|
const template = templates.find((t) => t.name === templateName)
|
||||||
type: 'starter',
|
|
||||||
url: 'https://github.com/payloadcms/payload/templates/blank',
|
|
||||||
description: 'Blank Template',
|
|
||||||
}
|
|
||||||
await createProject({
|
await createProject({
|
||||||
cliArgs: args,
|
cliArgs: args,
|
||||||
projectName,
|
projectName,
|
||||||
@@ -124,7 +128,12 @@ describe('createProject', () => {
|
|||||||
editorReplacement.version,
|
editorReplacement.version,
|
||||||
)
|
)
|
||||||
|
|
||||||
const payloadConfigPath = path.resolve(projectDir, 'src/payload.config.ts')
|
let payloadConfigPath = path.resolve(projectDir, 'src/payload.config.ts')
|
||||||
|
|
||||||
|
// Website and ecommerce templates have payload.config.ts in src/payload
|
||||||
|
if (!fse.existsSync(payloadConfigPath)) {
|
||||||
|
payloadConfigPath = path.resolve(projectDir, 'src/payload/payload.config.ts')
|
||||||
|
}
|
||||||
const content = fse.readFileSync(payloadConfigPath, 'utf-8')
|
const content = fse.readFileSync(payloadConfigPath, 'utf-8')
|
||||||
|
|
||||||
// Check payload.config.ts
|
// Check payload.config.ts
|
||||||
|
|||||||
@@ -19,6 +19,5 @@
|
|||||||
"src/**/*.spec.ts",
|
"src/**/*.spec.ts",
|
||||||
"src/**/*.spec.tsx"
|
"src/**/*.spec.tsx"
|
||||||
],
|
],
|
||||||
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"],
|
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"]
|
||||||
"references": [{ "path": "../payload" }]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/db-mongodb",
|
"name": "@payloadcms/db-mongodb",
|
||||||
"version": "1.0.3",
|
"version": "1.0.6",
|
||||||
"description": "The officially supported MongoDB database adapter for Payload",
|
"description": "The officially supported MongoDB database adapter for Payload",
|
||||||
"repository": "https://github.com/payloadcms/payload",
|
"repository": "https://github.com/payloadcms/payload",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -35,6 +35,9 @@
|
|||||||
"mongodb-memory-server": "8.13.0",
|
"mongodb-memory-server": "8.13.0",
|
||||||
"payload": "workspace:*"
|
"payload": "workspace:*"
|
||||||
},
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"payload": "^2.0.0"
|
||||||
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"registry": "https://registry.npmjs.org/",
|
"registry": "https://registry.npmjs.org/",
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import type { Create } from 'payload/database'
|
import type { Create } from 'payload/database'
|
||||||
import type { PayloadRequest } from 'payload/types'
|
import type { Document, PayloadRequest } from 'payload/types'
|
||||||
import type { Document } from 'payload/types'
|
|
||||||
|
|
||||||
import type { MongooseAdapter } from '.'
|
import type { MongooseAdapter } from '.'
|
||||||
|
|
||||||
import { withSession } from './withSession'
|
import { withSession } from './withSession'
|
||||||
|
import { ValidationError } from 'payload/errors'
|
||||||
|
import { i18nInit } from 'payload/utilities'
|
||||||
|
|
||||||
export const create: Create = async function create(
|
export const create: Create = async function create(
|
||||||
this: MongooseAdapter,
|
this: MongooseAdapter,
|
||||||
@@ -12,8 +13,23 @@ export const create: Create = async function create(
|
|||||||
) {
|
) {
|
||||||
const Model = this.collections[collection]
|
const Model = this.collections[collection]
|
||||||
const options = withSession(this, req.transactionID)
|
const options = withSession(this, req.transactionID)
|
||||||
|
let doc
|
||||||
const [doc] = await Model.create([data], options)
|
try {
|
||||||
|
;[doc] = await Model.create([data], options)
|
||||||
|
} catch (error) {
|
||||||
|
// Handle uniqueness error from MongoDB
|
||||||
|
throw error.code === 11000 && error.keyValue
|
||||||
|
? new ValidationError(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
field: Object.keys(error.keyValue)[0],
|
||||||
|
message: req.t('error:valueMustBeUnique'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
req?.t ?? i18nInit(this.payload.config.i18n).t,
|
||||||
|
)
|
||||||
|
: error
|
||||||
|
}
|
||||||
|
|
||||||
// doc.toJSON does not do stuff like converting ObjectIds to string, or date strings to date objects. That's why we use JSON.parse/stringify here
|
// doc.toJSON does not do stuff like converting ObjectIds to string, or date strings to date objects. That's why we use JSON.parse/stringify here
|
||||||
const result: Document = JSON.parse(JSON.stringify(doc))
|
const result: Document = JSON.parse(JSON.stringify(doc))
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ export const find: Find = async function find(
|
|||||||
where,
|
where,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// useEstimatedCount is faster, but not accurate, as it ignores any filters. It is thus set to true if there are no filters.
|
||||||
|
const useEstimatedCount = hasNearConstraint || !query || Object.keys(query).length === 0
|
||||||
const paginationOptions: PaginateOptions = {
|
const paginationOptions: PaginateOptions = {
|
||||||
forceCountFn: hasNearConstraint,
|
forceCountFn: hasNearConstraint,
|
||||||
lean: true,
|
lean: true,
|
||||||
@@ -50,7 +52,18 @@ export const find: Find = async function find(
|
|||||||
page,
|
page,
|
||||||
pagination,
|
pagination,
|
||||||
sort,
|
sort,
|
||||||
useEstimatedCount: hasNearConstraint,
|
useEstimatedCount,
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!useEstimatedCount) {
|
||||||
|
// Improve the performance of the countDocuments query which is used if useEstimatedCount is set to false by adding a hint.
|
||||||
|
paginationOptions.useCustomCountFn = () => {
|
||||||
|
return Promise.resolve(
|
||||||
|
Model.countDocuments(query, {
|
||||||
|
hint: { _id: 1 },
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (limit > 0) {
|
if (limit > 0) {
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ export const findGlobalVersions: FindGlobalVersions = async function findGlobalV
|
|||||||
where,
|
where,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// useEstimatedCount is faster, but not accurate, as it ignores any filters. It is thus set to true if there are no filters.
|
||||||
|
const useEstimatedCount = hasNearConstraint || !query || Object.keys(query).length === 0
|
||||||
const paginationOptions: PaginateOptions = {
|
const paginationOptions: PaginateOptions = {
|
||||||
forceCountFn: hasNearConstraint,
|
forceCountFn: hasNearConstraint,
|
||||||
lean: true,
|
lean: true,
|
||||||
@@ -69,7 +71,18 @@ export const findGlobalVersions: FindGlobalVersions = async function findGlobalV
|
|||||||
page,
|
page,
|
||||||
pagination,
|
pagination,
|
||||||
sort,
|
sort,
|
||||||
useEstimatedCount: hasNearConstraint,
|
useEstimatedCount,
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!useEstimatedCount) {
|
||||||
|
// Improve the performance of the countDocuments query which is used if useEstimatedCount is set to false by adding a hint.
|
||||||
|
paginationOptions.useCustomCountFn = () => {
|
||||||
|
return Promise.resolve(
|
||||||
|
Model.countDocuments(query, {
|
||||||
|
hint: { _id: 1 },
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (limit > 0) {
|
if (limit > 0) {
|
||||||
|
|||||||
@@ -56,17 +56,30 @@ export const findVersions: FindVersions = async function findVersions(
|
|||||||
where,
|
where,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// useEstimatedCount is faster, but not accurate, as it ignores any filters. It is thus set to true if there are no filters.
|
||||||
|
const useEstimatedCount = hasNearConstraint || !query || Object.keys(query).length === 0
|
||||||
const paginationOptions: PaginateOptions = {
|
const paginationOptions: PaginateOptions = {
|
||||||
forceCountFn: hasNearConstraint,
|
forceCountFn: hasNearConstraint,
|
||||||
lean: true,
|
lean: true,
|
||||||
leanWithId: true,
|
leanWithId: true,
|
||||||
limit,
|
limit,
|
||||||
offset: skip,
|
offset: skip || 0,
|
||||||
options,
|
options,
|
||||||
page,
|
page,
|
||||||
pagination,
|
pagination,
|
||||||
sort,
|
sort,
|
||||||
useEstimatedCount: hasNearConstraint,
|
useEstimatedCount,
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!useEstimatedCount) {
|
||||||
|
// Improve the performance of the countDocuments query which is used if useEstimatedCount is set to false by adding a hint.
|
||||||
|
paginationOptions.useCustomCountFn = () => {
|
||||||
|
return Promise.resolve(
|
||||||
|
Model.countDocuments(query, {
|
||||||
|
hint: { _id: 1 },
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (limit > 0) {
|
if (limit > 0) {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export const init: Init = async function init(this: MongooseAdapter) {
|
|||||||
const model = mongoose.model(
|
const model = mongoose.model(
|
||||||
versionModelName,
|
versionModelName,
|
||||||
versionSchema,
|
versionSchema,
|
||||||
versionModelName,
|
this.autoPluralization === true ? undefined : versionModelName,
|
||||||
) as CollectionModel
|
) as CollectionModel
|
||||||
// this.payload.versions[collection.slug] = model;
|
// this.payload.versions[collection.slug] = model;
|
||||||
this.versions[collection.slug] = model
|
this.versions[collection.slug] = model
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ export const queryDrafts: QueryDrafts = async function queryDrafts(
|
|||||||
where: combinedWhere,
|
where: combinedWhere,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// useEstimatedCount is faster, but not accurate, as it ignores any filters. It is thus set to true if there are no filters.
|
||||||
|
const useEstimatedCount =
|
||||||
|
hasNearConstraint || !versionQuery || Object.keys(versionQuery).length === 0
|
||||||
const paginationOptions: PaginateOptions = {
|
const paginationOptions: PaginateOptions = {
|
||||||
forceCountFn: hasNearConstraint,
|
forceCountFn: hasNearConstraint,
|
||||||
lean: true,
|
lean: true,
|
||||||
@@ -52,7 +55,18 @@ export const queryDrafts: QueryDrafts = async function queryDrafts(
|
|||||||
page,
|
page,
|
||||||
pagination,
|
pagination,
|
||||||
sort,
|
sort,
|
||||||
useEstimatedCount: hasNearConstraint,
|
useEstimatedCount,
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!useEstimatedCount) {
|
||||||
|
// Improve the performance of the countDocuments query which is used if useEstimatedCount is set to false by adding a hint.
|
||||||
|
paginationOptions.useCustomCountFn = () => {
|
||||||
|
return Promise.resolve(
|
||||||
|
VersionModel.countDocuments(versionQuery, {
|
||||||
|
hint: { _id: 1 },
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (limit > 0) {
|
if (limit > 0) {
|
||||||
|
|||||||
@@ -7,9 +7,17 @@ import { withSession } from './withSession'
|
|||||||
|
|
||||||
export async function updateGlobalVersion<T extends TypeWithID>(
|
export async function updateGlobalVersion<T extends TypeWithID>(
|
||||||
this: MongooseAdapter,
|
this: MongooseAdapter,
|
||||||
{ global, locale, req = {} as PayloadRequest, versionData, where }: UpdateGlobalVersionArgs<T>,
|
{
|
||||||
|
id,
|
||||||
|
global,
|
||||||
|
locale,
|
||||||
|
req = {} as PayloadRequest,
|
||||||
|
versionData,
|
||||||
|
where,
|
||||||
|
}: UpdateGlobalVersionArgs<T>,
|
||||||
) {
|
) {
|
||||||
const VersionModel = this.versions[global]
|
const VersionModel = this.versions[global]
|
||||||
|
const whereToUse = where || { id: { equals: id } }
|
||||||
const options = {
|
const options = {
|
||||||
...withSession(this, req.transactionID),
|
...withSession(this, req.transactionID),
|
||||||
lean: true,
|
lean: true,
|
||||||
@@ -19,7 +27,7 @@ export async function updateGlobalVersion<T extends TypeWithID>(
|
|||||||
const query = await VersionModel.buildQuery({
|
const query = await VersionModel.buildQuery({
|
||||||
locale,
|
locale,
|
||||||
payload: this.payload,
|
payload: this.payload,
|
||||||
where,
|
where: whereToUse,
|
||||||
})
|
})
|
||||||
|
|
||||||
const doc = await VersionModel.findOneAndUpdate(query, versionData, options)
|
const doc = await VersionModel.findOneAndUpdate(query, versionData, options)
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ import { withSession } from './withSession'
|
|||||||
|
|
||||||
export const updateVersion: UpdateVersion = async function updateVersion(
|
export const updateVersion: UpdateVersion = async function updateVersion(
|
||||||
this: MongooseAdapter,
|
this: MongooseAdapter,
|
||||||
{ collection, locale, req = {} as PayloadRequest, versionData, where },
|
{ id, collection, locale, req = {} as PayloadRequest, versionData, where },
|
||||||
) {
|
) {
|
||||||
const VersionModel = this.versions[collection]
|
const VersionModel = this.versions[collection]
|
||||||
|
const whereToUse = where || { id: { equals: id } }
|
||||||
const options = {
|
const options = {
|
||||||
...withSession(this, req.transactionID),
|
...withSession(this, req.transactionID),
|
||||||
lean: true,
|
lean: true,
|
||||||
@@ -19,7 +20,7 @@ export const updateVersion: UpdateVersion = async function updateVersion(
|
|||||||
const query = await VersionModel.buildQuery({
|
const query = await VersionModel.buildQuery({
|
||||||
locale,
|
locale,
|
||||||
payload: this.payload,
|
payload: this.payload,
|
||||||
where,
|
where: whereToUse,
|
||||||
})
|
})
|
||||||
|
|
||||||
const doc = await VersionModel.findOneAndUpdate(query, versionData, options)
|
const doc = await VersionModel.findOneAndUpdate(query, versionData, options)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/db-postgres",
|
"name": "@payloadcms/db-postgres",
|
||||||
"version": "0.1.8",
|
"version": "0.1.11",
|
||||||
"description": "The officially supported Postgres database adapter for Payload",
|
"description": "The officially supported Postgres database adapter for Payload",
|
||||||
"repository": "https://github.com/payloadcms/payload",
|
"repository": "https://github.com/payloadcms/payload",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -34,6 +34,9 @@
|
|||||||
"@types/to-snake-case": "1.0.0",
|
"@types/to-snake-case": "1.0.0",
|
||||||
"payload": "workspace:*"
|
"payload": "workspace:*"
|
||||||
},
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"payload": "^2.0.0"
|
||||||
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"registry": "https://registry.npmjs.org/",
|
"registry": "https://registry.npmjs.org/",
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export const create: Create = async function create(
|
|||||||
fields: collection.fields,
|
fields: collection.fields,
|
||||||
operation: 'create',
|
operation: 'create',
|
||||||
tableName: toSnakeCase(collectionSlug),
|
tableName: toSnakeCase(collectionSlug),
|
||||||
|
req,
|
||||||
})
|
})
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export async function createGlobal<T extends TypeWithID>(
|
|||||||
fields: globalConfig.fields,
|
fields: globalConfig.fields,
|
||||||
operation: 'create',
|
operation: 'create',
|
||||||
tableName: toSnakeCase(slug),
|
tableName: toSnakeCase(slug),
|
||||||
|
req,
|
||||||
})
|
})
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import type { TypeWithVersion } from 'payload/database'
|
import type { TypeWithVersion } from 'payload/database'
|
||||||
|
import { type CreateGlobalVersionArgs } from 'payload/database'
|
||||||
import type { PayloadRequest, TypeWithID } from 'payload/types'
|
import type { PayloadRequest, TypeWithID } from 'payload/types'
|
||||||
|
|
||||||
import { sql } from 'drizzle-orm'
|
import { sql } from 'drizzle-orm'
|
||||||
import { type CreateGlobalVersionArgs } from 'payload/database'
|
|
||||||
import { buildVersionGlobalFields } from 'payload/versions'
|
import { buildVersionGlobalFields } from 'payload/versions'
|
||||||
import toSnakeCase from 'to-snake-case'
|
import toSnakeCase from 'to-snake-case'
|
||||||
|
|
||||||
@@ -30,6 +30,7 @@ export async function createGlobalVersion<T extends TypeWithID>(
|
|||||||
fields: buildVersionGlobalFields(global),
|
fields: buildVersionGlobalFields(global),
|
||||||
operation: 'create',
|
operation: 'create',
|
||||||
tableName,
|
tableName,
|
||||||
|
req,
|
||||||
})
|
})
|
||||||
|
|
||||||
const table = this.tables[tableName]
|
const table = this.tables[tableName]
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ export async function createVersion<T extends TypeWithID>(
|
|||||||
fields: buildVersionCollectionFields(collection),
|
fields: buildVersionCollectionFields(collection),
|
||||||
operation: 'create',
|
operation: 'create',
|
||||||
tableName,
|
tableName,
|
||||||
|
req,
|
||||||
})
|
})
|
||||||
|
|
||||||
const table = this.tables[tableName]
|
const table = this.tables[tableName]
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ export const traverseFields = ({
|
|||||||
with: {},
|
with: {},
|
||||||
}
|
}
|
||||||
|
|
||||||
if (adapter.tables[`${topLevelTableName}_${toSnakeCase(block.slug)}_locales`])
|
if (adapter.tables[`${topLevelTableName}_blocks_${toSnakeCase(block.slug)}_locales`])
|
||||||
withBlock.with._locales = _locales
|
withBlock.with._locales = _locales
|
||||||
topLevelArgs.with[blockKey] = withBlock
|
topLevelArgs.with[blockKey] = withBlock
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ export const traverseFields = ({
|
|||||||
currentTableName,
|
currentTableName,
|
||||||
depth,
|
depth,
|
||||||
fields: block.fields,
|
fields: block.fields,
|
||||||
path,
|
path: '',
|
||||||
topLevelArgs,
|
topLevelArgs,
|
||||||
topLevelTableName,
|
topLevelTableName,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ export function postgresAdapter(args: Args): PostgresAdapterResult {
|
|||||||
schema: {},
|
schema: {},
|
||||||
sessions: {},
|
sessions: {},
|
||||||
tables: {},
|
tables: {},
|
||||||
|
fieldConstraints: {},
|
||||||
|
|
||||||
// DatabaseAdapter
|
// DatabaseAdapter
|
||||||
beginTransaction,
|
beginTransaction,
|
||||||
|
|||||||
13
packages/db-postgres/src/schema/idToUUID.ts
Normal file
13
packages/db-postgres/src/schema/idToUUID.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import type { Field } from 'payload/types'
|
||||||
|
|
||||||
|
export const idToUUID = (fields: Field[]): Field[] =>
|
||||||
|
fields.map((field) => {
|
||||||
|
if ('name' in field && field.name === 'id') {
|
||||||
|
return {
|
||||||
|
...field,
|
||||||
|
name: '_uuid',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return field
|
||||||
|
})
|
||||||
@@ -1,24 +1,23 @@
|
|||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
import type { Relation } from 'drizzle-orm'
|
import type { Relation } from 'drizzle-orm'
|
||||||
import type { IndexBuilder, PgColumnBuilder, UniqueConstraintBuilder } from 'drizzle-orm/pg-core'
|
|
||||||
import type { Field, TabAsField } from 'payload/types'
|
|
||||||
|
|
||||||
import { relations } from 'drizzle-orm'
|
import { relations } from 'drizzle-orm'
|
||||||
|
import type { IndexBuilder, PgColumnBuilder, UniqueConstraintBuilder } from 'drizzle-orm/pg-core'
|
||||||
import {
|
import {
|
||||||
PgNumericBuilder,
|
|
||||||
PgVarcharBuilder,
|
|
||||||
boolean,
|
boolean,
|
||||||
index,
|
index,
|
||||||
integer,
|
integer,
|
||||||
jsonb,
|
jsonb,
|
||||||
numeric,
|
numeric,
|
||||||
pgEnum,
|
pgEnum,
|
||||||
|
PgNumericBuilder,
|
||||||
|
PgVarcharBuilder,
|
||||||
text,
|
text,
|
||||||
timestamp,
|
timestamp,
|
||||||
varchar,
|
varchar,
|
||||||
} from 'drizzle-orm/pg-core'
|
} from 'drizzle-orm/pg-core'
|
||||||
import { InvalidConfiguration } from 'payload/errors'
|
import type { Field, TabAsField } from 'payload/types'
|
||||||
import { fieldAffectsData, optionIsObject } from 'payload/types'
|
import { fieldAffectsData, optionIsObject } from 'payload/types'
|
||||||
|
import { InvalidConfiguration } from 'payload/errors'
|
||||||
import toSnakeCase from 'to-snake-case'
|
import toSnakeCase from 'to-snake-case'
|
||||||
|
|
||||||
import type { GenericColumns, PostgresAdapter } from '../types'
|
import type { GenericColumns, PostgresAdapter } from '../types'
|
||||||
@@ -26,6 +25,7 @@ import type { GenericColumns, PostgresAdapter } from '../types'
|
|||||||
import { hasLocalesTable } from '../utilities/hasLocalesTable'
|
import { hasLocalesTable } from '../utilities/hasLocalesTable'
|
||||||
import { buildTable } from './build'
|
import { buildTable } from './build'
|
||||||
import { createIndex } from './createIndex'
|
import { createIndex } from './createIndex'
|
||||||
|
import { idToUUID } from './idToUUID'
|
||||||
import { parentIDColumnMap } from './parentIDColumnMap'
|
import { parentIDColumnMap } from './parentIDColumnMap'
|
||||||
import { validateExistingBlockIsIdentical } from './validateExistingBlockIsIdentical'
|
import { validateExistingBlockIsIdentical } from './validateExistingBlockIsIdentical'
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ export const traverseFields = ({
|
|||||||
columnName = `${columnPrefix || ''}${field.name[0] === '_' ? '_' : ''}${toSnakeCase(
|
columnName = `${columnPrefix || ''}${field.name[0] === '_' ? '_' : ''}${toSnakeCase(
|
||||||
field.name,
|
field.name,
|
||||||
)}`
|
)}`
|
||||||
fieldName = `${fieldPrefix || ''}${field.name}`
|
fieldName = `${fieldPrefix?.replace('.', '_') || ''}${field.name}`
|
||||||
|
|
||||||
// If field is localized,
|
// If field is localized,
|
||||||
// add the column to the locale table instead of main table
|
// add the column to the locale table instead of main table
|
||||||
@@ -115,10 +115,18 @@ export const traverseFields = ({
|
|||||||
!['array', 'blocks', 'group', 'point', 'relationship', 'upload'].includes(field.type) &&
|
!['array', 'blocks', 'group', 'point', 'relationship', 'upload'].includes(field.type) &&
|
||||||
!(field.type === 'number' && field.hasMany === true)
|
!(field.type === 'number' && field.hasMany === true)
|
||||||
) {
|
) {
|
||||||
|
const unique = disableUnique !== true && field.unique
|
||||||
|
if (unique) {
|
||||||
|
const constraintValue = `${fieldPrefix || ''}${field.name}`
|
||||||
|
if (!adapter.fieldConstraints?.[rootTableName]) {
|
||||||
|
adapter.fieldConstraints[rootTableName] = {}
|
||||||
|
}
|
||||||
|
adapter.fieldConstraints[rootTableName][`${columnName}_idx`] = constraintValue
|
||||||
|
}
|
||||||
targetIndexes[`${field.name}Idx`] = createIndex({
|
targetIndexes[`${field.name}Idx`] = createIndex({
|
||||||
name: fieldName,
|
name: fieldName,
|
||||||
columnName,
|
columnName,
|
||||||
unique: disableUnique !== true && field.unique,
|
unique,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -281,7 +289,7 @@ export const traverseFields = ({
|
|||||||
baseExtraConfig,
|
baseExtraConfig,
|
||||||
disableNotNull: disableNotNullFromHere,
|
disableNotNull: disableNotNullFromHere,
|
||||||
disableUnique,
|
disableUnique,
|
||||||
fields: field.fields,
|
fields: disableUnique ? idToUUID(field.fields) : field.fields,
|
||||||
rootRelationsToBuild,
|
rootRelationsToBuild,
|
||||||
rootRelationships: relationships,
|
rootRelationships: relationships,
|
||||||
rootTableIDColType,
|
rootTableIDColType,
|
||||||
@@ -349,7 +357,7 @@ export const traverseFields = ({
|
|||||||
baseExtraConfig,
|
baseExtraConfig,
|
||||||
disableNotNull: disableNotNullFromHere,
|
disableNotNull: disableNotNullFromHere,
|
||||||
disableUnique,
|
disableUnique,
|
||||||
fields: block.fields,
|
fields: disableUnique ? idToUUID(block.fields) : block.fields,
|
||||||
rootRelationsToBuild,
|
rootRelationsToBuild,
|
||||||
rootRelationships: relationships,
|
rootRelationships: relationships,
|
||||||
rootTableIDColType,
|
rootTableIDColType,
|
||||||
@@ -446,7 +454,7 @@ export const traverseFields = ({
|
|||||||
columns,
|
columns,
|
||||||
disableNotNull: disableNotNullFromHere,
|
disableNotNull: disableNotNullFromHere,
|
||||||
disableUnique,
|
disableUnique,
|
||||||
fieldPrefix: `${fieldName}_`,
|
fieldPrefix: `${fieldName}.`,
|
||||||
fields: field.fields,
|
fields: field.fields,
|
||||||
forceLocalized: field.localized,
|
forceLocalized: field.localized,
|
||||||
indexes,
|
indexes,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export const validateExistingBlockIsIdentical = ({
|
|||||||
const fieldNames = flattenTopLevelFields(block.fields).flatMap((field) => field.name)
|
const fieldNames = flattenTopLevelFields(block.fields).flatMap((field) => field.name)
|
||||||
|
|
||||||
Object.keys(table).forEach((fieldName) => {
|
Object.keys(table).forEach((fieldName) => {
|
||||||
if (!['_locale', '_order', '_parentID', '_path'].includes(fieldName)) {
|
if (!['_locale', '_order', '_parentID', '_path', '_uuid'].includes(fieldName)) {
|
||||||
if (fieldNames.indexOf(fieldName) === -1) {
|
if (fieldNames.indexOf(fieldName) === -1) {
|
||||||
throw new InvalidConfiguration(
|
throw new InvalidConfiguration(
|
||||||
`The table ${rootTableName} has multiple blocks with slug ${block.slug}, but the schemas do not match. One block includes the field ${fieldName}, while the other block does not.`,
|
`The table ${rootTableName} has multiple blocks with slug ${block.slug}, but the schemas do not match. One block includes the field ${fieldName}, while the other block does not.`,
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export const transform = <T extends TypeWithID>({ config, data, fields }: Transf
|
|||||||
}
|
}
|
||||||
|
|
||||||
const blocks = createBlocksMap(data)
|
const blocks = createBlocksMap(data)
|
||||||
|
const deletions = []
|
||||||
|
|
||||||
const result = traverseFields<T>({
|
const result = traverseFields<T>({
|
||||||
blocks,
|
blocks,
|
||||||
@@ -38,6 +39,7 @@ export const transform = <T extends TypeWithID>({ config, data, fields }: Transf
|
|||||||
dataRef: {
|
dataRef: {
|
||||||
id: data.id,
|
id: data.id,
|
||||||
},
|
},
|
||||||
|
deletions,
|
||||||
fieldPrefix: '',
|
fieldPrefix: '',
|
||||||
fields,
|
fields,
|
||||||
numbers,
|
numbers,
|
||||||
@@ -46,5 +48,7 @@ export const transform = <T extends TypeWithID>({ config, data, fields }: Transf
|
|||||||
table: data,
|
table: data,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
deletions.forEach((deletion) => deletion())
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ type TraverseFieldsArgs = {
|
|||||||
* The data reference to be mutated within this recursive function
|
* The data reference to be mutated within this recursive function
|
||||||
*/
|
*/
|
||||||
dataRef: Record<string, unknown>
|
dataRef: Record<string, unknown>
|
||||||
|
/**
|
||||||
|
* Data that needs to be removed from the result after all fields have populated
|
||||||
|
*/
|
||||||
|
deletions: (() => void)[]
|
||||||
/**
|
/**
|
||||||
* Column prefix can be built up by group and named tab fields
|
* Column prefix can be built up by group and named tab fields
|
||||||
*/
|
*/
|
||||||
@@ -54,6 +58,7 @@ export const traverseFields = <T extends Record<string, unknown>>({
|
|||||||
blocks,
|
blocks,
|
||||||
config,
|
config,
|
||||||
dataRef,
|
dataRef,
|
||||||
|
deletions,
|
||||||
fieldPrefix,
|
fieldPrefix,
|
||||||
fields,
|
fields,
|
||||||
numbers,
|
numbers,
|
||||||
@@ -69,6 +74,7 @@ export const traverseFields = <T extends Record<string, unknown>>({
|
|||||||
blocks,
|
blocks,
|
||||||
config,
|
config,
|
||||||
dataRef,
|
dataRef,
|
||||||
|
deletions,
|
||||||
fieldPrefix,
|
fieldPrefix,
|
||||||
fields: field.tabs.map((tab) => ({ ...tab, type: 'tab' })),
|
fields: field.tabs.map((tab) => ({ ...tab, type: 'tab' })),
|
||||||
numbers,
|
numbers,
|
||||||
@@ -87,6 +93,7 @@ export const traverseFields = <T extends Record<string, unknown>>({
|
|||||||
blocks,
|
blocks,
|
||||||
config,
|
config,
|
||||||
dataRef,
|
dataRef,
|
||||||
|
deletions,
|
||||||
fieldPrefix,
|
fieldPrefix,
|
||||||
fields: field.fields,
|
fields: field.fields,
|
||||||
numbers,
|
numbers,
|
||||||
@@ -99,7 +106,6 @@ export const traverseFields = <T extends Record<string, unknown>>({
|
|||||||
if (fieldAffectsData(field)) {
|
if (fieldAffectsData(field)) {
|
||||||
const fieldName = `${fieldPrefix || ''}${field.name}`
|
const fieldName = `${fieldPrefix || ''}${field.name}`
|
||||||
const fieldData = table[fieldName]
|
const fieldData = table[fieldName]
|
||||||
|
|
||||||
if (field.type === 'array') {
|
if (field.type === 'array') {
|
||||||
if (Array.isArray(fieldData)) {
|
if (Array.isArray(fieldData)) {
|
||||||
if (field.localized) {
|
if (field.localized) {
|
||||||
@@ -109,11 +115,16 @@ export const traverseFields = <T extends Record<string, unknown>>({
|
|||||||
const locale = row._locale
|
const locale = row._locale
|
||||||
const data = {}
|
const data = {}
|
||||||
delete row._locale
|
delete row._locale
|
||||||
|
if (row._uuid) {
|
||||||
|
row.id = row._uuid
|
||||||
|
delete row._uuid
|
||||||
|
}
|
||||||
|
|
||||||
const rowResult = traverseFields<T>({
|
const rowResult = traverseFields<T>({
|
||||||
blocks,
|
blocks,
|
||||||
config,
|
config,
|
||||||
dataRef: data,
|
dataRef: data,
|
||||||
|
deletions,
|
||||||
fieldPrefix: '',
|
fieldPrefix: '',
|
||||||
fields: field.fields,
|
fields: field.fields,
|
||||||
numbers,
|
numbers,
|
||||||
@@ -129,10 +140,15 @@ export const traverseFields = <T extends Record<string, unknown>>({
|
|||||||
}, {})
|
}, {})
|
||||||
} else {
|
} else {
|
||||||
result[field.name] = fieldData.map((row, i) => {
|
result[field.name] = fieldData.map((row, i) => {
|
||||||
|
if (row._uuid) {
|
||||||
|
row.id = row._uuid
|
||||||
|
delete row._uuid
|
||||||
|
}
|
||||||
return traverseFields<T>({
|
return traverseFields<T>({
|
||||||
blocks,
|
blocks,
|
||||||
config,
|
config,
|
||||||
dataRef: row,
|
dataRef: row,
|
||||||
|
deletions,
|
||||||
fieldPrefix: '',
|
fieldPrefix: '',
|
||||||
fields: field.fields,
|
fields: field.fields,
|
||||||
numbers,
|
numbers,
|
||||||
@@ -155,6 +171,10 @@ export const traverseFields = <T extends Record<string, unknown>>({
|
|||||||
result[field.name] = {}
|
result[field.name] = {}
|
||||||
|
|
||||||
blocks[blockFieldPath].forEach((row) => {
|
blocks[blockFieldPath].forEach((row) => {
|
||||||
|
if (row._uuid) {
|
||||||
|
row.id = row._uuid
|
||||||
|
delete row._uuid
|
||||||
|
}
|
||||||
if (typeof row._locale === 'string') {
|
if (typeof row._locale === 'string') {
|
||||||
if (!result[field.name][row._locale]) result[field.name][row._locale] = []
|
if (!result[field.name][row._locale]) result[field.name][row._locale] = []
|
||||||
result[field.name][row._locale].push(row)
|
result[field.name][row._locale].push(row)
|
||||||
@@ -171,6 +191,7 @@ export const traverseFields = <T extends Record<string, unknown>>({
|
|||||||
blocks,
|
blocks,
|
||||||
config,
|
config,
|
||||||
dataRef: row,
|
dataRef: row,
|
||||||
|
deletions,
|
||||||
fieldPrefix: '',
|
fieldPrefix: '',
|
||||||
fields: block.fields,
|
fields: block.fields,
|
||||||
numbers,
|
numbers,
|
||||||
@@ -189,6 +210,10 @@ export const traverseFields = <T extends Record<string, unknown>>({
|
|||||||
} else {
|
} else {
|
||||||
result[field.name] = blocks[blockFieldPath].map((row, i) => {
|
result[field.name] = blocks[blockFieldPath].map((row, i) => {
|
||||||
delete row._order
|
delete row._order
|
||||||
|
if (row._uuid) {
|
||||||
|
row.id = row._uuid
|
||||||
|
delete row._uuid
|
||||||
|
}
|
||||||
const block = field.blocks.find(({ slug }) => slug === row.blockType)
|
const block = field.blocks.find(({ slug }) => slug === row.blockType)
|
||||||
|
|
||||||
if (block) {
|
if (block) {
|
||||||
@@ -196,6 +221,7 @@ export const traverseFields = <T extends Record<string, unknown>>({
|
|||||||
blocks,
|
blocks,
|
||||||
config,
|
config,
|
||||||
dataRef: row,
|
dataRef: row,
|
||||||
|
deletions,
|
||||||
fieldPrefix: '',
|
fieldPrefix: '',
|
||||||
fields: block.fields,
|
fields: block.fields,
|
||||||
numbers,
|
numbers,
|
||||||
@@ -345,6 +371,7 @@ export const traverseFields = <T extends Record<string, unknown>>({
|
|||||||
blocks,
|
blocks,
|
||||||
config,
|
config,
|
||||||
dataRef: groupLocaleData as Record<string, unknown>,
|
dataRef: groupLocaleData as Record<string, unknown>,
|
||||||
|
deletions,
|
||||||
fieldPrefix: groupFieldPrefix,
|
fieldPrefix: groupFieldPrefix,
|
||||||
fields: field.fields,
|
fields: field.fields,
|
||||||
numbers,
|
numbers,
|
||||||
@@ -360,6 +387,7 @@ export const traverseFields = <T extends Record<string, unknown>>({
|
|||||||
blocks,
|
blocks,
|
||||||
config,
|
config,
|
||||||
dataRef: groupData as Record<string, unknown>,
|
dataRef: groupData as Record<string, unknown>,
|
||||||
|
deletions,
|
||||||
fieldPrefix: groupFieldPrefix,
|
fieldPrefix: groupFieldPrefix,
|
||||||
fields: field.fields,
|
fields: field.fields,
|
||||||
numbers,
|
numbers,
|
||||||
@@ -425,5 +453,9 @@ export const traverseFields = <T extends Record<string, unknown>>({
|
|||||||
return result
|
return result
|
||||||
}, dataRef)
|
}, dataRef)
|
||||||
|
|
||||||
|
if (Array.isArray(table._locales)) {
|
||||||
|
deletions.push(() => delete table._locales)
|
||||||
|
}
|
||||||
|
|
||||||
return formatted as T
|
return formatted as T
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,20 @@
|
|||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
import type { ArrayField } from 'payload/types'
|
import type { ArrayField } from 'payload/types'
|
||||||
|
|
||||||
|
import type { PostgresAdapter } from '../../types'
|
||||||
import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types'
|
import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types'
|
||||||
|
|
||||||
import { isArrayOfRows } from '../../utilities/isArrayOfRows'
|
import { isArrayOfRows } from '../../utilities/isArrayOfRows'
|
||||||
import { traverseFields } from './traverseFields'
|
import { traverseFields } from './traverseFields'
|
||||||
|
|
||||||
type Args = {
|
type Args = {
|
||||||
|
adapter: PostgresAdapter
|
||||||
arrayTableName: string
|
arrayTableName: string
|
||||||
baseTableName: string
|
baseTableName: string
|
||||||
blocks: {
|
blocks: {
|
||||||
[blockType: string]: BlockRowToInsert[]
|
[blockType: string]: BlockRowToInsert[]
|
||||||
}
|
}
|
||||||
|
blocksToDelete: Set<string>
|
||||||
data: unknown
|
data: unknown
|
||||||
field: ArrayField
|
field: ArrayField
|
||||||
locale?: string
|
locale?: string
|
||||||
@@ -25,9 +28,11 @@ type Args = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const transformArray = ({
|
export const transformArray = ({
|
||||||
|
adapter,
|
||||||
arrayTableName,
|
arrayTableName,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
data,
|
data,
|
||||||
field,
|
field,
|
||||||
locale,
|
locale,
|
||||||
@@ -38,6 +43,7 @@ export const transformArray = ({
|
|||||||
selects,
|
selects,
|
||||||
}: Args) => {
|
}: Args) => {
|
||||||
const newRows: ArrayRowToInsert[] = []
|
const newRows: ArrayRowToInsert[] = []
|
||||||
|
const hasUUID = adapter.tables[arrayTableName]._uuid
|
||||||
|
|
||||||
if (isArrayOfRows(data)) {
|
if (isArrayOfRows(data)) {
|
||||||
data.forEach((arrayRow, i) => {
|
data.forEach((arrayRow, i) => {
|
||||||
@@ -49,6 +55,16 @@ export const transformArray = ({
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we have declared a _uuid field on arrays,
|
||||||
|
// that means the ID has to be unique,
|
||||||
|
// and our ids within arrays are not unique.
|
||||||
|
// So move the ID to a uuid field for storage
|
||||||
|
// and allow the database to generate a serial id automatically
|
||||||
|
if (hasUUID) {
|
||||||
|
newRow.row._uuid = arrayRow.id
|
||||||
|
delete arrayRow.id
|
||||||
|
}
|
||||||
|
|
||||||
if (locale) {
|
if (locale) {
|
||||||
newRow.locales[locale] = {
|
newRow.locales[locale] = {
|
||||||
_locale: locale,
|
_locale: locale,
|
||||||
@@ -60,9 +76,11 @@ export const transformArray = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
traverseFields({
|
traverseFields({
|
||||||
|
adapter,
|
||||||
arrays: newRow.arrays,
|
arrays: newRow.arrays,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
columnPrefix: '',
|
columnPrefix: '',
|
||||||
data: arrayRow,
|
data: arrayRow,
|
||||||
fieldPrefix: '',
|
fieldPrefix: '',
|
||||||
|
|||||||
@@ -3,15 +3,18 @@ import type { BlockField } from 'payload/types'
|
|||||||
|
|
||||||
import toSnakeCase from 'to-snake-case'
|
import toSnakeCase from 'to-snake-case'
|
||||||
|
|
||||||
|
import type { PostgresAdapter } from '../../types'
|
||||||
import type { BlockRowToInsert, RelationshipToDelete } from './types'
|
import type { BlockRowToInsert, RelationshipToDelete } from './types'
|
||||||
|
|
||||||
import { traverseFields } from './traverseFields'
|
import { traverseFields } from './traverseFields'
|
||||||
|
|
||||||
type Args = {
|
type Args = {
|
||||||
|
adapter: PostgresAdapter
|
||||||
baseTableName: string
|
baseTableName: string
|
||||||
blocks: {
|
blocks: {
|
||||||
[blockType: string]: BlockRowToInsert[]
|
[blockType: string]: BlockRowToInsert[]
|
||||||
}
|
}
|
||||||
|
blocksToDelete: Set<string>
|
||||||
data: Record<string, unknown>[]
|
data: Record<string, unknown>[]
|
||||||
field: BlockField
|
field: BlockField
|
||||||
locale?: string
|
locale?: string
|
||||||
@@ -24,8 +27,10 @@ type Args = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
export const transformBlocks = ({
|
export const transformBlocks = ({
|
||||||
|
adapter,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
data,
|
data,
|
||||||
field,
|
field,
|
||||||
locale,
|
locale,
|
||||||
@@ -56,10 +61,24 @@ export const transformBlocks = ({
|
|||||||
|
|
||||||
const blockTableName = `${baseTableName}_blocks_${blockType}`
|
const blockTableName = `${baseTableName}_blocks_${blockType}`
|
||||||
|
|
||||||
|
const hasUUID = adapter.tables[blockTableName]._uuid
|
||||||
|
|
||||||
|
// If we have declared a _uuid field on arrays,
|
||||||
|
// that means the ID has to be unique,
|
||||||
|
// and our ids within arrays are not unique.
|
||||||
|
// So move the ID to a uuid field for storage
|
||||||
|
// and allow the database to generate a serial id automatically
|
||||||
|
if (hasUUID) {
|
||||||
|
newRow.row._uuid = blockRow.id
|
||||||
|
delete blockRow.id
|
||||||
|
}
|
||||||
|
|
||||||
traverseFields({
|
traverseFields({
|
||||||
|
adapter,
|
||||||
arrays: newRow.arrays,
|
arrays: newRow.arrays,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
columnPrefix: '',
|
columnPrefix: '',
|
||||||
data: blockRow,
|
data: blockRow,
|
||||||
fieldPrefix: '',
|
fieldPrefix: '',
|
||||||
|
|||||||
@@ -1,22 +1,31 @@
|
|||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
import type { Field } from 'payload/types'
|
import type { Field } from 'payload/types'
|
||||||
|
|
||||||
|
import type { PostgresAdapter } from '../../types'
|
||||||
import type { RowToInsert } from './types'
|
import type { RowToInsert } from './types'
|
||||||
|
|
||||||
import { traverseFields } from './traverseFields'
|
import { traverseFields } from './traverseFields'
|
||||||
|
|
||||||
type Args = {
|
type Args = {
|
||||||
|
adapter: PostgresAdapter
|
||||||
data: Record<string, unknown>
|
data: Record<string, unknown>
|
||||||
fields: Field[]
|
fields: Field[]
|
||||||
path?: string
|
path?: string
|
||||||
tableName: string
|
tableName: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const transformForWrite = ({ data, fields, path = '', tableName }: Args): RowToInsert => {
|
export const transformForWrite = ({
|
||||||
|
adapter,
|
||||||
|
data,
|
||||||
|
fields,
|
||||||
|
path = '',
|
||||||
|
tableName,
|
||||||
|
}: Args): RowToInsert => {
|
||||||
// Split out the incoming data into rows to insert / delete
|
// Split out the incoming data into rows to insert / delete
|
||||||
const rowToInsert: RowToInsert = {
|
const rowToInsert: RowToInsert = {
|
||||||
arrays: {},
|
arrays: {},
|
||||||
blocks: {},
|
blocks: {},
|
||||||
|
blocksToDelete: new Set(),
|
||||||
locales: {},
|
locales: {},
|
||||||
numbers: [],
|
numbers: [],
|
||||||
relationships: [],
|
relationships: [],
|
||||||
@@ -28,9 +37,11 @@ export const transformForWrite = ({ data, fields, path = '', tableName }: Args):
|
|||||||
// This function is responsible for building up the
|
// This function is responsible for building up the
|
||||||
// above rowToInsert
|
// above rowToInsert
|
||||||
traverseFields({
|
traverseFields({
|
||||||
|
adapter,
|
||||||
arrays: rowToInsert.arrays,
|
arrays: rowToInsert.arrays,
|
||||||
baseTableName: tableName,
|
baseTableName: tableName,
|
||||||
blocks: rowToInsert.blocks,
|
blocks: rowToInsert.blocks,
|
||||||
|
blocksToDelete: rowToInsert.blocksToDelete,
|
||||||
columnPrefix: '',
|
columnPrefix: '',
|
||||||
data,
|
data,
|
||||||
fieldPrefix: '',
|
fieldPrefix: '',
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import type { Field } from 'payload/types'
|
|||||||
import { fieldAffectsData } from 'payload/types'
|
import { fieldAffectsData } from 'payload/types'
|
||||||
import toSnakeCase from 'to-snake-case'
|
import toSnakeCase from 'to-snake-case'
|
||||||
|
|
||||||
|
import type { PostgresAdapter } from '../../types'
|
||||||
import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types'
|
import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types'
|
||||||
|
|
||||||
import { isArrayOfRows } from '../../utilities/isArrayOfRows'
|
import { isArrayOfRows } from '../../utilities/isArrayOfRows'
|
||||||
@@ -14,6 +15,7 @@ import { transformRelationship } from './relationships'
|
|||||||
import { transformSelects } from './selects'
|
import { transformSelects } from './selects'
|
||||||
|
|
||||||
type Args = {
|
type Args = {
|
||||||
|
adapter: PostgresAdapter
|
||||||
arrays: {
|
arrays: {
|
||||||
[tableName: string]: ArrayRowToInsert[]
|
[tableName: string]: ArrayRowToInsert[]
|
||||||
}
|
}
|
||||||
@@ -24,6 +26,7 @@ type Args = {
|
|||||||
blocks: {
|
blocks: {
|
||||||
[blockType: string]: BlockRowToInsert[]
|
[blockType: string]: BlockRowToInsert[]
|
||||||
}
|
}
|
||||||
|
blocksToDelete: Set<string>
|
||||||
/**
|
/**
|
||||||
* A snake-case field prefix, representing prior fields
|
* A snake-case field prefix, representing prior fields
|
||||||
* Ex: my_group_my_named_tab_
|
* Ex: my_group_my_named_tab_
|
||||||
@@ -56,9 +59,11 @@ type Args = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const traverseFields = ({
|
export const traverseFields = ({
|
||||||
|
adapter,
|
||||||
arrays,
|
arrays,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
columnPrefix,
|
columnPrefix,
|
||||||
data,
|
data,
|
||||||
existingLocales,
|
existingLocales,
|
||||||
@@ -95,9 +100,11 @@ export const traverseFields = ({
|
|||||||
Object.entries(data[field.name]).forEach(([localeKey, localeData]) => {
|
Object.entries(data[field.name]).forEach(([localeKey, localeData]) => {
|
||||||
if (Array.isArray(localeData)) {
|
if (Array.isArray(localeData)) {
|
||||||
const newRows = transformArray({
|
const newRows = transformArray({
|
||||||
|
adapter,
|
||||||
arrayTableName,
|
arrayTableName,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
data: localeData,
|
data: localeData,
|
||||||
field,
|
field,
|
||||||
locale: localeKey,
|
locale: localeKey,
|
||||||
@@ -114,9 +121,11 @@ export const traverseFields = ({
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const newRows = transformArray({
|
const newRows = transformArray({
|
||||||
|
adapter,
|
||||||
arrayTableName,
|
arrayTableName,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
data: data[field.name],
|
data: data[field.name],
|
||||||
field,
|
field,
|
||||||
numbers,
|
numbers,
|
||||||
@@ -133,13 +142,19 @@ export const traverseFields = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (field.type === 'blocks') {
|
if (field.type === 'blocks') {
|
||||||
|
field.blocks.forEach(({ slug }) => {
|
||||||
|
blocksToDelete.add(toSnakeCase(slug))
|
||||||
|
})
|
||||||
|
|
||||||
if (field.localized) {
|
if (field.localized) {
|
||||||
if (typeof data[field.name] === 'object' && data[field.name] !== null) {
|
if (typeof data[field.name] === 'object' && data[field.name] !== null) {
|
||||||
Object.entries(data[field.name]).forEach(([localeKey, localeData]) => {
|
Object.entries(data[field.name]).forEach(([localeKey, localeData]) => {
|
||||||
if (Array.isArray(localeData)) {
|
if (Array.isArray(localeData)) {
|
||||||
transformBlocks({
|
transformBlocks({
|
||||||
|
adapter,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
data: localeData,
|
data: localeData,
|
||||||
field,
|
field,
|
||||||
locale: localeKey,
|
locale: localeKey,
|
||||||
@@ -154,8 +169,10 @@ export const traverseFields = ({
|
|||||||
}
|
}
|
||||||
} else if (isArrayOfRows(fieldData)) {
|
} else if (isArrayOfRows(fieldData)) {
|
||||||
transformBlocks({
|
transformBlocks({
|
||||||
|
adapter,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
data: fieldData,
|
data: fieldData,
|
||||||
field,
|
field,
|
||||||
numbers,
|
numbers,
|
||||||
@@ -174,9 +191,11 @@ export const traverseFields = ({
|
|||||||
if (field.localized) {
|
if (field.localized) {
|
||||||
Object.entries(data[field.name]).forEach(([localeKey, localeData]) => {
|
Object.entries(data[field.name]).forEach(([localeKey, localeData]) => {
|
||||||
traverseFields({
|
traverseFields({
|
||||||
|
adapter,
|
||||||
arrays,
|
arrays,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
columnPrefix: `${columnName}_`,
|
columnPrefix: `${columnName}_`,
|
||||||
data: localeData as Record<string, unknown>,
|
data: localeData as Record<string, unknown>,
|
||||||
existingLocales,
|
existingLocales,
|
||||||
@@ -195,9 +214,11 @@ export const traverseFields = ({
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
traverseFields({
|
traverseFields({
|
||||||
|
adapter,
|
||||||
arrays,
|
arrays,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
columnPrefix: `${columnName}_`,
|
columnPrefix: `${columnName}_`,
|
||||||
data: data[field.name] as Record<string, unknown>,
|
data: data[field.name] as Record<string, unknown>,
|
||||||
existingLocales,
|
existingLocales,
|
||||||
@@ -225,9 +246,11 @@ export const traverseFields = ({
|
|||||||
if (tab.localized) {
|
if (tab.localized) {
|
||||||
Object.entries(data[tab.name]).forEach(([localeKey, localeData]) => {
|
Object.entries(data[tab.name]).forEach(([localeKey, localeData]) => {
|
||||||
traverseFields({
|
traverseFields({
|
||||||
|
adapter,
|
||||||
arrays,
|
arrays,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
columnPrefix: `${columnPrefix || ''}${toSnakeCase(tab.name)}_`,
|
columnPrefix: `${columnPrefix || ''}${toSnakeCase(tab.name)}_`,
|
||||||
data: localeData as Record<string, unknown>,
|
data: localeData as Record<string, unknown>,
|
||||||
existingLocales,
|
existingLocales,
|
||||||
@@ -246,9 +269,11 @@ export const traverseFields = ({
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
traverseFields({
|
traverseFields({
|
||||||
|
adapter,
|
||||||
arrays,
|
arrays,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
columnPrefix: `${columnPrefix || ''}${toSnakeCase(tab.name)}_`,
|
columnPrefix: `${columnPrefix || ''}${toSnakeCase(tab.name)}_`,
|
||||||
data: data[tab.name] as Record<string, unknown>,
|
data: data[tab.name] as Record<string, unknown>,
|
||||||
existingLocales,
|
existingLocales,
|
||||||
@@ -267,9 +292,11 @@ export const traverseFields = ({
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
traverseFields({
|
traverseFields({
|
||||||
|
adapter,
|
||||||
arrays,
|
arrays,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
columnPrefix,
|
columnPrefix,
|
||||||
data,
|
data,
|
||||||
existingLocales,
|
existingLocales,
|
||||||
@@ -290,9 +317,11 @@ export const traverseFields = ({
|
|||||||
|
|
||||||
if (field.type === 'row' || field.type === 'collapsible') {
|
if (field.type === 'row' || field.type === 'collapsible') {
|
||||||
traverseFields({
|
traverseFields({
|
||||||
|
adapter,
|
||||||
arrays,
|
arrays,
|
||||||
baseTableName,
|
baseTableName,
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksToDelete,
|
||||||
columnPrefix,
|
columnPrefix,
|
||||||
data,
|
data,
|
||||||
existingLocales,
|
existingLocales,
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export type RowToInsert = {
|
|||||||
blocks: {
|
blocks: {
|
||||||
[blockType: string]: BlockRowToInsert[]
|
[blockType: string]: BlockRowToInsert[]
|
||||||
}
|
}
|
||||||
|
blocksToDelete: Set<string>
|
||||||
locales: {
|
locales: {
|
||||||
[locale: string]: Record<string, unknown>
|
[locale: string]: Record<string, unknown>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,11 @@ export type PostgresAdapter = BaseDatabaseAdapter & {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
tables: Record<string, GenericTable>
|
tables: Record<string, GenericTable>
|
||||||
|
/**
|
||||||
|
* An object keyed on each table, with a key value pair where the constraint name is the key, followed by the dot-notation field name
|
||||||
|
* Used for returning properly formed errors from unique fields
|
||||||
|
*/
|
||||||
|
fieldConstraints: Record<string, Record<string, string>>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type PostgresAdapterResult = (args: { payload: Payload }) => PostgresAdapter
|
export type PostgresAdapterResult = (args: { payload: Payload }) => PostgresAdapter
|
||||||
@@ -86,5 +91,6 @@ declare module 'payload' {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
tables: Record<string, GenericTable>
|
tables: Record<string, GenericTable>
|
||||||
|
fieldConstraints: Record<string, Record<string, string>>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ import type { UpdateOne } from 'payload/database'
|
|||||||
import toSnakeCase from 'to-snake-case'
|
import toSnakeCase from 'to-snake-case'
|
||||||
|
|
||||||
import type { ChainedMethods } from './find/chainMethods'
|
import type { ChainedMethods } from './find/chainMethods'
|
||||||
import type { PostgresAdapter } from './types'
|
|
||||||
|
|
||||||
import { chainMethods } from './find/chainMethods'
|
import { chainMethods } from './find/chainMethods'
|
||||||
|
import type { PostgresAdapter } from './types'
|
||||||
import buildQuery from './queries/buildQuery'
|
import buildQuery from './queries/buildQuery'
|
||||||
import { upsertRow } from './upsertRow'
|
import { upsertRow } from './upsertRow'
|
||||||
|
|
||||||
@@ -72,6 +71,7 @@ export const updateOne: UpdateOne = async function updateOne(
|
|||||||
fields: collection.fields,
|
fields: collection.fields,
|
||||||
operation: 'update',
|
operation: 'update',
|
||||||
tableName: toSnakeCase(collectionSlug),
|
tableName: toSnakeCase(collectionSlug),
|
||||||
|
req,
|
||||||
})
|
})
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export async function updateGlobal<T extends TypeWithID>(
|
|||||||
db,
|
db,
|
||||||
fields: globalConfig.fields,
|
fields: globalConfig.fields,
|
||||||
tableName,
|
tableName,
|
||||||
|
req,
|
||||||
})
|
})
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import type { TypeWithVersion } from 'payload/database'
|
import type { TypeWithVersion, UpdateGlobalVersionArgs } from 'payload/database'
|
||||||
import type { UpdateGlobalVersionArgs } from 'payload/database'
|
|
||||||
import type { PayloadRequest, SanitizedGlobalConfig, TypeWithID } from 'payload/types'
|
import type { PayloadRequest, SanitizedGlobalConfig, TypeWithID } from 'payload/types'
|
||||||
|
|
||||||
import { buildVersionGlobalFields } from 'payload/versions'
|
import { buildVersionGlobalFields } from 'payload/versions'
|
||||||
@@ -46,6 +45,7 @@ export async function updateGlobalVersion<T extends TypeWithID>(
|
|||||||
operation: 'update',
|
operation: 'update',
|
||||||
tableName,
|
tableName,
|
||||||
where,
|
where,
|
||||||
|
req,
|
||||||
})
|
})
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ export async function updateVersion<T extends TypeWithID>(
|
|||||||
operation: 'update',
|
operation: 'update',
|
||||||
tableName,
|
tableName,
|
||||||
where,
|
where,
|
||||||
|
req,
|
||||||
})
|
})
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
import type { TypeWithID } from 'payload/types'
|
import type { TypeWithID } from 'payload/types'
|
||||||
|
|
||||||
import { eq } from 'drizzle-orm'
|
import { eq } from 'drizzle-orm'
|
||||||
|
import { ValidationError } from 'payload/errors'
|
||||||
|
import { i18nInit } from 'payload/utilities'
|
||||||
|
|
||||||
import type { BlockRowToInsert } from '../transform/write/types'
|
import type { BlockRowToInsert } from '../transform/write/types'
|
||||||
import type { Args } from './types'
|
import type { Args } from './types'
|
||||||
@@ -21,6 +23,7 @@ export const upsertRow = async <T extends TypeWithID>({
|
|||||||
fields,
|
fields,
|
||||||
operation,
|
operation,
|
||||||
path = '',
|
path = '',
|
||||||
|
req,
|
||||||
tableName,
|
tableName,
|
||||||
upsertTarget,
|
upsertTarget,
|
||||||
where,
|
where,
|
||||||
@@ -28,6 +31,7 @@ export const upsertRow = async <T extends TypeWithID>({
|
|||||||
// Split out the incoming data into the corresponding:
|
// Split out the incoming data into the corresponding:
|
||||||
// base row, locales, relationships, blocks, and arrays
|
// base row, locales, relationships, blocks, and arrays
|
||||||
const rowToInsert = transformForWrite({
|
const rowToInsert = transformForWrite({
|
||||||
|
adapter,
|
||||||
data,
|
data,
|
||||||
fields,
|
fields,
|
||||||
path,
|
path,
|
||||||
@@ -37,6 +41,7 @@ export const upsertRow = async <T extends TypeWithID>({
|
|||||||
// First, we insert the main row
|
// First, we insert the main row
|
||||||
let insertedRow: Record<string, unknown>
|
let insertedRow: Record<string, unknown>
|
||||||
|
|
||||||
|
try {
|
||||||
if (operation === 'update') {
|
if (operation === 'update') {
|
||||||
const target = upsertTarget || adapter.tables[tableName].id
|
const target = upsertTarget || adapter.tables[tableName].id
|
||||||
|
|
||||||
@@ -55,7 +60,10 @@ export const upsertRow = async <T extends TypeWithID>({
|
|||||||
.returning()
|
.returning()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
;[insertedRow] = await db.insert(adapter.tables[tableName]).values(rowToInsert.row).returning()
|
;[insertedRow] = await db
|
||||||
|
.insert(adapter.tables[tableName])
|
||||||
|
.values(rowToInsert.row)
|
||||||
|
.returning()
|
||||||
}
|
}
|
||||||
|
|
||||||
const localesToInsert: Record<string, unknown>[] = []
|
const localesToInsert: Record<string, unknown>[] = []
|
||||||
@@ -107,6 +115,9 @@ export const upsertRow = async <T extends TypeWithID>({
|
|||||||
rowToInsert.blocks[blockName].forEach((blockRow) => {
|
rowToInsert.blocks[blockName].forEach((blockRow) => {
|
||||||
blockRow.row._parentID = insertedRow.id
|
blockRow.row._parentID = insertedRow.id
|
||||||
if (!blocksToInsert[blockName]) blocksToInsert[blockName] = []
|
if (!blocksToInsert[blockName]) blocksToInsert[blockName] = []
|
||||||
|
if (blockRow.row.uuid) {
|
||||||
|
delete blockRow.row.uuid
|
||||||
|
}
|
||||||
blocksToInsert[blockName].push(blockRow)
|
blocksToInsert[blockName].push(blockRow)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -177,18 +188,15 @@ export const upsertRow = async <T extends TypeWithID>({
|
|||||||
|
|
||||||
const insertedBlockRows: Record<string, Record<string, unknown>[]> = {}
|
const insertedBlockRows: Record<string, Record<string, unknown>[]> = {}
|
||||||
|
|
||||||
for (const [blockName, blockRows] of Object.entries(blocksToInsert)) {
|
|
||||||
if (operation === 'update') {
|
if (operation === 'update') {
|
||||||
await deleteExistingRowsByPath({
|
for (const blockName of rowToInsert.blocksToDelete) {
|
||||||
adapter,
|
const blockTableName = `${tableName}_blocks_${blockName}`
|
||||||
db,
|
const blockTable = adapter.tables[blockTableName]
|
||||||
parentID: insertedRow.id,
|
await db.delete(blockTable).where(eq(blockTable._parentID, insertedRow.id))
|
||||||
pathColumnName: '_path',
|
}
|
||||||
rows: blockRows.map(({ row }) => row),
|
|
||||||
tableName: `${tableName}_blocks_${blockName}`,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const [blockName, blockRows] of Object.entries(blocksToInsert)) {
|
||||||
insertedBlockRows[blockName] = await db
|
insertedBlockRows[blockName] = await db
|
||||||
.insert(adapter.tables[`${tableName}_blocks_${blockName}`])
|
.insert(adapter.tables[`${tableName}_blocks_${blockName}`])
|
||||||
.values(blockRows.map(({ row }) => row))
|
.values(blockRows.map(({ row }) => row))
|
||||||
@@ -264,6 +272,23 @@ export const upsertRow = async <T extends TypeWithID>({
|
|||||||
await db.insert(selectTable).values(tableRows).returning()
|
await db.insert(selectTable).values(tableRows).returning()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// //////////////////////////////////
|
||||||
|
// Error Handling
|
||||||
|
// //////////////////////////////////
|
||||||
|
} catch (error) {
|
||||||
|
throw error.code === '23505'
|
||||||
|
? new ValidationError(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
field: adapter.fieldConstraints[tableName][error.constraint],
|
||||||
|
message: req.t('error:valueMustBeUnique'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
req?.t ?? i18nInit(req.payload.config.i18n).t,
|
||||||
|
)
|
||||||
|
: error
|
||||||
|
}
|
||||||
|
|
||||||
// //////////////////////////////////
|
// //////////////////////////////////
|
||||||
// RETRIEVE NEWLY UPDATED ROW
|
// RETRIEVE NEWLY UPDATED ROW
|
||||||
// //////////////////////////////////
|
// //////////////////////////////////
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { SQL } from 'drizzle-orm'
|
import type { SQL } from 'drizzle-orm'
|
||||||
import type { Field } from 'payload/types'
|
import type { Field, PayloadRequest } from 'payload/types'
|
||||||
|
|
||||||
import type { DrizzleDB, GenericColumn, PostgresAdapter } from '../types'
|
import type { DrizzleDB, GenericColumn, PostgresAdapter } from '../types'
|
||||||
|
|
||||||
@@ -10,6 +10,7 @@ type BaseArgs = {
|
|||||||
fields: Field[]
|
fields: Field[]
|
||||||
path?: string
|
path?: string
|
||||||
tableName: string
|
tableName: string
|
||||||
|
req: PayloadRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateArgs = BaseArgs & {
|
type CreateArgs = BaseArgs & {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/eslint-config",
|
"name": "@payloadcms/eslint-config",
|
||||||
"version": "0.0.1",
|
"version": "1.0.0",
|
||||||
"description": "Payload styles for ESLint and Prettier",
|
"description": "Payload styles for ESLint and Prettier",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": {
|
"author": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/live-preview-react",
|
"name": "@payloadcms/live-preview-react",
|
||||||
"version": "0.1.3",
|
"version": "0.1.5",
|
||||||
"description": "The official live preview React SDK for Payload",
|
"description": "The official live preview React SDK for Payload",
|
||||||
"repository": "https://github.com/payloadcms/payload",
|
"repository": "https://github.com/payloadcms/payload",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
"prepublishOnly": "pnpm clean && pnpm build"
|
"prepublishOnly": "pnpm clean && pnpm build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@payloadcms/live-preview": "workspace:*"
|
"@payloadcms/live-preview": "workspace:^0.x"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@payloadcms/eslint-config": "workspace:*",
|
"@payloadcms/eslint-config": "workspace:*",
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
"payload": "workspace:*"
|
"payload": "workspace:*"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
"payload": "^2.0.0",
|
||||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||||
},
|
},
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/live-preview",
|
"name": "@payloadcms/live-preview",
|
||||||
"version": "0.1.3",
|
"version": "0.1.5",
|
||||||
"description": "The official live preview JavaScript SDK for Payload",
|
"description": "The official live preview JavaScript SDK for Payload",
|
||||||
"repository": "https://github.com/payloadcms/payload",
|
"repository": "https://github.com/payloadcms/payload",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -20,6 +20,9 @@
|
|||||||
"@payloadcms/eslint-config": "workspace:*",
|
"@payloadcms/eslint-config": "workspace:*",
|
||||||
"payload": "workspace:*"
|
"payload": "workspace:*"
|
||||||
},
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"payload": "^2.0.0"
|
||||||
|
},
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"default": "./src/index.ts",
|
"default": "./src/index.ts",
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user