1.1.1 • Published 1 year ago

sanity-plugin-schema-visualizer v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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:

  • Full schema is not displayed, and some inner fields are not retrieved
  • On the initial load, the "card" for each document schema is shown in a horizontal bar, not grouped, but can be dragged into position
  • The arrows aren't great :/

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.