Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit 5a802d0

Browse files
committed
feat: allows adapter to be set to null, which will fall back to local storage
1 parent 97a3be8 commit 5a802d0

5 files changed

Lines changed: 51 additions & 41 deletions

File tree

dev/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7826,7 +7826,7 @@ pause@0.0.1:
78267826

78277827
payload@^1.0.27:
78287828
version "1.0.27"
7829-
resolved "https://registry.yarnpkg.com/payload/-/payload-1.0.27.tgz#6ac1ecf7800ec0c55638942bbbbf5688180fd6c3"
7829+
resolved "https://registry.npmjs.org/payload/-/payload-1.0.27.tgz#6ac1ecf7800ec0c55638942bbbbf5688180fd6c3"
78307830
integrity sha512-tCiVH9GuhGtgGJ4ICPOKPv7BySVOwyOx6BekClp+WBLxe6Z2Wmd33bTY4X9/ZdllsdxATwmrMItUWpv0VEMEKw==
78317831
dependencies:
78327832
"@babel/cli" "^7.12.8"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"eslint-plugin-import": "2.25.4",
4949
"eslint-plugin-prettier": "^4.0.0",
5050
"nodemon": "^2.0.6",
51-
"payload": "^1.0.19",
51+
"payload": "^1.0.27",
5252
"prettier": "^2.7.1",
5353
"ts-node": "^9.1.1",
5454
"typescript": "^4.1.3"

src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const cloudStorage =
3030
collections: (config.collections || []).map(existingCollection => {
3131
const options = allCollectionOptions[existingCollection.slug]
3232

33-
if (options) {
33+
if (options?.adapter) {
3434
const adapter = options.adapter({ collection: existingCollection })
3535

3636
const fields = getFields({

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export type Adapter = (args: { collection: CollectionConfig }) => GeneratedAdapt
4848
export interface CollectionOptions {
4949
disableLocalStorage?: boolean
5050
disablePayloadAccessControl?: true
51-
adapter: Adapter
51+
adapter: Adapter | null
5252
}
5353

5454
export interface PluginOptions {

yarn.lock

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,7 @@
19671967
pirates "^4.0.5"
19681968
source-map-support "^0.5.16"
19691969

1970-
"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.15.4", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
1970+
"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.15.4", "@babel/runtime@^7.2.0", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
19711971
version "7.18.9"
19721972
resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a"
19731973
integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==
@@ -3775,12 +3775,12 @@ buffer@^5.5.0, buffer@^5.6.0:
37753775
base64-js "^1.3.1"
37763776
ieee754 "^1.1.13"
37773777

3778-
busboy@^0.3.1:
3779-
version "0.3.1"
3780-
resolved "https://registry.npmjs.org/busboy/-/busboy-0.3.1.tgz#170899274c5bf38aae27d5c62b71268cd585fd1b"
3781-
integrity sha512-y7tTxhGKXcyBxRKAni+awqx8uqaJKrSFSNFSeRG5CsWNdmy2BIK+6VGWEW7TZnIO/533mtMEA4rOevQV815YJw==
3778+
busboy@^1.6.0:
3779+
version "1.6.0"
3780+
resolved "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893"
3781+
integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==
37823782
dependencies:
3783-
dicer "0.3.0"
3783+
streamsearch "^1.1.0"
37843784

37853785
bytes@3.0.0:
37863786
version "3.0.0"
@@ -4648,13 +4648,6 @@ detect-newline@^3.0.0:
46484648
resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651"
46494649
integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==
46504650

4651-
dicer@0.3.0:
4652-
version "0.3.0"
4653-
resolved "https://registry.npmjs.org/dicer/-/dicer-0.3.0.tgz#eacd98b3bfbf92e8ab5c2fdb71aaac44bb06b872"
4654-
integrity sha512-MdceRRWqltEG2dZqO769g27N/3PXfcKl04VhYnBlo2YhH7zPi88VebsjTKclaOyiuMaGU72hTfw3VkUitGcVCA==
4655-
dependencies:
4656-
streamsearch "0.1.2"
4657-
46584651
diff-sequences@^26.6.2:
46594652
version "26.6.2"
46604653
resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1"
@@ -5275,12 +5268,12 @@ expect@^26.6.2:
52755268
jest-message-util "^26.6.2"
52765269
jest-regex-util "^26.0.0"
52775270

5278-
express-fileupload@1.3.1:
5279-
version "1.3.1"
5280-
resolved "https://registry.npmjs.org/express-fileupload/-/express-fileupload-1.3.1.tgz#3238472def305b8cb4cc5936a953761d0c442011"
5281-
integrity sha512-LD1yabD3exmWIFujKGDnT1rmxSomaqQSlUvzIsrA1ZgwCJ6ci7lg2YHFGM3Q6DfK+Yk0gAVU7GWLE7qDMwZLkw==
5271+
express-fileupload@1.4.0:
5272+
version "1.4.0"
5273+
resolved "https://registry.npmjs.org/express-fileupload/-/express-fileupload-1.4.0.tgz#be9d70a881d6c2b1ce668df86e4f89ddbf238ec7"
5274+
integrity sha512-RjzLCHxkv3umDeZKeFeMg8w7qe0V09w3B7oGZprr/oO2H/ISCgNzuqzn7gV3HRWb37GjRk429CCpSLS2KNTqMQ==
52825275
dependencies:
5283-
busboy "^0.3.1"
5276+
busboy "^1.6.0"
52845277

52855278
express-graphql@0.12.0:
52865279
version "0.12.0"
@@ -6233,6 +6226,13 @@ interpret@^2.2.0:
62336226
resolved "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9"
62346227
integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==
62356228

6229+
invariant@^2.2.4:
6230+
version "2.2.4"
6231+
resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
6232+
integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
6233+
dependencies:
6234+
loose-envify "^1.0.0"
6235+
62366236
ip@^2.0.0:
62376237
version "2.0.0"
62386238
resolved "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz#4cf4ab182fee2314c75ede1276f8c80b479936da"
@@ -7127,7 +7127,7 @@ json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1:
71277127
resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d"
71287128
integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==
71297129

7130-
json-schema-to-typescript@^11.0.0:
7130+
json-schema-to-typescript@^11.0.2:
71317131
version "11.0.2"
71327132
resolved "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-11.0.2.tgz#80348391abb4ffb75daf312380c2f01c552ffba8"
71337133
integrity sha512-XRyeXBJeo/IH4eTP5D1ptX78vCvH86nMDt2k3AxO28C3uYWEDmy4mgPyMpb8bLJ/pJMElOGuQbnKR5Y6NSh3QQ==
@@ -7726,10 +7726,10 @@ mongoose-paginate-v2@^1.6.1:
77267726
resolved "https://registry.npmjs.org/mongoose-paginate-v2/-/mongoose-paginate-v2-1.7.0.tgz#989a97160b5aa18b4bb16fb9ac3a80c6c33837ec"
77277727
integrity sha512-r9bns1sMWRl0QO3YXVZ/uGOL/CYcDXTmapGHlddIgzbfOhVxUWKHKItwJO8rZICF1ooOukLQv8qQLVTc3qSLpQ==
77287728

7729-
mongoose@^6.2.0:
7730-
version "6.5.1"
7731-
resolved "https://registry.npmjs.org/mongoose/-/mongoose-6.5.1.tgz#bcf28700ce3552fcdd4d6d4078d0127290020928"
7732-
integrity sha512-8C0213y279nrSp6Au+WB+l/VczcotMU65jalTJJxU6KYf/Kd8gNW9+B3giWNJOVd8VvKvUQG0suWv/Vngp/83A==
7729+
mongoose@6.5.0:
7730+
version "6.5.0"
7731+
resolved "https://registry.npmjs.org/mongoose/-/mongoose-6.5.0.tgz#5c71aa8d4027e50bfe8d29d6e955e378e010d174"
7732+
integrity sha512-swOX8ZEbmCeJaEs29B1j67StBIhuOccNNkipbVhsnLYYCDpNE7heM9W54MFGwN5es9tGGoxINHSzOhJ9kTOZGg==
77337733
dependencies:
77347734
bson "^4.6.5"
77357735
kareem "2.4.1"
@@ -8375,10 +8375,10 @@ pause@0.0.1:
83758375
resolved "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz#1d408b3fdb76923b9543d96fb4c9dfd535d9cb5d"
83768376
integrity sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg==
83778377

8378-
payload@^1.0.19:
8379-
version "1.0.19"
8380-
resolved "https://registry.npmjs.org/payload/-/payload-1.0.19.tgz#7344e93a0fc8187069fef1a690f865d4926b20b5"
8381-
integrity sha512-8vOybSd4TMkq+nwiigz4DXbrBlCrSIfEQSexsLj/HsjcTYLDOWdVz5UK3v3oYY4H2RuSIv+Hi7Kja//R1X7IRw==
8378+
payload@^1.0.27:
8379+
version "1.0.27"
8380+
resolved "https://registry.npmjs.org/payload/-/payload-1.0.27.tgz#6ac1ecf7800ec0c55638942bbbbf5688180fd6c3"
8381+
integrity sha512-tCiVH9GuhGtgGJ4ICPOKPv7BySVOwyOx6BekClp+WBLxe6Z2Wmd33bTY4X9/ZdllsdxATwmrMItUWpv0VEMEKw==
83828382
dependencies:
83838383
"@babel/cli" "^7.12.8"
83848384
"@babel/core" "^7.11.6"
@@ -8410,7 +8410,7 @@ payload@^1.0.19:
84108410
deepmerge "^4.2.2"
84118411
dotenv "^8.2.0"
84128412
express "^4.17.1"
8413-
express-fileupload "1.3.1"
8413+
express-fileupload "1.4.0"
84148414
express-graphql "0.12.0"
84158415
express-rate-limit "^5.1.3"
84168416
"falsey" "^1.0.0"
@@ -8430,7 +8430,7 @@ payload@^1.0.19:
84308430
isomorphic-fetch "^3.0.0"
84318431
jest "^26.6.3"
84328432
joi "^17.3.0"
8433-
json-schema-to-typescript "^11.0.0"
8433+
json-schema-to-typescript "^11.0.2"
84348434
jsonwebtoken "^8.5.1"
84358435
jwt-decode "^3.1.2"
84368436
method-override "^3.0.0"
@@ -8439,7 +8439,7 @@ payload@^1.0.19:
84398439
mini-css-extract-plugin "1.3.3"
84408440
minimist "^1.2.0"
84418441
mkdirp "^1.0.4"
8442-
mongoose "^6.2.0"
8442+
mongoose "6.5.0"
84438443
mongoose-paginate-v2 "^1.6.1"
84448444
nodemailer "^6.4.2"
84458445
object-to-formdata "^4.1.0"
@@ -8469,9 +8469,10 @@ payload@^1.0.19:
84698469
react-dom "^18.0.0"
84708470
react-helmet "^6.1.0"
84718471
react-router-dom "^5.1.2"
8472-
react-router-navigation-prompt "^1.8.11"
8472+
react-router-navigation-prompt "^1.9.6"
84738473
react-select "^3.0.8"
84748474
react-simple-code-editor "^0.11.0"
8475+
react-sortable-hoc "^2.0.0"
84758476
react-toastify "^8.2.0"
84768477
sanitize-filename "^1.6.3"
84778478
sass "^1.52.1"
@@ -9166,7 +9167,7 @@ prompts@^2.0.1:
91669167
kleur "^3.0.3"
91679168
sisteransi "^1.0.5"
91689169

9169-
prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
9170+
prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
91709171
version "15.8.1"
91719172
resolved "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
91729173
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
@@ -9411,7 +9412,7 @@ react-router-dom@^5.1.2:
94119412
tiny-invariant "^1.0.2"
94129413
tiny-warning "^1.0.0"
94139414

9414-
react-router-navigation-prompt@^1.8.11:
9415+
react-router-navigation-prompt@^1.9.6:
94159416
version "1.9.6"
94169417
resolved "https://registry.npmjs.org/react-router-navigation-prompt/-/react-router-navigation-prompt-1.9.6.tgz#a949252dfbae8c40508671beb6d5995f0b089ac4"
94179418
integrity sha512-l0sAtbroHK8i1/Eyy29XcrMpBEt0R08BaScgMUt8r5vWWbLz7G0ChOikayTCQm7QgDFsHw8gVnxDJb7TBZCAKg==
@@ -9456,6 +9457,15 @@ react-simple-code-editor@^0.11.0:
94569457
resolved "https://registry.npmjs.org/react-simple-code-editor/-/react-simple-code-editor-0.11.2.tgz#af9da6706b76d2a520bd7b82e3383b329f61cd87"
94579458
integrity sha512-vLMEDj+qLrZ88zK/8bhRdqM2Mp0cQJCUbHPc/QIfxlIYHzAclaAzPX0TQ4ZI5LTYSP3hsYYOT3EciV2dCG4o0Q==
94589459

9460+
react-sortable-hoc@^2.0.0:
9461+
version "2.0.0"
9462+
resolved "https://registry.npmjs.org/react-sortable-hoc/-/react-sortable-hoc-2.0.0.tgz#f6780d8aa4b922a21f3e754af542f032677078b7"
9463+
integrity sha512-JZUw7hBsAHXK7PTyErJyI7SopSBFRcFHDjWW5SWjcugY0i6iH7f+eJkY8cJmGMlZ1C9xz1J3Vjz0plFpavVeRg==
9464+
dependencies:
9465+
"@babel/runtime" "^7.2.0"
9466+
invariant "^2.2.4"
9467+
prop-types "^15.5.7"
9468+
94599469
react-toastify@^8.2.0:
94609470
version "8.2.0"
94619471
resolved "https://registry.npmjs.org/react-toastify/-/react-toastify-8.2.0.tgz#ef7d56bdfdc6272ca6b228368ab564721c3a3244"
@@ -10292,10 +10302,10 @@ stream-shift@^1.0.0:
1029210302
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d"
1029310303
integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==
1029410304

10295-
streamsearch@0.1.2:
10296-
version "0.1.2"
10297-
resolved "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz#808b9d0e56fc273d809ba57338e929919a1a9f1a"
10298-
integrity sha512-jos8u++JKm0ARcSUTAZXOVC0mSox7Bhn6sBgty73P1f3JGf7yG2clTbBNHUdde/kdvP2FESam+vM6l8jBrNxHA==
10305+
streamsearch@^1.1.0:
10306+
version "1.1.0"
10307+
resolved "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764"
10308+
integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==
1029910309

1030010310
string-length@^4.0.1:
1030110311
version "4.0.2"

0 commit comments

Comments
 (0)