Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sanity-plugin-gatsby-cloud #138

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/sanity-plugin/.env.EXAMPLE
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
SANITY_PROJECT_ID=""
SANITY_PROJECT_DATASET=""
SANITY_READ_TOKEN=""
SANITY_STUDIO_CONTENT_SYNC_URL=
1 change: 1 addition & 0 deletions plugins/sanity-plugin/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"prop-types": "^15.7",
"react": "^17.0",
"react-dom": "^17.0",
"sanity-plugin-gatsby-cloud-preview": "^1.0.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kathmbeck @DanielSLew I'm missing the context here. Is this required when any site uses gatsby-source-sanity? I'm not seeing anything about this package mentioned in the README

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's needed for content sync to be available out of the box. It's more so that we indicate that's the case for the starter here: https://www.npmjs.com/package/sanity-plugin-gatsby-cloud-preview

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Katherine and I are meeting up tomorrow to go over this package / PR and I'll be updating the README as an action item from that conversation.

"styled-components": "^5.2.0"
},
"devDependencies": {}
Expand Down
7 changes: 7 additions & 0 deletions plugins/sanity-plugin/studio/resolveDocumentActions.js
Original file line number Diff line number Diff line change
@@ -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]
}
4 changes: 4 additions & 0 deletions plugins/sanity-plugin/studio/sanity.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
{
"name": "part:@sanity/base/schema",
"path": "./schemas/schema"
},
{
"implements": "part:@sanity/base/document-actions/resolver",
"path": "resolveDocumentActions.js"
}
]
}
12 changes: 12 additions & 0 deletions plugins/sanity-plugin/studio/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down