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 🙏

© 2024 – Pkg Stats / Ryan Hefner

sanipack

v2.1.0

Published

Enhanced Sanity.io plugin development experience

Downloads

84

Readme

sanipack

npm versionBuild Status

An opinionated, enhanced Sanity.io plugin development experience.

Features

  • Bootstrap new plugins with (opinionated) tooling:
  • Verifies plugin conventions before publishing:
    • No unused dependencies
    • No undeclared dependencies
    • Referenced files exist, has correct casing and is publishable
    • Has an SPDX compatible license definition
    • Has a valid plugin config, if present
    • react/react-dom declared as peer dependencies, if used
    • ... and more ...
  • Compiles plugin source code using Babel

Quick start

# Initialize a new plugin (outside of your Sanity studio folder)
npx sanipack init sanity-plugin-spotify

# Make your plugin linkable, and compile an initial version
cd sanity-plugin-spotify
npm link
npm run build

# Link the plugin to your Sanity studio and start it
cd /path/to/my-studio
npm link sanity-plugin-spotify
sanity start

# In another terminal, start a watch task for your plugin
cd /path/to/sanity-plugin-spotify
npm run watch

Usage

Enhanced Sanity.io plugin development experience

Usage
  $ sanipack [--help] [--debug] <command> [<args>]

  These are common commands used in various situations:

    build    Compile a Sanity plugin (prior to publishing)
    init     Create a new Sanity plugin
    splat    Inject sanipack into an existing Sanity plugin
    verify   Verify a Sanity plugin prior to publishing
    version  Show the version of sanipack currently installed

  Options
    --silent      Do not print info and warning messages
    --verbose     Log everything. This option conflicts with --silent
    --debug       Print stack trace on errors
    --version     Output the version number
    --help        Output usage information

  Examples
    # Build a Sanity plugin for publishing
    $ sanipack build

    # Verify that a Sanity plugin is ready to be published
    # (great for pre-publish step!)
    $ sanipack verify

Use the --help flag on each command for more information on their usage, eg sanipack build --help.

Publishing a plugin

Note: If you're writing a plugin that is only useful for yourself or your company, you might want to either put the plugin inside of the plugins folder of your Sanity studio (saves you from having to publish at all), or if shared across multiple "private" studios: register an organization on npm and make sure your module is prefixed with the organization scope, eg @your-company/plugin-name.

Also; you cannot easily remove modules/versions from npm once published. Take a good look at your package.json to see that the fields in there makes sense to you, and make sure there are no "secrets" (authorization tokens, API keys or similar) in the plugin directory - anything not listed in .npmignore will be part of the published module.

When you're ready to publish, run npm publish (or yarn publish if you prefer). The prepublishOnly task should kick in and compile the source files, then verify the built output to ensure it looks good.

If you have not published any modules to npm before, you will be asked to create a user first.

FAQ

Q: Do I have to use this for developing Sanity plugins?

A: Absolutely not! Make sure your Sanity plugin is ES5-compatible and that your sanity.json file and any references parts refer to the right directories, and you're good to go. This package was created to make it easier to set up the build toolchain and prevent common mistakes. If you know what you're doing and don't like any magic, roll your own thing! :)

License

MIT © Espen Hovlandsdal