From 2d4f258efb5bdef2e99a72e31116e5227be3d2a2 Mon Sep 17 00:00:00 2001 From: Alex Reed Date: Wed, 17 Aug 2022 18:27:49 +0200 Subject: [PATCH] install sanity-plugin-gatsby-cloud - add configs from README --- plugins/sanity-plugin/.env.EXAMPLE | 1 + plugins/sanity-plugin/studio/package.json | 1 + .../sanity-plugin/studio/resolveDocumentActions.js | 7 +++++++ plugins/sanity-plugin/studio/sanity.json | 4 ++++ plugins/sanity-plugin/studio/yarn.lock | 12 ++++++++++++ 5 files changed, 25 insertions(+) create mode 100644 plugins/sanity-plugin/studio/resolveDocumentActions.js diff --git a/plugins/sanity-plugin/.env.EXAMPLE b/plugins/sanity-plugin/.env.EXAMPLE index 376bdbf2..4b6d20c1 100644 --- a/plugins/sanity-plugin/.env.EXAMPLE +++ b/plugins/sanity-plugin/.env.EXAMPLE @@ -4,3 +4,4 @@ SANITY_PROJECT_ID="" SANITY_PROJECT_DATASET="" SANITY_READ_TOKEN="" +SANITY_STUDIO_CONTENT_SYNC_URL= \ No newline at end of file diff --git a/plugins/sanity-plugin/studio/package.json b/plugins/sanity-plugin/studio/package.json index 1a8d8a5d..43c3dd0e 100644 --- a/plugins/sanity-plugin/studio/package.json +++ b/plugins/sanity-plugin/studio/package.json @@ -28,6 +28,7 @@ "prop-types": "^15.7", "react": "^17.0", "react-dom": "^17.0", + "sanity-plugin-gatsby-cloud-preview": "^1.0.3", "styled-components": "^5.2.0" }, "devDependencies": {} diff --git a/plugins/sanity-plugin/studio/resolveDocumentActions.js b/plugins/sanity-plugin/studio/resolveDocumentActions.js new file mode 100644 index 00000000..cef8ecf5 --- /dev/null +++ b/plugins/sanity-plugin/studio/resolveDocumentActions.js @@ -0,0 +1,7 @@ +import defaultResolve from "part:@sanity/base/document-actions" + +import { gatsbyPreviewAction } from "sanity-plugin-gatsby-cloud-preview" + +export default function resolveDocumentActions(props) { + return [...defaultResolve(props), gatsbyPreviewAction] +} diff --git a/plugins/sanity-plugin/studio/sanity.json b/plugins/sanity-plugin/studio/sanity.json index f979198b..3c5d4ca8 100644 --- a/plugins/sanity-plugin/studio/sanity.json +++ b/plugins/sanity-plugin/studio/sanity.json @@ -24,6 +24,10 @@ { "name": "part:@sanity/base/schema", "path": "./schemas/schema" + }, + { + "implements": "part:@sanity/base/document-actions/resolver", + "path": "resolveDocumentActions.js" } ] } diff --git a/plugins/sanity-plugin/studio/yarn.lock b/plugins/sanity-plugin/studio/yarn.lock index e8cd9ca3..a09332d7 100644 --- a/plugins/sanity-plugin/studio/yarn.lock +++ b/plugins/sanity-plugin/studio/yarn.lock @@ -8283,6 +8283,11 @@ react-icon-base@^2.1.2: resolved "https://registry.npmjs.org/react-icon-base/-/react-icon-base-2.1.2.tgz#a17101dad9c1192652356096860a9ab43a0766c7" integrity sha512-NRlRo0RPxWRMQT7osj8UCBSSXsGOxhF1pre84ildhuft5S2U382NOs7tg29osWSjbO90L2a3VTCqadA/LnAzHQ== +react-icons@^4.3.1: + version "4.4.0" + resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.4.0.tgz#a13a8a20c254854e1ec9aecef28a95cdf24ef703" + integrity sha512-fSbvHeVYo/B5/L4VhB7sBA1i2tS8MkT0Hb9t2H1AVPkwGfVHLJCqyr2Py9dKMxsyM63Eng1GkdZfbWj+Fmv8Rg== + react-is@^16.13.1, react-is@^16.7.0: version "16.13.1" resolved "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" @@ -8838,6 +8843,13 @@ sanity-diff-patch@^1.0.9: dependencies: diff-match-patch "^1.0.5" +sanity-plugin-gatsby-cloud-preview@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sanity-plugin-gatsby-cloud-preview/-/sanity-plugin-gatsby-cloud-preview-1.0.3.tgz#c24e27ac43b03c2e14d87dd80642259c400158d7" + integrity sha512-u9kpJvhDiBjucdezxAZRIx/HWi4G0efOy0E5aL2hW2KUxjBRCLlEtGsTq4fdKLDybjcsU+jPIcUp6wogfl5pUA== + dependencies: + react-icons "^4.3.1" + sax@~1.2.4: version "1.2.4" resolved "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"