SimeonGriggs / sanity-plugin-schema-visualizer

Visualize the schema registered to your Sanity Studio
MIT License
12 stars 1 forks source link

Sanity Plugin Schema Visualizer

A basic Studio Tool to visually represent schema registered in a Sanity Studio.

Not intended to be feature complete or as a schema builder/editor.

There are known issues:

Screenshot 2023-03-14 at 09 08 29

Installation

npm install sanity-plugin-schema-visualizer

Usage

Add it as a plugin in sanity.config.ts (or .js):

import {defineConfig} from 'sanity'
import {schemaVisualizer} from 'sanity-plugin-schema-visualizer'

export default defineConfig({
  // ...
  plugins: [
    // ...all other plugins
    schemaVisualizer()
  ],
})

Optionally, you can configure some defaults for displayed and hidden document cards.

schemaVisualizer({
  defaultSchemaTypes: ['movie'],
  hiddenSchemaTypes: ['person'],
})

License

MIT © Simeon Griggs

Develop & test

This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.

See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.

Release new version

Run "CI & Release" workflow. Make sure to select the main branch and check "Release new version".

Semantic release will only release on configured branches, so it is safe to run release on any branch.