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 🙏

© 2026 – Pkg Stats / Ryan Hefner

storybook-addon-semantic-version

v2.2.0

Published

Storybook addon for deploying sematically versioned components

Readme

Storybook Semantic Version Addon

NPM version NPM downloads

A Storybook addon for managing and deploying semantically versioned component libraries. Deploy and maintain multiple versions of your Storybook instances simultaneously, making it easy to document component evolution and breaking changes in monorepo environments.

Version Switcher Demo

Features

  • 📦 Multi-version management - Deploy and maintain multiple versions of your Storybook
  • 🔄 Version switching - Toolbar dropdown to switch between component versions
  • 📱 Persistent selection - Selected version is saved to localStorage
  • 🏗️ Monorepo support - Discover and build Storybooks from NX monorepos automatically
  • 🔗 Story path preservation - Navigate between versions while keeping the current story view

Compatibility

| Addon version | Storybook version | Node.js | |---|---|---| | 1.x | ^7.6.20 | ≥16 | | 2.x | ^8.0.0 | ≥18 |

Note: This addon doesn't support Storybook's hot reloading. Static builds are required for proper version viewing.

Getting Started

Step 1: Install the addon

npm install storybook-addon-semantic-version

or with pnpm:

pnpm add storybook-addon-semantic-version

Step 2: Register the addon

Update your root .storybook/main.ts to include the addon and generated refs:

import { refs } from './refs.generated';

export default {
  refs,
  addons: ['@storybook/addon-essentials', 'storybook-addon-semantic-version'],
};

Note: The refs.generated.ts file is automatically created in step 3. If you encounter an error, you can create it manually.

Step 3: Build versioned Storybooks

Run the CLI command from your project root to discover all Storybook instances, build them, and generate the version management files:

npx storybook-addon-semantic-version

This command will:

  • Discover all Storybook instances in your monorepo
  • Build each Storybook with its current version (from package.json)
  • Generate versions.json with the list of all available versions
  • Generate refs.generated.ts with the refs configuration
  • Output to dist/storybooks/<version>/ and dist/root/

Your dist/ folder structure will look like:

dist/
├── root/
│   ├── storybook/           # Root Storybook build (with version switcher)
│   └── versions.json        # List of all built versions
└── storybooks/
    ├── v1.0.0/              # Version 1 build
    ├── v1.1.0/              # Version 2 build
    └── v2.0.0/              # Version 3 build

Step 4: Serve locally

To test locally, serve the dist/ folder:

npx http-server dist --cors

Note: Install http-server globally with npm install -g http-server if needed.

View your Storybook at http://localhost:3000/root/storybook

Step 5: Deploy

Deploy the entire dist/ folder to a hosting service (S3, GitHub Pages, Vercel, etc.) and configure your DNS to point to it.

Important Notes

⚠️ Persistent Storage: The dist/ folder must be preserved. Deleting it will lose all previously built versions. If accidentally deleted:

  1. Clear refs.generated.ts from .storybook/
  2. Clear versions.json from .storybook/
  3. Rebuild to start fresh

Contributing

Found a bug or want to suggest a feature? Check the issues tab to get started.

License

MIT