sanity-plugin-schema-visualizer
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i sanity-plugin-schema-visualizer

Weekly Downloads

16

Version

1.1.1

License

MIT

Unpacked Size

892 kB

Total Files

18

Last publish

Collaborators

  • simeongriggs