0.2.7 • Published 4 years ago

rs-sanity-schema v0.2.7

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

Redstitch Sanity Schema Bro!

npm i rs-sanity-schema

To be used with:

You should really consider creating a env.js file in the root of your project, or you're not going to have a good time:

export const appName = 'NAME';
export const netlifyAppId = 'NETLIFYAPPID';
export const netlifyBuildHook = 'NETLIFYBUILDHOOK';
const remoteURL = 'https://REMOTE.netlify.com'
const localURL = 'http://localhost:8000';
const appUrl = window.location.hostname === 'localhost' ? localURL : remoteURL;
export const previewUrl = `${appUrl}/preview`;

You will also TOTALLY need this change your sanity.json file to some that goes a little bit... like this:

{
  "root": true,
  "project": {
    "name": "test"
  },
  "api": {
    "projectId": "hazo3ur7",
    "dataset": "production"
  },
  "plugins": [
    "@sanity/base",
    "@sanity/components",
    "@sanity/default-layout",
    "@sanity/default-login",
    "@sanity/desk-tool",
    "studio-logo",
    "@sanity/dashboard",
    "media",
    "@sanity/code-input",
    "asset-source-unsplash",
    "color-list",
    "dashboard-widget-netlify",
    "datatable",
    "@sanity/vision",
    "@sanity/production-preview",
    "@sanity/google-maps-input",
    "@sanity/color-input"
  ],
  "parts": [
    {
      "name": "part:@sanity/base/schema",
      "path": "./schemas/schema.js"
    },
    {
      "implements": "part:@sanity/production-preview/resolve-production-url",
      "path": "./node_modules/rs-sanity-schema/actions/resolvers/resolveProductionUrl.js"
    },
    {
      "name": "part:@sanity/desk-tool/structure",
      "path": "./deskStructure.js"
    },
    {
      "implements": "part:@sanity/dashboard/config",
      "path": "./node_modules/rs-sanity-schema/config/dashboardConfig.js"
    },
    {
      "implements": "part:@sanity/base/theme/variables/override-style",
      "path": "./variableOverrides.css"
    },
    {
      "implements": "part:@sanity/base/document-actions/resolver",
      "path": "./node_modules/rs-sanity-schema/actions/resolvers/resolveDocumentActions.js"
    },
    {
      "implements": "part:@sanity/base/document-badges/resolver",
      "path": "./node_modules/rs-sanity-schema/actions/resolvers/resolveDocumentBadges.js"
    }
  ]
}

Oh, silly me, one more thing... Make sure you copy the /plugins folder from the root of this node pkg (/node_modules/rs-sanity-schema/plugins/*) to the root of your sanity project! DUH!