New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@snorreeb/incompatible-plugin

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@snorreeb/incompatible-plugin

Display an error dialog in Sanity Studio v2 when a v3 plugin has been installed.

unpublished
latest
npmnpm
Version
1.0.7
Version published
Maintainers
1
Created
Source

@sanity/incompatible-plugin

Small helper library that will display a warning in Sanity Studio v2 when a plugin built for Studio v3 is installed.

Installation

npm i --save @sanity/incompatible-plugin

or

yarn add @sanity/incompatible-plugin

Usage

In your plugin root directory, create two files:

v2-incompatible.js

const {showIncompatiblePluginDialog} = require('@snorreeb/incompatible-plugin')
const {name, version} = require('./package.json')

export default showIncompatiblePluginDialog({
  name: name,
  versions: {
    v3: version,
    // Optional: If there is not v2 version of your plugin, v2 can be omitted
    v2: '^1.2.5', 
  },
  // Optional: Feel free to put this as field in package.json and import it alongside name and version above
  sanityExchangeUrl: 'https://www.sanity.io/plugins/<plugin-on-sanity-exchanged>'
})

sanity.json

{
  "parts": [
    {
      "implements": "part:@sanity/base/sanity-root",
      "path": "./v2-incompatible.js"
    }
  ]
}

Add these to files in the plugin package.json alongside anything else already there, for instance:

{
  "files": [
    "src",
    "lib",
    "v2-incompatible.js",
    "sanity.json"
  ]
}

Done!

If your v3 plugin gets installed in a V2 studio by mistake, a dialog will display how to fix it.

Keywords

sanity

FAQs

Package last updated on 11 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts