npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@electrolux-oss/sanity-plugin-workflow

v3.0.0

Published

> This is a **Sanity Studio v4** plugin. > This is a forked version of Sanitys own [Sanity Workflow Plugin (v1.0.3)](https://www.npmjs.com/package/sanity-plugin-workflow/v/1.0.3)

Downloads

226

Readme

Sanity Workflow Plugin - Electrolux Version (for Sanity Studio v4)

This is a Sanity Studio v4 plugin. This is a forked version of Sanitys own Sanity Workflow Plugin (v1.0.3)

[!WARNING] Breaking changes introduced in verion 3.0.0 of this plugin. Please see more information below.

:warning: Breaking changes - (v2.0.0 → v3.0.0)

v2 → v3

This release upgrades the plugin’s peer dependency from React 18 to React 19.
Projects using this plugin must update to React 19 before upgrading to v3.

Sanity Workflow Plugin

Screenshot 2023-03-21 at 12 11 24

Features

  • A unique schema to handle workflow metadata documents
  • Document Actions to promote and demote documents through the workflow
  • Document Badges for visual feedback about the current state of a document
  • A custom Tool for drag-and-drop updating of a document's state
  • Language filter to make it easier for multi-market users to find relevant information.

Install (Sanity Studio v4)

npm install --save sanity-plugin-workflow

or

yarn add sanity-plugin-workflow

Usage

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

 import { createConfig } from 'sanity'
 import { workflow } from 'sanity-plugin-workflow'

 export const createConfig({
    // all other settings ...
     plugins: [
         workflow({
            // Required, list of document type names
            // schemaTypes: ['article', 'product'],
            schemaTypes: [],
            // Optional, see below
            // states: [],
         })
     ]
 })

Configuring "States"

The plugin comes with a default set of "States". These are tracked by the plugin creating a separate "metadata" document for each document that has begun the Workflow.

Documents can be promoted and demoted in the Workflow with the provided Document Actions as well as a drag-and-drop custom Tool. The settings below are not enforced by the API, custom access control rules could be used to do so.

{
    // Required configuration
    id: 'inReview',
    title: 'In Review',
    // Optional settings:
    // Used for the color of the Document Badge
    color: 'success',
    // Will limit document actions and drag-and-drop for only users with these Role
    roles: ['publisher', 'administrator'],
    // Requires the user to be "assigned" in order to update to this State
    requireAssignment: true,
    // Requires the document to be valid before being promoted out of this State
    // Warning: With many documents in the Kanban view this can negatively impact performance
    requireValidation: true,
    // Defines which States a document can be moved to from this one
    transitions: ['changesRequested', 'approved']
}

Intended content operations with this plugin

A content creator composes a new document of one of the configured Schema types. The document is a "Draft", but not automatically added to the Workflow.

The creator clicks the "Begin Workflow" Document Action to create a new "metadata" document and add the document to the first State in the Workflow. Using the default States, the document is now "In Review".

The document is now visible in the Workflow Tool. The creator can drag and drop the document to the next State in the Workflow, "Changes Requested". Other users may be "assigned" to the document. In the default State configuration, only an assigned user can move the document into the final "Approved" state.

An administrator can move the document into Changes Requested or Approved.

With the document now Approved, a user may also return to the document and Publish it, by whatever means that make sense to your use case. Such as scheduled publishing or migrating it to a new dataset.

Once the Workflow is complete, the metadata can be removed by using the "Complete Workflow" document action.

Develop locally

Test your plugin locally

Step 1: Set up the plugin for local development

In the plugin directory, run:

npm run link-watch

This will:

  • Build your plugin automatically whenever code changes
  • Publish the package to a local yalc repository

Step 2: Link the plugin to your studio

In your studio project directory, run:

npx yalc add @electrolux-oss/sanity-plugin-workflow && npm install

Step 3: Verify the setup

Check your studio's package.json - you should see:

"@electrolux-oss/sanity-plugin-workflow": "file:.yalc/@electrolux-oss/sanity-plugin-workflow"

Now you can use the local version of the plugin:

import { workflow } from '@electrolux-oss/sanity-plugin-workflow'

Making changes

When you modify the plugin code:

  1. The link-watch command will automatically rebuild
  2. In your studio, run npx yalc update to pull the latest changes
  3. Restart your dev server: npm run dev

FAQ

Q: Why multiple tsconfig*.json files?

Plugin kit information source.

After running plugin-kit init you will get these tsconfig files:

  • tsconfig.json used by the IDE (this typically includes test files)
  • tsconfig.dist.json used by the build system, and ignores test files
  • tsconfig.settings.json with shared settings between tsconfig.json and tsconfig.dist.json

This configuration allows for type-checking you scripts and tests, and not only the distribution files. When building the scripts and test files will not be included in the npm package distribution.